flowbite-svelte 1.10.4 → 1.10.6
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/dist/accordion/Accordion.svelte +4 -4
- package/dist/accordion/AccordionItem.svelte +7 -6
- package/dist/accordion/theme.d.ts +3 -2
- package/dist/alert/Alert.svelte +10 -12
- package/dist/alert/theme.d.ts +2 -1
- package/dist/avatar/Avatar.svelte +9 -11
- package/dist/avatar/theme.d.ts +2 -1
- package/dist/badge/Badge.svelte +4 -3
- package/dist/badge/theme.d.ts +2 -1
- package/dist/banner/Banner.svelte +5 -4
- package/dist/banner/theme.d.ts +2 -1
- package/dist/bottom-navigation/BottomNav.svelte +3 -2
- package/dist/bottom-navigation/BottomNavHeader.svelte +4 -3
- package/dist/bottom-navigation/BottomNavHeaderItem.svelte +4 -3
- package/dist/bottom-navigation/BottomNavItem.svelte +4 -3
- package/dist/bottom-navigation/theme.d.ts +5 -4
- package/dist/breadcrumb/Breadcrumb.svelte +4 -3
- package/dist/breadcrumb/BreadcrumbItem.svelte +7 -6
- package/dist/breadcrumb/theme.d.ts +3 -2
- package/dist/button-group/ButtonGroup.svelte +3 -2
- package/dist/button-group/theme.d.ts +2 -1
- package/dist/buttons/Button.svelte +3 -2
- package/dist/buttons/GradientButton.svelte +5 -4
- package/dist/buttons/theme.d.ts +3 -2
- package/dist/card/Card.svelte +4 -4
- package/dist/card/theme.d.ts +2 -1
- package/dist/carousel/Carousel.svelte +5 -4
- package/dist/carousel/CarouselIndicators.svelte +4 -3
- package/dist/carousel/ControlButton.svelte +7 -4
- package/dist/carousel/Controls.svelte +4 -3
- package/dist/carousel/Slide.svelte +3 -2
- package/dist/carousel/Thumbnail.svelte +2 -2
- package/dist/carousel/Thumbnails.svelte +3 -3
- package/dist/carousel/theme.d.ts +20 -9
- package/dist/carousel/theme.js +4 -1
- package/dist/clipboard/Clipboard.svelte +2 -2
- package/dist/clipboard/theme.d.ts +2 -1
- package/dist/darkmode/DarkMode.svelte +3 -2
- package/dist/darkmode/theme.d.ts +2 -1
- package/dist/datepicker/Datepicker.svelte +27 -23
- package/dist/datepicker/theme.d.ts +1 -1
- package/dist/drawer/Drawer.svelte +4 -3
- package/dist/drawer/Drawerhead.svelte +5 -4
- package/dist/drawer/theme.d.ts +3 -2
- package/dist/dropdown/Dropdown.svelte +3 -2
- package/dist/dropdown/DropdownDivider.svelte +3 -2
- package/dist/dropdown/DropdownGroup.svelte +3 -2
- package/dist/dropdown/DropdownHeader.svelte +3 -2
- package/dist/dropdown/DropdownItem.svelte +4 -3
- package/dist/dropdown/theme.d.ts +6 -5
- package/dist/footer/Footer.svelte +4 -3
- package/dist/footer/FooterBrand.svelte +6 -5
- package/dist/footer/FooterCopyright.svelte +5 -4
- package/dist/footer/FooterIcon.svelte +3 -2
- package/dist/footer/FooterLink.svelte +4 -3
- package/dist/footer/FooterLinkGroup.svelte +3 -2
- package/dist/footer/theme.d.ts +7 -6
- package/dist/forms/button-toggle/ButtonToggle.svelte +7 -6
- package/dist/forms/button-toggle/ButtonToggleGroup.svelte +6 -5
- package/dist/forms/button-toggle/CheckIcon.svelte +3 -2
- package/dist/forms/button-toggle/theme.d.ts +5 -4
- package/dist/forms/checkbox/Checkbox.svelte +6 -5
- package/dist/forms/checkbox/CheckboxButton.svelte +3 -2
- package/dist/forms/checkbox/theme.d.ts +3 -2
- package/dist/forms/dropzone/Dropzone.svelte +3 -2
- package/dist/forms/dropzone/theme.d.ts +2 -1
- package/dist/forms/fileupload/Fileupload.svelte +5 -4
- package/dist/forms/fileupload/theme.d.ts +2 -1
- package/dist/forms/floating-label/FloatingLabelInput.svelte +7 -6
- package/dist/forms/floating-label/theme.d.ts +2 -1
- package/dist/forms/helper/Helper.svelte +3 -2
- package/dist/forms/helper/theme.d.ts +2 -1
- package/dist/forms/input-addon/InputAddon.svelte +3 -2
- package/dist/forms/input-field/Input.svelte +11 -10
- package/dist/forms/input-field/theme.d.ts +2 -1
- package/dist/forms/label/Label.svelte +3 -2
- package/dist/forms/label/theme.d.ts +2 -1
- package/dist/forms/phoneinput/PhoneInput.svelte +7 -7
- package/dist/forms/phoneinput/theme.d.ts +1 -1
- package/dist/forms/radio/Radio.svelte +4 -3
- package/dist/forms/radio/RadioButton.svelte +3 -2
- package/dist/forms/radio/theme.d.ts +3 -2
- package/dist/forms/range/Range.svelte +3 -2
- package/dist/forms/range/theme.d.ts +2 -1
- package/dist/forms/search/Search.svelte +8 -7
- package/dist/forms/search/theme.d.ts +2 -1
- package/dist/forms/select/MultiSelect.svelte +7 -6
- package/dist/forms/select/Select.svelte +5 -4
- package/dist/forms/select/theme.d.ts +3 -2
- package/dist/forms/tags/Tags.svelte +7 -6
- package/dist/forms/tags/theme.d.ts +2 -1
- package/dist/forms/textarea/Textarea.svelte +11 -10
- package/dist/forms/textarea/theme.d.ts +2 -1
- package/dist/forms/timepicker/Timepicker.svelte +38 -37
- package/dist/forms/timepicker/theme.d.ts +2 -1
- package/dist/forms/toggle/Toggle.svelte +5 -4
- package/dist/forms/toggle/theme.d.ts +2 -1
- package/dist/gallery/Gallery.svelte +4 -3
- package/dist/gallery/theme.d.ts +2 -1
- package/dist/indicator/Indicator.svelte +5 -3
- package/dist/indicator/theme.d.ts +2 -1
- package/dist/kbd/Kbd.svelte +3 -2
- package/dist/kbd/theme.d.ts +2 -1
- package/dist/list-group/Listgroup.svelte +6 -5
- package/dist/list-group/ListgroupItem.svelte +7 -6
- package/dist/list-group/theme.d.ts +3 -2
- package/dist/mega-menu/MegaMenu.svelte +6 -5
- package/dist/mega-menu/theme.d.ts +2 -1
- package/dist/modal/Modal.svelte +7 -7
- package/dist/modal/theme.d.ts +2 -1
- package/dist/navbar/Menu.svelte +1 -2
- package/dist/navbar/NavBrand.svelte +1 -2
- package/dist/navbar/NavContainer.svelte +1 -2
- package/dist/navbar/NavHamburger.svelte +2 -3
- package/dist/navbar/NavHamburger.svelte.d.ts +1 -2
- package/dist/navbar/NavLi.svelte +1 -2
- package/dist/navbar/NavUl.svelte +4 -5
- package/dist/navbar/Navbar.svelte +2 -2
- package/dist/navbar/theme.d.ts +6 -5
- package/dist/pagination/Pagination.svelte +2 -2
- package/dist/pagination/PaginationButton.svelte +10 -13
- package/dist/pagination/PaginationItem.svelte +1 -2
- package/dist/pagination/PaginationNav.svelte +7 -7
- package/dist/pagination/theme.d.ts +5 -4
- package/dist/popover/Popover.svelte +4 -5
- package/dist/popover/theme.d.ts +2 -1
- package/dist/progress/Progressbar.svelte +6 -7
- package/dist/progress/Progressradial.svelte +7 -8
- package/dist/progress/theme.d.ts +2 -2
- package/dist/rating/AdvancedRating.svelte +5 -6
- package/dist/rating/Rating.svelte +2 -3
- package/dist/rating/Review.svelte +7 -8
- package/dist/rating/ScoreRating.svelte +8 -8
- package/dist/rating/theme.d.ts +5 -4
- package/dist/sidebar/Sidebar.svelte +27 -62
- package/dist/sidebar/SidebarBrand.svelte +3 -4
- package/dist/sidebar/SidebarButton.svelte +1 -2
- package/dist/sidebar/SidebarCta.svelte +3 -4
- package/dist/sidebar/SidebarDropdownWrapper.svelte +6 -7
- package/dist/sidebar/SidebarItem.svelte +5 -4
- package/dist/sidebar/theme.d.ts +12 -23
- package/dist/sidebar/theme.js +6 -45
- package/dist/skeleton/CardPlaceholder.svelte +11 -12
- package/dist/skeleton/ImagePlaceholder.svelte +39 -12
- package/dist/skeleton/ListPlaceholder.svelte +26 -8
- package/dist/skeleton/Skeleton.svelte +24 -9
- package/dist/skeleton/TestimonialPlaceholder.svelte +27 -8
- package/dist/skeleton/TextPlaceholder.svelte +49 -26
- package/dist/skeleton/VideoPlaceholder.svelte +2 -3
- package/dist/skeleton/WidgetPlaceholder.svelte +1 -2
- package/dist/skeleton/theme.d.ts +9 -8
- package/dist/speed-dial/SpeedDial.svelte +3 -3
- package/dist/speed-dial/SpeedDialButton.svelte +3 -3
- package/dist/speed-dial/theme.d.ts +3 -2
- package/dist/spinner/Spinner.svelte +2 -3
- package/dist/spinner/theme.d.ts +2 -1
- package/dist/stepindicator/StepIndicator.svelte +10 -9
- package/dist/stepindicator/theme.d.ts +2 -1
- package/dist/stepper/BreadcrumbStepper.svelte +9 -10
- package/dist/stepper/DetailedStepper.svelte +4 -4
- package/dist/stepper/ProgressStepper.svelte +8 -11
- package/dist/stepper/Stepper.svelte +12 -18
- package/dist/stepper/TimelineStepper.svelte +4 -4
- package/dist/stepper/VerticalStepper.svelte +4 -4
- package/dist/table/Table.svelte +3 -3
- package/dist/table/TableBody.svelte +1 -2
- package/dist/table/TableBodyCell.svelte +1 -2
- package/dist/table/TableBodyRow.svelte +2 -3
- package/dist/table/TableHead.svelte +2 -3
- package/dist/table/TableHeadCell.svelte +1 -2
- package/dist/table/TableSearch.svelte +9 -9
- package/dist/table/theme.d.ts +6 -6
- package/dist/tabs/TabItem.svelte +5 -4
- package/dist/tabs/Tabs.svelte +3 -4
- package/dist/tabs/theme.d.ts +3 -2
- package/dist/timeline/Activity.svelte +1 -2
- package/dist/timeline/ActivityItem.svelte +9 -9
- package/dist/timeline/Group.svelte +4 -4
- package/dist/timeline/GroupItem.svelte +6 -6
- package/dist/timeline/Timeline.svelte +2 -3
- package/dist/timeline/TimelineItem.svelte +7 -7
- package/dist/timeline/theme.d.ts +7 -6
- package/dist/toast/Toast.svelte +5 -5
- package/dist/toast/theme.d.ts +2 -1
- package/dist/toolbar/Toolbar.svelte +2 -3
- package/dist/toolbar/ToolbarButton.svelte +4 -5
- package/dist/toolbar/ToolbarGroup.svelte +2 -3
- package/dist/toolbar/theme.d.ts +4 -3
- package/dist/tooltip/Tooltip.svelte +1 -2
- package/dist/tooltip/theme.d.ts +2 -1
- package/dist/types.d.ts +2 -3
- package/dist/typography/anchor/A.svelte +3 -4
- package/dist/typography/anchor/theme.d.ts +2 -1
- package/dist/typography/blockquote/Blockquote.svelte +3 -4
- package/dist/typography/blockquote/theme.d.ts +2 -1
- package/dist/typography/descriptionlist/DescriptionList.svelte +2 -3
- package/dist/typography/descriptionlist/theme.d.ts +2 -1
- package/dist/typography/heading/Heading.svelte +2 -3
- package/dist/typography/heading/theme.d.ts +2 -1
- package/dist/typography/hr/Hr.svelte +4 -5
- package/dist/typography/hr/theme.d.ts +2 -1
- package/dist/typography/img/EnhancedImg.svelte +4 -5
- package/dist/typography/img/Img.svelte +4 -5
- package/dist/typography/img/theme.d.ts +2 -1
- package/dist/typography/layout/Layout.svelte +2 -3
- package/dist/typography/layout/theme.d.ts +2 -1
- package/dist/typography/list/Li.svelte +1 -2
- package/dist/typography/list/List.svelte +2 -3
- package/dist/typography/list/theme.d.ts +2 -1
- package/dist/typography/mark/Mark.svelte +1 -1
- package/dist/typography/mark/theme.d.ts +2 -1
- package/dist/typography/paragraph/P.svelte +2 -3
- package/dist/typography/paragraph/theme.d.ts +2 -1
- package/dist/typography/secondary/Secondary.svelte +1 -2
- package/dist/typography/secondary/theme.d.ts +2 -1
- package/dist/typography/span/Span.svelte +2 -3
- package/dist/typography/span/theme.d.ts +2 -1
- package/dist/video/Video.svelte +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import type { Writable } from "svelte/store";
|
|
4
4
|
import { carouselIndicators, type CarouselIndicatorsTheme } from "./theme";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { Indicator, type IndicatorsProps, type State } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
8
9
|
let { children, activeClass, inactiveClass, position = "bottom", class: className, ...restProps }: IndicatorsProps = $props();
|
|
@@ -26,14 +27,14 @@
|
|
|
26
27
|
}
|
|
27
28
|
</script>
|
|
28
29
|
|
|
29
|
-
<div class={
|
|
30
|
+
<div class={base({ class: clsx((theme as CarouselIndicatorsTheme)?.base, className) })} {...restProps}>
|
|
30
31
|
{#each $state.images as _, idx}
|
|
31
32
|
{@const selected = $state.index === idx}
|
|
32
33
|
<button onclick={() => goToIndex(idx)}>
|
|
33
34
|
{#if children}
|
|
34
35
|
{@render children({ selected, index: idx })}
|
|
35
36
|
{:else}
|
|
36
|
-
<Indicator class={
|
|
37
|
+
<Indicator class={indicator({ selected, class: clsx(selected ? activeClass : inactiveClass, (theme as CarouselIndicatorsTheme)?.indicator) })} />
|
|
37
38
|
{/if}
|
|
38
39
|
</button>
|
|
39
40
|
{/each}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { controlButton } from "./theme";
|
|
3
|
-
import
|
|
2
|
+
import { controlButton, type ControlButtonTheme } from "./theme";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type ControlButtonProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, forward, name, class: className, spanClass, ...restProps }: ControlButtonProps = $props();
|
|
7
8
|
|
|
9
|
+
const { base, span } = controlButton({ forward });
|
|
10
|
+
|
|
8
11
|
const theme = getTheme("carouselButton");
|
|
9
12
|
</script>
|
|
10
13
|
|
|
11
|
-
<button type="button" class={
|
|
14
|
+
<button type="button" class={base({ class: clsx(className, theme) })} {...restProps}>
|
|
12
15
|
{#if children}
|
|
13
16
|
{@render children()}
|
|
14
17
|
{:else}
|
|
15
|
-
<span class={
|
|
18
|
+
<span class={span({ class: clsx(spanClass) })}>
|
|
16
19
|
{#if forward}
|
|
17
20
|
<svg aria-hidden="true" class="h-5 w-5 sm:h-6 sm:w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
18
21
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import type { Writable } from "svelte/store";
|
|
4
4
|
import { canChangeSlide } from "./CarouselSlide";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { type State, type ControlsProps, ControlButton } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
8
9
|
let { children, class: className, ...restProps }: ControlsProps = $props();
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
{#if children}
|
|
46
47
|
{@render children(changeSlide)}
|
|
47
48
|
{:else}
|
|
48
|
-
<ControlButton name="Previous" forward={false} onclick={() => changeSlide(false)} class={
|
|
49
|
-
<ControlButton name="Next" forward={true} onclick={() => changeSlide(true)} class={
|
|
49
|
+
<ControlButton name="Previous" forward={false} onclick={() => changeSlide(false)} class={clsx(theme, className)} {...restProps} />
|
|
50
|
+
<ControlButton name="Next" forward={true} onclick={() => changeSlide(true)} class={clsx(theme, className)} {...restProps} />
|
|
50
51
|
{/if}
|
|
51
52
|
|
|
52
53
|
<!--
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import type { Writable } from "svelte/store";
|
|
4
4
|
import { fly } from "svelte/transition";
|
|
5
5
|
import { slide } from "./theme";
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { type SlideProps, type State } from "..";
|
|
7
8
|
import { getTheme } from "../theme/themeUtils";
|
|
8
9
|
|
|
9
10
|
const state = getContext<Writable<State>>("state");
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
duration: $state.slideDuration
|
|
29
30
|
});
|
|
30
31
|
|
|
31
|
-
let imgClass =
|
|
32
|
+
let imgClass = slide({ class: clsx(theme, className) });
|
|
32
33
|
</script>
|
|
33
34
|
|
|
34
35
|
{#if transition}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { thumbnail } from "./theme";
|
|
3
|
-
import { type ThumbnailProps
|
|
3
|
+
import { type ThumbnailProps } from "..";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { getTheme } from "../theme/themeUtils";
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
const theme = getTheme("thumbnail");
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<img {...restProps} class={
|
|
12
|
+
<img {...restProps} class={thumbnail({ selected, class: clsx(theme, className) })} />
|
|
13
13
|
|
|
14
14
|
<!--
|
|
15
15
|
@component
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import type { Writable } from "svelte/store";
|
|
4
4
|
import { thumbnails } from "./theme";
|
|
5
|
-
import { type ThumbnailsProps, type State, Thumbnail
|
|
5
|
+
import { type ThumbnailsProps, type State, Thumbnail } from "..";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { getTheme } from "../theme/themeUtils";
|
|
8
8
|
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
});
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
|
-
<div class={
|
|
53
|
+
<div class={thumbnails({ class: clsx(theme, className) })}>
|
|
54
54
|
{#each images as image, idx}
|
|
55
55
|
{@const selected = index === idx}
|
|
56
56
|
<button onclick={() => btnClick(idx)} aria-label={ariaLabel}>
|
|
57
57
|
{#if children}
|
|
58
|
-
{@render children({ image, selected, imgClass:
|
|
58
|
+
{@render children({ image, selected, imgClass: clsx(imgClass), Thumbnail })}
|
|
59
59
|
{:else}
|
|
60
60
|
<Thumbnail {...image} {selected} class={clsx(imgClass)} />
|
|
61
61
|
{/if}
|
package/dist/carousel/theme.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type CarouselVariants = VariantProps<typeof carousel>;
|
|
3
4
|
export declare const carousel: import("tailwind-variants").TVReturnType<{}, undefined, "grid overflow-hidden relative rounded-lg h-56 sm:h-64 xl:h-80 2xl:h-96", {}, undefined, import("tailwind-variants").TVReturnType<{}, undefined, "grid overflow-hidden relative rounded-lg h-56 sm:h-64 xl:h-80 2xl:h-96", unknown, unknown, undefined>>;
|
|
4
|
-
export type CarouselTheme =
|
|
5
|
+
export type CarouselTheme = ClassValue;
|
|
5
6
|
export declare const carouselIndicators: import("tailwind-variants").TVReturnType<{
|
|
6
7
|
selected: {
|
|
7
8
|
true: {
|
|
@@ -73,26 +74,36 @@ export declare const carouselIndicators: import("tailwind-variants").TVReturnTyp
|
|
|
73
74
|
indicator: string;
|
|
74
75
|
}, undefined, unknown, unknown, undefined>>;
|
|
75
76
|
export type CarouselIndicatorsSlots = keyof typeof carouselIndicators.slots;
|
|
76
|
-
export type CarouselIndicatorsTheme = Partial<Record<CarouselIndicatorsSlots,
|
|
77
|
+
export type CarouselIndicatorsTheme = Partial<Record<CarouselIndicatorsSlots, ClassValue>>;
|
|
77
78
|
export declare const controlButton: import("tailwind-variants").TVReturnType<{
|
|
78
79
|
forward: {
|
|
79
80
|
true: string;
|
|
80
81
|
false: string;
|
|
81
82
|
};
|
|
82
|
-
},
|
|
83
|
+
}, {
|
|
84
|
+
base: string;
|
|
85
|
+
span: string;
|
|
86
|
+
}, undefined, {
|
|
83
87
|
forward: {
|
|
84
88
|
true: string;
|
|
85
89
|
false: string;
|
|
86
90
|
};
|
|
87
|
-
},
|
|
91
|
+
}, {
|
|
92
|
+
base: string;
|
|
93
|
+
span: string;
|
|
94
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
88
95
|
forward: {
|
|
89
96
|
true: string;
|
|
90
97
|
false: string;
|
|
91
98
|
};
|
|
92
|
-
},
|
|
93
|
-
|
|
99
|
+
}, {
|
|
100
|
+
base: string;
|
|
101
|
+
span: string;
|
|
102
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
103
|
+
export type ControlButtonSlots = keyof typeof controlButton.slots;
|
|
104
|
+
export type ControlButtonTheme = Partial<Record<ControlButtonSlots, ClassValue>>;
|
|
94
105
|
export declare const thumbnails: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "flex flex-row justify-center bg-gray-100 w-full", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "flex flex-row justify-center bg-gray-100 w-full", unknown, unknown, undefined>>;
|
|
95
|
-
export type ThumbnailsTheme =
|
|
106
|
+
export type ThumbnailsTheme = ClassValue;
|
|
96
107
|
export declare const thumbnail: import("tailwind-variants").TVReturnType<{
|
|
97
108
|
selected: {
|
|
98
109
|
true: string;
|
|
@@ -109,6 +120,6 @@ export declare const thumbnail: import("tailwind-variants").TVReturnType<{
|
|
|
109
120
|
false: string;
|
|
110
121
|
};
|
|
111
122
|
}, undefined, "", unknown, unknown, undefined>>;
|
|
112
|
-
export type ThumbnailTheme =
|
|
123
|
+
export type ThumbnailTheme = ClassValue;
|
|
113
124
|
export declare const slide: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "absolute block w-full! h-full object-cover", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "absolute block w-full! h-full object-cover", unknown, unknown, undefined>>;
|
|
114
|
-
export type SlideTheme =
|
|
125
|
+
export type SlideTheme = ClassValue;
|
package/dist/carousel/theme.js
CHANGED
|
@@ -23,7 +23,10 @@ export const carouselIndicators = tv({
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export const controlButton = tv({
|
|
26
|
-
|
|
26
|
+
slots: {
|
|
27
|
+
base: "flex absolute top-0 z-30 justify-center items-center px-4 h-full group focus:outline-hidden text-white dark:text-gray-300",
|
|
28
|
+
span: "inline-flex h-8 w-8 items-center justify-center rounded-full bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-hidden sm:h-10 sm:w-10 dark:bg-gray-800/30 dark:group-hover:bg-gray-800/60 dark:group-focus:ring-gray-800/70"
|
|
29
|
+
},
|
|
27
30
|
variants: {
|
|
28
31
|
forward: {
|
|
29
32
|
true: "end-0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from "../buttons/Button.svelte";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { type ClipboardProps
|
|
4
|
+
import { type ClipboardProps } from "..";
|
|
5
5
|
import { clipboard } from "./theme";
|
|
6
6
|
import type { MouseEventHandler } from "svelte/elements";
|
|
7
7
|
import { getTheme } from "../theme/themeUtils";
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
};
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
|
-
<Button onclick={copyToClipboard} {...restProps} class={
|
|
41
|
+
<Button onclick={copyToClipboard} {...restProps} class={clipboard({ embedded, class: clsx(theme, className) })}>
|
|
42
42
|
{@render children?.(success)}
|
|
43
43
|
</Button>
|
|
44
44
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type ClipboardVariants = VariantProps<typeof clipboard>;
|
|
3
4
|
export declare const clipboard: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
embedded: {
|
|
@@ -16,4 +17,4 @@ export declare const clipboard: import("tailwind-variants").TVReturnType<{
|
|
|
16
17
|
false: string;
|
|
17
18
|
};
|
|
18
19
|
}, undefined, "gap-2", unknown, unknown, undefined>>;
|
|
19
|
-
export type ClipboardTheme =
|
|
20
|
+
export type ClipboardTheme = ClassValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { darkmode } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type DarkmodeProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
// const THEME_PREFERENCE_KEY = 'color-theme';
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
</script>
|
|
34
35
|
</svelte:head>
|
|
35
36
|
|
|
36
|
-
<button onclick={toggleTheme} aria-label={ariaLabel} type="button" {...restProps} class={
|
|
37
|
+
<button onclick={toggleTheme} aria-label={ariaLabel} type="button" {...restProps} class={darkmode({ class: clsx(theme, className) })} tabindex={0}>
|
|
37
38
|
<span class="hidden dark:block">
|
|
38
39
|
{#if lightIcon}
|
|
39
40
|
{@render lightIcon()}
|
package/dist/darkmode/theme.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const darkmode: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-hidden rounded-lg text-sm p-2.5", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-hidden rounded-lg text-sm p-2.5", unknown, unknown, undefined>>;
|
|
2
|
-
export type DarkModeTheme =
|
|
3
|
+
export type DarkModeTheme = ClassValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from "svelte";
|
|
3
|
-
import clsx from "clsx";
|
|
4
3
|
import { fade } from "svelte/transition";
|
|
5
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { Button, ToolbarButton, type DatepickerProps } from "..";
|
|
6
6
|
import { datepicker, type DatepickerTheme } from "./theme";
|
|
7
7
|
import { parse, isValid, addDays, startOfMonth, endOfMonth, startOfWeek, endOfWeek, eachDayOfInterval, isSameDay, isWithinInterval } from "date-fns";
|
|
8
8
|
import { getTheme } from "../theme/themeUtils";
|
|
@@ -274,8 +274,8 @@
|
|
|
274
274
|
<div bind:this={datepickerContainerElement} class={["relative", inline && "inline-block"]}>
|
|
275
275
|
{#if !inline}
|
|
276
276
|
<div class="relative">
|
|
277
|
-
<input bind:this={inputElement} type="text" class={
|
|
278
|
-
<button type="button" class={
|
|
277
|
+
<input bind:this={inputElement} type="text" class={input({ color, class: clsx((theme as DatepickerTheme)?.input, inputClass) })} {placeholder} value={range ? `${formatDate(rangeFrom)} - ${formatDate(rangeTo)}` : formatDate(value)} onfocus={() => (isOpen = true)} oninput={handleInputChangeWithDateFns} onkeydown={handleInputKeydown} {disabled} {required} {inputmode} aria-haspopup="dialog" />
|
|
278
|
+
<button type="button" class={button({ class: clsx(btnClass, (theme as DatepickerTheme)?.button, classes?.button) })} onclick={() => (isOpen = !isOpen)} {disabled} aria-label={isOpen ? "Close date picker" : "Open date picker"}>
|
|
279
279
|
<svg class="h-4 w-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
|
280
280
|
<path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"></path>
|
|
281
281
|
</svg>
|
|
@@ -284,23 +284,30 @@
|
|
|
284
284
|
{/if}
|
|
285
285
|
|
|
286
286
|
{#if isOpen || inline}
|
|
287
|
-
<div bind:this={calendarRef} id="datepicker-dropdown" class={
|
|
287
|
+
<div bind:this={calendarRef} id="datepicker-dropdown" class={base({ inline, class: clsx((theme as DatepickerTheme)?.base, classes?.base, className) })} transition:fade={{ duration: 100 }} role="dialog" aria-label="Calendar">
|
|
288
288
|
{#if title}
|
|
289
|
-
<h2 class={
|
|
289
|
+
<h2 class={titleVariant({ class: clsx((theme as DatepickerTheme)?.titleVariant, classes?.titleVariant) })}>{title}</h2>
|
|
290
290
|
{/if}
|
|
291
291
|
|
|
292
292
|
{#if showMonthSelector}
|
|
293
293
|
<!-- Month/Year Selector View -->
|
|
294
|
-
<div class={
|
|
294
|
+
<div class={nav({ class: clsx((theme as DatepickerTheme)?.nav, classes?.nav) })}>
|
|
295
295
|
{@render yearNavButton(false)}
|
|
296
|
-
<h3 class={
|
|
296
|
+
<h3 class={polite({ class: clsx((theme as DatepickerTheme)?.polite, classes?.polite) })} aria-live="polite">
|
|
297
297
|
{currentMonth.getFullYear()}
|
|
298
298
|
</h3>
|
|
299
299
|
{@render yearNavButton(true)}
|
|
300
300
|
</div>
|
|
301
301
|
<div class="grid grid-cols-4 gap-2 p-4">
|
|
302
302
|
{#each monthNames as month, index}
|
|
303
|
-
<Button
|
|
303
|
+
<Button
|
|
304
|
+
type="button"
|
|
305
|
+
color={monthColor}
|
|
306
|
+
class={monthButton({
|
|
307
|
+
class: clsx(currentMonth.getMonth() === index ? monthBtnSelected : monthBtn, classes?.monthButton, (theme as DatepickerTheme)?.monthButton)
|
|
308
|
+
})}
|
|
309
|
+
onclick={(event: MouseEvent) => selectMonth(index, event)}
|
|
310
|
+
>
|
|
304
311
|
{month}
|
|
305
312
|
</Button>
|
|
306
313
|
{/each}
|
|
@@ -310,14 +317,14 @@
|
|
|
310
317
|
<div class={nav({ class: clsx(classes?.nav) })}>
|
|
311
318
|
{@render navButton(false)}
|
|
312
319
|
<!-- MODIFIED: Use translationLocale for month/year display -->
|
|
313
|
-
<Button type="button" class={
|
|
320
|
+
<Button type="button" class={polite({ class: clsx("cursor-pointer rounded px-2 py-1 hover:bg-gray-100 dark:hover:bg-gray-700", classes?.polite) })} aria-live="polite" onclick={(event: MouseEvent) => toggleMonthSelector(event)}>
|
|
314
321
|
{currentMonth.toLocaleString(translationLocale, { month: "long", year: "numeric" })}
|
|
315
322
|
</Button>
|
|
316
323
|
{@render navButton(true)}
|
|
317
324
|
</div>
|
|
318
|
-
<div class={
|
|
325
|
+
<div class={grid({ class: clsx((theme as DatepickerTheme)?.grid, classes?.grid) })} role="grid">
|
|
319
326
|
{#each weekdays as day}
|
|
320
|
-
<div class={
|
|
327
|
+
<div class={columnHeader({ class: clsx((theme as DatepickerTheme)?.columnHeader, classes?.columnHeader) })} role="columnheader">{day}</div>
|
|
321
328
|
{/each}
|
|
322
329
|
{#each daysInMonth as day}
|
|
323
330
|
{@const current = day.getMonth() !== currentMonth.getMonth()}
|
|
@@ -325,16 +332,13 @@
|
|
|
325
332
|
<Button
|
|
326
333
|
type="button"
|
|
327
334
|
color={isSelected(day) ? color : "alternative"}
|
|
328
|
-
class={
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}),
|
|
336
|
-
(theme as DatepickerTheme)?.dayButton
|
|
337
|
-
)}
|
|
335
|
+
class={dayButton({
|
|
336
|
+
current,
|
|
337
|
+
today: isToday(day),
|
|
338
|
+
color: isInRange(day) ? color : undefined,
|
|
339
|
+
unavailable: !available,
|
|
340
|
+
class: clsx((theme as DatepickerTheme)?.dayButton, classes?.dayButton, !available && "cursor-not-allowed opacity-50")
|
|
341
|
+
})}
|
|
338
342
|
onclick={() => handleDaySelect(day)}
|
|
339
343
|
onkeydown={handleCalendarKeydown}
|
|
340
344
|
aria-label={day.toLocaleDateString(translationLocale, { weekday: "long", year: "numeric", month: "long", day: "numeric" })}
|
|
@@ -350,7 +354,7 @@
|
|
|
350
354
|
{/if}
|
|
351
355
|
|
|
352
356
|
{#if showActionButtons && !showMonthSelector}
|
|
353
|
-
<div class={
|
|
357
|
+
<div class={actionButtons({ class: clsx((theme as DatepickerTheme)?.actionButtons, classes?.actionButtons) })}>
|
|
354
358
|
<Button onclick={() => handleDaySelect(new Date())} {color} size="sm" disabled={!isDateAvailable(new Date())}>Today</Button>
|
|
355
359
|
<Button onclick={handleClear} color="red" size="sm">Clear</Button>
|
|
356
360
|
<Button onclick={handleApply} {color} size="sm">Apply</Button>
|
|
@@ -389,4 +389,4 @@ export declare const datepicker: import("tailwind-variants").TVReturnType<{
|
|
|
389
389
|
monthButton: string;
|
|
390
390
|
}, undefined, unknown, unknown, undefined>>;
|
|
391
391
|
export type DatepickerSlots = keyof typeof datepicker.slots;
|
|
392
|
-
export type DatepickerTheme = Partial<Record<DatepickerSlots,
|
|
392
|
+
export type DatepickerTheme = Partial<Record<DatepickerSlots, ClassValue>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type ParamsType, type DrawerProps, trapFocus
|
|
2
|
+
import { type ParamsType, type DrawerProps, trapFocus } from "..";
|
|
3
|
+
import clsx from "clsx";
|
|
3
4
|
import { fly } from "svelte/transition";
|
|
4
5
|
import { sineIn } from "svelte/easing";
|
|
5
6
|
import { drawer, type DrawerTheme } from ".";
|
|
@@ -30,8 +31,8 @@
|
|
|
30
31
|
<svelte:window bind:innerWidth bind:innerHeight />
|
|
31
32
|
|
|
32
33
|
{#if !hidden}
|
|
33
|
-
<div role="presentation" class={
|
|
34
|
-
<div use:trapFocus={{ onEscape: closeDrawer }} {...restProps} class={
|
|
34
|
+
<div role="presentation" class={backdropCls({ class: clsx((theme as DrawerTheme)?.backdrop, backdropClass) })} onclick={activateClickOutside ? closeDrawer : undefined} style={bodyScrolling ? "pointer-events: none;" : ""}></div>
|
|
35
|
+
<div use:trapFocus={{ onEscape: closeDrawer }} {...restProps} class={base({ class: clsx((theme as DrawerTheme)?.base, className) })} transition:transitionType={transitionParams ? transitionParams : (transition_params as ParamsType)} tabindex="-1">
|
|
35
36
|
{@render children?.()}
|
|
36
37
|
</div>
|
|
37
38
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { drawerhead, type DrawerHeadTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type DrawerheadProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { closeIcon, children, buttonClass, svgClass, class: className, ...restProps }: DrawerheadProps = $props();
|
|
@@ -10,15 +11,15 @@
|
|
|
10
11
|
const { base, button, svg } = $derived(drawerhead());
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<div class={
|
|
14
|
+
<div class={base({ class: clsx((theme as DrawerHeadTheme)?.base, className) })}>
|
|
14
15
|
{#if children}
|
|
15
16
|
{@render children()}
|
|
16
17
|
{/if}
|
|
17
18
|
{#if closeIcon}
|
|
18
19
|
{@render closeIcon()}
|
|
19
20
|
{:else}
|
|
20
|
-
<button type="button" {...restProps} class={
|
|
21
|
-
<svg class={
|
|
21
|
+
<button type="button" {...restProps} class={button({ class: clsx((theme as DrawerHeadTheme)?.button, buttonClass) })}>
|
|
22
|
+
<svg class={svg({ class: clsx((theme as DrawerHeadTheme)?.svg, svgClass) })} aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
22
23
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
|
|
23
24
|
</svg>
|
|
24
25
|
<span class="sr-only">Close drawer</span>
|
package/dist/drawer/theme.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type DrawerVariants = VariantProps<typeof drawer>;
|
|
3
4
|
export declare const drawer: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
position: {
|
|
@@ -171,6 +172,6 @@ export declare const drawerhead: import("tailwind-variants").TVReturnType<{
|
|
|
171
172
|
svg: string;
|
|
172
173
|
}, undefined, unknown, unknown, undefined>>;
|
|
173
174
|
export type DrawerSlots = keyof typeof drawer.slots;
|
|
174
|
-
export type DrawerTheme = Partial<Record<DrawerSlots,
|
|
175
|
+
export type DrawerTheme = Partial<Record<DrawerSlots, ClassValue>>;
|
|
175
176
|
export type DrawerHeadSlots = keyof typeof drawerhead.slots;
|
|
176
|
-
export type DrawerHeadTheme = Partial<Record<DrawerHeadSlots,
|
|
177
|
+
export type DrawerHeadTheme = Partial<Record<DrawerHeadSlots, ClassValue>>;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import { writable } from "svelte/store";
|
|
4
4
|
import { dropdown } from "./";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { type DropdownProps, Popper, DropdownGroup } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
8
9
|
let { children, simple = false, placement = "bottom", offset = 2, class: className, activeUrl = "", isOpen = $bindable(false), ...restProps }: DropdownProps = $props();
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
|
|
21
22
|
<!-- Dropdown menu -->
|
|
22
23
|
|
|
23
|
-
<Popper {...restProps} {placement} {offset} bind:isOpen class={
|
|
24
|
+
<Popper {...restProps} {placement} {offset} bind:isOpen class={base({ class: clsx(theme, className) })}>
|
|
24
25
|
{#if simple}
|
|
25
26
|
<DropdownGroup>
|
|
26
27
|
{@render children()}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { dropdownDivider } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type DropdownDividerProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { class: className, ...restProps }: DropdownDividerProps = $props();
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
const theme = getTheme("dropdownDivider");
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<div {...restProps} class={
|
|
12
|
+
<div {...restProps} class={dropdownDivider({ class: clsx(theme, className) })}></div>
|
|
12
13
|
|
|
13
14
|
<!--
|
|
14
15
|
@component
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { dropdownGroup } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type DropdownGroupProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, class: className, ...restProps }: DropdownGroupProps = $props();
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
const theme = getTheme("dropdownGroup");
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<ul {...restProps} class={
|
|
12
|
+
<ul {...restProps} class={dropdownGroup({ class: clsx(theme, className) })}>
|
|
12
13
|
{@render children()}
|
|
13
14
|
</ul>
|
|
14
15
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { dropdownHeader } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type DropdownHeaderProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, class: className, ...restProps }: DropdownHeaderProps = $props();
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
const theme = getTheme("dropdownHeader");
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<div {...restProps} class={
|
|
12
|
+
<div {...restProps} class={dropdownHeader({ class: clsx(theme, className) })}>
|
|
12
13
|
{@render children()}
|
|
13
14
|
</div>
|
|
14
15
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { dropdownItem, type DropdownItemTheme } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type DropdownItemProps } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { aClass, children, activeClass, liClass, class: className, ...restProps }: DropdownItemProps = $props();
|
|
@@ -20,10 +21,10 @@
|
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
const { anchor, activeAnchor } = dropdownItem();
|
|
23
|
-
let finalClass = $derived([active ?
|
|
24
|
+
let finalClass = $derived([active ? activeAnchor({ class: clsx((theme as DropdownItemTheme)?.activeAnchor, activeClass, className) }) : anchor({ class: clsx((theme as DropdownItemTheme)?.anchor, aClass, className) })]);
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
|
-
<li class={
|
|
27
|
+
<li class={liClass}>
|
|
27
28
|
{#if restProps.href === undefined && restProps.onclick === undefined}
|
|
28
29
|
<div {...restProps} class={finalClass}>
|
|
29
30
|
{@render children()}
|
package/dist/dropdown/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const dropdown: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
[key: string]: {
|
|
3
4
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -30,11 +31,11 @@ export declare const dropdown: import("tailwind-variants").TVReturnType<{
|
|
|
30
31
|
backdrop: string;
|
|
31
32
|
}, undefined, unknown, unknown, undefined>>;
|
|
32
33
|
export type DropdownSlots = keyof typeof dropdown.slots;
|
|
33
|
-
export type DropdownTheme = Partial<Record<DropdownSlots,
|
|
34
|
+
export type DropdownTheme = Partial<Record<DropdownSlots, ClassValue>>;
|
|
34
35
|
export declare const dropdownDivider: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "my-1 h-px bg-gray-100 dark:bg-gray-500", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "my-1 h-px bg-gray-100 dark:bg-gray-500", unknown, unknown, undefined>>;
|
|
35
|
-
export type DropdownDividerTheme =
|
|
36
|
+
export type DropdownDividerTheme = ClassValue;
|
|
36
37
|
export declare const dropdownHeader: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "px-4 py-3 text-sm text-gray-900 dark:text-white", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "px-4 py-3 text-sm text-gray-900 dark:text-white", unknown, unknown, undefined>>;
|
|
37
|
-
export type DropdownHeaderTheme =
|
|
38
|
+
export type DropdownHeaderTheme = ClassValue;
|
|
38
39
|
export declare const dropdownItem: import("tailwind-variants").TVReturnType<{
|
|
39
40
|
[key: string]: {
|
|
40
41
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -67,6 +68,6 @@ export declare const dropdownItem: import("tailwind-variants").TVReturnType<{
|
|
|
67
68
|
activeAnchor: string;
|
|
68
69
|
}, undefined, unknown, unknown, undefined>>;
|
|
69
70
|
export type DropdownItemSlots = keyof typeof dropdownItem.slots;
|
|
70
|
-
export type DropdownItemTheme = Partial<Record<DropdownItemSlots,
|
|
71
|
+
export type DropdownItemTheme = Partial<Record<DropdownItemSlots, ClassValue>>;
|
|
71
72
|
export declare const dropdownGroup: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "py-2 text-sm text-gray-700 dark:text-gray-200", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "py-2 text-sm text-gray-700 dark:text-gray-200", unknown, unknown, undefined>>;
|
|
72
|
-
export type DropdownGroupTheme =
|
|
73
|
+
export type DropdownGroupTheme = ClassValue;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { footer } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, footerType = "default", class: className, ...restProps }: FooterProps = $props();
|
|
7
8
|
|
|
8
9
|
const theme = getTheme("footer");
|
|
9
10
|
|
|
10
|
-
const footerCls = $derived(footer({ footerType }));
|
|
11
|
+
const footerCls = $derived(footer({ footerType, class: clsx(theme, className) }));
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<footer {...restProps} class={
|
|
14
|
+
<footer {...restProps} class={footerCls}>
|
|
14
15
|
{@render children()}
|
|
15
16
|
</footer>
|
|
16
17
|
|