webcoreui 0.0.12 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -6
- package/astro.d.ts +4 -0
- package/astro.js +4 -0
- package/components/Accordion/accordion.module.scss +20 -27
- package/components/Alert/alert.module.scss +19 -22
- package/components/Avatar/avatar.module.scss +9 -6
- package/components/Badge/badge.module.scss +31 -34
- package/components/Button/Button.astro +0 -2
- package/components/Button/Button.svelte +0 -2
- package/components/Button/Button.tsx +0 -2
- package/components/Button/button.module.scss +32 -39
- package/components/Button/button.ts +1 -2
- package/components/Card/card.module.scss +19 -15
- package/components/Checkbox/checkbox.module.scss +27 -41
- package/components/Icon/Icon.astro +2 -2
- package/components/Icon/map.ts +2 -0
- package/components/Input/input.module.scss +28 -36
- package/components/Menu/Menu.astro +7 -3
- package/components/Menu/Menu.svelte +11 -3
- package/components/Menu/Menu.tsx +7 -1
- package/components/Menu/menu.module.scss +144 -144
- package/components/Menu/menu.ts +1 -0
- package/components/Modal/Modal.astro +70 -0
- package/components/Modal/Modal.svelte +71 -0
- package/components/Modal/Modal.tsx +76 -0
- package/components/Modal/modal.module.scss +103 -0
- package/components/Modal/modal.ts +18 -0
- package/components/Progress/progress.module.scss +26 -22
- package/components/Radio/radio.module.scss +32 -41
- package/components/Rating/Rating.astro +2 -2
- package/components/Rating/Rating.svelte +2 -2
- package/components/Rating/Rating.tsx +2 -2
- package/components/Rating/rating.module.scss +15 -8
- package/components/Slider/Slider.astro +44 -0
- package/components/Slider/Slider.svelte +42 -0
- package/components/Slider/Slider.tsx +48 -0
- package/components/Slider/slider.module.scss +68 -0
- package/components/Slider/slider.ts +20 -0
- package/components/Spinner/spinner.module.scss +11 -2
- package/components/Switch/switch.module.scss +28 -30
- package/components/Table/Table.astro +6 -1
- package/components/Table/Table.svelte +3 -1
- package/components/Table/Table.tsx +7 -1
- package/components/Table/table.module.scss +23 -17
- package/components/Table/table.ts +1 -0
- package/components/Tabs/Tabs.astro +0 -1
- package/components/Tabs/tabs.module.scss +45 -48
- package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -0
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +2 -1
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +2 -1
- package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
- package/components/Timeline/timeline.module.scss +28 -23
- package/components/TimelineItem/TimelineItem.tsx +1 -6
- package/components/TimelineItem/timelineitem.module.scss +14 -17
- package/components/TimelineItem/timelineitem.ts +5 -0
- package/components/Toast/toast.module.scss +10 -14
- package/components/Toast/toast.ts +6 -1
- package/icons/close.svg +3 -0
- package/icons.d.ts +12 -0
- package/icons.js +10 -0
- package/index.js +2 -0
- package/package.json +3 -1
- package/react.d.ts +6 -2
- package/react.js +4 -0
- package/scss/config/color-palette.scss +24 -0
- package/scss/config/css-values.scss +44 -0
- package/scss/config/layout.scss +41 -0
- package/scss/config/mixins.scss +392 -9
- package/scss/config/typography.scss +65 -0
- package/scss/config.scss +6 -1
- package/scss/global/elements.scss +21 -1
- package/scss/global/scrollbar.scss +12 -9
- package/scss/global/theme.scss +73 -40
- package/scss/global/tooltip.scss +42 -35
- package/scss/global/utility.scss +79 -61
- package/scss/global.scss +0 -1
- package/scss/resets.scss +67 -9
- package/scss/setup.scss +14 -41
- package/svelte.d.ts +4 -0
- package/svelte.js +4 -0
- package/utils/interpolate.ts +23 -0
- package/utils/modal.ts +59 -0
- package/utils/toast.ts +3 -2
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
.menu {
|
|
4
|
-
background
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@include
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
img,
|
|
53
|
-
svg {
|
|
54
|
-
display: block;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ul {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
&:hover {
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
box-shadow
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
border
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
&:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
pointer-events: all;
|
|
141
|
-
transform: none;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
3
|
+
.menu {
|
|
4
|
+
@include background(primary-70);
|
|
5
|
+
@include spacing(p-md);
|
|
6
|
+
@include border(bottom, primary-50);
|
|
7
|
+
@include position(sticky, t0);
|
|
8
|
+
@include layer(header);
|
|
9
|
+
|
|
10
|
+
&[data-active="true"] {
|
|
11
|
+
.hamburger {
|
|
12
|
+
box-shadow: 0 0 0 1000px var(--w-color-primary-70);
|
|
13
|
+
|
|
14
|
+
.meat:first-child,
|
|
15
|
+
.meat:last-child {
|
|
16
|
+
@include visibility(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.meat:first-child {
|
|
20
|
+
transform: translateY(20px) scale(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.meat:last-child {
|
|
24
|
+
transform: translateY(-20px) scale(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.meat:nth-child(2) {
|
|
28
|
+
transform: rotate(45deg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.meat:nth-child(3) {
|
|
32
|
+
transform: rotate(-45deg);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ul {
|
|
37
|
+
@include transition(opacity);
|
|
38
|
+
@include visibility(1);
|
|
39
|
+
@include layer(header);
|
|
40
|
+
pointer-events: all;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.wrapper {
|
|
45
|
+
@include layout(flex, v-center, default);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
a {
|
|
49
|
+
@include typography(none);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
img,
|
|
53
|
+
svg {
|
|
54
|
+
display: block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ul {
|
|
58
|
+
@include spacing(0);
|
|
59
|
+
@include layout(flex, default, column);
|
|
60
|
+
@include position(fixed, t20px, l20px);
|
|
61
|
+
@include visibility(0);
|
|
62
|
+
@include typography(normal);
|
|
63
|
+
|
|
64
|
+
list-style-type: none;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
|
|
67
|
+
li {
|
|
68
|
+
@include spacing(m0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
a {
|
|
72
|
+
@include typography(primary-20);
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
@include typography(primary);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&.active {
|
|
79
|
+
@include typography(primary);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.hamburger {
|
|
85
|
+
@include transition(box-shadow);
|
|
86
|
+
@include position(relative);
|
|
87
|
+
@include size(w30px, h20px);
|
|
88
|
+
@include border-radius(max);
|
|
89
|
+
@include spacing(p0);
|
|
90
|
+
@include border(0);
|
|
91
|
+
@include background(transparent);
|
|
92
|
+
@include layer(top);
|
|
93
|
+
|
|
94
|
+
box-shadow: 0 0 0 0 var(--w-color-primary-70);
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
|
|
97
|
+
.meat {
|
|
98
|
+
@include transition();
|
|
99
|
+
@include size('w100%', h2px);
|
|
100
|
+
@include position(absolute);
|
|
101
|
+
@include background(primary);
|
|
102
|
+
@include border-radius(md);
|
|
103
|
+
|
|
104
|
+
display: block;
|
|
105
|
+
|
|
106
|
+
&:first-child {
|
|
107
|
+
@include position(t0);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:nth-child(2),
|
|
111
|
+
&:nth-child(3) {
|
|
112
|
+
@include position(v-center);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:last-child {
|
|
116
|
+
@include position(b0);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.container {
|
|
123
|
+
@include layout(flex, v-center, default, h-between, wrap);
|
|
124
|
+
@include spacing(auto-none, px-default);
|
|
125
|
+
|
|
126
|
+
max-width: 1200px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@include media('sm') {
|
|
130
|
+
.menu {
|
|
131
|
+
.hamburger {
|
|
132
|
+
@include visibility(none);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
ul {
|
|
136
|
+
@include position(static);
|
|
137
|
+
@include visibility(1);
|
|
138
|
+
@include layout(row);
|
|
139
|
+
|
|
140
|
+
pointer-events: all;
|
|
141
|
+
transform: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
package/components/Menu/menu.ts
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ModalProps } from './modal'
|
|
3
|
+
|
|
4
|
+
import Button from '../Button/Button.astro'
|
|
5
|
+
|
|
6
|
+
import info from '../../icons/info.svg?raw'
|
|
7
|
+
import success from '../../icons/circle-check.svg?raw'
|
|
8
|
+
import warning from '../../icons/warning.svg?raw'
|
|
9
|
+
import alert from '../../icons/alert.svg?raw'
|
|
10
|
+
import closeIcon from '../../icons/close.svg?raw'
|
|
11
|
+
|
|
12
|
+
import styles from './modal.module.scss'
|
|
13
|
+
|
|
14
|
+
interface Props extends ModalProps {}
|
|
15
|
+
|
|
16
|
+
const iconMap = {
|
|
17
|
+
info,
|
|
18
|
+
success,
|
|
19
|
+
warning,
|
|
20
|
+
alert
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
title,
|
|
25
|
+
subTitle,
|
|
26
|
+
showCloseIcon = true,
|
|
27
|
+
closeOnEsc = true,
|
|
28
|
+
closeOnOverlay = true,
|
|
29
|
+
theme,
|
|
30
|
+
id,
|
|
31
|
+
className
|
|
32
|
+
} = Astro.props
|
|
33
|
+
|
|
34
|
+
const close = [
|
|
35
|
+
showCloseIcon && 'icon',
|
|
36
|
+
closeOnEsc && 'esc',
|
|
37
|
+
closeOnOverlay && 'overlay'
|
|
38
|
+
].filter(Boolean).join(',')
|
|
39
|
+
|
|
40
|
+
const classes = [
|
|
41
|
+
styles.modal,
|
|
42
|
+
theme && styles[theme],
|
|
43
|
+
className
|
|
44
|
+
]
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
<dialog
|
|
48
|
+
class:list={classes}
|
|
49
|
+
id={id}
|
|
50
|
+
data-close={close.length ? close : undefined}
|
|
51
|
+
>
|
|
52
|
+
{showCloseIcon && (
|
|
53
|
+
<Button
|
|
54
|
+
theme="flat"
|
|
55
|
+
className={styles.close}
|
|
56
|
+
data-id="close"
|
|
57
|
+
>
|
|
58
|
+
<Fragment set:html={closeIcon} />
|
|
59
|
+
</Button>
|
|
60
|
+
)}
|
|
61
|
+
{title && (
|
|
62
|
+
<strong class={styles.title}>
|
|
63
|
+
{theme && <Fragment set:html={iconMap[theme]} />}
|
|
64
|
+
{title}
|
|
65
|
+
</strong>
|
|
66
|
+
)}
|
|
67
|
+
{subTitle && <div class={styles.subTitle}>{subTitle}</div>}
|
|
68
|
+
<slot />
|
|
69
|
+
</dialog>
|
|
70
|
+
<div class={styles.overlay} />
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ModalProps } from './modal'
|
|
3
|
+
|
|
4
|
+
import styles from './modal.module.scss'
|
|
5
|
+
import { classNames } from '../../utils/classNames'
|
|
6
|
+
|
|
7
|
+
import Button from '../Button/Button.svelte'
|
|
8
|
+
|
|
9
|
+
import info from '../../icons/info.svg?raw'
|
|
10
|
+
import success from '../../icons/circle-check.svg?raw'
|
|
11
|
+
import warning from '../../icons/warning.svg?raw'
|
|
12
|
+
import alert from '../../icons/alert.svg?raw'
|
|
13
|
+
import closeIcon from '../../icons/close.svg?raw'
|
|
14
|
+
|
|
15
|
+
export let title: ModalProps['title'] = ''
|
|
16
|
+
export let subTitle: ModalProps['subTitle'] = ''
|
|
17
|
+
export let showCloseIcon: ModalProps['showCloseIcon'] = true
|
|
18
|
+
export let closeOnEsc: ModalProps['closeOnEsc'] = true
|
|
19
|
+
export let closeOnOverlay: ModalProps['closeOnOverlay'] = true
|
|
20
|
+
export let theme: ModalProps['theme'] = null
|
|
21
|
+
export let id : ModalProps['className'] = ''
|
|
22
|
+
export let className: ModalProps['className'] = ''
|
|
23
|
+
|
|
24
|
+
const iconMap = {
|
|
25
|
+
info,
|
|
26
|
+
success,
|
|
27
|
+
warning,
|
|
28
|
+
alert
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const classes = classNames([
|
|
32
|
+
styles.modal,
|
|
33
|
+
theme && styles[theme],
|
|
34
|
+
className
|
|
35
|
+
])
|
|
36
|
+
|
|
37
|
+
const close = [
|
|
38
|
+
showCloseIcon && 'icon',
|
|
39
|
+
closeOnEsc && 'esc',
|
|
40
|
+
closeOnOverlay && 'overlay'
|
|
41
|
+
].filter(Boolean).join(',')
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<dialog
|
|
45
|
+
class={classes}
|
|
46
|
+
id={id}
|
|
47
|
+
data-close={close.length ? close : undefined}
|
|
48
|
+
>
|
|
49
|
+
{#if showCloseIcon}
|
|
50
|
+
<Button
|
|
51
|
+
theme="flat"
|
|
52
|
+
className={styles.close}
|
|
53
|
+
data-id="close"
|
|
54
|
+
>
|
|
55
|
+
{@html closeIcon}
|
|
56
|
+
</Button>
|
|
57
|
+
{/if}
|
|
58
|
+
{#if title}
|
|
59
|
+
<strong class={styles.title}>
|
|
60
|
+
{#if theme}
|
|
61
|
+
{@html iconMap[theme]}
|
|
62
|
+
{/if}
|
|
63
|
+
{title}
|
|
64
|
+
</strong>
|
|
65
|
+
{/if}
|
|
66
|
+
{#if subTitle}
|
|
67
|
+
<div class={styles.subTitle}>{subTitle}</div>
|
|
68
|
+
{/if}
|
|
69
|
+
<slot />
|
|
70
|
+
</dialog>
|
|
71
|
+
<div class={styles.overlay} />
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { ReactModalProps } from './modal'
|
|
3
|
+
|
|
4
|
+
import styles from './modal.module.scss'
|
|
5
|
+
import { classNames } from '../../utils/classNames'
|
|
6
|
+
|
|
7
|
+
import Button from '../Button/Button.tsx'
|
|
8
|
+
|
|
9
|
+
import info from '../../icons/info.svg?raw'
|
|
10
|
+
import success from '../../icons/circle-check.svg?raw'
|
|
11
|
+
import warning from '../../icons/warning.svg?raw'
|
|
12
|
+
import alert from '../../icons/alert.svg?raw'
|
|
13
|
+
import closeIcon from '../../icons/close.svg?raw'
|
|
14
|
+
|
|
15
|
+
const iconMap = {
|
|
16
|
+
info,
|
|
17
|
+
success,
|
|
18
|
+
warning,
|
|
19
|
+
alert
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Modal = ({
|
|
23
|
+
title,
|
|
24
|
+
subTitle,
|
|
25
|
+
showCloseIcon = true,
|
|
26
|
+
closeOnEsc = true,
|
|
27
|
+
closeOnOverlay = true,
|
|
28
|
+
theme,
|
|
29
|
+
id,
|
|
30
|
+
className,
|
|
31
|
+
children
|
|
32
|
+
}: ReactModalProps) => {
|
|
33
|
+
const classes = classNames([
|
|
34
|
+
styles.modal,
|
|
35
|
+
theme && styles[theme],
|
|
36
|
+
className
|
|
37
|
+
])
|
|
38
|
+
|
|
39
|
+
const close = [
|
|
40
|
+
showCloseIcon && 'icon',
|
|
41
|
+
closeOnEsc && 'esc',
|
|
42
|
+
closeOnOverlay && 'overlay'
|
|
43
|
+
].filter(Boolean).join(',')
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment>
|
|
47
|
+
<dialog
|
|
48
|
+
className={classes}
|
|
49
|
+
id={id}
|
|
50
|
+
data-close={close.length ? close : undefined}
|
|
51
|
+
>
|
|
52
|
+
{showCloseIcon && (
|
|
53
|
+
<Button
|
|
54
|
+
theme="flat"
|
|
55
|
+
className={styles.close}
|
|
56
|
+
data-id="close"
|
|
57
|
+
dangerouslySetInnerHTML={{ __html: closeIcon }}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
{title && (
|
|
61
|
+
<strong
|
|
62
|
+
className={styles.title}
|
|
63
|
+
dangerouslySetInnerHTML={{
|
|
64
|
+
__html: theme ? iconMap[theme] + title : title
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
{subTitle && <div className={styles.subTitle}>{subTitle}</div>}
|
|
69
|
+
{children}
|
|
70
|
+
</dialog>
|
|
71
|
+
<div className={styles.overlay} />
|
|
72
|
+
</React.Fragment>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default Modal
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@import '../../scss/config.scss';
|
|
2
|
+
|
|
3
|
+
.modal {
|
|
4
|
+
@include transition();
|
|
5
|
+
@include position(fixed, 't50%', 'l50%');
|
|
6
|
+
@include spacing(0, p-default);
|
|
7
|
+
@include layer(modal);
|
|
8
|
+
@include visibility(block, 0);
|
|
9
|
+
@include border(primary-50);
|
|
10
|
+
@include background(primary-70);
|
|
11
|
+
@include typography(primary);
|
|
12
|
+
@include border-radius(md);
|
|
13
|
+
@include size('w90%');
|
|
14
|
+
|
|
15
|
+
transform: translate(-50%, calc(-50% + 15px));
|
|
16
|
+
max-width: 500px;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
|
|
19
|
+
&[data-show="true"] {
|
|
20
|
+
@include visibility(1);
|
|
21
|
+
|
|
22
|
+
transform: translate(-50%, -50%);
|
|
23
|
+
pointer-events: all;
|
|
24
|
+
|
|
25
|
+
+ .overlay {
|
|
26
|
+
@include visibility(1);
|
|
27
|
+
pointer-events: all;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
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);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.info {
|
|
56
|
+
@include border(info);
|
|
57
|
+
|
|
58
|
+
.title {
|
|
59
|
+
@include typography(info);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.success {
|
|
64
|
+
@include border(success);
|
|
65
|
+
|
|
66
|
+
.title {
|
|
67
|
+
@include typography(success);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.warning {
|
|
72
|
+
@include border(warning);
|
|
73
|
+
|
|
74
|
+
.title {
|
|
75
|
+
@include typography(warning);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.alert {
|
|
80
|
+
@include border(alert);
|
|
81
|
+
|
|
82
|
+
.title {
|
|
83
|
+
@include typography(alert);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.overlay {
|
|
89
|
+
@include transition(opacity);
|
|
90
|
+
@include position(fixed);
|
|
91
|
+
@include background(overlay);
|
|
92
|
+
@include layer(header);
|
|
93
|
+
@include visibility(0);
|
|
94
|
+
|
|
95
|
+
inset: 0;
|
|
96
|
+
pointer-events: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include media(xs) {
|
|
100
|
+
.modal {
|
|
101
|
+
@include size('wauto');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ModalProps = {
|
|
2
|
+
title?: string
|
|
3
|
+
subTitle?: string
|
|
4
|
+
showCloseIcon?: boolean
|
|
5
|
+
closeOnEsc?: boolean
|
|
6
|
+
closeOnOverlay?: boolean
|
|
7
|
+
id?: string
|
|
8
|
+
className?: string
|
|
9
|
+
theme?: 'info'
|
|
10
|
+
| 'success'
|
|
11
|
+
| 'warning'
|
|
12
|
+
| 'alert'
|
|
13
|
+
| null
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ReactModalProps = {
|
|
17
|
+
children?: React.ReactNode
|
|
18
|
+
} & ModalProps
|