webcoreui 1.5.0-0 → 1.5.0-beta.2
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/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 +4 -2
- package/components/Alert/Alert.astro +2 -1
- package/components/Alert/Alert.svelte +9 -2
- 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 +7 -2
- 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 +3 -1
- package/components/Avatar/Avatar.tsx +3 -2
- package/components/Badge/Badge.astro +2 -1
- package/components/Badge/Badge.svelte +9 -2
- package/components/Badge/Badge.tsx +8 -3
- package/components/Badge/badge.ts +11 -13
- package/components/Banner/Banner.astro +1 -1
- package/components/Banner/Banner.svelte +7 -2
- package/components/Banner/Banner.tsx +6 -2
- package/components/Banner/banner.ts +0 -10
- package/components/BottomNavigation/BottomNavigation.astro +1 -1
- package/components/BottomNavigation/BottomNavigation.svelte +3 -1
- package/components/BottomNavigation/BottomNavigation.tsx +3 -2
- package/components/Breadcrumb/Breadcrumb.astro +1 -1
- package/components/Breadcrumb/Breadcrumb.svelte +3 -1
- package/components/Breadcrumb/Breadcrumb.tsx +3 -1
- package/components/Button/Button.astro +2 -1
- package/components/Button/Button.svelte +9 -2
- package/components/Button/Button.tsx +7 -2
- package/components/Button/button.ts +23 -20
- package/components/Card/Card.astro +9 -2
- package/components/Card/Card.svelte +17 -4
- package/components/Card/Card.tsx +23 -6
- package/components/Card/card.module.scss +11 -4
- package/components/Card/card.ts +3 -16
- package/components/Carousel/Carousel.astro +1 -1
- package/components/Carousel/Carousel.svelte +8 -3
- package/components/Carousel/Carousel.tsx +7 -2
- 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 +9 -7
- package/components/Checkbox/Checkbox.tsx +8 -5
- package/components/Checkbox/checkbox.ts +2 -17
- package/components/Collapsible/Collapsible.astro +1 -1
- package/components/Collapsible/Collapsible.svelte +9 -2
- package/components/Collapsible/Collapsible.tsx +8 -2
- 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 +9 -3
- 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 +8 -3
- 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 +10 -5
- package/components/Counter/Counter.tsx +11 -7
- package/components/Counter/counter.ts +2 -11
- package/components/DataTable/DataTable.astro +1 -1
- package/components/DataTable/DataTable.svelte +8 -2
- 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 +8 -2
- 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 +7 -2
- 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 +8 -2
- 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 +7 -2
- 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 +3 -1
- package/components/Icon/Icon.tsx +3 -2
- package/components/Image/Image.astro +2 -1
- package/components/Image/Image.svelte +4 -1
- 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 +3 -1
- package/components/ImageLoader/ImageLoader.tsx +4 -2
- package/components/Input/Input.astro +3 -2
- package/components/Input/Input.svelte +14 -4
- 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 +7 -2
- 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 +6 -2
- package/components/List/List.tsx +8 -4
- package/components/List/list.ts +0 -8
- package/components/Masonry/Masonry.astro +1 -1
- package/components/Masonry/Masonry.svelte +7 -2
- package/components/Masonry/Masonry.tsx +7 -3
- package/components/Masonry/masonry.ts +2 -13
- package/components/Menu/Menu.astro +1 -1
- package/components/Menu/Menu.svelte +7 -2
- 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 +8 -4
- package/components/Modal/Modal.tsx +6 -4
- package/components/Modal/modal.ts +2 -14
- package/components/OTPInput/OTPInput.astro +3 -5
- package/components/OTPInput/OTPInput.svelte +6 -6
- package/components/OTPInput/OTPInput.tsx +10 -8
- package/components/OTPInput/otpinput.ts +2 -4
- package/components/Pagination/Pagination.astro +1 -1
- package/components/Pagination/Pagination.svelte +6 -2
- 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 +9 -8
- 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 +3 -1
- package/components/Progress/Progress.tsx +3 -1
- package/components/Radio/Radio.astro +3 -4
- package/components/Radio/Radio.svelte +10 -5
- package/components/Radio/Radio.tsx +7 -5
- package/components/Radio/radio.ts +2 -14
- package/components/RangeSlider/RangeSlider.astro +1 -1
- package/components/RangeSlider/RangeSlider.svelte +6 -2
- package/components/RangeSlider/RangeSlider.tsx +7 -3
- package/components/RangeSlider/rangeslider.ts +0 -9
- package/components/Rating/Rating.astro +1 -1
- package/components/Rating/Rating.svelte +3 -1
- package/components/Rating/Rating.tsx +3 -1
- package/components/Ribbon/Ribbon.astro +1 -1
- package/components/Ribbon/Ribbon.svelte +7 -2
- package/components/Ribbon/Ribbon.tsx +6 -2
- package/components/Ribbon/ribbon.ts +0 -10
- package/components/Select/Select.astro +1 -1
- package/components/Select/Select.svelte +9 -4
- package/components/Select/Select.tsx +9 -4
- package/components/Select/select.ts +1 -12
- package/components/Sheet/Sheet.astro +2 -1
- package/components/Sheet/Sheet.svelte +5 -3
- 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 +7 -2
- 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 +3 -1
- package/components/Skeleton/Skeleton.tsx +3 -1
- package/components/Slider/Slider.astro +1 -1
- package/components/Slider/Slider.svelte +8 -2
- package/components/Slider/Slider.tsx +6 -2
- package/components/Slider/slider.ts +0 -10
- package/components/SpeedDial/SpeedDial.astro +1 -1
- package/components/SpeedDial/SpeedDial.svelte +3 -1
- package/components/SpeedDial/SpeedDial.tsx +4 -2
- package/components/Spinner/Spinner.astro +1 -1
- package/components/Spinner/Spinner.svelte +3 -1
- package/components/Spinner/Spinner.tsx +3 -1
- package/components/Spoiler/Spoiler.astro +1 -1
- package/components/Spoiler/Spoiler.svelte +7 -2
- package/components/Spoiler/Spoiler.tsx +6 -2
- package/components/Spoiler/spoiler.ts +0 -10
- package/components/Stepper/Stepper.astro +1 -1
- package/components/Stepper/Stepper.svelte +3 -1
- package/components/Stepper/Stepper.tsx +3 -1
- package/components/Switch/Switch.astro +7 -2
- package/components/Switch/Switch.svelte +13 -4
- package/components/Switch/Switch.tsx +8 -4
- 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 +3 -1
- package/components/Table/Table.tsx +3 -1
- package/components/Tabs/Tabs.astro +58 -25
- package/components/Tabs/Tabs.svelte +45 -12
- 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 +10 -7
- 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 +9 -3
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +7 -2
- package/components/ThemeSwitcher/themeswitcher.ts +0 -13
- package/components/Timeline/Timeline.astro +1 -1
- package/components/Timeline/Timeline.svelte +7 -2
- package/components/Timeline/Timeline.tsx +6 -2
- package/components/Timeline/timeline.ts +0 -10
- package/components/TimelineItem/TimelineItem.astro +1 -1
- package/components/TimelineItem/TimelineItem.svelte +7 -2
- package/components/TimelineItem/TimelineItem.tsx +8 -3
- package/components/TimelineItem/timelineitem.ts +0 -12
- package/components/Toast/Toast.astro +2 -1
- package/components/Toast/Toast.svelte +5 -3
- 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/svelte.d.ts +145 -138
- package/svelte.js +4 -0
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
8
|
import styles from './rating.module.scss'
|
|
9
|
+
|
|
10
|
+
export type Props = RatingProps
|
|
9
11
|
|
|
10
12
|
const {
|
|
11
13
|
score,
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
emptyColor,
|
|
23
25
|
size,
|
|
24
26
|
className
|
|
25
|
-
}:
|
|
27
|
+
}: Props = $props()
|
|
26
28
|
|
|
27
29
|
const classes = $derived(classNames([
|
|
28
30
|
styles.rating,
|
|
@@ -6,6 +6,8 @@ import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
|
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
8
|
import styles from './rating.module.scss'
|
|
9
|
+
|
|
10
|
+
export type Props = RatingProps
|
|
9
11
|
|
|
10
12
|
const Rating = ({
|
|
11
13
|
score,
|
|
@@ -22,7 +24,7 @@ const Rating = ({
|
|
|
22
24
|
emptyColor,
|
|
23
25
|
size,
|
|
24
26
|
className
|
|
25
|
-
}:
|
|
27
|
+
}: Props) => {
|
|
26
28
|
const classes = classNames([
|
|
27
29
|
styles.rating,
|
|
28
30
|
outline && styles.outline,
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { RibbonProps } from './ribbon'
|
|
3
4
|
|
|
4
5
|
import { classNames } from '../../utils/classNames'
|
|
5
6
|
|
|
6
7
|
import styles from './ribbon.module.scss'
|
|
7
8
|
|
|
9
|
+
export type Props = RibbonProps & {
|
|
10
|
+
children: Snippet
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
const {
|
|
9
14
|
offset,
|
|
10
15
|
type,
|
|
11
16
|
theme,
|
|
12
17
|
className,
|
|
13
18
|
children
|
|
14
|
-
}:
|
|
19
|
+
}: Props = $props()
|
|
15
20
|
|
|
16
21
|
const classes = $derived(classNames([
|
|
17
22
|
styles.ribbon,
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { RibbonProps } from './ribbon'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './ribbon.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = RibbonProps & {
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
const Ribbon = ({
|
|
9
13
|
offset,
|
|
10
14
|
type,
|
|
11
15
|
theme,
|
|
12
16
|
className,
|
|
13
17
|
children
|
|
14
|
-
}:
|
|
18
|
+
}: Props) => {
|
|
15
19
|
const classes = classNames([
|
|
16
20
|
styles.ribbon,
|
|
17
21
|
theme && styles[theme],
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
1
|
export type RibbonProps = {
|
|
4
2
|
offset?: number
|
|
5
3
|
type?: 'folded' | null
|
|
@@ -12,11 +10,3 @@ export type RibbonProps = {
|
|
|
12
10
|
| undefined
|
|
13
11
|
className?: string
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
export type SvelteRibbonProps = {
|
|
17
|
-
children: Snippet
|
|
18
|
-
} & RibbonProps
|
|
19
|
-
|
|
20
|
-
export type ReactRibbonProps = {
|
|
21
|
-
children: React.ReactNode
|
|
22
|
-
} & RibbonProps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte'
|
|
3
|
-
import type {
|
|
3
|
+
import type { SelectEventType, SelectProps } from './select'
|
|
4
4
|
|
|
5
5
|
import Input from '../Input/Input.svelte'
|
|
6
6
|
import List from '../List/List.svelte'
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
import { classNames } from '../../utils/classNames'
|
|
11
11
|
import { debounce } from '../../utils/debounce'
|
|
12
12
|
import { on } from '../../utils/DOMUtils'
|
|
13
|
-
import { modal } from '../../utils/modal'
|
|
14
|
-
import { closePopover, popover, type PopoverPosition } from '../../utils/popover'
|
|
13
|
+
import { modal, type ModalCallback } from '../../utils/modal'
|
|
14
|
+
import { closePopover, popover, type PopoverCallback, type PopoverPosition } from '../../utils/popover'
|
|
15
15
|
|
|
16
16
|
import ChevronDown from '../../icons/chevron-down.svg?raw'
|
|
17
17
|
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
import type { ListEventType, ListProps } from '../List/list'
|
|
21
21
|
|
|
22
|
+
export type Props = SelectProps & {
|
|
23
|
+
onChange?: (event: SelectEventType) => void
|
|
24
|
+
onClose?: (event: ModalCallback | PopoverCallback) => void
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
const {
|
|
23
28
|
name,
|
|
24
29
|
value,
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
onChange,
|
|
34
39
|
onClose,
|
|
35
40
|
...rest
|
|
36
|
-
}:
|
|
41
|
+
}: Props = $props()
|
|
37
42
|
|
|
38
43
|
let popoverInstance: any
|
|
39
44
|
let focusByTab = false
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect,useState } from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { SelectEventType, SelectProps } from './select'
|
|
3
3
|
|
|
4
4
|
import Input from '../Input/Input.tsx'
|
|
5
5
|
import List from '../List/List.tsx'
|
|
@@ -9,8 +9,8 @@ import Popover from '../Popover/Popover.tsx'
|
|
|
9
9
|
import { classNames } from '../../utils/classNames'
|
|
10
10
|
import { debounce } from '../../utils/debounce'
|
|
11
11
|
import { on } from '../../utils/DOMUtils'
|
|
12
|
-
import { modal } from '../../utils/modal'
|
|
13
|
-
import { closePopover, popover, type PopoverPosition } from '../../utils/popover'
|
|
12
|
+
import { modal, type ModalCallback } from '../../utils/modal'
|
|
13
|
+
import { closePopover, popover, type PopoverCallback, type PopoverPosition } from '../../utils/popover'
|
|
14
14
|
|
|
15
15
|
import ChevronDown from '../../icons/chevron-down.svg?raw'
|
|
16
16
|
|
|
@@ -18,6 +18,11 @@ import styles from './select.module.scss'
|
|
|
18
18
|
|
|
19
19
|
import type { ListEventType } from '../List/list'
|
|
20
20
|
|
|
21
|
+
export type Props = SelectProps & {
|
|
22
|
+
onChange?: (event: SelectEventType) => void
|
|
23
|
+
onClose?: (event: ModalCallback | PopoverCallback) => void
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
const Select = ({
|
|
22
27
|
name,
|
|
23
28
|
value,
|
|
@@ -32,7 +37,7 @@ const Select = ({
|
|
|
32
37
|
onChange,
|
|
33
38
|
onClose,
|
|
34
39
|
...rest
|
|
35
|
-
}:
|
|
40
|
+
}: Props) => {
|
|
36
41
|
const inferredValue = rest.itemGroups.map(group => group.items)
|
|
37
42
|
.flat()
|
|
38
43
|
.find(item => item.value === value)?.name
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { PopoverCallback, PopoverPosition } from '../../utils/popover'
|
|
1
|
+
import type { PopoverPosition } from '../../utils/popover'
|
|
3
2
|
|
|
4
3
|
import type { ListEventType, ListProps } from '../List/list'
|
|
5
4
|
|
|
@@ -18,13 +17,3 @@ export type SelectProps = {
|
|
|
18
17
|
updateValue?: boolean
|
|
19
18
|
position?: PopoverPosition | 'modal'
|
|
20
19
|
} & ListProps
|
|
21
|
-
|
|
22
|
-
export type SvelteSelectProps = {
|
|
23
|
-
onChange?: (event: SelectEventType) => void
|
|
24
|
-
onClose?: (event: ModalCallback | PopoverCallback) => void
|
|
25
|
-
} & SelectProps
|
|
26
|
-
|
|
27
|
-
export type ReactSelectProps = {
|
|
28
|
-
onChange?: (event: SelectEventType) => void
|
|
29
|
-
onClose?: (event: ModalCallback | PopoverCallback) => void
|
|
30
|
-
} & SelectProps
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
2
3
|
import type { SheetProps } from './sheet'
|
|
3
4
|
|
|
4
5
|
import Modal from '../Modal/Modal.astro'
|
|
@@ -7,7 +8,7 @@ import { classNames } from '../../utils/classNames'
|
|
|
7
8
|
|
|
8
9
|
import styles from './sheet.module.scss'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
export type Props = SheetProps<HTMLAttributes<'dialog'>>
|
|
11
12
|
|
|
12
13
|
const {
|
|
13
14
|
position,
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { SheetProps } from './sheet'
|
|
3
3
|
|
|
4
|
-
import Modal from '../Modal/Modal.svelte'
|
|
4
|
+
import Modal, { type Props as ModalProps } from '../Modal/Modal.svelte'
|
|
5
5
|
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
8
|
import styles from './sheet.module.scss'
|
|
9
9
|
|
|
10
|
+
export type Props = SheetProps & ModalProps
|
|
11
|
+
|
|
10
12
|
const {
|
|
11
13
|
position,
|
|
12
14
|
className,
|
|
13
15
|
children,
|
|
14
16
|
...rest
|
|
15
|
-
}:
|
|
17
|
+
}: Props = $props()
|
|
16
18
|
|
|
17
19
|
const classes = $derived(classNames([
|
|
18
20
|
styles.sheet,
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ReactSheetProps } from './sheet'
|
|
1
|
+
import type { SheetProps } from './sheet'
|
|
3
2
|
|
|
4
|
-
import Modal from '../Modal/Modal.tsx'
|
|
3
|
+
import Modal, { type Props as ModalProps } from '../Modal/Modal.tsx'
|
|
5
4
|
|
|
6
5
|
import { classNames } from '../../utils/classNames'
|
|
7
6
|
|
|
8
7
|
import styles from './sheet.module.scss'
|
|
9
8
|
|
|
9
|
+
export type Props = SheetProps & ModalProps
|
|
10
|
+
|
|
10
11
|
const Sheet = ({
|
|
11
12
|
position,
|
|
12
13
|
className,
|
|
13
14
|
children,
|
|
14
15
|
...rest
|
|
15
|
-
}:
|
|
16
|
+
}: Props) => {
|
|
16
17
|
const classes = classNames([
|
|
17
18
|
styles.sheet,
|
|
18
19
|
position && styles[position],
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ModalProps,
|
|
3
|
-
ReactModalProps,
|
|
4
|
-
SvelteModalProps
|
|
5
|
-
} from '../Modal/modal'
|
|
1
|
+
import type { ModalProps } from '../Modal/modal'
|
|
6
2
|
|
|
7
|
-
export type SheetProps = {
|
|
3
|
+
export type SheetProps<T extends object = object> = {
|
|
8
4
|
position?: 'left'
|
|
9
5
|
| 'top'
|
|
10
6
|
| 'bottom'
|
|
11
|
-
} & ModalProps
|
|
12
|
-
|
|
13
|
-
export type SvelteSheetProps = SheetProps & SvelteModalProps
|
|
14
|
-
export type ReactSheetProps = SheetProps & ReactModalProps
|
|
7
|
+
} & ModalProps<T>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { SidebarProps } from './sidebar'
|
|
3
4
|
|
|
4
5
|
import Badge from '../Badge/Badge.svelte'
|
|
5
6
|
|
|
@@ -7,11 +8,15 @@
|
|
|
7
8
|
|
|
8
9
|
import styles from './sidebar.module.scss'
|
|
9
10
|
|
|
11
|
+
export type Props = SidebarProps & {
|
|
12
|
+
children?: Snippet
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
const {
|
|
11
16
|
groups,
|
|
12
17
|
children,
|
|
13
18
|
className
|
|
14
|
-
}:
|
|
19
|
+
}: Props = $props()
|
|
15
20
|
|
|
16
21
|
const classes = $derived(classNames([
|
|
17
22
|
styles.sidebar,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { SidebarProps } from './sidebar'
|
|
3
3
|
|
|
4
4
|
import Badge from '../Badge/Badge.tsx'
|
|
5
5
|
|
|
@@ -7,11 +7,15 @@ import { classNames } from '../../utils/classNames'
|
|
|
7
7
|
|
|
8
8
|
import styles from './sidebar.module.scss'
|
|
9
9
|
|
|
10
|
+
export type Props = SidebarProps & {
|
|
11
|
+
children?: React.ReactNode
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
const Sidebar = ({
|
|
11
15
|
groups,
|
|
12
16
|
children,
|
|
13
17
|
className
|
|
14
|
-
}:
|
|
18
|
+
}: Props) => {
|
|
15
19
|
const classes = classNames([
|
|
16
20
|
styles.sidebar,
|
|
17
21
|
className
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
1
|
import type { ButtonProps } from '../Button/button'
|
|
4
2
|
|
|
5
3
|
export type SidebarProps = {
|
|
@@ -17,11 +15,3 @@ export type SidebarProps = {
|
|
|
17
15
|
}[]
|
|
18
16
|
className?: string
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
export type SvelteSidebarProps = {
|
|
22
|
-
children?: Snippet
|
|
23
|
-
} & SidebarProps
|
|
24
|
-
|
|
25
|
-
export type ReactSidebarProps = {
|
|
26
|
-
children?: React.ReactNode
|
|
27
|
-
} & SidebarProps
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import styles from './skeleton.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = SkeletonProps
|
|
9
|
+
|
|
8
10
|
const {
|
|
9
11
|
animate = 'wave',
|
|
10
12
|
type = 'rounded',
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
color,
|
|
14
16
|
waveColor,
|
|
15
17
|
className
|
|
16
|
-
}:
|
|
18
|
+
}: Props = $props()
|
|
17
19
|
|
|
18
20
|
const classes = $derived(classNames([
|
|
19
21
|
animate && styles[animate],
|
|
@@ -5,6 +5,8 @@ import { classNames } from '../../utils/classNames'
|
|
|
5
5
|
|
|
6
6
|
import styles from './skeleton.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = SkeletonProps
|
|
9
|
+
|
|
8
10
|
const Skeleton = ({
|
|
9
11
|
animate = 'wave',
|
|
10
12
|
type = 'rounded',
|
|
@@ -13,7 +15,7 @@ const Skeleton = ({
|
|
|
13
15
|
color,
|
|
14
16
|
waveColor,
|
|
15
17
|
className
|
|
16
|
-
}:
|
|
18
|
+
}: Props) => {
|
|
17
19
|
const classes = classNames([
|
|
18
20
|
animate && styles[animate],
|
|
19
21
|
styles[type],
|
|
@@ -1,10 +1,16 @@
|
|
|
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
15
|
min = 0,
|
|
10
16
|
max = 100,
|
|
@@ -18,7 +24,7 @@
|
|
|
18
24
|
className,
|
|
19
25
|
onChange,
|
|
20
26
|
...rest
|
|
21
|
-
}:
|
|
27
|
+
}: Props = $props()
|
|
22
28
|
|
|
23
29
|
const classes = $derived(classNames([
|
|
24
30
|
styles.slider,
|
|
@@ -1,10 +1,14 @@
|
|
|
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
13
|
min = 0,
|
|
10
14
|
max = 100,
|
|
@@ -18,7 +22,7 @@ const Slider = ({
|
|
|
18
22
|
className,
|
|
19
23
|
onChange,
|
|
20
24
|
...rest
|
|
21
|
-
}:
|
|
25
|
+
}: Props) => {
|
|
22
26
|
const classes = classNames([
|
|
23
27
|
styles.slider,
|
|
24
28
|
className
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { InputTarget } from '../Input/input'
|
|
2
|
-
|
|
3
1
|
export type SliderProps = {
|
|
4
2
|
min?: number
|
|
5
3
|
max?: number
|
|
@@ -13,11 +11,3 @@ export type SliderProps = {
|
|
|
13
11
|
id?: string
|
|
14
12
|
className?: string
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
export type SvelteSliderProps = {
|
|
18
|
-
onChange?: (event: Event & InputTarget) => void
|
|
19
|
-
} & SliderProps
|
|
20
|
-
|
|
21
|
-
export type ReactSliderProps = {
|
|
22
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
23
|
-
} & 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,7 +20,7 @@
|
|
|
18
20
|
icon,
|
|
19
21
|
triggerOnClick,
|
|
20
22
|
className
|
|
21
|
-
}:
|
|
23
|
+
}: Props = $props()
|
|
22
24
|
|
|
23
25
|
let show = $state(false)
|
|
24
26
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
2
|
import type { SpeedDialProps } from './speeddial'
|
|
3
3
|
|
|
4
4
|
import Button from '../Button/Button.tsx'
|
|
@@ -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([
|
|
@@ -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,7 +13,7 @@
|
|
|
11
13
|
speed,
|
|
12
14
|
size,
|
|
13
15
|
dashArray
|
|
14
|
-
}:
|
|
16
|
+
}: Props = $props()
|
|
15
17
|
|
|
16
18
|
const classes = $derived(classNames([
|
|
17
19
|
styles.spinner,
|
|
@@ -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,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,7 +17,7 @@
|
|
|
12
17
|
tooltip,
|
|
13
18
|
tooltipPosition,
|
|
14
19
|
children
|
|
15
|
-
}:
|
|
20
|
+
}: Props = $props()
|
|
16
21
|
|
|
17
22
|
const classes = $derived(classNames([
|
|
18
23
|
styles.spoiler,
|