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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { toggle, type ToggleTheme } from "./index";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type ToggleProps, Label } from "../..";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, size = "default", value, checked = $bindable(), disabled, color = "primary", class: className, inputClass, spanClass, offLabel, ...restProps }: ToggleProps = $props();
|
|
@@ -10,12 +11,12 @@
|
|
|
10
11
|
const { input, label, span } = $derived(toggle({ color, checked, size, disabled, off_state_label: !!offLabel }));
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<Label class={
|
|
14
|
+
<Label class={label({ class: clsx((theme as ToggleTheme)?.label, className) })}>
|
|
14
15
|
{#if offLabel}
|
|
15
16
|
{@render offLabel()}
|
|
16
17
|
{/if}
|
|
17
|
-
<input type="checkbox" bind:checked {value} {...restProps} {disabled} class={
|
|
18
|
-
<span class={
|
|
18
|
+
<input type="checkbox" bind:checked {value} {...restProps} {disabled} class={input({ class: clsx((theme as ToggleTheme)?.input, inputClass) })} />
|
|
19
|
+
<span class={span({ class: clsx((theme as ToggleTheme)?.span, spanClass) })}></span>
|
|
19
20
|
{#if children}
|
|
20
21
|
{@render children()}
|
|
21
22
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type ToggleVariants = VariantProps<typeof toggle>;
|
|
3
4
|
export declare const toggle: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
disabled: {
|
|
@@ -278,4 +279,4 @@ export declare const toggle: import("tailwind-variants").TVReturnType<{
|
|
|
278
279
|
input: string;
|
|
279
280
|
}, undefined, unknown, unknown, undefined>>;
|
|
280
281
|
export type ToggleSlots = keyof typeof toggle.slots;
|
|
281
|
-
export type ToggleTheme = Partial<Record<ToggleSlots,
|
|
282
|
+
export type ToggleTheme = Partial<Record<ToggleSlots, ClassValue>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { gallery, type GalleryTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type GalleryProps, type ImgType } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, figure, items = [], imgClass, class: className, ...restProps }: GalleryProps = $props();
|
|
@@ -16,11 +17,11 @@
|
|
|
16
17
|
|
|
17
18
|
{#snippet _figure(item: ImgType)}
|
|
18
19
|
<div>
|
|
19
|
-
<img src={item.src} alt={item.alt} class={
|
|
20
|
+
<img src={item.src} alt={item.alt} class={image({ class: clsx((theme as GalleryTheme)?.image, imgClass) })} {...restProps} />
|
|
20
21
|
</div>
|
|
21
22
|
{/snippet}
|
|
22
23
|
|
|
23
|
-
<div class={
|
|
24
|
+
<div class={div({ class: clsx((theme as GalleryTheme)?.div, className) })} use:init>
|
|
24
25
|
{#each items as item}
|
|
25
26
|
{#if figure}
|
|
26
27
|
{@render figure(item as ImgType)}
|
package/dist/gallery/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
declare const gallery: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
[key: string]: {
|
|
3
4
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -31,4 +32,4 @@ declare const gallery: import("tailwind-variants").TVReturnType<{
|
|
|
31
32
|
}, undefined, unknown, unknown, undefined>>;
|
|
32
33
|
export { gallery };
|
|
33
34
|
export type GallerySlots = keyof typeof gallery.slots;
|
|
34
|
-
export type GalleryTheme = Partial<Record<GallerySlots,
|
|
35
|
+
export type GalleryTheme = Partial<Record<GallerySlots, ClassValue>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { indicator } from "./index";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type IndicatorProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, color = "primary", cornerStyle = "circular", size = "md", border = false, placement, offset = true, class: className, ...restProps }: IndicatorProps = $props();
|
|
@@ -16,12 +17,13 @@
|
|
|
16
17
|
border,
|
|
17
18
|
placement,
|
|
18
19
|
offset,
|
|
19
|
-
hasChildren
|
|
20
|
+
hasChildren,
|
|
21
|
+
class: clsx(theme, className)
|
|
20
22
|
})
|
|
21
23
|
);
|
|
22
24
|
</script>
|
|
23
25
|
|
|
24
|
-
<div {...restProps} class={
|
|
26
|
+
<div {...restProps} class={base}>
|
|
25
27
|
{#if children}
|
|
26
28
|
{@render children()}
|
|
27
29
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type IndicatorVariants = VariantProps<typeof indicator>;
|
|
3
4
|
export declare const indicator: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -175,4 +176,4 @@ export declare const indicator: import("tailwind-variants").TVReturnType<{
|
|
|
175
176
|
false: {};
|
|
176
177
|
};
|
|
177
178
|
}, undefined, "shrink-0", unknown, unknown, undefined>>;
|
|
178
|
-
export type IndicatorTheme =
|
|
179
|
+
export type IndicatorTheme = ClassValue;
|
package/dist/kbd/Kbd.svelte
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { kbd } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type KbdProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, class: className, ...restProps }: KbdProps = $props();
|
|
7
8
|
|
|
8
9
|
const theme = getTheme("kbd");
|
|
9
10
|
|
|
10
|
-
const kbdCls =
|
|
11
|
+
const kbdCls = kbd({ class: clsx(theme, className) });
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<kbd {...restProps} class={kbdCls}>
|
package/dist/kbd/theme.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const kbd: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "px-2 py-1.5 text-xs font-semibold text-gray-800 bg-gray-100 border border-gray-200 rounded-lg dark:bg-gray-600 dark:text-gray-100 dark:border-gray-500", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "px-2 py-1.5 text-xs font-semibold text-gray-800 bg-gray-100 border border-gray-200 rounded-lg dark:bg-gray-600 dark:text-gray-100 dark:border-gray-500", unknown, unknown, undefined>>;
|
|
2
|
-
export type KbdTheme =
|
|
3
|
+
export type KbdTheme = ClassValue;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
3
|
import { listGroup } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type ListgroupProps, ListgroupItem } from "..";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, items, active, onclick, horizontal, rounded, border, class: className, itemClass, iconClass, ...restProps }: ListgroupProps = $props();
|
|
8
9
|
|
|
9
10
|
const theme = getTheme("listgroup");
|
|
10
11
|
|
|
11
|
-
const base = $derived(listGroup({ rounded, border, horizontal }));
|
|
12
|
+
const base = $derived(listGroup({ rounded, border, horizontal, class: clsx(theme, className) }));
|
|
12
13
|
|
|
13
14
|
let tag = active ? "div" : "ul";
|
|
14
15
|
setContext("listGrpActive", active);
|
|
@@ -25,15 +26,15 @@
|
|
|
25
26
|
}
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
|
-
<svelte:element this={tag} {...restProps} class={
|
|
29
|
+
<svelte:element this={tag} {...restProps} class={base}>
|
|
29
30
|
{#if items?.length}
|
|
30
31
|
{#each items as item}
|
|
31
32
|
{#if children}
|
|
32
33
|
{@render children(item)}
|
|
33
34
|
{:else if typeof item === "string"}
|
|
34
|
-
<ListgroupItem href={undefined} class={
|
|
35
|
+
<ListgroupItem href={undefined} class={clsx(itemClass)} iconClass={clsx(iconClass)} {active} {horizontal} onclick={createItemClickHandler(item)}>{item}</ListgroupItem>
|
|
35
36
|
{:else}
|
|
36
|
-
<ListgroupItem href={item.href} class={
|
|
37
|
+
<ListgroupItem href={item.href} class={clsx(itemClass)} iconClass={clsx(iconClass)} {active} {horizontal} {...item} onclick={item.onclick ?? createItemClickHandler(item)} />
|
|
37
38
|
{/if}
|
|
38
39
|
{/each}
|
|
39
40
|
{:else}
|
|
@@ -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 ListgroupItemProps } from "..";
|
|
4
5
|
import { listGroupItem, type ListgroupItemVariants } from "./theme";
|
|
5
6
|
import { getTheme } from "../theme/themeUtils";
|
|
6
7
|
|
|
@@ -12,12 +13,12 @@
|
|
|
12
13
|
horizontal = horizontal ?? getContext("listGrpHorizontal");
|
|
13
14
|
|
|
14
15
|
let state: ListgroupItemVariants["state"] = $derived(disabled ? "disabled" : current ? "current" : "normal");
|
|
15
|
-
let itemClass = $derived(listGroupItem({ state, active, horizontal }));
|
|
16
|
+
let itemClass = $derived(listGroupItem({ state, active, horizontal, class: clsx(theme, className) }));
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
{#snippet nameOrChildren()}
|
|
19
20
|
{#if Icon}
|
|
20
|
-
<Icon class={
|
|
21
|
+
<Icon class={clsx(iconClass)} />
|
|
21
22
|
{/if}
|
|
22
23
|
{#if children}
|
|
23
24
|
{@render children()}
|
|
@@ -27,15 +28,15 @@
|
|
|
27
28
|
{/snippet}
|
|
28
29
|
|
|
29
30
|
{#if restProps.href === undefined && !active}
|
|
30
|
-
<li class={
|
|
31
|
+
<li class={itemClass}>
|
|
31
32
|
{@render nameOrChildren()}
|
|
32
33
|
</li>
|
|
33
34
|
{:else if restProps.href === undefined}
|
|
34
|
-
<button type="button" {...restProps} class={
|
|
35
|
+
<button type="button" {...restProps} class={itemClass} {disabled} aria-current={current}>
|
|
35
36
|
{@render nameOrChildren()}
|
|
36
37
|
</button>
|
|
37
38
|
{:else}
|
|
38
|
-
<a {...restProps} class={
|
|
39
|
+
<a {...restProps} class={itemClass} aria-current={current}>
|
|
39
40
|
{@render nameOrChildren()}
|
|
40
41
|
</a>
|
|
41
42
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type ListgroupVariants = VariantProps<typeof listGroup>;
|
|
3
4
|
export declare const listGroup: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
rounded: {
|
|
@@ -40,7 +41,7 @@ export declare const listGroup: import("tailwind-variants").TVReturnType<{
|
|
|
40
41
|
false: string;
|
|
41
42
|
};
|
|
42
43
|
}, undefined, "flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600", unknown, unknown, undefined>>;
|
|
43
|
-
export type ListGroupTheme =
|
|
44
|
+
export type ListGroupTheme = ClassValue;
|
|
44
45
|
export type ListgroupItemVariants = VariantProps<typeof listGroupItem>;
|
|
45
46
|
export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
46
47
|
state: {
|
|
@@ -85,4 +86,4 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
|
|
|
85
86
|
false: string;
|
|
86
87
|
};
|
|
87
88
|
}, undefined, "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2", unknown, unknown, undefined>>;
|
|
88
|
-
export type ListGroupItemTheme =
|
|
89
|
+
export type ListGroupItemTheme = ClassValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { megamenu, type MegaMenuTheme } from "./theme";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type MegaMenuProps, type LinkType, Popper } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, extra, items = [], full, ulClass, isOpen = $bindable(false), class: className, extraClass, ...restProps }: MegaMenuProps = $props();
|
|
@@ -15,9 +16,9 @@
|
|
|
15
16
|
const { base, div, ul, extra: extraCls } = $derived(megamenu({ full, extra: !!extra }));
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
|
-
<Popper color={full ? "default" : "dropdown"} arrow={false} bind:isOpen trigger="click" placement="bottom" yOnly={full} {...restProps} class={
|
|
19
|
-
<div class={
|
|
20
|
-
<ul class={
|
|
19
|
+
<Popper color={full ? "default" : "dropdown"} arrow={false} bind:isOpen trigger="click" placement="bottom" yOnly={full} {...restProps} class={base({ class: clsx((theme as MegaMenuTheme)?.base, className) })}>
|
|
20
|
+
<div class={div({ class: clsx((theme as MegaMenuTheme)?.div) })}>
|
|
21
|
+
<ul class={ul({ class: clsx((theme as MegaMenuTheme)?.ul, ulClass) })}>
|
|
21
22
|
{#each items as item, index}
|
|
22
23
|
<li>
|
|
23
24
|
{@render children({ item, index })}
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
{@render children({ item: items[0], index: 0 })}
|
|
27
28
|
{/each}
|
|
28
29
|
</ul>
|
|
29
|
-
{#if full && extra}<div class={
|
|
30
|
+
{#if full && extra}<div class={extraCls({ class: clsx((theme as MegaMenuTheme)?.extra, extraClass) })}>{@render extra()}</div>{/if}
|
|
30
31
|
</div>
|
|
31
32
|
</Popper>
|
|
32
33
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const megamenu: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
full: {
|
|
3
4
|
true: {
|
|
@@ -42,4 +43,4 @@ export declare const megamenu: import("tailwind-variants").TVReturnType<{
|
|
|
42
43
|
extra: string;
|
|
43
44
|
}, undefined, unknown, unknown, undefined>>;
|
|
44
45
|
export type MegaMenuSlots = keyof typeof megamenu.slots;
|
|
45
|
-
export type MegaMenuTheme = Partial<Record<MegaMenuSlots,
|
|
46
|
+
export type MegaMenuTheme = Partial<Record<MegaMenuSlots, ClassValue>>;
|
package/dist/modal/Modal.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type ModalProps, type ParamsType, CloseButton, trapFocus
|
|
2
|
+
import { type ModalProps, type ParamsType, CloseButton, trapFocus } from "..";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { sineIn } from "svelte/easing";
|
|
5
5
|
import { fade } from "svelte/transition";
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
|
|
85
85
|
{#snippet content()}
|
|
86
86
|
{#if title || header}
|
|
87
|
-
<div class={
|
|
87
|
+
<div class={headerCls({ class: clsx((theme as ModalTheme)?.header, headerClass) })}>
|
|
88
88
|
{#if title}
|
|
89
89
|
<h3>{title}</h3>
|
|
90
90
|
{#if dismissable && !permanent}
|
|
@@ -95,23 +95,23 @@
|
|
|
95
95
|
{/if}
|
|
96
96
|
</div>
|
|
97
97
|
{/if}
|
|
98
|
-
<div class={
|
|
98
|
+
<div class={body({ class: clsx((theme as ModalTheme)?.body, bodyClass) })}>
|
|
99
99
|
{@render children?.()}
|
|
100
100
|
</div>
|
|
101
101
|
{#if footer}
|
|
102
|
-
<div class={
|
|
102
|
+
<div class={footerCls({ class: clsx((theme as ModalTheme)?.footer, footerClass) })}>
|
|
103
103
|
{@render footer()}
|
|
104
104
|
</div>
|
|
105
105
|
{/if}
|
|
106
106
|
{#if dismissable && !permanent && !title}
|
|
107
|
-
<CloseButton type="submit" formnovalidate onclick={close_handler(form)} class={
|
|
107
|
+
<CloseButton type="submit" formnovalidate onclick={close_handler(form)} class={closebutton({ class: clsx((theme as ModalTheme)?.closebutton, closeBtnClass) })} />
|
|
108
108
|
{/if}
|
|
109
109
|
{/snippet}
|
|
110
110
|
|
|
111
111
|
{#if open}
|
|
112
|
-
<dialog {@attach init} use:focusTrap class={
|
|
112
|
+
<dialog {@attach init} use:focusTrap class={base({ class: clsx((theme as ModalTheme)?.base, className) })} tabindex="-1" onsubmit={_onsubmit} oncancel={_oncancel} onclick={_onclick} ontoggle={_ontoggle} transition:transition|global={paramsOptions as ParamsType} {...restProps}>
|
|
113
113
|
{#if form}
|
|
114
|
-
<form method="dialog" class={
|
|
114
|
+
<form method="dialog" class={formCls({ class: clsx((theme as ModalTheme)?.form) })}>
|
|
115
115
|
{@render content()}
|
|
116
116
|
</form>
|
|
117
117
|
{:else}
|
package/dist/modal/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 ModalVariants = VariantProps<typeof modal>;
|
|
3
4
|
export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
placement: {
|
|
@@ -164,4 +165,4 @@ export declare const modal: import("tailwind-variants").TVReturnType<{
|
|
|
164
165
|
closebutton: string;
|
|
165
166
|
}, undefined, unknown, unknown, undefined>>;
|
|
166
167
|
export type ModalSlots = keyof typeof modal.slots;
|
|
167
|
-
export type ModalTheme = Partial<Record<ModalSlots,
|
|
168
|
+
export type ModalTheme = Partial<Record<ModalSlots, ClassValue>>;
|
package/dist/navbar/Menu.svelte
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type { MenuProps } from "../types";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { getTheme } from "../theme/themeUtils";
|
|
5
|
-
import { cn } from "..";
|
|
6
5
|
|
|
7
6
|
let { size = "24", color = "currentColor", variation = "outline", ariaLabel = "bars 3", class: className, ...restProps }: MenuProps = $props();
|
|
8
7
|
|
|
@@ -29,7 +28,7 @@
|
|
|
29
28
|
});
|
|
30
29
|
</script>
|
|
31
30
|
|
|
32
|
-
<svg xmlns="http://www.w3.org/2000/svg" role="button" tabindex="0" width={size} height={size} class={
|
|
31
|
+
<svg xmlns="http://www.w3.org/2000/svg" role="button" tabindex="0" width={size} height={size} class={clsx(theme, className)} {...restProps} aria-label={ariaLabel} fill="none" {viewBox} stroke-width="2">
|
|
33
32
|
{@html svgpath}
|
|
34
33
|
</svg>
|
|
35
34
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { cn } from "..";
|
|
4
3
|
import { navbarBrand } from "./theme";
|
|
5
4
|
import type { NavBrandProps } from "../types";
|
|
6
5
|
import { getTheme } from "../theme/themeUtils";
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
const theme = getTheme("navBrand");
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
|
-
<a {...restProps} class={
|
|
12
|
+
<a {...restProps} class={navbarBrand({ class: clsx(theme, className) })}>
|
|
14
13
|
{@render children?.()}
|
|
15
14
|
</a>
|
|
16
15
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { navbarContainer } from "./theme";
|
|
5
4
|
import type { NavContainerProps } from "../types";
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
const theme = getTheme("navContainer");
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
|
-
<div {...restProps} class={
|
|
12
|
+
<div {...restProps} class={navbarContainer({ fluid, class: clsx(theme, clasName) })}>
|
|
14
13
|
{@render children?.()}
|
|
15
14
|
</div>
|
|
16
15
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { getContext } from "svelte";
|
|
5
4
|
import ToolbarButton from "../toolbar/ToolbarButton.svelte";
|
|
@@ -21,8 +20,8 @@
|
|
|
21
20
|
};
|
|
22
21
|
</script>
|
|
23
22
|
|
|
24
|
-
<ToolbarButton {name} onclick={onclick || toggle} {...restProps} class={
|
|
25
|
-
<Menu class={
|
|
23
|
+
<ToolbarButton {name} onclick={onclick || toggle} {...restProps} class={base({ class: clsx((theme as NavbarHamburgerTheme)?.base, className) })}>
|
|
24
|
+
<Menu class={menu({ class: clsx((theme as NavbarHamburgerTheme)?.menu, menuClass) })} />
|
|
26
25
|
</ToolbarButton>
|
|
27
26
|
|
|
28
27
|
<!--
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
1
|
/**
|
|
3
2
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
4
3
|
* ## Type
|
|
@@ -17,7 +16,7 @@ declare const NavHamburger: import("svelte").Component<import("../toolbar/theme"
|
|
|
17
16
|
name?: string;
|
|
18
17
|
} & {
|
|
19
18
|
href?: undefined;
|
|
20
|
-
menuClass?:
|
|
19
|
+
menuClass?: import("svelte/elements").ClassValue;
|
|
21
20
|
}, {}, "">;
|
|
22
21
|
type NavHamburger = ReturnType<typeof NavHamburger>;
|
|
23
22
|
export default NavHamburger;
|
package/dist/navbar/NavLi.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { getContext } from "svelte";
|
|
5
4
|
import { navbarLi } from "./theme";
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
});
|
|
21
20
|
|
|
22
21
|
let active = $derived(navUrl ? restProps.href === navUrl : false);
|
|
23
|
-
let liClass = $derived(
|
|
22
|
+
let liClass = $derived(navbarLi({ hidden: navState.hidden, class: clsx(active ? (activeClass ?? navState.activeClass) : (nonActiveClass ?? navState.nonActiveClass), theme, className) }));
|
|
24
23
|
</script>
|
|
25
24
|
|
|
26
25
|
<li>
|
package/dist/navbar/NavUl.svelte
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { prefersReducedMotion } from "svelte/motion";
|
|
5
5
|
import { writable } from "svelte/store";
|
|
6
6
|
import { slide, fly, fade, scale } from "svelte/transition";
|
|
7
|
-
import { cn } from "..";
|
|
8
7
|
import clsx from "clsx";
|
|
9
8
|
import { navbarUl, type NavbarUlTheme } from "./theme";
|
|
10
9
|
import type { NavbarState, NavUlProps } from "../types";
|
|
@@ -44,8 +43,8 @@
|
|
|
44
43
|
let { base, ul, active, nonActive } = $derived(navbarUl({ hidden }));
|
|
45
44
|
|
|
46
45
|
$effect(() => {
|
|
47
|
-
navState.activeClass =
|
|
48
|
-
navState.nonActiveClass =
|
|
46
|
+
navState.activeClass = active({ class: clsx((theme as NavbarUlTheme)?.active, activeClass) });
|
|
47
|
+
navState.nonActiveClass = nonActive({ class: clsx((theme as NavbarUlTheme)?.nonActive, nonActiveClass) });
|
|
49
48
|
});
|
|
50
49
|
|
|
51
50
|
$effect(() => {
|
|
@@ -53,8 +52,8 @@
|
|
|
53
52
|
});
|
|
54
53
|
setContext("activeUrl", activeUrlStore);
|
|
55
54
|
|
|
56
|
-
let divCls: string = $derived(
|
|
57
|
-
let ulCls: string = $derived(
|
|
55
|
+
let divCls: string = $derived(base({ class: clsx((theme as NavbarUlTheme)?.base, clasName) }));
|
|
56
|
+
let ulCls: string = $derived(ul({ class: clsx((theme as NavbarUlTheme)?.ul, ulClass) }));
|
|
58
57
|
</script>
|
|
59
58
|
|
|
60
59
|
{#if !hidden}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { setContext } from "svelte";
|
|
4
|
-
import { NavContainer
|
|
4
|
+
import { NavContainer } from "..";
|
|
5
5
|
import { navbar } from "./theme";
|
|
6
6
|
import type { NavbarState, NavbarProps } from "../types";
|
|
7
7
|
import { getTheme } from "../theme/themeUtils";
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<svelte:document onclick={handleDocumentClick} />
|
|
35
35
|
|
|
36
36
|
<nav bind:this={navbarElement}>
|
|
37
|
-
<div {...restProps} class={
|
|
37
|
+
<div {...restProps} class={navbar({ class: clsx(theme, className) })}>
|
|
38
38
|
<NavContainer {fluid} class={clsx(navContainerClass)}>
|
|
39
39
|
{@render children({ hidden: navState.hidden, toggle, NavContainer })}
|
|
40
40
|
</NavContainer>
|
package/dist/navbar/theme.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const navbar: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "relative w-full px-2 py-2.5 sm:px-4", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "relative w-full px-2 py-2.5 sm:px-4", unknown, unknown, undefined>>;
|
|
2
|
-
export type NavbarTheme =
|
|
3
|
+
export type NavbarTheme = ClassValue;
|
|
3
4
|
export declare const navbarBrand: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "flex items-center", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "flex items-center", unknown, unknown, undefined>>;
|
|
4
|
-
export type NavbarBrandTheme =
|
|
5
|
+
export type NavbarBrandTheme = ClassValue;
|
|
5
6
|
export declare const navbarContainer: import("tailwind-variants").TVReturnType<{
|
|
6
7
|
fluid: {
|
|
7
8
|
true: string;
|
|
@@ -65,7 +66,7 @@ export declare const navbarUl: import("tailwind-variants").TVReturnType<{
|
|
|
65
66
|
nonActive: string;
|
|
66
67
|
}, undefined, unknown, unknown, undefined>>;
|
|
67
68
|
export type NavbarUlSlots = keyof typeof navbarUl.slots;
|
|
68
|
-
export type NavbarUlTheme = Partial<Record<NavbarUlSlots,
|
|
69
|
+
export type NavbarUlTheme = Partial<Record<NavbarUlSlots, ClassValue>>;
|
|
69
70
|
export declare const navbarLi: import("tailwind-variants").TVReturnType<{
|
|
70
71
|
hidden: {
|
|
71
72
|
false: string;
|
|
@@ -79,7 +80,7 @@ export declare const navbarLi: import("tailwind-variants").TVReturnType<{
|
|
|
79
80
|
false: string;
|
|
80
81
|
};
|
|
81
82
|
}, undefined, "block py-2 pe-4 ps-3 md:p-2 rounded-sm md:border-0", unknown, unknown, undefined>>;
|
|
82
|
-
export type NavbarLiTheme =
|
|
83
|
+
export type NavbarLiTheme = ClassValue;
|
|
83
84
|
export declare const navbarHamburger: import("tailwind-variants").TVReturnType<{
|
|
84
85
|
[key: string]: {
|
|
85
86
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -112,4 +113,4 @@ export declare const navbarHamburger: import("tailwind-variants").TVReturnType<{
|
|
|
112
113
|
menu: string;
|
|
113
114
|
}, undefined, unknown, unknown, undefined>>;
|
|
114
115
|
export type NavbarHamburgerSlots = keyof typeof navbarHamburger.slots;
|
|
115
|
-
export type NavbarHamburgerTheme = Partial<Record<NavbarHamburgerSlots,
|
|
116
|
+
export type NavbarHamburgerTheme = Partial<Record<NavbarHamburgerSlots, ClassValue>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { pagination, PaginationItem } from ".";
|
|
4
4
|
import type { PaginationProps } from "../types";
|
|
5
5
|
import { getTheme } from "../theme/themeUtils";
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
7
|
|
|
8
8
|
let { pages = [], previous, next, prevContent, nextContent, table, size, ariaLabel, ...restProps }: PaginationProps = $props();
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
setContext("table", table);
|
|
14
14
|
setContext("size", size);
|
|
15
15
|
|
|
16
|
-
const paginationCls = $derived(
|
|
16
|
+
const paginationCls = $derived(pagination({ table, size, class: clsx(theme) }));
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<nav aria-label={ariaLabel}>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { paginationButton } from ".";
|
|
5
4
|
import type { PaginationButtonProps } from "../types";
|
|
@@ -14,16 +13,14 @@
|
|
|
14
13
|
const table = getContext<boolean>("table");
|
|
15
14
|
|
|
16
15
|
const paginationCls = $derived(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
theme
|
|
26
|
-
)
|
|
16
|
+
paginationButton({
|
|
17
|
+
size: getContext("size") ?? size,
|
|
18
|
+
active,
|
|
19
|
+
group,
|
|
20
|
+
table,
|
|
21
|
+
disabled,
|
|
22
|
+
class: clsx(theme, className)
|
|
23
|
+
})
|
|
27
24
|
);
|
|
28
25
|
|
|
29
26
|
function handleClick(e: MouseEvent) {
|
|
@@ -36,13 +33,13 @@
|
|
|
36
33
|
</script>
|
|
37
34
|
|
|
38
35
|
{#if href}
|
|
39
|
-
<a {href} {...restProps} class={
|
|
36
|
+
<a {href} {...restProps} class={paginationCls} onclick={handleClick}>
|
|
40
37
|
{#if children}
|
|
41
38
|
{@render children()}
|
|
42
39
|
{/if}
|
|
43
40
|
</a>
|
|
44
41
|
{:else}
|
|
45
|
-
<button {...restProps} {disabled} class={
|
|
42
|
+
<button {...restProps} {disabled} class={paginationCls} onclick={handleClick}>
|
|
46
43
|
{#if children}
|
|
47
44
|
{@render children()}
|
|
48
45
|
{/if}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from "..";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { paginationItem, type PaginationItemTheme } from ".";
|
|
5
4
|
import type { PaginationItemProps } from "../types";
|
|
@@ -12,7 +11,7 @@
|
|
|
12
11
|
|
|
13
12
|
const group = getContext<boolean>("group");
|
|
14
13
|
const table = getContext<boolean>("table");
|
|
15
|
-
const paginationCls = $derived(
|
|
14
|
+
const paginationCls = $derived(paginationItem({ size: getContext("size") ?? size, active, group, table, class: clsx(theme, className) }));
|
|
16
15
|
</script>
|
|
17
16
|
|
|
18
17
|
{#if href}
|