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,33 +1,37 @@
|
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
1
3
|
.card {
|
|
2
|
-
border
|
|
3
|
-
border-radius
|
|
4
|
-
|
|
5
|
-
flex-direction: column;
|
|
4
|
+
@include border(primary-50);
|
|
5
|
+
@include border-radius(md);
|
|
6
|
+
@include layout(flex, column);
|
|
6
7
|
|
|
7
8
|
&.secondary {
|
|
8
|
-
background
|
|
9
|
+
@include background(primary-60);
|
|
9
10
|
|
|
10
11
|
.title {
|
|
11
|
-
background
|
|
12
|
+
@include background(primary-70);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.title {
|
|
16
|
-
|
|
17
|
+
@include spacing(p-default);
|
|
18
|
+
@include border(primary-50, bottom);
|
|
17
19
|
display: block;
|
|
18
|
-
border-bottom: 1px solid var(--w-color-primary-50);
|
|
19
|
-
font-size: 16px;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.body {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
position
|
|
23
|
+
@include spacing(p-default);
|
|
24
|
+
@include size('h100%');
|
|
25
|
+
@include position(relative);
|
|
26
26
|
|
|
27
27
|
&.compact {
|
|
28
|
-
border
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
@include border(20px, primary-60);
|
|
29
|
+
@include spacing(p-3xl);
|
|
30
|
+
@include background(primary-70);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
a.card {
|
|
36
|
+
@include typography(none);
|
|
37
|
+
}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
--w-checkbox-color: var(--w-color-primary);
|
|
5
|
+
}
|
|
2
6
|
|
|
3
7
|
.checkbox {
|
|
8
|
+
@include layout(inline-flex, sm);
|
|
9
|
+
@include typography(hmd);
|
|
10
|
+
|
|
4
11
|
cursor: pointer;
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 10px;
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
line-height: 1.5;
|
|
10
12
|
|
|
11
13
|
&.col {
|
|
12
|
-
|
|
13
|
-
align-items: flex-start;
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
gap: 0;
|
|
14
|
+
@include layout(column, h-start, v-start, none);
|
|
16
15
|
|
|
17
16
|
.wrapper {
|
|
18
|
-
|
|
19
|
-
gap: 10px;
|
|
20
|
-
|
|
21
|
-
.check {
|
|
22
|
-
margin-top: 5px;
|
|
23
|
-
}
|
|
17
|
+
@include layout(flex, sm);
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
20
|
|
|
@@ -28,56 +22,48 @@
|
|
|
28
22
|
display: none;
|
|
29
23
|
|
|
30
24
|
&:checked + span {
|
|
31
|
-
background
|
|
25
|
+
@include background(var(--w-checkbox-color));
|
|
32
26
|
|
|
33
27
|
svg {
|
|
34
|
-
position
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
@include position(absolute, center);
|
|
29
|
+
@include typography(primary-50);
|
|
30
|
+
@include size(10px);
|
|
31
|
+
|
|
38
32
|
display: block;
|
|
39
|
-
color: var(--w-color-primary-50);
|
|
40
|
-
width: 10px;
|
|
41
|
-
height: 10px;
|
|
42
33
|
}
|
|
43
34
|
}
|
|
44
35
|
|
|
45
36
|
&:disabled + span {
|
|
46
|
-
background
|
|
47
|
-
border
|
|
37
|
+
@include background(primary-30);
|
|
38
|
+
@include border(primary-30);
|
|
48
39
|
cursor: no-drop;
|
|
49
40
|
}
|
|
50
41
|
}
|
|
51
42
|
|
|
52
|
-
a {
|
|
53
|
-
text-decoration: underline;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
43
|
.check {
|
|
44
|
+
@include size(15px);
|
|
45
|
+
@include position(relative);
|
|
46
|
+
@include border-radius(sm);
|
|
47
|
+
@include spacing(mt-xs);
|
|
48
|
+
|
|
57
49
|
display: inline-block;
|
|
58
|
-
width: 15px;
|
|
59
|
-
height: 15px;
|
|
60
50
|
min-width: 15px;
|
|
61
51
|
border: 1px solid var(--w-checkbox-color);
|
|
62
|
-
border-radius: 2px;
|
|
63
|
-
position: relative;
|
|
64
52
|
|
|
65
53
|
svg {
|
|
66
|
-
|
|
54
|
+
@include visibility(none);
|
|
67
55
|
}
|
|
68
56
|
}
|
|
69
57
|
|
|
70
58
|
.text {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
color: var(--w-color-primary-20);
|
|
59
|
+
@include spacing(ml-lg);
|
|
60
|
+
@include typography(md, primary-20);
|
|
74
61
|
|
|
75
62
|
a {
|
|
76
|
-
@include
|
|
77
|
-
color: var(--w-color-primary-20);
|
|
63
|
+
@include typography(primary-20);
|
|
78
64
|
|
|
79
65
|
&:hover {
|
|
80
|
-
|
|
66
|
+
@include typography(primary);
|
|
81
67
|
}
|
|
82
68
|
}
|
|
83
69
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { IconProps } from './icon'
|
|
3
|
+
import iconMap from './map'
|
|
3
4
|
|
|
4
5
|
interface Props extends IconProps {}
|
|
5
6
|
|
|
@@ -9,8 +10,7 @@ const {
|
|
|
9
10
|
color
|
|
10
11
|
} = Astro.props
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
-
const icon = markup
|
|
13
|
+
const icon = iconMap[type as keyof typeof iconMap]
|
|
14
14
|
.replace('width="24"', `width=${size}`)
|
|
15
15
|
.replace('height="24"', color
|
|
16
16
|
? `height=${size} color=${color}`
|
package/components/Icon/map.ts
CHANGED
|
@@ -2,6 +2,7 @@ import Alert from '../../icons/alert.svg?raw'
|
|
|
2
2
|
import ArrowDown from '../../icons/arrow-down.svg?raw'
|
|
3
3
|
import Check from '../../icons/check.svg?raw'
|
|
4
4
|
import CircleCheck from '../../icons/circle-check.svg?raw'
|
|
5
|
+
import Close from '../../icons/close.svg?raw'
|
|
5
6
|
import Github from '../../icons/github.svg?raw'
|
|
6
7
|
import Info from '../../icons/info.svg?raw'
|
|
7
8
|
import Moon from '../../icons/moon.svg?raw'
|
|
@@ -13,6 +14,7 @@ const iconMap = {
|
|
|
13
14
|
'arrow-down': ArrowDown,
|
|
14
15
|
'check': Check,
|
|
15
16
|
'circle-check': CircleCheck,
|
|
17
|
+
'close': Close,
|
|
16
18
|
'github': Github,
|
|
17
19
|
'info': Info,
|
|
18
20
|
'moon': Moon,
|
|
@@ -1,87 +1,79 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
3
|
.input {
|
|
4
|
-
border-radius
|
|
5
|
-
|
|
6
|
-
border
|
|
7
|
-
background
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
width: 100%;
|
|
4
|
+
@include border-radius(sm);
|
|
5
|
+
@include spacing(py-xs, px-sm);
|
|
6
|
+
@include border(primary-50);
|
|
7
|
+
@include background(transparent);
|
|
8
|
+
@include typography(regular, primary, hlg);
|
|
9
|
+
@include size('w100%');
|
|
10
|
+
|
|
12
11
|
color-scheme: var(--w-color-scheme);
|
|
13
12
|
|
|
14
13
|
&[disabled] {
|
|
14
|
+
@include typography(primary-30);
|
|
15
15
|
cursor: no-drop;
|
|
16
|
-
color: var(--w-color-primary-30);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
&::file-selector-button {
|
|
20
|
-
background
|
|
21
|
-
border
|
|
22
|
-
|
|
19
|
+
@include background(transparent);
|
|
20
|
+
@include border(0);
|
|
21
|
+
@include typography(primary);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
&::placeholder {
|
|
26
|
-
|
|
25
|
+
@include typography(primary-30);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
&[type="color"] {
|
|
30
|
-
|
|
29
|
+
@include spacing(p0);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
&.info {
|
|
34
|
-
border
|
|
33
|
+
@include border(info);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
&.success {
|
|
38
|
-
border
|
|
37
|
+
@include border(success);
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
&.warning {
|
|
42
|
-
border
|
|
41
|
+
@include border(warning);
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
&.alert {
|
|
46
|
-
border
|
|
45
|
+
@include border(alert);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
&.fill {
|
|
50
|
-
background
|
|
49
|
+
@include background(primary-50);
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
.input-label {
|
|
55
|
-
|
|
56
|
-
flex-direction: column;
|
|
54
|
+
@include layout(flex, column);
|
|
57
55
|
|
|
58
56
|
.label {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
margin-bottom: 5px;
|
|
57
|
+
@include typography(primary-20);
|
|
58
|
+
@include spacing(mb-xs);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
.wrapper {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
align-items: center;
|
|
68
|
-
position: relative;
|
|
62
|
+
@include layout(flex, v-center, sm);
|
|
63
|
+
@include position(relative);
|
|
69
64
|
|
|
70
65
|
input {
|
|
71
66
|
padding-left: 40px;
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
svg {
|
|
75
|
-
position
|
|
76
|
-
|
|
77
|
-
width: 20px;
|
|
78
|
-
height: 20px;
|
|
70
|
+
@include position(absolute, l10px);
|
|
71
|
+
@include size(20px);
|
|
79
72
|
}
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
.subtext {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
margin-top: 5px;
|
|
76
|
+
@include typography(md, primary-30);
|
|
77
|
+
@include spacing(mt-xs);
|
|
86
78
|
}
|
|
87
79
|
}
|
|
@@ -45,7 +45,7 @@ const wrapMenu = (logo?.url || logo?.html) && items?.length && Astro.slots.has('
|
|
|
45
45
|
)}
|
|
46
46
|
|
|
47
47
|
{!centerLogo && logo?.html && (
|
|
48
|
-
<a href="/">
|
|
48
|
+
<a href="/" aria-label={logo.alt || 'Logo'}>
|
|
49
49
|
<Fragment set:html={logo.html} />
|
|
50
50
|
</a>
|
|
51
51
|
)}
|
|
@@ -54,7 +54,11 @@ const wrapMenu = (logo?.url || logo?.html) && items?.length && Astro.slots.has('
|
|
|
54
54
|
<ul>
|
|
55
55
|
{items.map(item => (
|
|
56
56
|
<li>
|
|
57
|
-
<a
|
|
57
|
+
<a
|
|
58
|
+
href={item.url}
|
|
59
|
+
target={item.target}
|
|
60
|
+
class:list={[item.active && styles.active]}
|
|
61
|
+
>
|
|
58
62
|
{item.name}
|
|
59
63
|
</a>
|
|
60
64
|
</li>
|
|
@@ -73,7 +77,7 @@ const wrapMenu = (logo?.url || logo?.html) && items?.length && Astro.slots.has('
|
|
|
73
77
|
)}
|
|
74
78
|
|
|
75
79
|
{centerLogo && logo?.html && (
|
|
76
|
-
<a href="/">
|
|
80
|
+
<a href="/" aria-label={logo.alt || 'Logo'}>
|
|
77
81
|
<Fragment set:html={logo.html} />
|
|
78
82
|
</a>
|
|
79
83
|
)}
|
|
@@ -43,14 +43,20 @@
|
|
|
43
43
|
{/if}
|
|
44
44
|
|
|
45
45
|
{#if !centerLogo && logo?.html}
|
|
46
|
-
<a href="/"
|
|
46
|
+
<a href="/" aria-label={logo.alt || 'Logo'}>
|
|
47
|
+
{@html logo.html}
|
|
48
|
+
</a>
|
|
47
49
|
{/if}
|
|
48
50
|
|
|
49
51
|
{#if items?.length}
|
|
50
52
|
<ul>
|
|
51
53
|
{#each items as item}
|
|
52
54
|
<li>
|
|
53
|
-
<a
|
|
55
|
+
<a
|
|
56
|
+
href={item.url}
|
|
57
|
+
target={item.target}
|
|
58
|
+
class={item.active ? styles.active : null}
|
|
59
|
+
>
|
|
54
60
|
{item.name}
|
|
55
61
|
</a>
|
|
56
62
|
</li>
|
|
@@ -69,7 +75,9 @@
|
|
|
69
75
|
{/if}
|
|
70
76
|
|
|
71
77
|
{#if centerLogo && logo?.html}
|
|
72
|
-
<a href="/"
|
|
78
|
+
<a href="/" aria-label={logo.alt || 'Logo'}>
|
|
79
|
+
{@html logo.html}
|
|
80
|
+
</a>
|
|
73
81
|
{/if}
|
|
74
82
|
|
|
75
83
|
{#if logo?.url && centerLogo}
|
package/components/Menu/Menu.tsx
CHANGED
|
@@ -55,6 +55,7 @@ const Menu = ({
|
|
|
55
55
|
<a
|
|
56
56
|
href="/"
|
|
57
57
|
dangerouslySetInnerHTML={{ __html: logo.html }}
|
|
58
|
+
aria-label={logo.alt || 'Logo'}
|
|
58
59
|
/>
|
|
59
60
|
)}
|
|
60
61
|
|
|
@@ -62,7 +63,11 @@ const Menu = ({
|
|
|
62
63
|
<ul>
|
|
63
64
|
{items.map((item, index) => (
|
|
64
65
|
<li key={index}>
|
|
65
|
-
<a
|
|
66
|
+
<a
|
|
67
|
+
href={item.url}
|
|
68
|
+
target={item.target}
|
|
69
|
+
className={item.active ? styles.active : undefined}
|
|
70
|
+
>
|
|
66
71
|
{item.name}
|
|
67
72
|
</a>
|
|
68
73
|
</li>
|
|
@@ -84,6 +89,7 @@ const Menu = ({
|
|
|
84
89
|
<a
|
|
85
90
|
href="/"
|
|
86
91
|
dangerouslySetInnerHTML={{ __html: logo.html }}
|
|
92
|
+
aria-label={logo.alt || 'Logo'}
|
|
87
93
|
/>
|
|
88
94
|
)}
|
|
89
95
|
|