flowbite-svelte 1.10.5 → 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 +8 -9
- 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 +6 -5
- 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 { setContext } from "svelte";
|
|
3
3
|
import { writable } from "svelte/store";
|
|
4
4
|
import { accordion } from "./";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { type AccordionProps } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
8
9
|
let { children, flush, activeClass, inactiveClass, multiple = false, class: className, transitionType, ...restProps }: AccordionProps = $props();
|
|
@@ -18,11 +19,10 @@
|
|
|
18
19
|
|
|
19
20
|
setContext("ctx", ctx);
|
|
20
21
|
setContext("ctxTransitionType", transitionType);
|
|
21
|
-
const base = $derived(
|
|
22
|
-
const finalClass = $derived(cn(base, theme));
|
|
22
|
+
const base = $derived(accordion({ flush, class: clsx(theme, className) }));
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
|
-
<div {...restProps} class={
|
|
25
|
+
<div {...restProps} class={base}>
|
|
26
26
|
{@render children()}
|
|
27
27
|
</div>
|
|
28
28
|
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { slide } from "svelte/transition";
|
|
3
3
|
import { getContext } from "svelte";
|
|
4
4
|
import { writable } from "svelte/store";
|
|
5
|
+
import clsx from "clsx";
|
|
5
6
|
import { accordionItem, type AccordionItemTheme } from ".";
|
|
6
|
-
import { type AccordionCtxType, type AccordionItemProps, type ParamsType
|
|
7
|
+
import { type AccordionCtxType, type AccordionItemProps, type ParamsType } from "..";
|
|
7
8
|
import { getTheme } from "../theme/themeUtils";
|
|
8
9
|
|
|
9
10
|
let { children, header, arrowup, arrowdown, open = $bindable(false), activeClass, inactiveClass, transitionType = slide, transitionParams, class: className, headerClass, contentClass }: AccordionItemProps = $props();
|
|
@@ -29,11 +30,11 @@
|
|
|
29
30
|
|
|
30
31
|
const { base, button, content, active, inactive } = $derived(accordionItem({ flush: ctx.flush, open }));
|
|
31
32
|
|
|
32
|
-
let buttonClass = $derived(
|
|
33
|
+
let buttonClass = $derived(clsx(open && !ctx.flush && (activeClass || ctx.activeClass || active()), !open && !ctx.flush && (inactiveClass || ctx.inactiveClass || inactive())));
|
|
33
34
|
</script>
|
|
34
35
|
|
|
35
|
-
<h2 class={
|
|
36
|
-
<button type="button" onclick={handleToggle} class={
|
|
36
|
+
<h2 class={base({ class: clsx((theme as AccordionItemTheme)?.base, headerClass) })}>
|
|
37
|
+
<button type="button" onclick={handleToggle} class={button({ class: clsx(buttonClass, (theme as AccordionItemTheme)?.button, className) })} aria-expanded={open}>
|
|
37
38
|
{#if header}
|
|
38
39
|
{@render header()}
|
|
39
40
|
{#if open}
|
|
@@ -58,14 +59,14 @@
|
|
|
58
59
|
{#if useTransition}
|
|
59
60
|
{#if open && transitionType !== "none"}
|
|
60
61
|
<div transition:transitionType={transitionParams as ParamsType}>
|
|
61
|
-
<div class={
|
|
62
|
+
<div class={content({ class: clsx((theme as AccordionItemTheme)?.content, contentClass) })}>
|
|
62
63
|
{@render children()}
|
|
63
64
|
</div>
|
|
64
65
|
</div>
|
|
65
66
|
{/if}
|
|
66
67
|
{:else}
|
|
67
68
|
<div class={open ? "block" : "hidden"}>
|
|
68
|
-
<div class={
|
|
69
|
+
<div class={content({ class: clsx(contentClass, (theme as AccordionItemTheme)?.content) })}>
|
|
69
70
|
{@render children()}
|
|
70
71
|
</div>
|
|
71
72
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const accordion: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
color: {
|
|
3
4
|
primary: string;
|
|
@@ -90,6 +91,6 @@ export declare const accordionItem: import("tailwind-variants").TVReturnType<{
|
|
|
90
91
|
active: string;
|
|
91
92
|
inactive: string;
|
|
92
93
|
}, undefined, unknown, unknown, undefined>>;
|
|
93
|
-
export type AccordionTheme =
|
|
94
|
+
export type AccordionTheme = ClassValue;
|
|
94
95
|
export type AccordionItemSlots = keyof typeof accordionItem.slots;
|
|
95
|
-
export type AccordionItemTheme = Partial<Record<AccordionItemSlots,
|
|
96
|
+
export type AccordionItemTheme = Partial<Record<AccordionItemSlots, ClassValue>>;
|
package/dist/alert/Alert.svelte
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fade } from "svelte/transition";
|
|
3
3
|
import { alert } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type AlertProps, type ParamsType, CloseButton } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, icon, alertStatus = $bindable(true), closeIcon: CloseIcon, color = "primary", rounded = true, border, class: className, dismissable, transition = fade, params, onclick = () => (alertStatus = false), ...restProps }: AlertProps = $props();
|
|
@@ -10,17 +11,14 @@
|
|
|
10
11
|
const theme = getTheme("alert");
|
|
11
12
|
|
|
12
13
|
let divCls = $derived(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className,
|
|
22
|
-
theme
|
|
23
|
-
)
|
|
14
|
+
alert({
|
|
15
|
+
color,
|
|
16
|
+
rounded,
|
|
17
|
+
border,
|
|
18
|
+
icon: !!icon,
|
|
19
|
+
dismissable,
|
|
20
|
+
class: clsx(theme, className)
|
|
21
|
+
})
|
|
24
22
|
);
|
|
25
23
|
</script>
|
|
26
24
|
|
package/dist/alert/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
|
type AlertVariants = VariantProps<typeof alert>;
|
|
3
4
|
declare const alert: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -107,4 +108,4 @@ declare const alert: import("tailwind-variants").TVReturnType<{
|
|
|
107
108
|
};
|
|
108
109
|
}, undefined, "p-4 gap-3 text-sm", unknown, unknown, undefined>>;
|
|
109
110
|
export { alert, type AlertVariants };
|
|
110
|
-
export type AlertTheme =
|
|
111
|
+
export type AlertTheme = ClassValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { avatar } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type AvatarProps, Indicator } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, indicator, src, href, target, cornerStyle = "circular", border = false, stacked = false, dot, class: className, alt, size = "md", onclick, ...restProps }: AvatarProps = $props();
|
|
@@ -11,16 +12,13 @@
|
|
|
11
12
|
dot = dot && { placement: "top-right", color: "gray", size: "lg", ...dot };
|
|
12
13
|
|
|
13
14
|
let avatarClass = $derived(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className,
|
|
22
|
-
theme
|
|
23
|
-
)
|
|
15
|
+
avatar({
|
|
16
|
+
cornerStyle,
|
|
17
|
+
border,
|
|
18
|
+
stacked,
|
|
19
|
+
size,
|
|
20
|
+
class: clsx(theme, className)
|
|
21
|
+
})
|
|
24
22
|
);
|
|
25
23
|
</script>
|
|
26
24
|
|
package/dist/avatar/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
declare const avatar: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
cornerStyle: {
|
|
3
4
|
rounded: string;
|
|
@@ -60,4 +61,4 @@ declare const avatar: import("tailwind-variants").TVReturnType<{
|
|
|
60
61
|
};
|
|
61
62
|
}, undefined, "relative flex items-center justify-center bg-gray-100 dark:bg-gray-600 text-gray-600 dark:text-gray-300", unknown, unknown, undefined>>;
|
|
62
63
|
export { avatar };
|
|
63
|
-
export type AvatarTheme =
|
|
64
|
+
export type AvatarTheme = ClassValue;
|
package/dist/badge/Badge.svelte
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { badge, type BadgeTheme } from ".";
|
|
3
|
+
import clsx from "clsx";
|
|
3
4
|
import { fade } from "svelte/transition";
|
|
4
|
-
import { type ParamsType, type BadgeProps, CloseButton
|
|
5
|
+
import { type ParamsType, type BadgeProps, CloseButton } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, icon, badgeStatus = $bindable(true), color = "primary", large = false, dismissable = false, class: className, border, href, target, rounded, transition = fade, params, aClass, onclose, ...restProps }: BadgeProps = $props();
|
|
@@ -18,9 +19,9 @@
|
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
{#if badgeStatus}
|
|
21
|
-
<div {...restProps} transition:transition={params as ParamsType} class={
|
|
22
|
+
<div {...restProps} transition:transition={params as ParamsType} class={base({ class: clsx((theme as BadgeTheme)?.base, className) })}>
|
|
22
23
|
{#if href}
|
|
23
|
-
<a {href} {target} class={
|
|
24
|
+
<a {href} {target} class={linkClass({ class: clsx((theme as BadgeTheme)?.linkClass, aClass) })}>
|
|
24
25
|
{@render children()}
|
|
25
26
|
</a>
|
|
26
27
|
{:else}
|
package/dist/badge/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
|
type BadgeVariants = VariantProps<typeof badge>;
|
|
3
4
|
declare const badge: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -246,4 +247,4 @@ declare const badge: import("tailwind-variants").TVReturnType<{
|
|
|
246
247
|
}, undefined, unknown, unknown, undefined>>;
|
|
247
248
|
export { badge, type BadgeVariants };
|
|
248
249
|
export type BadgeSlots = keyof typeof badge.slots;
|
|
249
|
-
export type BadgeTheme = Partial<Record<BadgeSlots,
|
|
250
|
+
export type BadgeTheme = Partial<Record<BadgeSlots, ClassValue>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fade } from "svelte/transition";
|
|
3
3
|
import { banner, type BannerTheme } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type ParamsType, type BannerProps, CloseButton } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, header, open = $bindable(true), dismissable = true, color = "gray", type, class: className, innerClass, transition = fade, params, closeClass, ...restProps }: BannerProps = $props();
|
|
@@ -13,15 +14,15 @@
|
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
{#if open}
|
|
16
|
-
<div tabindex="-1" class={
|
|
17
|
-
<div class={
|
|
17
|
+
<div tabindex="-1" class={base({ class: clsx((theme as BannerTheme)?.base, className) })} {...restProps} transition:transition={params as ParamsType}>
|
|
18
|
+
<div class={insideDiv({ class: clsx((theme as BannerTheme)?.insideDiv, innerClass) })}>
|
|
18
19
|
{@render children?.()}
|
|
19
20
|
</div>
|
|
20
21
|
|
|
21
22
|
{#if dismissable}
|
|
22
23
|
<div class="flex items-center justify-end">
|
|
23
24
|
<CloseButton
|
|
24
|
-
class={
|
|
25
|
+
class={dismissableClass({ class: clsx((theme as BannerTheme)?.dismissable, closeClass) })}
|
|
25
26
|
{color}
|
|
26
27
|
ariaLabel="Remove banner"
|
|
27
28
|
onclick={() => {
|
package/dist/banner/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 BannerVariants = VariantProps<typeof banner>;
|
|
3
4
|
declare const banner: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
type: {
|
|
@@ -228,4 +229,4 @@ declare const banner: import("tailwind-variants").TVReturnType<{
|
|
|
228
229
|
}, undefined, unknown, unknown, undefined>>;
|
|
229
230
|
export { banner };
|
|
230
231
|
export type BannerSlots = keyof typeof banner.slots;
|
|
231
|
-
export type BannerTheme = Partial<Record<BannerSlots,
|
|
232
|
+
export type BannerTheme = Partial<Record<BannerSlots, ClassValue>>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import { writable } from "svelte/store";
|
|
4
4
|
import { bottomNav } from ".";
|
|
5
|
+
import clsx from "clsx";
|
|
5
6
|
import { type BottomNavProps, type BottomNavContextType, cn, type BottomNavTheme } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
@@ -24,12 +25,12 @@
|
|
|
24
25
|
});
|
|
25
26
|
</script>
|
|
26
27
|
|
|
27
|
-
<div {...restProps} class={
|
|
28
|
+
<div {...restProps} class={outer({ class: clsx((theme as BottomNavTheme)?.outer, outerClass) })}>
|
|
28
29
|
{#if header}
|
|
29
30
|
{@render header()}
|
|
30
31
|
{/if}
|
|
31
32
|
|
|
32
|
-
<div class={
|
|
33
|
+
<div class={inner({ class: clsx((theme as BottomNavTheme)?.inner, innerClass) })}>
|
|
33
34
|
{@render children()}
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { bottomNavHeader } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type BottomNavHeaderProps, type BottomNavHeaderTheme } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, outerClass, innerClass, ...restProps }: BottomNavHeaderProps = $props();
|
|
@@ -11,8 +12,8 @@
|
|
|
11
12
|
const { innerDiv, outerDiv } = $derived(bottomNavHeader());
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<div {...restProps} class={
|
|
15
|
-
<div class={
|
|
15
|
+
<div {...restProps} class={outerDiv({ class: clsx((theme as BottomNavHeaderTheme)?.outerDiv, outerClass) })}>
|
|
16
|
+
<div class={innerDiv({ class: clsx((theme as BottomNavHeaderTheme)?.innerDiv, innerClass) })} role="group">
|
|
16
17
|
{@render children()}
|
|
17
18
|
</div>
|
|
18
19
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { bottomNavHeaderItem } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type BottomNavHeaderItemProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { itemName, active, class: className, ...restProps }: BottomNavHeaderItemProps = $props();
|
|
@@ -8,10 +9,10 @@
|
|
|
8
9
|
// Theme context
|
|
9
10
|
const theme = getTheme("bottomNavHeaderItem");
|
|
10
11
|
|
|
11
|
-
let base = $derived(bottomNavHeaderItem({ active }));
|
|
12
|
+
let base = $derived(bottomNavHeaderItem({ active, class: clsx(theme, className) }));
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<button {...restProps} class={
|
|
15
|
+
<button {...restProps} class={base}>
|
|
15
16
|
{itemName}
|
|
16
17
|
</button>
|
|
17
18
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import type { HTMLButtonAttributes, HTMLAnchorAttributes } from "svelte/elements";
|
|
4
4
|
import { bottomNavItem, type BottomNavItemTheme } from ".";
|
|
5
|
-
import
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { type BottomNavItemProps, type BottomNavContextType, type BottomNavVariantType } from "..";
|
|
6
7
|
import { getTheme } from "../theme/themeUtils";
|
|
7
8
|
|
|
8
9
|
let { children, btnName, appBtnPosition = "middle", target, activeClass, href = "", btnClass, spanClass, active: manualActive, ...restProps }: BottomNavItemProps = $props();
|
|
@@ -26,11 +27,11 @@
|
|
|
26
27
|
let isActive = $derived(manualActive !== undefined ? !!manualActive : navUrl ? (href === "/" ? navUrl === "/" : href && (navUrl === href || navUrl.startsWith(href + "/") || (href !== "/" && navUrl.replace(/^https?:\/\/[^/]+/, "").startsWith(href)))) : false);
|
|
27
28
|
|
|
28
29
|
function getCommonClass() {
|
|
29
|
-
return
|
|
30
|
+
return base({ class: clsx(isActive && (activeClass ?? context.activeClass), (theme as BottomNavItemTheme)?.base, btnClass) });
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
function getSpanClass() {
|
|
33
|
-
return
|
|
34
|
+
return span({ class: clsx(isActive && (activeClass ?? context.activeClass), (theme as BottomNavItemTheme)?.span, spanClass) });
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const bottomNav: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
position: {
|
|
3
4
|
static: {
|
|
@@ -342,10 +343,10 @@ export declare const bottomNavHeaderItem: import("tailwind-variants").TVReturnTy
|
|
|
342
343
|
};
|
|
343
344
|
}, undefined, "px-5 py-1.5 text-xs font-medium rounded-lg", unknown, unknown, undefined>>;
|
|
344
345
|
export type BottomNavSlots = keyof typeof bottomNav.slots;
|
|
345
|
-
export type BottomNavTheme = Partial<Record<BottomNavSlots,
|
|
346
|
+
export type BottomNavTheme = Partial<Record<BottomNavSlots, ClassValue>>;
|
|
346
347
|
export type BottomNavItemSlots = keyof typeof bottomNavItem.slots;
|
|
347
|
-
export type BottomNavItemTheme = Partial<Record<BottomNavItemSlots,
|
|
348
|
+
export type BottomNavItemTheme = Partial<Record<BottomNavItemSlots, ClassValue>>;
|
|
348
349
|
export type BottomnavheaderSlots = keyof typeof bottomNavHeader.slots;
|
|
349
|
-
export type BottomNavHeaderTheme = Partial<Record<BottomnavheaderSlots,
|
|
350
|
+
export type BottomNavHeaderTheme = Partial<Record<BottomnavheaderSlots, ClassValue>>;
|
|
350
351
|
export type bottomNavHeaderItemSlots = keyof typeof bottomNavHeaderItem.slots;
|
|
351
|
-
export type BottomNavHeaderItemTheme = Partial<Record<bottomNavHeaderItemSlots,
|
|
352
|
+
export type BottomNavHeaderItemTheme = Partial<Record<bottomNavHeaderItemSlots, ClassValue>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { breadcrumb } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type BreadcrumbProps, type BreadcrumbTheme } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, solid = false, class: className, olClass, ariaLabel = "Breadcrumb", ...restProps }: BreadcrumbProps = $props();
|
|
@@ -8,8 +9,8 @@
|
|
|
8
9
|
const theme = getTheme("breadcrumb");
|
|
9
10
|
|
|
10
11
|
const { nav, list } = breadcrumb({ solid });
|
|
11
|
-
let classNav = $derived(
|
|
12
|
-
let classList = $derived(
|
|
12
|
+
let classNav = $derived(nav({ class: clsx((theme as BreadcrumbTheme)?.nav, className) }));
|
|
13
|
+
let classList = $derived(list({ class: clsx((theme as BreadcrumbTheme)?.list, olClass) }));
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<nav aria-label={ariaLabel} {...restProps} class={classNav}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { breadcrumbItem } from "./index";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type BreadcrumbItemProps, type BreadcrumbItemTheme } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, icon, home = false, href, linkClass, spanClass, homeClass, class: className, ...restProps }: BreadcrumbItemProps = $props();
|
|
@@ -15,9 +16,9 @@
|
|
|
15
16
|
);
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
|
-
<li {...restProps} class={
|
|
19
|
+
<li {...restProps} class={base({ class: clsx((theme as BreadcrumbItemTheme)?.base, className) })}>
|
|
19
20
|
{#if home}
|
|
20
|
-
<a class={
|
|
21
|
+
<a class={base({ home: true, class: clsx((theme as BreadcrumbItemTheme)?.base, homeClass) })} {href}>
|
|
21
22
|
{#if icon}
|
|
22
23
|
{@render icon()}
|
|
23
24
|
{:else}
|
|
@@ -32,17 +33,17 @@
|
|
|
32
33
|
{#if icon}
|
|
33
34
|
{@render icon()}
|
|
34
35
|
{:else}
|
|
35
|
-
<svg class={
|
|
36
|
+
<svg class={separator({ class: clsx((theme as BreadcrumbItemTheme)?.separator) })} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
36
37
|
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
|
|
37
38
|
</svg>
|
|
38
39
|
{/if}
|
|
39
40
|
|
|
40
41
|
{#if href}
|
|
41
|
-
<a class={
|
|
42
|
+
<a class={base({ home: false, hasHref: true, class: clsx((theme as BreadcrumbItemTheme)?.base, linkClass) })} {href}>
|
|
42
43
|
{@render children()}
|
|
43
44
|
</a>
|
|
44
45
|
{:else}
|
|
45
|
-
<span class={
|
|
46
|
+
<span class={base({ home: false, hasHref: false, class: clsx((theme as BreadcrumbItemTheme)?.base, spanClass) })}>
|
|
46
47
|
{@render children()}
|
|
47
48
|
</span>
|
|
48
49
|
{/if}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const breadcrumb: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
solid: {
|
|
3
4
|
true: {
|
|
@@ -67,6 +68,6 @@ export declare const breadcrumbItem: import("tailwind-variants").TVReturnType<{
|
|
|
67
68
|
separator: string;
|
|
68
69
|
}, undefined, unknown, unknown, undefined>>;
|
|
69
70
|
export type BreadcrumbSlots = keyof typeof breadcrumb.slots;
|
|
70
|
-
export type BreadcrumbTheme = Partial<Record<BreadcrumbSlots,
|
|
71
|
+
export type BreadcrumbTheme = Partial<Record<BreadcrumbSlots, ClassValue>>;
|
|
71
72
|
export type BreadcrumbItemSlots = keyof typeof breadcrumbItem.slots;
|
|
72
|
-
export type BreadcrumbItemTheme = Partial<Record<BreadcrumbItemSlots,
|
|
73
|
+
export type BreadcrumbItemTheme = Partial<Record<BreadcrumbItemSlots, ClassValue>>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import { buttonGroup } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type ButtonGroupProps } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, size = "md", disabled, class: className, ...restProps }: ButtonGroupProps = $props();
|
|
8
9
|
|
|
9
10
|
const theme = getTheme("buttonGroup");
|
|
10
11
|
|
|
11
|
-
let groupClass = $derived(
|
|
12
|
+
let groupClass = $derived(buttonGroup({ size, class: clsx(theme, className) }));
|
|
12
13
|
setContext("group", size);
|
|
13
14
|
setContext("disabled", disabled);
|
|
14
15
|
</script>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
declare const buttonGroup: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
size: {
|
|
3
4
|
sm: string;
|
|
@@ -18,4 +19,4 @@ declare const buttonGroup: import("tailwind-variants").TVReturnType<{
|
|
|
18
19
|
};
|
|
19
20
|
}, undefined, "inline-flex rounded-lg shadow-xs", unknown, unknown, undefined>>;
|
|
20
21
|
export { buttonGroup };
|
|
21
|
-
export type ButtonGroupTheme =
|
|
22
|
+
export type ButtonGroupTheme = ClassValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type SizeType, type ButtonProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
import { button, type ButtonTheme } from ".";
|
|
6
7
|
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
let isDisabled = $derived(Boolean(ctxDisabled) || Boolean(disabled));
|
|
17
18
|
|
|
18
19
|
const { base, outline: outline_, shadow: shadow_ } = $derived(button({ color: actualColor, size: actualSize, disabled: isDisabled, pill, group: !!group }));
|
|
19
|
-
let btnCls = $derived(
|
|
20
|
+
let btnCls = $derived(base({ class: clsx(outline && outline_(), shadow && shadow_(), (theme as ButtonTheme)?.base, className) }));
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
{#if restProps.href === undefined}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { gradientButton, type GradientButtonTheme } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type GradientButtonProps, type SizeType, Button } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
const group: SizeType = getContext("group");
|
|
@@ -14,13 +15,13 @@
|
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
{#if outline}
|
|
17
|
-
<div class={
|
|
18
|
-
<Button {...restProps} class={
|
|
18
|
+
<div class={base({ class: clsx((theme as GradientButtonTheme)?.base, className) })}>
|
|
19
|
+
<Button {...restProps} class={outlineWrapper({ class: clsx((theme as GradientButtonTheme)?.outlineWrapper, btnClass) })} {disabled} {href} {size}>
|
|
19
20
|
{@render children?.()}
|
|
20
21
|
</Button>
|
|
21
22
|
</div>
|
|
22
23
|
{:else}
|
|
23
|
-
<Button {...restProps} class={
|
|
24
|
+
<Button {...restProps} class={base({ class: clsx((theme as GradientButtonTheme)?.base, className) })} {disabled} {href} {size}>
|
|
24
25
|
{@render children?.()}
|
|
25
26
|
</Button>
|
|
26
27
|
{/if}
|
package/dist/buttons/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 ButtonVariants = VariantProps<typeof button>;
|
|
3
4
|
export declare const button: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -703,6 +704,6 @@ export declare const gradientButton: import("tailwind-variants").TVReturnType<{
|
|
|
703
704
|
outlineWrapper: string;
|
|
704
705
|
}, undefined, unknown, unknown, undefined>>;
|
|
705
706
|
export type ButtonSlots = keyof typeof button.slots;
|
|
706
|
-
export type ButtonTheme = Partial<Record<ButtonSlots,
|
|
707
|
+
export type ButtonTheme = Partial<Record<ButtonSlots, ClassValue>>;
|
|
707
708
|
export type GradientButtonSlots = keyof typeof gradientButton.slots;
|
|
708
|
-
export type GradientButtonTheme = Partial<Record<GradientButtonSlots,
|
|
709
|
+
export type GradientButtonTheme = Partial<Record<GradientButtonSlots, ClassValue>>;
|
package/dist/card/Card.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type CardProps
|
|
2
|
+
import { type CardProps } from "..";
|
|
3
3
|
import { getTheme } from "../theme/themeUtils";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { card, type CardTheme } from ".";
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
{#snippet childSlot()}
|
|
24
24
|
{#if img}
|
|
25
|
-
<img class={
|
|
25
|
+
<img class={image({ class: clsx((theme as CardTheme)?.image, imgClass) })} src={img} alt={img} />
|
|
26
26
|
{@render children()}
|
|
27
27
|
{:else}
|
|
28
28
|
{@render children()}
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
{/snippet}
|
|
31
31
|
|
|
32
32
|
{#if restProps.href === undefined}
|
|
33
|
-
<div {...restProps} class={
|
|
33
|
+
<div {...restProps} class={base({ class: clsx((theme as CardTheme)?.base, className) })}>
|
|
34
34
|
{@render childSlot()}
|
|
35
35
|
</div>
|
|
36
36
|
{:else}
|
|
37
|
-
<a {...restProps} class={
|
|
37
|
+
<a {...restProps} class={base({ class: clsx((theme as CardTheme)?.base, className) })}>
|
|
38
38
|
{@render childSlot()}
|
|
39
39
|
</a>
|
|
40
40
|
{/if}
|
package/dist/card/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 CardVariants = VariantProps<typeof card>;
|
|
3
4
|
export declare const card: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
size: {
|
|
@@ -392,4 +393,4 @@ export declare const card: import("tailwind-variants").TVReturnType<{
|
|
|
392
393
|
image: string;
|
|
393
394
|
}, undefined, unknown, unknown, undefined>>;
|
|
394
395
|
export type CardSlots = keyof typeof card.slots;
|
|
395
|
-
export type CardTheme = Partial<Record<CardSlots,
|
|
396
|
+
export type CardTheme = Partial<Record<CardSlots, ClassValue>>;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import { writable } from "svelte/store";
|
|
4
4
|
import { canChangeSlide } from "./CarouselSlide";
|
|
5
5
|
import { carousel } from "./theme";
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { type CarouselProps, type State, Slide } from "..";
|
|
7
8
|
import { getTheme } from "../theme/themeUtils";
|
|
8
9
|
|
|
9
10
|
const SLIDE_DURATION_RATIO = 0.25;
|
|
@@ -168,12 +169,12 @@
|
|
|
168
169
|
|
|
169
170
|
<!-- The move listeners go here, so things keep working if the touch strays out of the element. -->
|
|
170
171
|
<svelte:document onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} />
|
|
171
|
-
<div bind:this={carouselDiv} class={
|
|
172
|
-
<div {...restProps} class={
|
|
172
|
+
<div bind:this={carouselDiv} class={clsx("relative", divClass)} onmousedown={onDragStart} ontouchstart={onDragStart} onmousemove={onDragMove} onmouseup={onDragStop} ontouchmove={onDragMove} ontouchend={onDragStop} role="button" aria-label={ariaLabel} tabindex="0">
|
|
173
|
+
<div {...restProps} class={carousel({ class: clsx(activeDragGesture === undefined ? "transition-transform" : "", theme, className) })} {@attach loop}>
|
|
173
174
|
{#if slide}
|
|
174
175
|
{@render slide({ index, Slide })}
|
|
175
176
|
{:else}
|
|
176
|
-
<Slide image={images[index]} class={
|
|
177
|
+
<Slide image={images[index]} class={clsx(imgClass)} {transition} />
|
|
177
178
|
{/if}
|
|
178
179
|
</div>
|
|
179
180
|
{@render children?.(index)}
|