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,4 +1,3 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import type { AvatarProps } from './avatar'
|
|
3
2
|
|
|
4
3
|
import Image from '../Image/Image.tsx'
|
|
@@ -6,6 +5,8 @@ import Image from '../Image/Image.tsx'
|
|
|
6
5
|
import { classNames } from '../../utils/classNames'
|
|
7
6
|
|
|
8
7
|
import styles from './avatar.module.scss'
|
|
8
|
+
|
|
9
|
+
export type Props = AvatarProps
|
|
9
10
|
|
|
10
11
|
const Avatar = ({
|
|
11
12
|
img,
|
|
@@ -17,7 +18,7 @@ const Avatar = ({
|
|
|
17
18
|
reverse,
|
|
18
19
|
className,
|
|
19
20
|
groupClassName
|
|
20
|
-
}:
|
|
21
|
+
}: Props) => {
|
|
21
22
|
const classes = classNames([
|
|
22
23
|
styles.avatar,
|
|
23
24
|
borderless && styles.borderless,
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-avatar-border: var(--w-color-primary-70);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.avatar {
|
|
4
|
+
--border: var(--w-avatar-border, var(--w-color-primary-70));
|
|
5
|
+
|
|
8
6
|
@include border-radius(max);
|
|
9
7
|
|
|
10
8
|
object-fit: cover;
|
|
11
9
|
|
|
12
10
|
&:not(.borderless) {
|
|
13
|
-
border: 3px solid var(--
|
|
11
|
+
border: 3px solid var(--border);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
2
3
|
import type { BadgeProps } from './badge'
|
|
3
4
|
|
|
4
5
|
import styles from './badge.module.scss'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export type Props = BadgeProps<HTMLAttributes<'span'>>
|
|
7
8
|
|
|
8
9
|
const {
|
|
9
10
|
theme,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLAttributes, MouseEventHandler } from 'svelte/elements'
|
|
4
|
+
import type { BadgeProps } from './badge'
|
|
3
5
|
|
|
4
6
|
import { classNames } from '../../utils/classNames'
|
|
5
7
|
|
|
6
8
|
import styles from './badge.module.scss'
|
|
7
9
|
|
|
10
|
+
export type Props = BadgeProps<HTMLAttributes<HTMLElement>> & {
|
|
11
|
+
onClick?: MouseEventHandler<HTMLButtonElement> | null
|
|
12
|
+
children?: Snippet
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
const {
|
|
9
16
|
theme,
|
|
10
17
|
hover,
|
|
@@ -15,9 +22,9 @@
|
|
|
15
22
|
onClick,
|
|
16
23
|
children,
|
|
17
24
|
...rest
|
|
18
|
-
}:
|
|
25
|
+
}: Props = $props()
|
|
19
26
|
|
|
20
|
-
const classes = classNames([
|
|
27
|
+
const classes = $derived(classNames([
|
|
21
28
|
styles.badge,
|
|
22
29
|
theme && styles[theme],
|
|
23
30
|
(onClick || hover) && styles.hover,
|
|
@@ -25,7 +32,7 @@
|
|
|
25
32
|
rounded && styles.round,
|
|
26
33
|
transparent && styles.transparent,
|
|
27
34
|
className
|
|
28
|
-
])
|
|
35
|
+
]))
|
|
29
36
|
</script>
|
|
30
37
|
|
|
31
38
|
{#if onClick}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type {
|
|
1
|
+
import type React from 'react'
|
|
2
|
+
import type { BadgeProps } from './badge'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './badge.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = BadgeProps<React.HTMLAttributes<HTMLElement>> & {
|
|
9
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>
|
|
10
|
+
children?: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
const Badge = ({
|
|
9
14
|
theme,
|
|
10
15
|
onClick,
|
|
@@ -15,7 +20,7 @@ const Badge = ({
|
|
|
15
20
|
className,
|
|
16
21
|
children,
|
|
17
22
|
...rest
|
|
18
|
-
}:
|
|
23
|
+
}: Props) => {
|
|
19
24
|
const classes = classNames([
|
|
20
25
|
styles.badge,
|
|
21
26
|
theme && styles[theme],
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&.outline:hover {
|
|
24
|
-
@include
|
|
25
|
-
@include background(transparent);
|
|
24
|
+
@include background(primary-60);
|
|
26
25
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
|
|
27
26
|
}
|
|
28
27
|
|
|
@@ -54,14 +53,14 @@
|
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
&.outline {
|
|
57
|
-
@include typography(primary
|
|
58
|
-
@include background(
|
|
59
|
-
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-
|
|
56
|
+
@include typography(primary);
|
|
57
|
+
@include background(transparent);
|
|
58
|
+
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-40);
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
&.flat {
|
|
63
62
|
@include typography(primary);
|
|
64
|
-
@include background(
|
|
63
|
+
@include background(transparent);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
&.info {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { MouseEventHandler } from 'svelte/elements'
|
|
3
|
-
|
|
4
|
-
export type BadgeProps = {
|
|
1
|
+
type BadgeBase = {
|
|
5
2
|
theme?: 'secondary'
|
|
6
3
|
| 'outline'
|
|
7
4
|
| 'flat'
|
|
@@ -14,15 +11,16 @@ export type BadgeProps = {
|
|
|
14
11
|
rounded?: boolean
|
|
15
12
|
transparent?: boolean
|
|
16
13
|
className?: string
|
|
17
|
-
[key: string]: any
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
onClick?:
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
type AsSpan<T extends object = object> = BadgeBase & {
|
|
17
|
+
onClick?: never
|
|
18
|
+
} & T
|
|
19
|
+
|
|
20
|
+
type AsButton<T extends object = object> = BadgeBase & {
|
|
21
|
+
onClick: any
|
|
22
|
+
} & T
|
|
24
23
|
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} & BadgeProps
|
|
24
|
+
export type BadgeProps<T extends object = object> =
|
|
25
|
+
| AsSpan<T>
|
|
26
|
+
| AsButton<T>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { BannerProps } from './banner'
|
|
3
4
|
|
|
4
5
|
import Button from '../Button/Button.svelte'
|
|
5
6
|
|
|
@@ -9,6 +10,10 @@
|
|
|
9
10
|
|
|
10
11
|
import styles from './banner.module.scss'
|
|
11
12
|
|
|
13
|
+
export type Props = BannerProps & {
|
|
14
|
+
children: Snippet
|
|
15
|
+
}
|
|
16
|
+
|
|
12
17
|
const {
|
|
13
18
|
top,
|
|
14
19
|
bottom,
|
|
@@ -17,19 +22,20 @@
|
|
|
17
22
|
sticky = true,
|
|
18
23
|
className,
|
|
19
24
|
children
|
|
20
|
-
}:
|
|
25
|
+
}: Props = $props()
|
|
21
26
|
|
|
22
|
-
const classes = classNames([
|
|
27
|
+
const classes = $derived(classNames([
|
|
23
28
|
styles.banner,
|
|
24
29
|
bottom && styles.bottom,
|
|
25
30
|
padded && styles.padded,
|
|
26
31
|
!sticky && styles.relative,
|
|
27
32
|
className
|
|
28
|
-
])
|
|
33
|
+
]))
|
|
29
34
|
|
|
30
|
-
const style = top
|
|
35
|
+
const style = $derived(top
|
|
31
36
|
? `--w-banner-top: ${top}px;`
|
|
32
37
|
: null
|
|
38
|
+
)
|
|
33
39
|
|
|
34
40
|
let visible = $state(true)
|
|
35
41
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { BannerProps } from './banner'
|
|
3
3
|
|
|
4
4
|
import Button from '../Button/Button.tsx'
|
|
5
5
|
|
|
@@ -9,6 +9,10 @@ import closeIcon from '../../icons/close.svg?raw'
|
|
|
9
9
|
|
|
10
10
|
import styles from './banner.module.scss'
|
|
11
11
|
|
|
12
|
+
export type Props = BannerProps & {
|
|
13
|
+
children: React.ReactNode
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
const Banner = ({
|
|
13
17
|
top,
|
|
14
18
|
bottom,
|
|
@@ -17,7 +21,7 @@ const Banner = ({
|
|
|
17
21
|
sticky = true,
|
|
18
22
|
className,
|
|
19
23
|
children
|
|
20
|
-
}:
|
|
24
|
+
}: Props) => {
|
|
21
25
|
const [visible, setVisible] = useState(true)
|
|
22
26
|
|
|
23
27
|
const classes = classNames([
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-banner-top: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.banner {
|
|
4
|
+
--top: var(--w-banner-top, 0);
|
|
5
|
+
|
|
8
6
|
@include background(primary-60);
|
|
9
7
|
@include spacing(p-default);
|
|
10
8
|
@include position(sticky);
|
|
11
9
|
@include layer(top);
|
|
12
10
|
@include typography(center);
|
|
13
11
|
|
|
14
|
-
top: var(--
|
|
12
|
+
top: var(--top);
|
|
15
13
|
|
|
16
14
|
&.padded {
|
|
17
15
|
@include border-radius();
|
|
18
16
|
@include position(l20px);
|
|
19
17
|
|
|
20
18
|
width: calc(100% - 40px);
|
|
21
|
-
top: calc(var(--
|
|
19
|
+
top: calc(var(--top) + 20px);
|
|
22
20
|
|
|
23
21
|
&.bottom {
|
|
24
22
|
@include position(l20px, b20px);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte'
|
|
2
|
-
|
|
3
1
|
export type BannerProps = {
|
|
4
2
|
top?: number
|
|
5
3
|
bottom?: boolean
|
|
@@ -8,11 +6,3 @@ export type BannerProps = {
|
|
|
8
6
|
sticky?: boolean
|
|
9
7
|
className?: string
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
export type SvelteBannerProps = {
|
|
13
|
-
children: Snippet
|
|
14
|
-
} & BannerProps
|
|
15
|
-
|
|
16
|
-
export type ReactBannerProps = {
|
|
17
|
-
children: React.ReactNode
|
|
18
|
-
} & BannerProps
|
|
@@ -5,25 +5,28 @@
|
|
|
5
5
|
|
|
6
6
|
import styles from './bottomnavigation.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = BottomNavigationProps
|
|
9
|
+
|
|
8
10
|
const {
|
|
9
11
|
items,
|
|
10
12
|
separated,
|
|
11
13
|
floating,
|
|
12
14
|
maxWidth,
|
|
13
15
|
className
|
|
14
|
-
}:
|
|
16
|
+
}: Props = $props()
|
|
15
17
|
|
|
16
|
-
const classes = classNames([
|
|
18
|
+
const classes = $derived(classNames([
|
|
17
19
|
styles.nav,
|
|
18
20
|
separated && styles.separated,
|
|
19
21
|
maxWidth && styles.bordered,
|
|
20
22
|
floating && styles.floating,
|
|
21
23
|
className
|
|
22
|
-
])
|
|
24
|
+
]))
|
|
23
25
|
|
|
24
|
-
const styleVariable = maxWidth
|
|
26
|
+
const styleVariable = $derived(maxWidth
|
|
25
27
|
? `--w-bottom-navigation-max-width: ${maxWidth};`
|
|
26
28
|
: null
|
|
29
|
+
)
|
|
27
30
|
</script>
|
|
28
31
|
|
|
29
32
|
<nav class={classes} style={styleVariable}>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import type { BottomNavigationProps } from './bottomnavigation'
|
|
3
2
|
|
|
4
3
|
import { classNames } from '../../utils/classNames'
|
|
5
4
|
|
|
6
5
|
import styles from './bottomnavigation.module.scss'
|
|
7
6
|
|
|
7
|
+
export type Props = BottomNavigationProps
|
|
8
|
+
|
|
8
9
|
type ElementType = BottomNavigationProps['items'][0] & {
|
|
9
10
|
className: string
|
|
10
11
|
dangerouslySetInnerHTML: {
|
|
@@ -18,7 +19,7 @@ const BottomNavigation = ({
|
|
|
18
19
|
floating,
|
|
19
20
|
maxWidth,
|
|
20
21
|
className
|
|
21
|
-
}:
|
|
22
|
+
}: Props) => {
|
|
22
23
|
const classes = classNames([
|
|
23
24
|
styles.nav,
|
|
24
25
|
separated && styles.separated,
|
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
@use '../../scss/config.scss' as *;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--w-bottom-navigation-max-width
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@include
|
|
9
|
-
@include
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@include
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@include
|
|
56
|
-
@include
|
|
57
|
-
@include
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
3
|
+
.nav {
|
|
4
|
+
--width: var(--w-bottom-navigation-max-width, auto);
|
|
5
|
+
|
|
6
|
+
@include background(primary-60);
|
|
7
|
+
@include position(fixed, b0, l0, r0);
|
|
8
|
+
@include layer(header);
|
|
9
|
+
@include border(top, primary-50);
|
|
10
|
+
|
|
11
|
+
&.separated ul li:not(:last-child) {
|
|
12
|
+
@include border(right, primary-50);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.separated.bordered ul {
|
|
16
|
+
@include border(left, primary-50);
|
|
17
|
+
@include border(right, primary-50);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.floating {
|
|
21
|
+
@include position(l20px, r20px, b20px);
|
|
22
|
+
@include border-radius(xl);
|
|
23
|
+
@include border(0);
|
|
24
|
+
|
|
25
|
+
&:not(.bordered) {
|
|
26
|
+
li:first-child .item {
|
|
27
|
+
@include border-radius(xl, left);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
li:last-child .item {
|
|
31
|
+
@include border-radius(xl, right);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ul {
|
|
37
|
+
@include spacing(none-auto, p0);
|
|
38
|
+
@include layout(flex, h-center);
|
|
39
|
+
|
|
40
|
+
max-width: var(--width);
|
|
41
|
+
list-style-type: none;
|
|
42
|
+
|
|
43
|
+
li {
|
|
44
|
+
@include spacing(mb-0);
|
|
45
|
+
|
|
46
|
+
flex: 1;
|
|
47
|
+
|
|
48
|
+
&.with-icon .item {
|
|
49
|
+
@include spacing(pt-sm, pb-xs);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.item {
|
|
53
|
+
@include layout(flex, column, center, xs);
|
|
54
|
+
@include spacing(py-sm);
|
|
55
|
+
@include size('h100%');
|
|
56
|
+
@include transition(background);
|
|
57
|
+
@include typography(md, primary-10, none);
|
|
58
|
+
|
|
59
|
+
user-select: none;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
@include background(primary-50);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -9,16 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
import styles from './breadcrumb.module.scss'
|
|
11
11
|
|
|
12
|
+
export type Props = BreadcrumbProps
|
|
13
|
+
|
|
12
14
|
const {
|
|
13
15
|
items,
|
|
14
16
|
separator,
|
|
15
17
|
className
|
|
16
|
-
}:
|
|
18
|
+
}: Props = $props()
|
|
17
19
|
|
|
18
|
-
const classes = classNames([
|
|
20
|
+
const classes = $derived(classNames([
|
|
19
21
|
styles.breadcrumb,
|
|
20
22
|
className
|
|
21
|
-
])
|
|
23
|
+
]))
|
|
22
24
|
</script>
|
|
23
25
|
|
|
24
26
|
<ul class={classes}>
|
|
@@ -9,11 +9,13 @@ import ChevronRight from '../../icons/chevron-right.svg?raw'
|
|
|
9
9
|
|
|
10
10
|
import styles from './breadcrumb.module.scss'
|
|
11
11
|
|
|
12
|
+
export type Props = BreadcrumbProps
|
|
13
|
+
|
|
12
14
|
const Breadcrumb = ({
|
|
13
15
|
items,
|
|
14
16
|
separator,
|
|
15
17
|
className
|
|
16
|
-
}:
|
|
18
|
+
}: Props) => {
|
|
17
19
|
const classes = classNames([
|
|
18
20
|
styles.breadcrumb,
|
|
19
21
|
className
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
2
3
|
import type { ButtonProps } from './button'
|
|
3
4
|
|
|
4
5
|
import styles from './button.module.scss'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export type Props = ButtonProps<HTMLAttributes<'button'>>
|
|
7
8
|
|
|
8
9
|
const {
|
|
9
10
|
theme,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLAttributes, MouseEventHandler } from 'svelte/elements'
|
|
4
|
+
import type { ButtonProps } from './button'
|
|
3
5
|
|
|
4
6
|
import { classNames } from '../../utils/classNames'
|
|
5
7
|
|
|
6
8
|
import styles from './button.module.scss'
|
|
7
9
|
|
|
10
|
+
export type Props = ButtonProps<HTMLAttributes<HTMLElement>> & {
|
|
11
|
+
onClick?: MouseEventHandler<HTMLButtonElement>
|
|
12
|
+
children: Snippet
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
const {
|
|
9
16
|
theme,
|
|
10
17
|
href,
|
|
@@ -12,13 +19,13 @@
|
|
|
12
19
|
onClick,
|
|
13
20
|
children,
|
|
14
21
|
...rest
|
|
15
|
-
}:
|
|
22
|
+
}: Props = $props()
|
|
16
23
|
|
|
17
|
-
const classes = classNames([
|
|
24
|
+
const classes = $derived(classNames([
|
|
18
25
|
styles.button,
|
|
19
26
|
theme && styles[theme],
|
|
20
27
|
className
|
|
21
|
-
])
|
|
28
|
+
]))
|
|
22
29
|
</script>
|
|
23
30
|
|
|
24
31
|
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { ButtonProps } from './button'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './button.module.scss'
|
|
7
7
|
|
|
8
|
+
export type Props = ButtonProps<Record<string, unknown>> & {
|
|
9
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>
|
|
10
|
+
children?: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
const Button = ({
|
|
9
14
|
theme,
|
|
10
15
|
href,
|
|
@@ -12,7 +17,7 @@ const Button = ({
|
|
|
12
17
|
onClick,
|
|
13
18
|
children,
|
|
14
19
|
...rest
|
|
15
|
-
}:
|
|
20
|
+
}: Props) => {
|
|
16
21
|
const classes = classNames([
|
|
17
22
|
styles.button,
|
|
18
23
|
theme && styles[theme],
|