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 { footerBrand, type FooterBrandTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterBrandProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, aClass, spanClass, imgClass, href, src, alt, name, ...restProps }: FooterBrandProps = $props();
|
|
@@ -11,19 +12,19 @@
|
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
{#if href}
|
|
14
|
-
<a {...restProps} {href} class={
|
|
15
|
+
<a {...restProps} {href} class={base({ class: clsx((theme as FooterBrandTheme)?.base, aClass) })}>
|
|
15
16
|
{#if src}
|
|
16
|
-
<img {src} class={
|
|
17
|
+
<img {src} class={img({ class: clsx((theme as FooterBrandTheme)?.img, imgClass) })} {alt} />
|
|
17
18
|
{/if}
|
|
18
19
|
{#if name}
|
|
19
|
-
<span class={
|
|
20
|
+
<span class={span({ class: clsx((theme as FooterBrandTheme)?.span, spanClass) })}>{name}</span>
|
|
20
21
|
{/if}
|
|
21
22
|
{#if children}
|
|
22
23
|
{@render children()}
|
|
23
24
|
{/if}
|
|
24
25
|
</a>
|
|
25
26
|
{:else}
|
|
26
|
-
<img {src} class={
|
|
27
|
+
<img {src} class={img({ class: clsx(imgClass) })} {alt} />
|
|
27
28
|
{/if}
|
|
28
29
|
|
|
29
30
|
<!--
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { footerCopyright, type FooterCopyrightTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterCopyrightProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { spanClass, aClass, href, by, copyrightMessage = "All Rights Reserved.", year, bySpanClass, ...restProps }: FooterCopyrightProps = $props();
|
|
@@ -12,14 +13,14 @@
|
|
|
12
13
|
const { base, link, bySpan } = footerCopyright();
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
|
-
<span class={
|
|
16
|
+
<span class={base({ class: clsx((theme as FooterCopyrightTheme)?.base, spanClass) })}>
|
|
16
17
|
© {year}
|
|
17
18
|
{#if href}
|
|
18
|
-
<a {...restProps} {href} class={
|
|
19
|
+
<a {...restProps} {href} class={link({ class: clsx((theme as FooterCopyrightTheme)?.link, aClass) })}>
|
|
19
20
|
{by}
|
|
20
21
|
</a>
|
|
21
22
|
{:else}
|
|
22
|
-
<span class={
|
|
23
|
+
<span class={bySpan({ class: clsx((theme as FooterCopyrightTheme)?.bySpan, bySpanClass) })}>{by}</span>
|
|
23
24
|
{/if}
|
|
24
25
|
{copyrightMessage}
|
|
25
26
|
</span>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { footerIcon } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterIconProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, href, ariaLabel, class: className, ...restProps }: FooterIconProps = $props();
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
{#if href}
|
|
12
|
-
<a {...restProps} {href} aria-label={ariaLabel} class={
|
|
13
|
+
<a {...restProps} {href} aria-label={ariaLabel} class={footerIcon({ class: clsx(theme, className) })}>
|
|
13
14
|
{@render children()}
|
|
14
15
|
</a>
|
|
15
16
|
{:else}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { footerLink, type FooterLinkTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterLinkProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, liClass, aClass, href, ...restProps }: FooterLinkProps = $props();
|
|
@@ -10,8 +11,8 @@
|
|
|
10
11
|
const { base, link } = footerLink();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<li class={
|
|
14
|
-
<a {...restProps} {href} class={
|
|
14
|
+
<li class={base({ class: clsx((theme as FooterLinkTheme)?.base, liClass) })}>
|
|
15
|
+
<a {...restProps} {href} class={link({ class: clsx((theme as FooterLinkTheme)?.link, aClass) })}>
|
|
15
16
|
{@render children()}
|
|
16
17
|
</a>
|
|
17
18
|
</li>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { footerLinkGroup } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type FooterLinkGroupProps } from "..";
|
|
4
5
|
import { getTheme } from "../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { class: className, children, ...restProps }: FooterLinkGroupProps = $props();
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
const theme = getTheme("footerLinkGroup");
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<ul {...restProps} class={
|
|
12
|
+
<ul {...restProps} class={footerLinkGroup({ class: clsx(theme, className) })}>
|
|
12
13
|
{@render children()}
|
|
13
14
|
</ul>
|
|
14
15
|
|
package/dist/footer/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const footer: import("tailwind-variants").TVReturnType<{
|
|
2
3
|
footerType: {
|
|
3
4
|
default: string;
|
|
@@ -23,7 +24,7 @@ export declare const footer: import("tailwind-variants").TVReturnType<{
|
|
|
23
24
|
sticky: string;
|
|
24
25
|
};
|
|
25
26
|
}, undefined, "bg-white dark:bg-gray-800", unknown, unknown, undefined>>;
|
|
26
|
-
export type FooterTheme =
|
|
27
|
+
export type FooterTheme = ClassValue;
|
|
27
28
|
export declare const footerBrand: import("tailwind-variants").TVReturnType<{
|
|
28
29
|
[key: string]: {
|
|
29
30
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -62,7 +63,7 @@ export declare const footerBrand: import("tailwind-variants").TVReturnType<{
|
|
|
62
63
|
img: string;
|
|
63
64
|
}, undefined, unknown, unknown, undefined>>;
|
|
64
65
|
export type FooterBrandSlots = keyof typeof footerBrand.slots;
|
|
65
|
-
export type FooterBrandTheme = Partial<Record<FooterBrandSlots,
|
|
66
|
+
export type FooterBrandTheme = Partial<Record<FooterBrandSlots, ClassValue>>;
|
|
66
67
|
export declare const footerCopyright: import("tailwind-variants").TVReturnType<{
|
|
67
68
|
[key: string]: {
|
|
68
69
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -101,11 +102,11 @@ export declare const footerCopyright: import("tailwind-variants").TVReturnType<{
|
|
|
101
102
|
bySpan: string;
|
|
102
103
|
}, undefined, unknown, unknown, undefined>>;
|
|
103
104
|
export type FooterCopyrightSlots = keyof typeof footerCopyright.slots;
|
|
104
|
-
export type FooterCopyrightTheme = Partial<Record<FooterCopyrightSlots,
|
|
105
|
+
export type FooterCopyrightTheme = Partial<Record<FooterCopyrightSlots, ClassValue>>;
|
|
105
106
|
export declare const footerIcon: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "text-gray-500 hover:text-gray-900 dark:hover:text-white", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "text-gray-500 hover:text-gray-900 dark:hover:text-white", unknown, unknown, undefined>>;
|
|
106
|
-
export type FooterIconTheme =
|
|
107
|
+
export type FooterIconTheme = ClassValue;
|
|
107
108
|
export declare const footerLinkGroup: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "text-gray-600 dark:text-gray-400", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "text-gray-600 dark:text-gray-400", unknown, unknown, undefined>>;
|
|
108
|
-
export type FooterLinkGroupTheme =
|
|
109
|
+
export type FooterLinkGroupTheme = ClassValue;
|
|
109
110
|
export declare const footerLink: import("tailwind-variants").TVReturnType<{
|
|
110
111
|
[key: string]: {
|
|
111
112
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
@@ -138,4 +139,4 @@ export declare const footerLink: import("tailwind-variants").TVReturnType<{
|
|
|
138
139
|
link: string;
|
|
139
140
|
}, undefined, unknown, unknown, undefined>>;
|
|
140
141
|
export type FooterLinkSlots = keyof typeof footerLink.slots;
|
|
141
|
-
export type FooterLinkTheme = Partial<Record<FooterLinkSlots,
|
|
142
|
+
export type FooterLinkTheme = Partial<Record<FooterLinkSlots, ClassValue>>;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import CheckIcon from "./CheckIcon.svelte";
|
|
4
4
|
import { buttonToggle, type ButtonToggleTheme } from ".";
|
|
5
5
|
import type { ButtonToggleVariants } from "./theme";
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { type ButtonToggleProps, type ButtonToggleContext } from "../..";
|
|
7
8
|
import { getTheme } from "../../theme/themeUtils";
|
|
8
9
|
|
|
9
10
|
let { value, selected = false, children, iconSlot, color, class: className, iconClass, txtClass, contentClass, ...restProps }: ButtonToggleProps = $props();
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
const size = getContext<ButtonToggleVariants["size"]>("buttonToggleSize");
|
|
17
18
|
const roundedSize = getContext<ButtonToggleVariants["roundedSize"]>("buttonToggleRounded");
|
|
18
19
|
const ctxIconClass = getContext<string | undefined>("ctxIconClass");
|
|
19
|
-
const actualIconClass = ctxIconClass ||
|
|
20
|
+
const actualIconClass = ctxIconClass || clsx(iconClass);
|
|
20
21
|
const ctxBtnClass = getContext<string | undefined>("ctxBtnClass");
|
|
21
22
|
|
|
22
23
|
function handleClick() {
|
|
@@ -28,16 +29,16 @@
|
|
|
28
29
|
});
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
|
-
<button type="button" class={
|
|
32
|
-
<div class={
|
|
32
|
+
<button type="button" class={buttonToggle.button({ selected, color: actualColor, size, roundedSize, class: clsx((theme as ButtonToggleTheme)?.button, ctxBtnClass, className) })} data-selected={selected} onclick={handleClick} role={multiSelect ? "checkbox" : "radio"} aria-checked={selected} {...restProps}>
|
|
33
|
+
<div class={buttonToggle.content({ class: clsx((theme as ButtonToggleTheme)?.content, contentClass) })}>
|
|
33
34
|
{#if selected}
|
|
34
35
|
{#if iconSlot}
|
|
35
36
|
{@render iconSlot()}
|
|
36
37
|
{:else}
|
|
37
|
-
<CheckIcon class={
|
|
38
|
+
<CheckIcon class={clsx("absolute left-0 flex-shrink-0 text-green-600", actualIconClass)} />
|
|
38
39
|
{/if}
|
|
39
40
|
{/if}
|
|
40
|
-
<span class={
|
|
41
|
+
<span class={buttonToggle.text({ selected, class: clsx((theme as ButtonToggleTheme)?.text, txtClass) })}>
|
|
41
42
|
{@render children()}
|
|
42
43
|
</span>
|
|
43
44
|
</div>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { setContext } from "svelte";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type ButtonToggleGroupProps, buttonToggleGroup } from "../..";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { multiSelect = false, name = "toggle-group", value = multiSelect ? [] : null, color, size = "md", roundedSize = "md", onSelect = (val: any) => {}, children, ctxIconClass, ctxBtnClass, class: className, ...restProps }: ButtonToggleGroupProps = $props();
|
|
7
8
|
|
|
8
9
|
const theme = getTheme("buttonToggleGroup");
|
|
9
10
|
|
|
10
|
-
const base = $derived(buttonToggleGroup({ roundedSize }));
|
|
11
|
+
const base = $derived(buttonToggleGroup({ roundedSize, class: clsx(theme, className) }));
|
|
11
12
|
type SelectedValue = string | null | string[];
|
|
12
13
|
|
|
13
14
|
let selectedValues = $state<SelectedValue>(multiSelect ? [] : null);
|
|
@@ -59,12 +60,12 @@
|
|
|
59
60
|
setContext("buttonToggleColor", color);
|
|
60
61
|
setContext("buttonToggleSize", size);
|
|
61
62
|
setContext("buttonToggleRounded", roundedSize);
|
|
62
|
-
setContext("ctxIconClass",
|
|
63
|
-
setContext("ctxBtnClass",
|
|
63
|
+
setContext("ctxIconClass", clsx(ctxIconClass));
|
|
64
|
+
setContext("ctxBtnClass", clsx(ctxBtnClass));
|
|
64
65
|
</script>
|
|
65
66
|
|
|
66
67
|
<div class="inline">
|
|
67
|
-
<div class={
|
|
68
|
+
<div class={base} role={multiSelect ? "group" : "radiogroup"} aria-label={name} {...restProps}>
|
|
68
69
|
{@render children()}
|
|
69
70
|
</div>
|
|
70
71
|
</div>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type CheckIconProps
|
|
2
|
+
import { type CheckIconProps } from "../..";
|
|
3
|
+
import clsx from "clsx";
|
|
3
4
|
let { class: className, ...restProps }: CheckIconProps = $props();
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class={clsx(className)} {...restProps}>
|
|
7
8
|
<polyline points="20 6 9 17 4 12"></polyline>
|
|
8
9
|
</svg>
|
|
9
10
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export declare const buttonToggleGroup: import("tailwind-variants").TVReturnType<{
|
|
3
4
|
roundedSize: {
|
|
4
5
|
sm: string;
|
|
@@ -24,7 +25,7 @@ export declare const buttonToggleGroup: import("tailwind-variants").TVReturnType
|
|
|
24
25
|
full: string;
|
|
25
26
|
};
|
|
26
27
|
}, undefined, "inline-flex border border-gray-300 overflow-hidden", unknown, unknown, undefined>>;
|
|
27
|
-
export type ButtonToggleGroupTheme =
|
|
28
|
+
export type ButtonToggleGroupTheme = ClassValue;
|
|
28
29
|
export declare const buttonToggle: {
|
|
29
30
|
button: import("tailwind-variants").TVReturnType<{
|
|
30
31
|
selected: {
|
|
@@ -169,9 +170,9 @@ export declare const buttonToggle: {
|
|
|
169
170
|
}, undefined, "transition-all duration-200 ml-0", unknown, unknown, undefined>>;
|
|
170
171
|
};
|
|
171
172
|
export type ButtonToggleTheme = {
|
|
172
|
-
button?:
|
|
173
|
-
content?:
|
|
174
|
-
text?:
|
|
173
|
+
button?: ClassValue;
|
|
174
|
+
content?: ClassValue;
|
|
175
|
+
text?: ClassValue;
|
|
175
176
|
};
|
|
176
177
|
export type ButtonToggleVariants = VariantProps<typeof buttonToggle.button>;
|
|
177
178
|
export type ButtonToggleContentVariants = VariantProps<typeof buttonToggle.content>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { checkbox, type CheckboxTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type CheckboxProps, type CheckboxItem, Label } from "../..";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, color = "primary", custom, inline, tinted, rounded, group = $bindable([]), choices = [], checked = $bindable(false), indeterminate, class: className, divClass, disabled = false, value, labelProps = {}, ...restProps }: CheckboxProps = $props();
|
|
@@ -23,17 +24,17 @@
|
|
|
23
24
|
|
|
24
25
|
{#if choices.length > 0}
|
|
25
26
|
{#each choices as choice, i}
|
|
26
|
-
<div class={
|
|
27
|
+
<div class={divStyle({ class: clsx((theme as CheckboxTheme)?.div, divClass) })}>
|
|
27
28
|
<Label show={true} {...labelProps}>
|
|
28
|
-
<input type="checkbox" value={choice.value} checked={choice.checked ?? false} {disabled} bind:group {...restProps} class={
|
|
29
|
+
<input type="checkbox" value={choice.value} checked={choice.checked ?? false} {disabled} bind:group {...restProps} class={base({ class: clsx((theme as CheckboxTheme)?.base, className) })} />
|
|
29
30
|
{renderLabel(choice)}
|
|
30
31
|
</Label>
|
|
31
32
|
</div>
|
|
32
33
|
{/each}
|
|
33
34
|
{:else}
|
|
34
|
-
<div class={
|
|
35
|
+
<div class={divStyle({ class: clsx((theme as CheckboxTheme)?.div, divClass) })}>
|
|
35
36
|
<Label show={true} {...labelProps}>
|
|
36
|
-
<input type="checkbox" {value} bind:checked {indeterminate} {disabled} {...restProps} class={
|
|
37
|
+
<input type="checkbox" {value} bind:checked {indeterminate} {disabled} {...restProps} class={base({ class: clsx((theme as CheckboxTheme)?.base, className) })} />
|
|
37
38
|
{#if children}
|
|
38
39
|
{@render children({ value, checked, disabled })}
|
|
39
40
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Button from "../../buttons/Button.svelte";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type CheckboxButtonProps } from "../..";
|
|
4
5
|
import { checkboxbutton } from "./theme";
|
|
5
6
|
import { getTheme } from "../../theme/themeUtils";
|
|
6
7
|
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
let buttonClass: string = $derived(
|
|
49
|
+
let buttonClass: string = $derived(checkboxbutton({ inline, checked, class: clsx(theme, className) }));
|
|
49
50
|
</script>
|
|
50
51
|
|
|
51
52
|
<Button tag="label" {checked} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type CheckboxVariants = VariantProps<typeof checkbox>;
|
|
3
4
|
export declare const checkbox: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -290,7 +291,7 @@ export declare const checkbox: import("tailwind-variants").TVReturnType<{
|
|
|
290
291
|
div: string;
|
|
291
292
|
}, undefined, unknown, unknown, undefined>>;
|
|
292
293
|
export type CheckboxSlots = keyof typeof checkbox.slots;
|
|
293
|
-
export type CheckboxTheme = Partial<Record<CheckboxSlots,
|
|
294
|
+
export type CheckboxTheme = Partial<Record<CheckboxSlots, ClassValue>>;
|
|
294
295
|
export declare const checkboxbutton: import("tailwind-variants").TVReturnType<{
|
|
295
296
|
inline: {
|
|
296
297
|
true: string;
|
|
@@ -316,4 +317,4 @@ export declare const checkboxbutton: import("tailwind-variants").TVReturnType<{
|
|
|
316
317
|
true: string;
|
|
317
318
|
};
|
|
318
319
|
}, undefined, "", unknown, unknown, undefined>>;
|
|
319
|
-
export type CheckboxButtonTheme =
|
|
320
|
+
export type CheckboxButtonTheme = ClassValue;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { DragEventHandler, ChangeEventHandler } from "svelte/elements";
|
|
3
3
|
import { dropzone } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type DropzoneProps } from "../..";
|
|
5
6
|
import { getTheme } from "../../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
type HTMLInputElementWithFiles = HTMLInputElement & { files: FileList | null };
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
};
|
|
53
54
|
</script>
|
|
54
55
|
|
|
55
|
-
<button class={
|
|
56
|
+
<button class={dropzone({ class: clsx(theme, className) })} onkeydown={keydown} onclick={onClick} ondrop={onDrop} ondragover={onDragOver} type="button">
|
|
56
57
|
{@render children()}
|
|
57
58
|
</button>
|
|
58
59
|
<label class="hidden">
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
2
|
export declare const dropzone: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "flex flex-col justify-center items-center w-full h-64 bg-gray-50 rounded-lg border-2 border-gray-300 border-dashed cursor-pointer dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "flex flex-col justify-center items-center w-full h-64 bg-gray-50 rounded-lg border-2 border-gray-300 border-dashed cursor-pointer dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600", unknown, unknown, undefined>>;
|
|
2
|
-
export type DropzoneTheme =
|
|
3
|
+
export type DropzoneTheme = ClassValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { fileupload, type FileuploadTheme } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { CloseButton, type FileuploadProps } from "../..";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { files = $bindable(), size = "md", clearable = false, elementRef = $bindable(), class: className, clearableSvgClass, clearableColor = "none", clearableClass, clearableOnClick, wrapperClass, ...restProps }: FileuploadProps = $props();
|
|
@@ -18,10 +19,10 @@
|
|
|
18
19
|
};
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
|
-
<div class={
|
|
22
|
-
<input type="file" bind:files bind:this={elementRef} {...restProps} class={
|
|
22
|
+
<div class={wrapper({ class: clsx((theme as FileuploadTheme)?.wrapper, wrapperClass) })}>
|
|
23
|
+
<input type="file" bind:files bind:this={elementRef} {...restProps} class={base({ size, class: clsx((theme as FileuploadTheme)?.base, className) })} />
|
|
23
24
|
{#if files && files.length > 0 && clearable}
|
|
24
|
-
<CloseButton onclick={clearAll} class={
|
|
25
|
+
<CloseButton onclick={clearAll} class={right({ class: clsx((theme as FileuploadTheme)?.right, clearableClass) })} color={clearableColor} aria-label="Clear selected files" svgClass={clsx(clearableSvgClass)} />
|
|
25
26
|
{/if}
|
|
26
27
|
</div>
|
|
27
28
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type FileuploadViariants = VariantProps<typeof fileupload>;
|
|
3
4
|
export declare const fileupload: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
size: {
|
|
@@ -50,4 +51,4 @@ export declare const fileupload: import("tailwind-variants").TVReturnType<{
|
|
|
50
51
|
right: string;
|
|
51
52
|
}, undefined, unknown, unknown, undefined>>;
|
|
52
53
|
export type FileuploadSlots = keyof typeof fileupload.slots;
|
|
53
|
-
export type FileuploadTheme = Partial<Record<FileuploadSlots,
|
|
54
|
+
export type FileuploadTheme = Partial<Record<FileuploadSlots, ClassValue>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { idGenerator } from "../../utils";
|
|
3
3
|
import { floatingLabelInput, type FloatingLabelInputTheme } from ".";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type FloatingLabelInputProps, CloseButton } from "../..";
|
|
5
6
|
import { getTheme } from "../../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, id = idGenerator(), value = $bindable(), elementRef = $bindable(), "aria-describedby": ariaDescribedby, variant = "standard", size = "default", color = "default", class: className, inputClass, labelClass, clearable, clearableSvgClass, clearableColor = "none", clearableClass, clearableOnClick, data = [], maxSuggestions = 5, onSelect, comboClass, ...restProps }: FloatingLabelInputProps = $props();
|
|
@@ -136,17 +137,17 @@
|
|
|
136
137
|
<div tabindex="-1" bind:this={dummyFocusDiv} class="sr-only"></div>
|
|
137
138
|
{/if}
|
|
138
139
|
|
|
139
|
-
<div class={
|
|
140
|
-
<input {id} placeholder=" " bind:value bind:this={elementRef} {...restProps} aria-describedby={ariaDescribedby} class={
|
|
140
|
+
<div class={base({ class: clsx(isCombobox ? "relative" : "", (theme as FloatingLabelInputTheme)?.base, className) })}>
|
|
141
|
+
<input {id} placeholder=" " bind:value bind:this={elementRef} {...restProps} aria-describedby={ariaDescribedby} class={input({ class: clsx((theme as FloatingLabelInputTheme)?.input, inputClass) })} oninput={handleInput} onfocus={handleFocus} onblur={handleBlur} onkeydown={handleKeydown} />
|
|
141
142
|
{#if value !== undefined && value !== "" && clearable}
|
|
142
|
-
<CloseButton onclick={clearAll} class={
|
|
143
|
+
<CloseButton onclick={clearAll} class={closebutton({ class: clsx((theme as FloatingLabelInputTheme)?.closebutton, clearableClass) })} color={clearableColor} aria-label="Clear search value" svgClass={clsx(clearableSvgClass)} />
|
|
143
144
|
{/if}
|
|
144
|
-
<label for={id} class={
|
|
145
|
+
<label for={id} class={label({ class: clsx((theme as FloatingLabelInputTheme)?.label, labelClass) })}>
|
|
145
146
|
{@render children()}
|
|
146
147
|
</label>
|
|
147
148
|
|
|
148
149
|
{#if isCombobox && isFocused && filteredSuggestions.length > 0}
|
|
149
|
-
<div class={
|
|
150
|
+
<div class={combo({ class: clsx((theme as FloatingLabelInputTheme)?.combo, comboClass) })}>
|
|
150
151
|
{#each filteredSuggestions as item, i}
|
|
151
152
|
<button type="button" class="w-full px-3 py-2 text-left {i === selectedIndex ? 'bg-gray-100 dark:bg-gray-700' : 'hover:bg-gray-50 dark:hover:bg-gray-700'} focus:outline-none" onclick={() => selectItem(item)} onmouseenter={() => (selectedIndex = i)}>
|
|
152
153
|
{item}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type FloatingLabelInputVaratiants = VariantProps<typeof floatingLabelInput>;
|
|
3
4
|
export declare const floatingLabelInput: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
variant: {
|
|
@@ -344,4 +345,4 @@ export declare const floatingLabelInput: import("tailwind-variants").TVReturnTyp
|
|
|
344
345
|
combo: string;
|
|
345
346
|
}, undefined, unknown, unknown, undefined>>;
|
|
346
347
|
export type FloatingLabelInputSlots = keyof typeof floatingLabelInput.slots;
|
|
347
|
-
export type FloatingLabelInputTheme = Partial<Record<FloatingLabelInputSlots,
|
|
348
|
+
export type FloatingLabelInputTheme = Partial<Record<FloatingLabelInputSlots, ClassValue>>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { helper } from ".";
|
|
3
|
-
import { type HelperProps
|
|
3
|
+
import { type HelperProps } from "../..";
|
|
4
|
+
import clsx from "clsx";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, class: className, color = "gray", ...restProps }: HelperProps = $props();
|
|
7
8
|
|
|
8
9
|
const theme = getTheme("helper");
|
|
9
10
|
|
|
10
|
-
const base = $derived(
|
|
11
|
+
const base = $derived(helper({ color, class: clsx(theme, className) }));
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<p {...restProps} class={base}>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type HelperVariants = VariantProps<typeof helper>;
|
|
3
4
|
export declare const helper: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
color: {
|
|
@@ -73,4 +74,4 @@ export declare const helper: import("tailwind-variants").TVReturnType<{
|
|
|
73
74
|
rose: string;
|
|
74
75
|
};
|
|
75
76
|
}, undefined, "text-xs font-normal text-gray-500 dark:text-gray-300", unknown, unknown, undefined>>;
|
|
76
|
-
export type HelperTheme =
|
|
77
|
+
export type HelperTheme = ClassValue;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SizeType } from "../../types";
|
|
3
3
|
import { getContext } from "svelte";
|
|
4
|
-
import
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { type InputAddonProps, clampSize } from "../..";
|
|
5
6
|
import { getTheme } from "../../theme/themeUtils";
|
|
6
7
|
|
|
7
8
|
let { children, class: className, size, ...restProps }: InputAddonProps = $props();
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
// size: explicit, inherited, default
|
|
33
34
|
let _size = size || clampSize(group?.size) || "md";
|
|
34
35
|
|
|
35
|
-
let divClass: string =
|
|
36
|
+
let divClass: string = clsx(textSizes[_size], prefixPadding[_size], "text-gray-500 bg-gray-200", background ? darkBgClasses.tinted : darkBgClasses.base, background ? divider.tinted : divider.base, background ? borderClasses["tinted"] : borderClasses["base"], "inline-flex items-center border", group && "not-first:-ms-px", "first:rounded-s-lg last:rounded-e-lg", theme, className);
|
|
36
37
|
</script>
|
|
37
38
|
|
|
38
39
|
<div {...restProps} class={divClass}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { CloseButton, type SizeType, type InputProps, type InputValue } from "../..";
|
|
4
5
|
import { input, clampSize, type InputTheme } from ".";
|
|
5
6
|
import { getTheme } from "../../theme/themeUtils";
|
|
6
7
|
|
|
@@ -208,9 +209,9 @@
|
|
|
208
209
|
{/if}
|
|
209
210
|
|
|
210
211
|
{#if isCombobox}
|
|
211
|
-
<div class={
|
|
212
|
+
<div class={clsx(isCombobox ? "relative w-full" : "", wrapperClass)}>
|
|
212
213
|
{#if right || left || clearable}
|
|
213
|
-
<div class={
|
|
214
|
+
<div class={base({ class: clsx((theme as InputTheme)?.base, divClass) })}>
|
|
214
215
|
{@render inputContent()}
|
|
215
216
|
</div>
|
|
216
217
|
{:else}
|
|
@@ -218,10 +219,10 @@
|
|
|
218
219
|
{/if}
|
|
219
220
|
|
|
220
221
|
{#if isCombobox && isFocused && filteredSuggestions.length > 0}
|
|
221
|
-
<div class={
|
|
222
|
+
<div class={combo({ class: clsx((theme as InputTheme)?.combo, comboClass) })}>
|
|
222
223
|
{#each filteredSuggestions as item, i}
|
|
223
224
|
<button type="button" class="w-full px-3 py-2 text-left {i === selectedIndex ? 'bg-gray-100 dark:bg-gray-700' : 'hover:bg-gray-50 dark:hover:bg-gray-700'} focus:outline-none" onclick={() => selectItem(item)} onmouseenter={() => (selectedIndex = i)}>
|
|
224
|
-
<p class={
|
|
225
|
+
<p class={comboItem({ class: clsx((theme as InputTheme)?.comboItem, comboItemClass) })}>{item}</p>
|
|
225
226
|
</button>
|
|
226
227
|
{/each}
|
|
227
228
|
</div>
|
|
@@ -230,7 +231,7 @@
|
|
|
230
231
|
{:else if group}
|
|
231
232
|
{@render inputContent()}
|
|
232
233
|
{:else if right || left || clearable}
|
|
233
|
-
<div class={
|
|
234
|
+
<div class={base({ class: clsx((theme as InputTheme)?.base, divClass) })}>
|
|
234
235
|
{@render inputContent()}
|
|
235
236
|
</div>
|
|
236
237
|
{:else}
|
|
@@ -239,20 +240,20 @@
|
|
|
239
240
|
|
|
240
241
|
{#snippet inputContent()}
|
|
241
242
|
{#if left}
|
|
242
|
-
<div class={
|
|
243
|
+
<div class={leftCls({ class: clsx((theme as InputTheme)?.left, leftClass) })}>
|
|
243
244
|
{@render left()}
|
|
244
245
|
</div>
|
|
245
246
|
{/if}
|
|
246
247
|
{#if children}
|
|
247
248
|
{@render children({ ...restProps, class: inputCls() })}
|
|
248
249
|
{:else}
|
|
249
|
-
<input {...restProps} bind:value bind:this={elementRef} oninput={handleInput} onfocus={handleFocus} onblur={handleBlur} onkeydown={handleKeydown} class={
|
|
250
|
+
<input {...restProps} bind:value bind:this={elementRef} oninput={handleInput} onfocus={handleFocus} onblur={handleBlur} onkeydown={handleKeydown} class={inputCls({ class: clsx((theme as InputTheme)?.input, className) })} />
|
|
250
251
|
{#if value !== undefined && value !== "" && clearable}
|
|
251
|
-
<CloseButton onclick={clearAll} class={
|
|
252
|
+
<CloseButton onclick={clearAll} class={closebutton({ class: clsx((theme as InputTheme)?.closebutton, clearableClass) })} color={clearableColor} aria-label="Clear search value" svgClass={clsx(clearableSvgClass)} />
|
|
252
253
|
{/if}
|
|
253
254
|
{/if}
|
|
254
255
|
{#if right}
|
|
255
|
-
<div class={
|
|
256
|
+
<div class={rightCls({ class: clsx((theme as InputTheme)?.right, rightClass) })}>
|
|
256
257
|
{@render right()}
|
|
257
258
|
</div>
|
|
258
259
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
import type { ClassValue } from "svelte/elements";
|
|
2
3
|
export type InputVariants = VariantProps<typeof input>;
|
|
3
4
|
export declare const input: import("tailwind-variants").TVReturnType<{
|
|
4
5
|
size: {
|
|
@@ -290,4 +291,4 @@ export declare const input: import("tailwind-variants").TVReturnType<{
|
|
|
290
291
|
comboItem: string;
|
|
291
292
|
}, undefined, unknown, unknown, undefined>>;
|
|
292
293
|
export type InputSlots = keyof typeof input.slots;
|
|
293
|
-
export type InputTheme = Partial<Record<InputSlots,
|
|
294
|
+
export type InputTheme = Partial<Record<InputSlots, ClassValue>>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { label } from ".";
|
|
3
|
-
import
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { type LabelProps } from "../..";
|
|
4
5
|
import { getTheme } from "../../theme/themeUtils";
|
|
5
6
|
|
|
6
7
|
let { children, color = "gray", show = true, class: className, ...restProps }: LabelProps = $props();
|
|
7
8
|
|
|
8
9
|
const theme = getTheme("label");
|
|
9
10
|
|
|
10
|
-
let base = $derived(
|
|
11
|
+
let base = $derived(label({ color, class: clsx(theme, className) }));
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
{#if show}
|