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.
Files changed (219) hide show
  1. package/dist/accordion/Accordion.svelte +4 -4
  2. package/dist/accordion/AccordionItem.svelte +7 -6
  3. package/dist/accordion/theme.d.ts +3 -2
  4. package/dist/alert/Alert.svelte +10 -12
  5. package/dist/alert/theme.d.ts +2 -1
  6. package/dist/avatar/Avatar.svelte +9 -11
  7. package/dist/avatar/theme.d.ts +2 -1
  8. package/dist/badge/Badge.svelte +4 -3
  9. package/dist/badge/theme.d.ts +2 -1
  10. package/dist/banner/Banner.svelte +5 -4
  11. package/dist/banner/theme.d.ts +2 -1
  12. package/dist/bottom-navigation/BottomNav.svelte +3 -2
  13. package/dist/bottom-navigation/BottomNavHeader.svelte +4 -3
  14. package/dist/bottom-navigation/BottomNavHeaderItem.svelte +4 -3
  15. package/dist/bottom-navigation/BottomNavItem.svelte +4 -3
  16. package/dist/bottom-navigation/theme.d.ts +5 -4
  17. package/dist/breadcrumb/Breadcrumb.svelte +4 -3
  18. package/dist/breadcrumb/BreadcrumbItem.svelte +7 -6
  19. package/dist/breadcrumb/theme.d.ts +3 -2
  20. package/dist/button-group/ButtonGroup.svelte +3 -2
  21. package/dist/button-group/theme.d.ts +2 -1
  22. package/dist/buttons/Button.svelte +3 -2
  23. package/dist/buttons/GradientButton.svelte +5 -4
  24. package/dist/buttons/theme.d.ts +3 -2
  25. package/dist/card/Card.svelte +4 -4
  26. package/dist/card/theme.d.ts +2 -1
  27. package/dist/carousel/Carousel.svelte +5 -4
  28. package/dist/carousel/CarouselIndicators.svelte +4 -3
  29. package/dist/carousel/ControlButton.svelte +7 -4
  30. package/dist/carousel/Controls.svelte +4 -3
  31. package/dist/carousel/Slide.svelte +3 -2
  32. package/dist/carousel/Thumbnail.svelte +2 -2
  33. package/dist/carousel/Thumbnails.svelte +3 -3
  34. package/dist/carousel/theme.d.ts +20 -9
  35. package/dist/carousel/theme.js +4 -1
  36. package/dist/clipboard/Clipboard.svelte +2 -2
  37. package/dist/clipboard/theme.d.ts +2 -1
  38. package/dist/darkmode/DarkMode.svelte +3 -2
  39. package/dist/darkmode/theme.d.ts +2 -1
  40. package/dist/datepicker/Datepicker.svelte +27 -23
  41. package/dist/datepicker/theme.d.ts +1 -1
  42. package/dist/drawer/Drawer.svelte +4 -3
  43. package/dist/drawer/Drawerhead.svelte +5 -4
  44. package/dist/drawer/theme.d.ts +3 -2
  45. package/dist/dropdown/Dropdown.svelte +3 -2
  46. package/dist/dropdown/DropdownDivider.svelte +3 -2
  47. package/dist/dropdown/DropdownGroup.svelte +3 -2
  48. package/dist/dropdown/DropdownHeader.svelte +3 -2
  49. package/dist/dropdown/DropdownItem.svelte +4 -3
  50. package/dist/dropdown/theme.d.ts +6 -5
  51. package/dist/footer/Footer.svelte +4 -3
  52. package/dist/footer/FooterBrand.svelte +6 -5
  53. package/dist/footer/FooterCopyright.svelte +5 -4
  54. package/dist/footer/FooterIcon.svelte +3 -2
  55. package/dist/footer/FooterLink.svelte +4 -3
  56. package/dist/footer/FooterLinkGroup.svelte +3 -2
  57. package/dist/footer/theme.d.ts +7 -6
  58. package/dist/forms/button-toggle/ButtonToggle.svelte +7 -6
  59. package/dist/forms/button-toggle/ButtonToggleGroup.svelte +6 -5
  60. package/dist/forms/button-toggle/CheckIcon.svelte +3 -2
  61. package/dist/forms/button-toggle/theme.d.ts +5 -4
  62. package/dist/forms/checkbox/Checkbox.svelte +6 -5
  63. package/dist/forms/checkbox/CheckboxButton.svelte +3 -2
  64. package/dist/forms/checkbox/theme.d.ts +3 -2
  65. package/dist/forms/dropzone/Dropzone.svelte +3 -2
  66. package/dist/forms/dropzone/theme.d.ts +2 -1
  67. package/dist/forms/fileupload/Fileupload.svelte +5 -4
  68. package/dist/forms/fileupload/theme.d.ts +2 -1
  69. package/dist/forms/floating-label/FloatingLabelInput.svelte +7 -6
  70. package/dist/forms/floating-label/theme.d.ts +2 -1
  71. package/dist/forms/helper/Helper.svelte +3 -2
  72. package/dist/forms/helper/theme.d.ts +2 -1
  73. package/dist/forms/input-addon/InputAddon.svelte +3 -2
  74. package/dist/forms/input-field/Input.svelte +11 -10
  75. package/dist/forms/input-field/theme.d.ts +2 -1
  76. package/dist/forms/label/Label.svelte +3 -2
  77. package/dist/forms/label/theme.d.ts +2 -1
  78. package/dist/forms/phoneinput/PhoneInput.svelte +7 -7
  79. package/dist/forms/phoneinput/theme.d.ts +1 -1
  80. package/dist/forms/radio/Radio.svelte +4 -3
  81. package/dist/forms/radio/RadioButton.svelte +3 -2
  82. package/dist/forms/radio/theme.d.ts +3 -2
  83. package/dist/forms/range/Range.svelte +3 -2
  84. package/dist/forms/range/theme.d.ts +2 -1
  85. package/dist/forms/search/Search.svelte +8 -7
  86. package/dist/forms/search/theme.d.ts +2 -1
  87. package/dist/forms/select/MultiSelect.svelte +7 -6
  88. package/dist/forms/select/Select.svelte +5 -4
  89. package/dist/forms/select/theme.d.ts +3 -2
  90. package/dist/forms/tags/Tags.svelte +7 -6
  91. package/dist/forms/tags/theme.d.ts +2 -1
  92. package/dist/forms/textarea/Textarea.svelte +11 -10
  93. package/dist/forms/textarea/theme.d.ts +2 -1
  94. package/dist/forms/timepicker/Timepicker.svelte +38 -37
  95. package/dist/forms/timepicker/theme.d.ts +2 -1
  96. package/dist/forms/toggle/Toggle.svelte +5 -4
  97. package/dist/forms/toggle/theme.d.ts +2 -1
  98. package/dist/gallery/Gallery.svelte +4 -3
  99. package/dist/gallery/theme.d.ts +2 -1
  100. package/dist/indicator/Indicator.svelte +5 -3
  101. package/dist/indicator/theme.d.ts +2 -1
  102. package/dist/kbd/Kbd.svelte +3 -2
  103. package/dist/kbd/theme.d.ts +2 -1
  104. package/dist/list-group/Listgroup.svelte +6 -5
  105. package/dist/list-group/ListgroupItem.svelte +7 -6
  106. package/dist/list-group/theme.d.ts +3 -2
  107. package/dist/mega-menu/MegaMenu.svelte +6 -5
  108. package/dist/mega-menu/theme.d.ts +2 -1
  109. package/dist/modal/Modal.svelte +7 -7
  110. package/dist/modal/theme.d.ts +2 -1
  111. package/dist/navbar/Menu.svelte +1 -2
  112. package/dist/navbar/NavBrand.svelte +1 -2
  113. package/dist/navbar/NavContainer.svelte +1 -2
  114. package/dist/navbar/NavHamburger.svelte +2 -3
  115. package/dist/navbar/NavHamburger.svelte.d.ts +1 -2
  116. package/dist/navbar/NavLi.svelte +1 -2
  117. package/dist/navbar/NavUl.svelte +4 -5
  118. package/dist/navbar/Navbar.svelte +2 -2
  119. package/dist/navbar/theme.d.ts +6 -5
  120. package/dist/pagination/Pagination.svelte +2 -2
  121. package/dist/pagination/PaginationButton.svelte +10 -13
  122. package/dist/pagination/PaginationItem.svelte +1 -2
  123. package/dist/pagination/PaginationNav.svelte +7 -7
  124. package/dist/pagination/theme.d.ts +5 -4
  125. package/dist/popover/Popover.svelte +4 -5
  126. package/dist/popover/theme.d.ts +2 -1
  127. package/dist/progress/Progressbar.svelte +6 -7
  128. package/dist/progress/Progressradial.svelte +7 -8
  129. package/dist/progress/theme.d.ts +2 -2
  130. package/dist/rating/AdvancedRating.svelte +5 -6
  131. package/dist/rating/Rating.svelte +2 -3
  132. package/dist/rating/Review.svelte +7 -8
  133. package/dist/rating/ScoreRating.svelte +8 -8
  134. package/dist/rating/theme.d.ts +5 -4
  135. package/dist/sidebar/Sidebar.svelte +27 -62
  136. package/dist/sidebar/SidebarBrand.svelte +3 -4
  137. package/dist/sidebar/SidebarButton.svelte +1 -2
  138. package/dist/sidebar/SidebarCta.svelte +3 -4
  139. package/dist/sidebar/SidebarDropdownWrapper.svelte +6 -7
  140. package/dist/sidebar/SidebarItem.svelte +5 -4
  141. package/dist/sidebar/theme.d.ts +12 -23
  142. package/dist/sidebar/theme.js +6 -45
  143. package/dist/skeleton/CardPlaceholder.svelte +11 -12
  144. package/dist/skeleton/ImagePlaceholder.svelte +39 -12
  145. package/dist/skeleton/ListPlaceholder.svelte +26 -8
  146. package/dist/skeleton/Skeleton.svelte +24 -9
  147. package/dist/skeleton/TestimonialPlaceholder.svelte +27 -8
  148. package/dist/skeleton/TextPlaceholder.svelte +49 -26
  149. package/dist/skeleton/VideoPlaceholder.svelte +2 -3
  150. package/dist/skeleton/WidgetPlaceholder.svelte +1 -2
  151. package/dist/skeleton/theme.d.ts +9 -8
  152. package/dist/speed-dial/SpeedDial.svelte +3 -3
  153. package/dist/speed-dial/SpeedDialButton.svelte +3 -3
  154. package/dist/speed-dial/theme.d.ts +3 -2
  155. package/dist/spinner/Spinner.svelte +2 -3
  156. package/dist/spinner/theme.d.ts +2 -1
  157. package/dist/stepindicator/StepIndicator.svelte +10 -9
  158. package/dist/stepindicator/theme.d.ts +2 -1
  159. package/dist/stepper/BreadcrumbStepper.svelte +9 -10
  160. package/dist/stepper/DetailedStepper.svelte +4 -4
  161. package/dist/stepper/ProgressStepper.svelte +8 -11
  162. package/dist/stepper/Stepper.svelte +12 -18
  163. package/dist/stepper/TimelineStepper.svelte +4 -4
  164. package/dist/stepper/VerticalStepper.svelte +4 -4
  165. package/dist/table/Table.svelte +3 -3
  166. package/dist/table/TableBody.svelte +1 -2
  167. package/dist/table/TableBodyCell.svelte +1 -2
  168. package/dist/table/TableBodyRow.svelte +2 -3
  169. package/dist/table/TableHead.svelte +2 -3
  170. package/dist/table/TableHeadCell.svelte +1 -2
  171. package/dist/table/TableSearch.svelte +9 -9
  172. package/dist/table/theme.d.ts +6 -6
  173. package/dist/tabs/TabItem.svelte +5 -4
  174. package/dist/tabs/Tabs.svelte +3 -4
  175. package/dist/tabs/theme.d.ts +3 -2
  176. package/dist/timeline/Activity.svelte +1 -2
  177. package/dist/timeline/ActivityItem.svelte +9 -9
  178. package/dist/timeline/Group.svelte +4 -4
  179. package/dist/timeline/GroupItem.svelte +6 -6
  180. package/dist/timeline/Timeline.svelte +2 -3
  181. package/dist/timeline/TimelineItem.svelte +7 -7
  182. package/dist/timeline/theme.d.ts +7 -6
  183. package/dist/toast/Toast.svelte +5 -5
  184. package/dist/toast/theme.d.ts +2 -1
  185. package/dist/toolbar/Toolbar.svelte +2 -3
  186. package/dist/toolbar/ToolbarButton.svelte +4 -5
  187. package/dist/toolbar/ToolbarGroup.svelte +2 -3
  188. package/dist/toolbar/theme.d.ts +4 -3
  189. package/dist/tooltip/Tooltip.svelte +1 -2
  190. package/dist/tooltip/theme.d.ts +2 -1
  191. package/dist/types.d.ts +2 -3
  192. package/dist/typography/anchor/A.svelte +3 -4
  193. package/dist/typography/anchor/theme.d.ts +2 -1
  194. package/dist/typography/blockquote/Blockquote.svelte +3 -4
  195. package/dist/typography/blockquote/theme.d.ts +2 -1
  196. package/dist/typography/descriptionlist/DescriptionList.svelte +2 -3
  197. package/dist/typography/descriptionlist/theme.d.ts +2 -1
  198. package/dist/typography/heading/Heading.svelte +2 -3
  199. package/dist/typography/heading/theme.d.ts +2 -1
  200. package/dist/typography/hr/Hr.svelte +4 -5
  201. package/dist/typography/hr/theme.d.ts +2 -1
  202. package/dist/typography/img/EnhancedImg.svelte +4 -5
  203. package/dist/typography/img/Img.svelte +4 -5
  204. package/dist/typography/img/theme.d.ts +2 -1
  205. package/dist/typography/layout/Layout.svelte +2 -3
  206. package/dist/typography/layout/theme.d.ts +2 -1
  207. package/dist/typography/list/Li.svelte +1 -2
  208. package/dist/typography/list/List.svelte +2 -3
  209. package/dist/typography/list/theme.d.ts +2 -1
  210. package/dist/typography/mark/Mark.svelte +1 -1
  211. package/dist/typography/mark/theme.d.ts +2 -1
  212. package/dist/typography/paragraph/P.svelte +2 -3
  213. package/dist/typography/paragraph/theme.d.ts +2 -1
  214. package/dist/typography/secondary/Secondary.svelte +1 -2
  215. package/dist/typography/secondary/theme.d.ts +2 -1
  216. package/dist/typography/span/Span.svelte +2 -3
  217. package/dist/typography/span/theme.d.ts +2 -1
  218. package/dist/video/Video.svelte +2 -2
  219. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { footerBrand, type FooterBrandTheme } from ".";
3
- import { type FooterBrandProps, cn } from "..";
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={cn(base(), aClass, (theme as FooterBrandTheme)?.base)}>
15
+ <a {...restProps} {href} class={base({ class: clsx((theme as FooterBrandTheme)?.base, aClass) })}>
15
16
  {#if src}
16
- <img {src} class={cn(img(), imgClass, (theme as FooterBrandTheme)?.img)} {alt} />
17
+ <img {src} class={img({ class: clsx((theme as FooterBrandTheme)?.img, imgClass) })} {alt} />
17
18
  {/if}
18
19
  {#if name}
19
- <span class={cn(span(), spanClass, (theme as FooterBrandTheme)?.span)}>{name}</span>
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={cn(img(), imgClass)} {alt} />
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 { type FooterCopyrightProps, cn } from "..";
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={cn(base(), spanClass, (theme as FooterCopyrightTheme)?.base)}>
16
+ <span class={base({ class: clsx((theme as FooterCopyrightTheme)?.base, spanClass) })}>
16
17
  &copy; {year}
17
18
  {#if href}
18
- <a {...restProps} {href} class={cn(link(), aClass, (theme as FooterCopyrightTheme)?.link)}>
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={cn(bySpan(), bySpanClass, (theme as FooterCopyrightTheme)?.bySpan)}>{by}</span>
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 { type FooterIconProps, cn } from "..";
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={cn(footerIcon(), className, theme)}>
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 { type FooterLinkProps, cn } from "..";
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={cn(base(), liClass, (theme as FooterLinkTheme)?.base)}>
14
- <a {...restProps} {href} class={cn(link(), aClass, (theme as FooterLinkTheme)?.link)}>
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 { type FooterLinkGroupProps, cn } from "..";
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={cn(footerLinkGroup(), className, theme)}>
12
+ <ul {...restProps} class={footerLinkGroup({ class: clsx(theme, className) })}>
12
13
  {@render children()}
13
14
  </ul>
14
15
 
@@ -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 = string;
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, string>>;
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, string>>;
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 = string;
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 = string;
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, string>>;
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 { type ButtonToggleProps, type ButtonToggleContext, cn } from "../..";
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 || cn(iconClass);
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={cn(buttonToggle.button({ selected, color: actualColor, size, roundedSize }), ctxBtnClass, className, (theme as ButtonToggleTheme)?.button)} data-selected={selected} onclick={handleClick} role={multiSelect ? "checkbox" : "radio"} aria-checked={selected} {...restProps}>
32
- <div class={cn(buttonToggle.content(), contentClass, (theme as ButtonToggleTheme)?.content)}>
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={cn("absolute left-0 flex-shrink-0 text-green-600", actualIconClass)} />
38
+ <CheckIcon class={clsx("absolute left-0 flex-shrink-0 text-green-600", actualIconClass)} />
38
39
  {/if}
39
40
  {/if}
40
- <span class={cn(buttonToggle.text({ selected }), txtClass, (theme as ButtonToggleTheme)?.text)}>
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 { type ButtonToggleGroupProps, buttonToggleGroup, cn } from "../..";
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", cn(ctxIconClass));
63
- setContext("ctxBtnClass", cn(ctxBtnClass));
63
+ setContext("ctxIconClass", clsx(ctxIconClass));
64
+ setContext("ctxBtnClass", clsx(ctxBtnClass));
64
65
  </script>
65
66
 
66
67
  <div class="inline">
67
- <div class={cn(base, className, theme)} role={multiSelect ? "group" : "radiogroup"} aria-label={name} {...restProps}>
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, cn } from "../..";
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={cn(className)} {...restProps}>
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 = string;
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?: string;
173
- content?: string;
174
- text?: string;
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 { type CheckboxProps, type CheckboxItem, Label, cn } from "../..";
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={cn(divStyle(), divClass, (theme as CheckboxTheme)?.div)}>
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={cn(base(), className, (theme as CheckboxTheme)?.base)} />
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={cn(divStyle(), divClass, (theme as CheckboxTheme)?.div)}>
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={cn(base(), className, (theme as CheckboxTheme)?.base)} />
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 { type CheckboxButtonProps, cn } from "../..";
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(cn(checkboxbutton({ inline, checked }), className, theme));
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, string>>;
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 = string;
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 { type DropzoneProps, cn } from "../..";
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={cn(dropzone(), className, theme)} onkeydown={keydown} onclick={onClick} ondrop={onDrop} ondragover={onDragOver} type="button">
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 = string;
3
+ export type DropzoneTheme = ClassValue;
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { fileupload, type FileuploadTheme } from ".";
3
- import { CloseButton, type FileuploadProps, cn } from "../..";
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={cn(wrapper(), wrapperClass, (theme as FileuploadTheme)?.wrapper)}>
22
- <input type="file" bind:files bind:this={elementRef} {...restProps} class={cn(base({ size }), className, (theme as FileuploadTheme)?.base)} />
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={cn(right(), clearableClass, (theme as FileuploadTheme)?.right)} color={clearableColor} aria-label="Clear selected files" svgClass={cn(clearableSvgClass)} />
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, string>>;
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 { type FloatingLabelInputProps, CloseButton, cn } from "../..";
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={cn(base(), isCombobox ? "relative" : "", className, (theme as FloatingLabelInputTheme)?.base)}>
140
- <input {id} placeholder=" " bind:value bind:this={elementRef} {...restProps} aria-describedby={ariaDescribedby} class={cn(input(), inputClass, (theme as FloatingLabelInputTheme)?.input)} oninput={handleInput} onfocus={handleFocus} onblur={handleBlur} onkeydown={handleKeydown} />
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={cn(closebutton(), clearableClass, (theme as FloatingLabelInputTheme)?.closebutton)} color={clearableColor} aria-label="Clear search value" svgClass={cn(clearableSvgClass)} />
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={cn(label(), labelClass, (theme as FloatingLabelInputTheme)?.label)}>
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={cn(combo(), comboClass, (theme as FloatingLabelInputTheme)?.combo)}>
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, string>>;
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, cn } from "../..";
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(cn(helper({ color }), className, theme));
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 = string;
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 { type InputAddonProps, clampSize, cn } from "../..";
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 = cn(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", className, theme);
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 { CloseButton, type SizeType, type InputProps, type InputValue, cn } from "../..";
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={cn(isCombobox ? "relative w-full" : "", wrapperClass)}>
212
+ <div class={clsx(isCombobox ? "relative w-full" : "", wrapperClass)}>
212
213
  {#if right || left || clearable}
213
- <div class={cn(base(), divClass, (theme as InputTheme)?.base)}>
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={cn(combo(), comboClass, (theme as InputTheme)?.combo)}>
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={cn(comboItem(), comboItemClass, (theme as InputTheme)?.comboItem)}>{item}</p>
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={cn(base(), divClass, (theme as InputTheme)?.base)}>
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={cn(leftCls(), leftClass, (theme as InputTheme)?.left)}>
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={cn(inputCls(), className, (theme as InputTheme)?.input)} />
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={cn(closebutton(), clearableClass, (theme as InputTheme)?.closebutton)} color={clearableColor} aria-label="Clear search value" svgClass={cn(clearableSvgClass)} />
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={cn(rightCls(), rightClass, (theme as InputTheme)?.right)}>
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, string>>;
294
+ export type InputTheme = Partial<Record<InputSlots, ClassValue>>;
@@ -1,13 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { label } from ".";
3
- import { type LabelProps, cn } from "../..";
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(cn(label({ color }), className, theme));
11
+ let base = $derived(label({ color, class: clsx(theme, className) }));
11
12
  </script>
12
13
 
13
14
  {#if show}