webcoreui 1.4.0 → 1.5.0-beta.1
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 +15 -1
- package/astro.d.ts +62 -56
- package/astro.js +4 -0
- package/components/Accordion/Accordion.astro +1 -1
- package/components/Accordion/Accordion.svelte +60 -58
- package/components/Accordion/Accordion.tsx +3 -1
- package/components/Alert/Alert.astro +2 -1
- package/components/Alert/Alert.svelte +12 -5
- package/components/Alert/Alert.tsx +10 -3
- package/components/Alert/alert.ts +2 -18
- package/components/AspectRatio/AspectRatio.astro +1 -1
- package/components/AspectRatio/AspectRatio.svelte +27 -22
- package/components/AspectRatio/AspectRatio.tsx +6 -3
- package/components/AspectRatio/aspectratio.ts +0 -10
- package/components/Avatar/Avatar.astro +1 -1
- package/components/Avatar/Avatar.svelte +7 -5
- package/components/Avatar/Avatar.tsx +3 -2
- package/components/Avatar/avatar.module.scss +3 -5
- package/components/Badge/Badge.astro +2 -1
- package/components/Badge/Badge.svelte +11 -4
- package/components/Badge/Badge.tsx +8 -3
- package/components/Badge/badge.module.scss +5 -6
- package/components/Badge/badge.ts +11 -13
- package/components/Banner/Banner.astro +1 -1
- package/components/Banner/Banner.svelte +11 -5
- package/components/Banner/Banner.tsx +6 -2
- package/components/Banner/banner.module.scss +4 -6
- package/components/Banner/banner.ts +0 -10
- package/components/BottomNavigation/BottomNavigation.astro +1 -1
- package/components/BottomNavigation/BottomNavigation.svelte +7 -4
- package/components/BottomNavigation/BottomNavigation.tsx +3 -2
- package/components/BottomNavigation/bottomnavigation.module.scss +68 -70
- package/components/Breadcrumb/Breadcrumb.astro +1 -1
- package/components/Breadcrumb/Breadcrumb.svelte +5 -3
- package/components/Breadcrumb/Breadcrumb.tsx +3 -1
- package/components/Button/Button.astro +2 -1
- package/components/Button/Button.svelte +11 -4
- package/components/Button/Button.tsx +7 -2
- package/components/Button/button.module.scss +9 -12
- package/components/Button/button.ts +23 -20
- package/components/Card/Card.astro +9 -2
- package/components/Card/Card.svelte +21 -8
- package/components/Card/Card.tsx +23 -6
- package/components/Card/card.module.scss +12 -9
- package/components/Card/card.ts +3 -16
- package/components/Carousel/Carousel.astro +3 -3
- package/components/Carousel/Carousel.svelte +24 -19
- package/components/Carousel/Carousel.tsx +9 -4
- package/components/Carousel/carousel.module.scss +3 -5
- package/components/Carousel/carousel.ts +0 -12
- package/components/CarouselItem/CarouselItem.astro +14 -0
- package/components/CarouselItem/CarouselItem.svelte +18 -0
- package/components/CarouselItem/CarouselItem.tsx +18 -0
- package/components/CarouselItem/carouselItem.ts +4 -0
- package/components/Checkbox/Checkbox.astro +3 -6
- package/components/Checkbox/Checkbox.svelte +13 -10
- package/components/Checkbox/Checkbox.tsx +8 -5
- package/components/Checkbox/checkbox.module.scss +4 -6
- package/components/Checkbox/checkbox.ts +2 -17
- package/components/Collapsible/Collapsible.astro +1 -1
- package/components/Collapsible/Collapsible.svelte +13 -6
- package/components/Collapsible/Collapsible.tsx +8 -2
- package/components/Collapsible/collapsible.module.scss +5 -5
- package/components/Collapsible/collapsible.ts +0 -15
- package/components/ConditionalWrapper/ConditionalWrapper.astro +1 -1
- package/components/ConditionalWrapper/ConditionalWrapper.svelte +8 -2
- package/components/ConditionalWrapper/ConditionalWrapper.tsx +7 -2
- package/components/ConditionalWrapper/conditionalwrapper.ts +2 -14
- package/components/ContextMenu/ContextMenu.astro +2 -1
- package/components/ContextMenu/ContextMenu.svelte +17 -9
- package/components/ContextMenu/ContextMenu.tsx +8 -2
- package/components/ContextMenu/contextmenu.ts +2 -17
- package/components/Copy/Copy.astro +2 -2
- package/components/Copy/Copy.svelte +10 -5
- package/components/Copy/Copy.tsx +7 -3
- package/components/Copy/copy.ts +2 -12
- package/components/Counter/Counter.astro +3 -2
- package/components/Counter/Counter.svelte +16 -10
- package/components/Counter/Counter.tsx +11 -7
- package/components/Counter/counter.module.scss +3 -5
- package/components/Counter/counter.ts +2 -11
- package/components/DataTable/DataTable.astro +1 -1
- package/components/DataTable/DataTable.svelte +23 -15
- package/components/DataTable/DataTable.tsx +7 -2
- package/components/DataTable/datatable.ts +0 -12
- package/components/Flex/Flex.astro +2 -1
- package/components/Flex/Flex.svelte +12 -6
- package/components/Flex/Flex.tsx +8 -3
- package/components/Flex/flex.ts +2 -15
- package/components/Footer/Footer.astro +1 -1
- package/components/Footer/Footer.svelte +13 -8
- package/components/Footer/Footer.tsx +6 -2
- package/components/Footer/footer.ts +0 -10
- package/components/Grid/Grid.astro +2 -1
- package/components/Grid/Grid.svelte +12 -6
- package/components/Grid/Grid.tsx +8 -3
- package/components/Grid/grid.ts +2 -15
- package/components/Group/Group.astro +1 -1
- package/components/Group/Group.svelte +9 -4
- package/components/Group/Group.tsx +6 -2
- package/components/Group/group.ts +0 -10
- package/components/Icon/Icon.astro +1 -1
- package/components/Icon/Icon.svelte +16 -9
- package/components/Icon/Icon.tsx +3 -2
- package/components/Image/Image.astro +2 -1
- package/components/Image/Image.svelte +54 -51
- package/components/Image/Image.tsx +3 -1
- package/components/Image/image.ts +2 -3
- package/components/ImageLoader/ImageLoader.astro +1 -1
- package/components/ImageLoader/ImageLoader.svelte +5 -3
- package/components/ImageLoader/ImageLoader.tsx +3 -1
- package/components/Input/Input.astro +3 -2
- package/components/Input/Input.svelte +19 -9
- package/components/Input/Input.tsx +11 -3
- package/components/Input/input.ts +26 -53
- package/components/Kbd/Kbd.astro +1 -1
- package/components/Kbd/Kbd.svelte +9 -4
- package/components/Kbd/Kbd.tsx +6 -2
- package/components/Kbd/kbd.ts +0 -10
- package/components/List/List.astro +1 -1
- package/components/List/List.svelte +13 -9
- package/components/List/List.tsx +10 -6
- package/components/List/list.ts +0 -8
- package/components/Masonry/Masonry.astro +1 -1
- package/components/Masonry/Masonry.svelte +14 -9
- package/components/Masonry/Masonry.tsx +7 -3
- package/components/Masonry/masonry.module.scss +4 -6
- package/components/Masonry/masonry.ts +2 -13
- package/components/Menu/Menu.astro +1 -1
- package/components/Menu/Menu.svelte +13 -7
- package/components/Menu/Menu.tsx +6 -2
- package/components/Menu/menu.ts +0 -10
- package/components/Modal/Modal.astro +2 -3
- package/components/Modal/Modal.svelte +12 -8
- package/components/Modal/Modal.tsx +6 -4
- package/components/Modal/modal.module.scss +5 -5
- package/components/Modal/modal.ts +2 -14
- package/components/OTPInput/OTPInput.astro +3 -5
- package/components/OTPInput/OTPInput.svelte +10 -10
- package/components/OTPInput/OTPInput.tsx +10 -8
- package/components/OTPInput/otpinput.module.scss +0 -12
- package/components/OTPInput/otpinput.ts +2 -4
- package/components/Pagination/Pagination.astro +1 -1
- package/components/Pagination/Pagination.svelte +8 -4
- package/components/Pagination/Pagination.tsx +6 -2
- package/components/Pagination/pagination.ts +0 -8
- package/components/Popover/Popover.astro +3 -7
- package/components/Popover/Popover.svelte +11 -10
- package/components/Popover/Popover.tsx +9 -12
- package/components/Popover/popover.ts +2 -15
- package/components/Progress/Progress.astro +1 -1
- package/components/Progress/Progress.svelte +8 -6
- package/components/Progress/Progress.tsx +3 -1
- package/components/Progress/progress.module.scss +15 -17
- package/components/Radio/Radio.astro +4 -4
- package/components/Radio/Radio.svelte +15 -8
- package/components/Radio/Radio.tsx +8 -5
- package/components/Radio/radio.module.scss +4 -6
- package/components/Radio/radio.ts +3 -14
- package/components/RangeSlider/RangeSlider.astro +5 -2
- package/components/RangeSlider/RangeSlider.svelte +20 -35
- package/components/RangeSlider/RangeSlider.tsx +11 -4
- package/components/RangeSlider/rangeslider.module.scss +14 -16
- package/components/RangeSlider/rangeslider.ts +1 -9
- package/components/Rating/Rating.astro +1 -1
- package/components/Rating/Rating.svelte +10 -7
- package/components/Rating/Rating.tsx +3 -1
- package/components/Rating/rating.module.scss +13 -15
- package/components/Ribbon/Ribbon.astro +1 -1
- package/components/Ribbon/Ribbon.svelte +9 -4
- package/components/Ribbon/Ribbon.tsx +6 -2
- package/components/Ribbon/ribbon.module.scss +9 -11
- package/components/Ribbon/ribbon.ts +0 -10
- package/components/Select/Select.astro +3 -1
- package/components/Select/Select.svelte +179 -171
- package/components/Select/Select.tsx +11 -4
- package/components/Select/select.ts +2 -12
- package/components/Sheet/Sheet.astro +2 -1
- package/components/Sheet/Sheet.svelte +7 -5
- package/components/Sheet/Sheet.tsx +5 -4
- package/components/Sheet/sheet.ts +3 -10
- package/components/Sidebar/Sidebar.astro +1 -1
- package/components/Sidebar/Sidebar.svelte +9 -4
- package/components/Sidebar/Sidebar.tsx +6 -2
- package/components/Sidebar/sidebar.ts +0 -10
- package/components/Skeleton/Skeleton.astro +1 -1
- package/components/Skeleton/Skeleton.svelte +7 -5
- package/components/Skeleton/Skeleton.tsx +3 -1
- package/components/Skeleton/skeleton.module.scss +6 -9
- package/components/Slider/Slider.astro +7 -5
- package/components/Slider/Slider.svelte +18 -10
- package/components/Slider/Slider.tsx +12 -6
- package/components/Slider/slider.module.scss +12 -14
- package/components/Slider/slider.ts +3 -12
- package/components/SpeedDial/SpeedDial.astro +1 -1
- package/components/SpeedDial/SpeedDial.svelte +6 -4
- package/components/SpeedDial/SpeedDial.tsx +4 -2
- package/components/SpeedDial/speeddial.module.scss +4 -6
- package/components/Spinner/Spinner.astro +1 -1
- package/components/Spinner/Spinner.svelte +7 -5
- package/components/Spinner/Spinner.tsx +3 -1
- package/components/Spinner/spinner.module.scss +13 -14
- package/components/Spoiler/Spoiler.astro +1 -1
- package/components/Spoiler/Spoiler.svelte +11 -5
- package/components/Spoiler/Spoiler.tsx +6 -2
- package/components/Spoiler/spoiler.module.scss +3 -5
- package/components/Spoiler/spoiler.ts +0 -10
- package/components/Stepper/Stepper.astro +1 -1
- package/components/Stepper/Stepper.svelte +7 -5
- package/components/Stepper/Stepper.tsx +3 -1
- package/components/Stepper/stepper.defaults.scss +5 -0
- package/components/Stepper/stepper.module.scss +11 -13
- package/components/Switch/Switch.astro +7 -2
- package/components/Switch/Switch.svelte +17 -8
- package/components/Switch/Switch.tsx +8 -4
- package/components/Switch/switch.module.scss +5 -7
- package/components/Switch/switch.ts +2 -16
- package/components/Tab/Tab.astro +25 -0
- package/components/Tab/Tab.svelte +28 -0
- package/components/Tab/Tab.tsx +30 -0
- package/components/Tab/tab.ts +6 -0
- package/components/Table/Table.astro +1 -1
- package/components/Table/Table.svelte +5 -3
- package/components/Table/Table.tsx +3 -1
- package/components/Tabs/Tabs.astro +58 -25
- package/components/Tabs/Tabs.svelte +47 -14
- package/components/Tabs/Tabs.tsx +42 -11
- package/components/Tabs/tabs.module.scss +7 -6
- package/components/Tabs/tabs.ts +0 -10
- package/components/Textarea/Textarea.astro +3 -6
- package/components/Textarea/Textarea.svelte +13 -10
- package/components/Textarea/Textarea.tsx +9 -7
- package/components/Textarea/textarea.ts +2 -17
- package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -1
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +14 -8
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +7 -2
- package/components/ThemeSwitcher/themeswitcher.module.scss +10 -12
- package/components/ThemeSwitcher/themeswitcher.ts +0 -13
- package/components/Timeline/Timeline.astro +1 -1
- package/components/Timeline/Timeline.svelte +11 -6
- package/components/Timeline/Timeline.tsx +6 -2
- package/components/Timeline/timeline.module.scss +6 -8
- package/components/Timeline/timeline.ts +0 -10
- package/components/TimelineItem/TimelineItem.astro +1 -1
- package/components/TimelineItem/TimelineItem.svelte +9 -4
- package/components/TimelineItem/TimelineItem.tsx +8 -3
- package/components/TimelineItem/timelineitem.module.scss +4 -4
- package/components/TimelineItem/timelineitem.ts +0 -12
- package/components/Toast/Toast.astro +2 -1
- package/components/Toast/Toast.svelte +9 -7
- package/components/Toast/Toast.tsx +5 -4
- package/components/Toast/toast.ts +3 -11
- package/package.json +19 -19
- package/react.d.ts +145 -138
- package/react.js +4 -0
- package/scss/config/functions.scss +41 -0
- package/scss/config/mixins.scss +65 -0
- package/scss/config.scss +1 -0
- package/scss/global/theme.scss +209 -194
- package/scss/setup.scss +6 -3
- package/svelte.d.ts +145 -138
- package/svelte.js +4 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-skeleton-color: var(--w-color-primary-60);
|
|
5
|
-
--w-skeleton-wave-color: var(--w-color-primary-50);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
.skeleton {
|
|
9
|
-
|
|
4
|
+
--color: var(--w-skeleton-color, var(--w-color-primary-60));
|
|
5
|
+
--wave-color: var(--w-skeleton-wave-color, var(--w-color-primary-50));
|
|
6
|
+
|
|
7
|
+
@include background(var(--color));
|
|
10
8
|
@include size(100%);
|
|
11
9
|
|
|
12
10
|
text-indent: -9999px;
|
|
@@ -26,7 +24,7 @@ body {
|
|
|
26
24
|
background: linear-gradient(
|
|
27
25
|
to right,
|
|
28
26
|
transparent 0%,
|
|
29
|
-
var(--
|
|
27
|
+
var(--wave-color) 50%,
|
|
30
28
|
transparent 100%
|
|
31
29
|
);
|
|
32
30
|
}
|
|
@@ -49,12 +47,11 @@ body {
|
|
|
49
47
|
from {
|
|
50
48
|
left: -200px;
|
|
51
49
|
}
|
|
52
|
-
to
|
|
50
|
+
to {
|
|
53
51
|
left: 100%;
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
|
|
58
55
|
@keyframes pulse {
|
|
59
56
|
0% {
|
|
60
57
|
@include visibility(1);
|
|
@@ -5,19 +5,20 @@ import { classNames } from '../../utils/classNames'
|
|
|
5
5
|
|
|
6
6
|
import styles from './slider.module.scss'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
export type Props = SliderProps
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
|
-
min,
|
|
12
|
-
max,
|
|
13
|
-
value,
|
|
11
|
+
min = 0,
|
|
12
|
+
max = 100,
|
|
13
|
+
value = 0,
|
|
14
14
|
step,
|
|
15
15
|
disabled,
|
|
16
16
|
color,
|
|
17
17
|
background,
|
|
18
18
|
thumb,
|
|
19
19
|
id,
|
|
20
|
-
className
|
|
20
|
+
className,
|
|
21
|
+
...rest
|
|
21
22
|
} = Astro.props
|
|
22
23
|
|
|
23
24
|
const classes = [
|
|
@@ -42,4 +43,5 @@ const styleVariables = classNames([
|
|
|
42
43
|
class:list={classes}
|
|
43
44
|
id={id}
|
|
44
45
|
style={styleVariables}
|
|
46
|
+
{...rest}
|
|
45
47
|
/>
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { SliderProps } from './slider'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './slider.module.scss'
|
|
7
7
|
|
|
8
|
+
import type { InputTarget } from '../Input/input'
|
|
9
|
+
|
|
10
|
+
export type Props = SliderProps & {
|
|
11
|
+
onChange?: (event: Event & InputTarget) => void
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
const {
|
|
9
|
-
min,
|
|
10
|
-
max,
|
|
11
|
-
value,
|
|
15
|
+
min = 0,
|
|
16
|
+
max = 100,
|
|
17
|
+
value = 0,
|
|
12
18
|
step,
|
|
13
19
|
disabled,
|
|
14
20
|
color,
|
|
@@ -16,19 +22,20 @@
|
|
|
16
22
|
thumb,
|
|
17
23
|
id,
|
|
18
24
|
className,
|
|
19
|
-
onChange
|
|
20
|
-
|
|
25
|
+
onChange,
|
|
26
|
+
...rest
|
|
27
|
+
}: Props = $props()
|
|
21
28
|
|
|
22
|
-
const classes = classNames([
|
|
29
|
+
const classes = $derived(classNames([
|
|
23
30
|
styles.slider,
|
|
24
31
|
className
|
|
25
|
-
])
|
|
32
|
+
]))
|
|
26
33
|
|
|
27
|
-
const styleVariables = classNames([
|
|
34
|
+
const styleVariables = $derived(classNames([
|
|
28
35
|
color && `--w-slider-color: ${color};`,
|
|
29
36
|
background && `--w-slider-background: ${background};`,
|
|
30
37
|
thumb && `--w-slider-thumb: ${thumb};`
|
|
31
|
-
])
|
|
38
|
+
]))
|
|
32
39
|
</script>
|
|
33
40
|
|
|
34
41
|
<input
|
|
@@ -42,4 +49,5 @@
|
|
|
42
49
|
id={id}
|
|
43
50
|
style={styleVariables || null}
|
|
44
51
|
onchange={onChange}
|
|
52
|
+
{...rest}
|
|
45
53
|
/>
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { SliderProps } from './slider'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './slider.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = SliderProps & {
|
|
9
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
const Slider = ({
|
|
9
|
-
min,
|
|
10
|
-
max,
|
|
11
|
-
value,
|
|
13
|
+
min = 0,
|
|
14
|
+
max = 100,
|
|
15
|
+
value = 0,
|
|
12
16
|
step,
|
|
13
17
|
disabled,
|
|
14
18
|
color,
|
|
@@ -16,8 +20,9 @@ const Slider = ({
|
|
|
16
20
|
thumb,
|
|
17
21
|
id,
|
|
18
22
|
className,
|
|
19
|
-
onChange
|
|
20
|
-
|
|
23
|
+
onChange,
|
|
24
|
+
...rest
|
|
25
|
+
}: Props) => {
|
|
21
26
|
const classes = classNames([
|
|
22
27
|
styles.slider,
|
|
23
28
|
className
|
|
@@ -41,6 +46,7 @@ const Slider = ({
|
|
|
41
46
|
id={id}
|
|
42
47
|
style={styleVariables}
|
|
43
48
|
onChange={onChange}
|
|
49
|
+
{...rest}
|
|
44
50
|
/>
|
|
45
51
|
|
|
46
52
|
)
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-slider-background: var(--w-color-primary-50);
|
|
5
|
-
--w-slider-color: var(--w-color-primary);
|
|
6
|
-
--w-slider-thumb: var(--w-color-primary-50);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
3
|
.slider {
|
|
4
|
+
--bg: var(--w-slider-background, var(--w-color-primary-50));
|
|
5
|
+
--color: var(--w-slider-color, var(--w-color-primary));
|
|
6
|
+
--thumb: var(--w-slider-thumb, var(--w-color-primary-50));
|
|
7
|
+
|
|
10
8
|
@include border-radius(xl);
|
|
11
9
|
@include size('w100%');
|
|
12
10
|
@include visibility(hidden);
|
|
@@ -43,30 +41,30 @@ body {
|
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
.slider::-webkit-slider-runnable-track {
|
|
46
|
-
@include background(var(--
|
|
44
|
+
@include background(var(--bg));
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
.slider::-moz-range-track {
|
|
50
|
-
@include background(var(--
|
|
48
|
+
@include background(var(--bg));
|
|
51
49
|
@include size(h10px);
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
.slider::-webkit-slider-thumb {
|
|
55
|
-
@include background(var(--
|
|
53
|
+
@include background(var(--thumb));
|
|
56
54
|
@include size(10px);
|
|
57
55
|
@include border-radius(max);
|
|
58
|
-
@include border(var(--
|
|
56
|
+
@include border(var(--color));
|
|
59
57
|
|
|
60
58
|
-webkit-appearance: none;
|
|
61
59
|
appearance: none;
|
|
62
|
-
box-shadow: -995px 0 0 990px var(--
|
|
60
|
+
box-shadow: -995px 0 0 990px var(--color);
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
.slider::-moz-range-thumb {
|
|
66
|
-
@include background(var(--
|
|
64
|
+
@include background(var(--thumb));
|
|
67
65
|
@include size(9px);
|
|
68
66
|
@include border-radius(max);
|
|
69
|
-
@include border(var(--
|
|
67
|
+
@include border(var(--color));
|
|
70
68
|
|
|
71
|
-
box-shadow: -995px 0 0 990px var(--
|
|
69
|
+
box-shadow: -995px 0 0 990px var(--color);
|
|
72
70
|
}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import type { InputTarget } from '../Input/input'
|
|
2
|
-
|
|
3
1
|
export type SliderProps = {
|
|
4
|
-
min
|
|
5
|
-
max
|
|
2
|
+
min?: number
|
|
3
|
+
max?: number
|
|
6
4
|
value?: number
|
|
7
5
|
step?: number
|
|
8
6
|
disabled?: boolean
|
|
7
|
+
required?: boolean
|
|
9
8
|
color?: string
|
|
10
9
|
background?: string
|
|
11
10
|
thumb?: string
|
|
12
11
|
id?: string
|
|
13
12
|
className?: string
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
export type SvelteSliderProps = {
|
|
17
|
-
onChange?: (event: Event & InputTarget) => void
|
|
18
|
-
} & SliderProps
|
|
19
|
-
|
|
20
|
-
export type ReactSliderProps = {
|
|
21
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
22
|
-
} & SliderProps
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
import styles from './speeddial.module.scss'
|
|
11
11
|
|
|
12
|
+
export type Props = SpeedDialProps
|
|
13
|
+
|
|
12
14
|
const {
|
|
13
15
|
items,
|
|
14
16
|
position,
|
|
@@ -18,17 +20,17 @@
|
|
|
18
20
|
icon,
|
|
19
21
|
triggerOnClick,
|
|
20
22
|
className
|
|
21
|
-
}:
|
|
23
|
+
}: Props = $props()
|
|
22
24
|
|
|
23
25
|
let show = $state(false)
|
|
24
26
|
|
|
25
|
-
const classes = classNames([
|
|
27
|
+
const classes = $derived(classNames([
|
|
26
28
|
styles.dial,
|
|
27
29
|
position && styles[position],
|
|
28
30
|
horizontal && styles.horizontal,
|
|
29
31
|
circular && styles.circular,
|
|
30
32
|
className
|
|
31
|
-
])
|
|
33
|
+
]))
|
|
32
34
|
|
|
33
35
|
const getTooltipPosition = () => {
|
|
34
36
|
const positionMap = {
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
const speedDial = get('[data-id="w-speed-dial"] button') as HTMLButtonElement
|
|
52
54
|
|
|
53
55
|
const eventListener = (event: Event) => {
|
|
54
|
-
if (!speedDial
|
|
56
|
+
if (!speedDial?.contains((event.target || event.currentTarget) as HTMLElement)) {
|
|
55
57
|
show = false
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -8,6 +8,8 @@ import { get, on } from '../../utils/DOMUtils'
|
|
|
8
8
|
|
|
9
9
|
import styles from './speeddial.module.scss'
|
|
10
10
|
|
|
11
|
+
export type Props = SpeedDialProps
|
|
12
|
+
|
|
11
13
|
const SpeedDial = ({
|
|
12
14
|
items,
|
|
13
15
|
position,
|
|
@@ -17,7 +19,7 @@ const SpeedDial = ({
|
|
|
17
19
|
icon,
|
|
18
20
|
triggerOnClick,
|
|
19
21
|
className
|
|
20
|
-
}:
|
|
22
|
+
}: Props) => {
|
|
21
23
|
const [show, setShow] = useState(false)
|
|
22
24
|
|
|
23
25
|
const classes = classNames([
|
|
@@ -51,7 +53,7 @@ const SpeedDial = ({
|
|
|
51
53
|
const speedDial = get('[data-id="w-speed-dial"] button') as HTMLButtonElement
|
|
52
54
|
|
|
53
55
|
const eventListener = (event: Event) => {
|
|
54
|
-
if (!speedDial
|
|
56
|
+
if (!speedDial?.contains((event.target || event.currentTarget) as HTMLElement)) {
|
|
55
57
|
setShow(false)
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-speed-dial-size: 40px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.dial {
|
|
4
|
+
--size: var(--w-speed-dial-size, 40px);
|
|
5
|
+
|
|
8
6
|
@include layout(flex, column-reverse, center, xs);
|
|
9
7
|
@include position(fixed, b20px, r20px);
|
|
10
8
|
|
|
@@ -54,7 +52,7 @@ body {
|
|
|
54
52
|
.trigger {
|
|
55
53
|
@include layout(flex, column);
|
|
56
54
|
@include typography(bold);
|
|
57
|
-
@include size(var(--
|
|
55
|
+
@include size(var(--size));
|
|
58
56
|
|
|
59
57
|
user-select: none;
|
|
60
58
|
|
|
@@ -85,7 +83,7 @@ body {
|
|
|
85
83
|
|
|
86
84
|
.button {
|
|
87
85
|
@include layout(flex, column, xs);
|
|
88
|
-
@include size(var(--
|
|
86
|
+
@include size(var(--size));
|
|
89
87
|
|
|
90
88
|
svg {
|
|
91
89
|
@include size(16px);
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './spinner.module.scss'
|
|
7
|
+
|
|
8
|
+
export type Props = SpinnerProps
|
|
7
9
|
|
|
8
10
|
const {
|
|
9
11
|
color,
|
|
@@ -11,20 +13,20 @@
|
|
|
11
13
|
speed,
|
|
12
14
|
size,
|
|
13
15
|
dashArray
|
|
14
|
-
}:
|
|
16
|
+
}: Props = $props()
|
|
15
17
|
|
|
16
|
-
const classes = classNames([
|
|
18
|
+
const classes = $derived(classNames([
|
|
17
19
|
styles.spinner,
|
|
18
20
|
dashArray && styles.dashed
|
|
19
|
-
])
|
|
21
|
+
]))
|
|
20
22
|
|
|
21
|
-
const styleVariables = classNames([
|
|
23
|
+
const styleVariables = $derived(classNames([
|
|
22
24
|
color && `--w-spinner-color: ${color};`,
|
|
23
25
|
width && `--w-spinner-width: ${width}px;`,
|
|
24
26
|
speed && `--w-spinner-speed: ${speed}s;`,
|
|
25
27
|
size && `--w-spinner-size: ${size}px;`,
|
|
26
28
|
dashArray && `--w-spinner-dash: ${dashArray}`
|
|
27
|
-
])
|
|
29
|
+
]))
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
32
|
<svg
|
|
@@ -4,6 +4,8 @@ import type { SpinnerProps } from './spinner'
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './spinner.module.scss'
|
|
7
|
+
|
|
8
|
+
export type Props = SpinnerProps
|
|
7
9
|
|
|
8
10
|
const Spinner = ({
|
|
9
11
|
color,
|
|
@@ -11,7 +13,7 @@ const Spinner = ({
|
|
|
11
13
|
speed,
|
|
12
14
|
size,
|
|
13
15
|
dashArray
|
|
14
|
-
}:
|
|
16
|
+
}: Props) => {
|
|
15
17
|
const classes = classNames([
|
|
16
18
|
styles.spinner,
|
|
17
19
|
dashArray && styles.dashed
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-spinner-color: var(--w-color-primary);
|
|
5
|
-
--w-spinner-width: 2px;
|
|
6
|
-
--w-spinner-speed: 2s;
|
|
7
|
-
--w-spinner-size: 30px;
|
|
8
|
-
--w-spinner-dash: 8;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
3
|
.spinner {
|
|
4
|
+
--color: var(--w-spinner-color, var(--w-color-primary));
|
|
5
|
+
--width: var(--w-spinner-width, 2px);
|
|
6
|
+
--speed: var(--w-spinner-speed, 2s);
|
|
7
|
+
--size: var(--w-spinner-size, 30px);
|
|
8
|
+
--dash: var(--w-spinner-dash, 8);
|
|
9
|
+
|
|
12
10
|
@include spacing(auto-none);
|
|
13
11
|
|
|
14
|
-
width: var(--
|
|
15
|
-
height: var(--
|
|
16
|
-
animation: rotate var(--
|
|
12
|
+
width: var(--size);
|
|
13
|
+
height: var(--size);
|
|
14
|
+
animation: rotate var(--speed) linear infinite;
|
|
17
15
|
|
|
18
16
|
&.dashed .path {
|
|
19
|
-
stroke-dasharray: var(--
|
|
17
|
+
stroke-dasharray: var(--dash);
|
|
20
18
|
animation: none;
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
.path {
|
|
24
|
-
stroke: var(--
|
|
25
|
-
stroke-width: var(--
|
|
22
|
+
stroke: var(--color);
|
|
23
|
+
stroke-width: var(--width);
|
|
26
24
|
animation: dash 1.5s ease-in-out infinite;
|
|
27
25
|
stroke-linecap: round;
|
|
28
26
|
}
|
|
@@ -48,3 +46,4 @@ body {
|
|
|
48
46
|
stroke-dashoffset: -124;
|
|
49
47
|
}
|
|
50
48
|
}
|
|
49
|
+
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { SpoilerProps } from './spoiler'
|
|
3
4
|
|
|
4
5
|
import { classNames } from '../../utils/classNames'
|
|
5
6
|
|
|
6
7
|
import styles from './spoiler.module.scss'
|
|
7
8
|
|
|
9
|
+
export type Props = SpoilerProps & {
|
|
10
|
+
children: Snippet
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
const {
|
|
9
14
|
color,
|
|
10
15
|
animated = true,
|
|
@@ -12,17 +17,18 @@
|
|
|
12
17
|
tooltip,
|
|
13
18
|
tooltipPosition,
|
|
14
19
|
children
|
|
15
|
-
}:
|
|
20
|
+
}: Props = $props()
|
|
16
21
|
|
|
17
|
-
const classes = classNames([
|
|
22
|
+
const classes = $derived(classNames([
|
|
18
23
|
styles.spoiler,
|
|
19
24
|
animated && styles.anim,
|
|
20
25
|
block && styles.block
|
|
21
|
-
])
|
|
26
|
+
]))
|
|
22
27
|
|
|
23
|
-
const style = color
|
|
28
|
+
const style = $derived(color
|
|
24
29
|
? `--w-spoiler-color: ${color};`
|
|
25
30
|
: null
|
|
31
|
+
)
|
|
26
32
|
|
|
27
33
|
const toggle = (event: MouseEvent | KeyboardEvent) => {
|
|
28
34
|
const target = event.currentTarget as HTMLSpanElement
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { SpoilerProps } from './spoiler'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './spoiler.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = SpoilerProps & {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
const Spoiler = ({
|
|
9
13
|
color,
|
|
10
14
|
animated = true,
|
|
@@ -12,7 +16,7 @@ const Spoiler = ({
|
|
|
12
16
|
tooltip,
|
|
13
17
|
tooltipPosition,
|
|
14
18
|
children
|
|
15
|
-
}:
|
|
19
|
+
}: Props) => {
|
|
16
20
|
const classes = classNames([
|
|
17
21
|
styles.spoiler,
|
|
18
22
|
animated && styles.anim,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-spoiler-color: var(--w-color-primary);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
span.spoiler {
|
|
4
|
+
--color: var(--w-spoiler-color, var(--w-color-primary));
|
|
5
|
+
|
|
8
6
|
@include border-radius();
|
|
9
|
-
@include background(var(--
|
|
7
|
+
@include background(var(--color));
|
|
10
8
|
@include typography(hmd);
|
|
11
9
|
@include visibility(inline);
|
|
12
10
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
1
|
export type SpoilerProps = {
|
|
4
2
|
color?: string
|
|
5
3
|
animated?: boolean
|
|
@@ -7,11 +5,3 @@ export type SpoilerProps = {
|
|
|
7
5
|
tooltip?: string
|
|
8
6
|
tooltipPosition?: 'bottom' | null
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
export type SvelteSpoilerProps = {
|
|
12
|
-
children: Snippet
|
|
13
|
-
} & SpoilerProps
|
|
14
|
-
|
|
15
|
-
export type ReactSpoilerProps = {
|
|
16
|
-
children: React.ReactNode
|
|
17
|
-
} & SpoilerProps
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import styles from './stepper.module.scss'
|
|
9
9
|
|
|
10
|
+
export type Props = StepperProps
|
|
11
|
+
|
|
10
12
|
const {
|
|
11
13
|
items,
|
|
12
14
|
color,
|
|
@@ -15,20 +17,20 @@
|
|
|
15
17
|
borderless,
|
|
16
18
|
vertical,
|
|
17
19
|
className
|
|
18
|
-
}:
|
|
20
|
+
}: Props = $props()
|
|
19
21
|
|
|
20
|
-
const classes = classNames([
|
|
22
|
+
const classes = $derived(classNames([
|
|
21
23
|
styles.stepper,
|
|
22
24
|
borderless && styles.borderless,
|
|
23
25
|
vertical && styles.vertical,
|
|
24
26
|
className
|
|
25
|
-
])
|
|
27
|
+
]))
|
|
26
28
|
|
|
27
|
-
const styleVariables = [
|
|
29
|
+
const styleVariables = $derived([
|
|
28
30
|
color && `--w-stepper-color-border: ${color}`,
|
|
29
31
|
completedColor && `--w-stepper-color-complete: ${completedColor}`,
|
|
30
32
|
activeColor && `--w-stepper-color-active: ${activeColor}`
|
|
31
|
-
].filter(Boolean).join(';')
|
|
33
|
+
].filter(Boolean).join(';'))
|
|
32
34
|
</script>
|
|
33
35
|
|
|
34
36
|
<ol class={classes} style={styleVariables || null}>
|
|
@@ -7,6 +7,8 @@ import { classNames } from '../../utils/classNames'
|
|
|
7
7
|
|
|
8
8
|
import styles from './stepper.module.scss'
|
|
9
9
|
|
|
10
|
+
export type Props = StepperProps
|
|
11
|
+
|
|
10
12
|
const Stepper = ({
|
|
11
13
|
items,
|
|
12
14
|
color,
|
|
@@ -15,7 +17,7 @@ const Stepper = ({
|
|
|
15
17
|
borderless,
|
|
16
18
|
vertical,
|
|
17
19
|
className
|
|
18
|
-
}:
|
|
20
|
+
}: Props) => {
|
|
19
21
|
const classes = classNames([
|
|
20
22
|
styles.stepper,
|
|
21
23
|
borderless && styles.borderless,
|