File tree Expand file tree Collapse file tree 11 files changed +59
-28
lines changed Expand file tree Collapse file tree 11 files changed +59
-28
lines changed Original file line number Diff line number Diff line change @@ -28,5 +28,5 @@ export type SvelteButtonProps = {
28
28
29
29
export type ReactButtonProps = {
30
30
onClick ?: React . MouseEventHandler < HTMLButtonElement >
31
- children : React . ReactNode
31
+ children ? : React . ReactNode
32
32
} & ButtonProps
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const {
26
26
showCloseIcon = true ,
27
27
closeOnEsc = true ,
28
28
closeOnOverlay = true ,
29
+ transparent,
29
30
theme,
30
31
id,
31
32
className,
@@ -40,6 +41,7 @@ const close = [
40
41
41
42
const classes = [
42
43
styles .modal ,
44
+ transparent && styles .transparent ,
43
45
theme && styles [theme ],
44
46
className
45
47
]
Original file line number Diff line number Diff line change 18
18
export let showCloseIcon: ModalProps [' showCloseIcon' ] = true
19
19
export let closeOnEsc: ModalProps [' closeOnEsc' ] = true
20
20
export let closeOnOverlay: ModalProps [' closeOnOverlay' ] = true
21
+ export let transparent: ModalProps [' transparent' ] = false
21
22
export let theme: ModalProps [' theme' ] = null
22
23
export let id : ModalProps [' className' ] = ' '
23
24
export let className: ModalProps [' className' ] = ' '
31
32
32
33
const classes = classNames ([
33
34
styles .modal ,
35
+ transparent && styles .transparent ,
34
36
theme && styles [theme ],
35
37
className
36
38
])
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const Modal = ({
26
26
showCloseIcon = true ,
27
27
closeOnEsc = true ,
28
28
closeOnOverlay = true ,
29
+ transparent,
29
30
theme,
30
31
id,
31
32
className,
@@ -35,6 +36,7 @@ const Modal = ({
35
36
const classes = classNames ( [
36
37
styles . modal ,
37
38
theme && styles [ theme ] ,
39
+ transparent && styles . transparent ,
38
40
className
39
41
] )
40
42
Original file line number Diff line number Diff line change 28
28
}
29
29
}
30
30
31
- .close {
32
- @include position (absolute , t10px, r10px);
33
- @include spacing (p- xs);
34
-
35
- svg {
36
- @include size (10px );
37
- }
38
- }
39
-
40
- .title {
41
- @include typography (lg);
42
- @include spacing (mb- xs);
43
- @include layout (flex , v- center, xs);
44
-
45
- svg {
46
- @include size (20px );
47
- }
48
- }
49
-
50
- .subTitle {
51
- @include typography (primary- 20);
52
- @include spacing (mb- xs);
31
+ & .transparent {
32
+ @include border (0 );
33
+ @include spacing (p0);
34
+ @include size (' wfit-content' );
35
+ @include background (transparent );
53
36
}
54
37
55
38
& .info {
83
66
@include typography (alert);
84
67
}
85
68
}
69
+
70
+ .close {
71
+ @include position (absolute , t10px, r10px);
72
+ @include spacing (p- xs);
73
+
74
+ svg {
75
+ @include size (10px );
76
+ }
77
+ }
78
+
79
+ .title {
80
+ @include typography (lg);
81
+ @include spacing (mb- xs);
82
+ @include layout (flex , v- center, xs);
83
+
84
+ svg {
85
+ @include size (20px );
86
+ }
87
+ }
88
+
89
+ .subTitle {
90
+ @include typography (primary- 20);
91
+ @include spacing (mb- xs);
92
+ }
86
93
}
87
94
88
95
.overlay {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ export type ModalProps = {
4
4
showCloseIcon ?: boolean
5
5
closeOnEsc ?: boolean
6
6
closeOnOverlay ?: boolean
7
+ transparent ?: boolean
7
8
id ?: string
8
9
className ?: string
9
10
theme ?: 'info'
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Button from '@components/Button/Button.astro'
6
6
import AstroModal from ' @components/Modal/Modal.astro'
7
7
import SvelteModal from ' @components/Modal/Modal.svelte'
8
8
import ReactModal from ' @components/Modal/Modal.tsx'
9
+ import Spinner from ' @components/Spinner/Spinner.astro'
9
10
10
11
import { getSections } from ' @helpers'
11
12
@@ -215,6 +216,22 @@ const sections = getSections({
215
216
This modal was created using the alert theme
216
217
</section.component >
217
218
</ComponentWrapper >
219
+
220
+ <ComponentWrapper title = " Loading modal" >
221
+ <Button theme = " secondary" id = { ` modal-btn-10${index } ` } >
222
+ Trigger
223
+ </Button >
224
+ <section.component
225
+ id = { ` modal-10${index } ` }
226
+ showCloseIcon = { false }
227
+ transparent = { true }
228
+ >
229
+ <Spinner
230
+ size = { 40 }
231
+ width = { 5 }
232
+ />
233
+ </section.component >
234
+ </ComponentWrapper >
218
235
</div >
219
236
))}
220
237
</Layout >
@@ -230,7 +247,7 @@ const sections = getSections({
230
247
'react'
231
248
]
232
249
233
- const ids = Array(9 ).fill(10).map((x, index) => x * (index + 1))
250
+ const ids = Array(10 ).fill(10).map((x, index) => x * (index + 1))
234
251
const variants = [
235
252
'00',
236
253
'01',
You can’t perform that action at this time.
0 commit comments