flowbite-svelte 2.0.0-next.0 → 2.0.0-next.1

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 (216) hide show
  1. package/dist/accordion/theme.js +1 -1
  2. package/dist/command-palette/CommandPalette.svelte +1 -1
  3. package/dist/command-palette/CommandPalette.svelte.d.ts +1 -1
  4. package/dist/forms/floating-label/FloatingLabelInput.svelte +6 -3
  5. package/dist/gallery/Gallery.svelte +4 -12
  6. package/dist/gallery/Gallery.svelte.d.ts +0 -1
  7. package/dist/gallery/theme.js +1 -1
  8. package/dist/indicator/Indicator.svelte +1 -1
  9. package/dist/indicator/Indicator.svelte.d.ts +1 -1
  10. package/dist/kanban/KanbanCard.svelte +1 -1
  11. package/dist/kanban/KanbanCard.svelte.d.ts +1 -1
  12. package/dist/kbd/Kbd.svelte +1 -1
  13. package/dist/kbd/Kbd.svelte.d.ts +1 -1
  14. package/dist/list-group/Listgroup.svelte +20 -8
  15. package/dist/list-group/Listgroup.svelte.d.ts +2 -3
  16. package/dist/list-group/ListgroupItem.svelte +14 -10
  17. package/dist/list-group/ListgroupItem.svelte.d.ts +4 -2
  18. package/dist/list-group/theme.d.ts +87 -29
  19. package/dist/list-group/theme.js +17 -18
  20. package/dist/mega-menu/MegaMenu.svelte +7 -16
  21. package/dist/mega-menu/MegaMenu.svelte.d.ts +1 -3
  22. package/dist/modal/Modal.svelte +7 -22
  23. package/dist/modal/Modal.svelte.d.ts +1 -5
  24. package/dist/modal/theme.d.ts +1 -0
  25. package/dist/modal/theme.js +2 -1
  26. package/dist/navbar/Menu.svelte +3 -4
  27. package/dist/navbar/Menu.svelte.d.ts +1 -2
  28. package/dist/navbar/NavBrand.svelte +1 -1
  29. package/dist/navbar/NavBrand.svelte.d.ts +1 -1
  30. package/dist/navbar/NavContainer.svelte +1 -1
  31. package/dist/navbar/NavContainer.svelte.d.ts +1 -1
  32. package/dist/navbar/NavHamburger.svelte +10 -16
  33. package/dist/navbar/NavHamburger.svelte.d.ts +1 -3
  34. package/dist/navbar/NavLi.svelte +8 -4
  35. package/dist/navbar/NavLi.svelte.d.ts +1 -1
  36. package/dist/navbar/NavUl.svelte +14 -31
  37. package/dist/navbar/NavUl.svelte.d.ts +1 -4
  38. package/dist/navbar/Navbar.svelte +9 -5
  39. package/dist/navbar/Navbar.svelte.d.ts +2 -2
  40. package/dist/navbar/index.d.ts +1 -0
  41. package/dist/navbar/index.js +1 -0
  42. package/dist/navbar/theme.d.ts +32 -1
  43. package/dist/navbar/theme.js +4 -1
  44. package/dist/pagination/Pagination.svelte +1 -1
  45. package/dist/pagination/Pagination.svelte.d.ts +1 -1
  46. package/dist/pagination/PaginationButton.svelte +1 -1
  47. package/dist/pagination/PaginationButton.svelte.d.ts +1 -1
  48. package/dist/pagination/PaginationItem.svelte +1 -1
  49. package/dist/pagination/PaginationItem.svelte.d.ts +1 -1
  50. package/dist/pagination/PaginationNav.svelte +10 -25
  51. package/dist/pagination/PaginationNav.svelte.d.ts +1 -5
  52. package/dist/popover/Popover.svelte +6 -15
  53. package/dist/popover/Popover.svelte.d.ts +1 -2
  54. package/dist/progress/Progressbar.svelte +1 -1
  55. package/dist/progress/Progressbar.svelte.d.ts +1 -1
  56. package/dist/progress/Progressradial.svelte +1 -1
  57. package/dist/progress/Progressradial.svelte.d.ts +1 -1
  58. package/dist/rating/AdvancedRating.svelte +8 -27
  59. package/dist/rating/AdvancedRating.svelte.d.ts +1 -6
  60. package/dist/rating/CustomIcon.svelte +4 -4
  61. package/dist/rating/CustomIcon.svelte.d.ts +2 -2
  62. package/dist/rating/Heart.svelte +4 -4
  63. package/dist/rating/Heart.svelte.d.ts +2 -2
  64. package/dist/rating/Rating.svelte +5 -13
  65. package/dist/rating/Rating.svelte.d.ts +1 -2
  66. package/dist/rating/RatingComment.svelte +1 -1
  67. package/dist/rating/RatingComment.svelte.d.ts +1 -1
  68. package/dist/rating/Review.svelte +13 -37
  69. package/dist/rating/Review.svelte.d.ts +1 -8
  70. package/dist/rating/ScoreRating.svelte +9 -8
  71. package/dist/rating/ScoreRating.svelte.d.ts +1 -1
  72. package/dist/rating/Star.svelte +4 -4
  73. package/dist/rating/Star.svelte.d.ts +2 -2
  74. package/dist/rating/Thumbup.svelte +4 -4
  75. package/dist/rating/Thumbup.svelte.d.ts +2 -2
  76. package/dist/scroll-spy/ScrollSpy.svelte +1 -1
  77. package/dist/scroll-spy/ScrollSpy.svelte.d.ts +1 -1
  78. package/dist/sidebar/Sidebar.svelte +9 -31
  79. package/dist/sidebar/Sidebar.svelte.d.ts +1 -5
  80. package/dist/sidebar/SidebarBrand.svelte +6 -20
  81. package/dist/sidebar/SidebarBrand.svelte.d.ts +1 -3
  82. package/dist/sidebar/SidebarButton.svelte +3 -2
  83. package/dist/sidebar/SidebarButton.svelte.d.ts +1 -1
  84. package/dist/sidebar/SidebarCta.svelte +6 -20
  85. package/dist/sidebar/SidebarCta.svelte.d.ts +1 -3
  86. package/dist/sidebar/SidebarDropdownWrapper.svelte +9 -44
  87. package/dist/sidebar/SidebarDropdownWrapper.svelte.d.ts +1 -5
  88. package/dist/sidebar/SidebarGroup.svelte +3 -4
  89. package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -2
  90. package/dist/sidebar/SidebarItem.svelte +12 -10
  91. package/dist/sidebar/SidebarItem.svelte.d.ts +2 -5
  92. package/dist/sidebar/index.d.ts +1 -1
  93. package/dist/sidebar/index.js +1 -1
  94. package/dist/sidebar/theme.d.ts +41 -0
  95. package/dist/sidebar/theme.js +23 -3
  96. package/dist/skeleton/CardPlaceholder.svelte +1 -1
  97. package/dist/skeleton/CardPlaceholder.svelte.d.ts +1 -1
  98. package/dist/skeleton/ImagePlaceholder.svelte +1 -1
  99. package/dist/skeleton/ImagePlaceholder.svelte.d.ts +1 -1
  100. package/dist/skeleton/ListPlaceholder.svelte +1 -1
  101. package/dist/skeleton/ListPlaceholder.svelte.d.ts +1 -1
  102. package/dist/skeleton/Skeleton.svelte +1 -1
  103. package/dist/skeleton/Skeleton.svelte.d.ts +1 -1
  104. package/dist/skeleton/TestimonialPlaceholder.svelte +1 -1
  105. package/dist/skeleton/TestimonialPlaceholder.svelte.d.ts +1 -1
  106. package/dist/skeleton/TextPlaceholder.svelte +1 -1
  107. package/dist/skeleton/TextPlaceholder.svelte.d.ts +1 -1
  108. package/dist/skeleton/VideoPlaceholder.svelte +1 -1
  109. package/dist/skeleton/VideoPlaceholder.svelte.d.ts +1 -1
  110. package/dist/skeleton/WidgetPlaceholder.svelte +1 -1
  111. package/dist/skeleton/WidgetPlaceholder.svelte.d.ts +1 -1
  112. package/dist/speed-dial/SpeedDial.svelte +1 -1
  113. package/dist/speed-dial/SpeedDial.svelte.d.ts +1 -1
  114. package/dist/speed-dial/SpeedDialButton.svelte +1 -1
  115. package/dist/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
  116. package/dist/speed-dial/SpeedDialTrigger.svelte +1 -1
  117. package/dist/speed-dial/SpeedDialTrigger.svelte.d.ts +1 -1
  118. package/dist/spinner/Spinner.svelte +1 -1
  119. package/dist/spinner/Spinner.svelte.d.ts +1 -1
  120. package/dist/split-pane/Divider.svelte +1 -1
  121. package/dist/split-pane/Divider.svelte.d.ts +1 -1
  122. package/dist/split-pane/Pane.svelte +1 -1
  123. package/dist/split-pane/Pane.svelte.d.ts +1 -1
  124. package/dist/split-pane/SplitPane.svelte +1 -1
  125. package/dist/split-pane/SplitPane.svelte.d.ts +1 -1
  126. package/dist/step-indicator/StepIndicator.svelte +1 -1
  127. package/dist/step-indicator/StepIndicator.svelte.d.ts +1 -1
  128. package/dist/stepper/BreadcrumbStepper.svelte +1 -1
  129. package/dist/stepper/BreadcrumbStepper.svelte.d.ts +1 -1
  130. package/dist/stepper/DetailedStepper.svelte +1 -1
  131. package/dist/stepper/DetailedStepper.svelte.d.ts +1 -1
  132. package/dist/stepper/ProgressStepper.svelte +1 -1
  133. package/dist/stepper/ProgressStepper.svelte.d.ts +1 -1
  134. package/dist/stepper/Stepper.svelte +1 -1
  135. package/dist/stepper/Stepper.svelte.d.ts +1 -1
  136. package/dist/stepper/TimelineStepper.svelte +1 -1
  137. package/dist/stepper/TimelineStepper.svelte.d.ts +1 -1
  138. package/dist/stepper/VerticalStepper.svelte +1 -1
  139. package/dist/stepper/VerticalStepper.svelte.d.ts +1 -1
  140. package/dist/table/Table.svelte +1 -1
  141. package/dist/table/Table.svelte.d.ts +1 -1
  142. package/dist/table/TableBody.svelte +1 -1
  143. package/dist/table/TableBody.svelte.d.ts +1 -1
  144. package/dist/table/TableBodyCell.svelte +1 -1
  145. package/dist/table/TableBodyCell.svelte.d.ts +1 -1
  146. package/dist/table/TableBodyRow.svelte +1 -1
  147. package/dist/table/TableBodyRow.svelte.d.ts +1 -1
  148. package/dist/table/TableHead.svelte +1 -1
  149. package/dist/table/TableHead.svelte.d.ts +1 -1
  150. package/dist/table/TableHeadCell.svelte +1 -1
  151. package/dist/table/TableHeadCell.svelte.d.ts +1 -1
  152. package/dist/table/TableSearch.svelte +1 -1
  153. package/dist/table/TableSearch.svelte.d.ts +1 -1
  154. package/dist/tabs/TabItem.svelte +1 -1
  155. package/dist/tabs/TabItem.svelte.d.ts +1 -1
  156. package/dist/tabs/Tabs.svelte +1 -1
  157. package/dist/tabs/Tabs.svelte.d.ts +1 -1
  158. package/dist/theme/themes.d.ts +1 -1
  159. package/dist/theme/themes.js +1 -1
  160. package/dist/timeline/Activity.svelte +1 -1
  161. package/dist/timeline/Activity.svelte.d.ts +1 -1
  162. package/dist/timeline/ActivityItem.svelte +1 -1
  163. package/dist/timeline/ActivityItem.svelte.d.ts +1 -1
  164. package/dist/timeline/Group.svelte +1 -1
  165. package/dist/timeline/Group.svelte.d.ts +1 -1
  166. package/dist/timeline/GroupItem.svelte +1 -1
  167. package/dist/timeline/GroupItem.svelte.d.ts +1 -1
  168. package/dist/timeline/Timeline.svelte +1 -1
  169. package/dist/timeline/Timeline.svelte.d.ts +1 -1
  170. package/dist/timeline/TimelineItem.svelte +1 -1
  171. package/dist/timeline/TimelineItem.svelte.d.ts +1 -1
  172. package/dist/toast/Toast.svelte +1 -1
  173. package/dist/toast/Toast.svelte.d.ts +1 -1
  174. package/dist/toast/ToastContainer.svelte +1 -1
  175. package/dist/toast/ToastContainer.svelte.d.ts +1 -1
  176. package/dist/toolbar/Toolbar.svelte +1 -1
  177. package/dist/toolbar/Toolbar.svelte.d.ts +1 -1
  178. package/dist/toolbar/ToolbarButton.svelte +5 -4
  179. package/dist/toolbar/ToolbarButton.svelte.d.ts +2 -1
  180. package/dist/toolbar/ToolbarGroup.svelte +1 -1
  181. package/dist/toolbar/ToolbarGroup.svelte.d.ts +1 -1
  182. package/dist/toolbar/theme.js +1 -1
  183. package/dist/tooltip/Tooltip.svelte +1 -1
  184. package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
  185. package/dist/types.d.ts +9 -62
  186. package/dist/typography/a/A.svelte +1 -1
  187. package/dist/typography/a/A.svelte.d.ts +1 -1
  188. package/dist/typography/blockquote/Blockquote.svelte +1 -1
  189. package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
  190. package/dist/typography/descriptionlist/DescriptionList.svelte +1 -1
  191. package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
  192. package/dist/typography/heading/Heading.svelte +1 -1
  193. package/dist/typography/heading/Heading.svelte.d.ts +1 -1
  194. package/dist/typography/img/Img.svelte +1 -1
  195. package/dist/typography/img/Img.svelte.d.ts +1 -1
  196. package/dist/typography/layout/Layout.svelte +1 -1
  197. package/dist/typography/layout/Layout.svelte.d.ts +1 -1
  198. package/dist/typography/list/Li.svelte +1 -1
  199. package/dist/typography/list/Li.svelte.d.ts +1 -1
  200. package/dist/typography/list/List.svelte +1 -1
  201. package/dist/typography/list/List.svelte.d.ts +1 -1
  202. package/dist/typography/mark/Mark.svelte +1 -1
  203. package/dist/typography/mark/Mark.svelte.d.ts +1 -1
  204. package/dist/typography/paragraph/P.svelte +1 -1
  205. package/dist/typography/paragraph/P.svelte.d.ts +1 -1
  206. package/dist/typography/secondary/Secondary.svelte +1 -1
  207. package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
  208. package/dist/typography/span/Span.svelte +1 -1
  209. package/dist/typography/span/Span.svelte.d.ts +1 -1
  210. package/dist/utils/Arrow.svelte +1 -1
  211. package/dist/utils/Arrow.svelte.d.ts +1 -1
  212. package/dist/utils/Popper.svelte +1 -1
  213. package/dist/utils/Popper.svelte.d.ts +1 -1
  214. package/dist/video/Video.svelte +1 -1
  215. package/dist/video/Video.svelte.d.ts +1 -1
  216. package/package.json +8 -7
@@ -39,7 +39,7 @@ export const accordionItem = tv({
39
39
  content: "py-5 border-b border-default text-body"
40
40
  },
41
41
  false: {
42
- button: "rounded-t-base hover:text-heading hover:bg-neutral-secondary-medium",
42
+ button: "hover:text-heading hover:bg-neutral-secondary-medium",
43
43
  contentWrapper: "border border-s-0 border-e-0 border-t-0 border-b-default",
44
44
  content: "p-4 md:p-5"
45
45
  }
@@ -194,7 +194,7 @@
194
194
  @component
195
195
  [Go to docs](https://flowbite-svelte.com/)
196
196
  ## Type
197
- [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2253)
197
+ [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2202)
198
198
  ## Props
199
199
  @prop open = $bindable(false)
200
200
  @prop items = []
@@ -2,7 +2,7 @@ import type { CommandPaletteProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2253)
5
+ * [CommandPaletteProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2202)
6
6
  * ## Props
7
7
  * @prop open = $bindable(false)
8
8
  * @prop items = []
@@ -35,7 +35,10 @@
35
35
 
36
36
  const { base, input, label, close, combo } = $derived(floatingLabelInput({ variant, size, validation, disabled, withIcon }));
37
37
 
38
- const clearAll = () => {
38
+ // Track if clear button should be shown
39
+ const showClearButton = $derived(clearable && value !== undefined && value !== "");
40
+
41
+ const clearAll = (_event?: MouseEvent) => {
39
42
  if (elementRef) {
40
43
  elementRef.value = "";
41
44
  value = "";
@@ -177,8 +180,8 @@
177
180
  onblur={handleBlur}
178
181
  onkeydown={handleKeydown}
179
182
  />
180
- {#if value !== undefined && value !== "" && clearable}
181
- <CloseButton class={close({ class: clsx(theme?.close, styling?.close) })} color={clearableColor} aria-label="Clear search value" svgClass={clsx(styling?.svg)} />
183
+ {#if showClearButton}
184
+ <CloseButton class={close({ class: clsx(theme?.close, styling?.close) })} color={clearableColor} ariaLabel="Clear search value" svgClass={clsx(styling?.svg)} />
182
185
  {/if}
183
186
  <label for={id} class={label({ class: clsx(theme?.label, styling?.label) })}>
184
187
  {@render children()}
@@ -2,18 +2,11 @@
2
2
  import { gallery } from "./theme";
3
3
  import clsx from "clsx";
4
4
  import type { GalleryProps, ImgType } from "..";
5
- import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
6
- import { untrack } from "svelte";
5
+ import { getTheme } from "../theme/themeUtils";
7
6
 
8
- let { children, figure, items = [], imgClass, class: className, classes, ...restProps }: GalleryProps = $props();
7
+ let { children, figure, items = [], class: className, classes, ...restProps }: GalleryProps = $props();
9
8
 
10
- warnThemeDeprecation(
11
- "Gallery",
12
- untrack(() => ({ imgClass })),
13
- { imgClass: "image" }
14
- );
15
-
16
- const styling = $derived(classes ?? { image: imgClass });
9
+ const styling = $derived(classes);
17
10
 
18
11
  const theme = $derived(getTheme("gallery"));
19
12
 
@@ -26,7 +19,7 @@
26
19
 
27
20
  {#snippet _figure(item: ImgType)}
28
21
  <div>
29
- <img src={item.src} alt={item.alt} class={image({ class: clsx(theme?.image, styling.image) })} {...restProps} />
22
+ <img src={item.src} alt={item.alt} class={image({ class: clsx(theme?.image, styling?.image) })} {...restProps} />
30
23
  </div>
31
24
  {/snippet}
32
25
 
@@ -53,7 +46,6 @@
53
46
  @prop children
54
47
  @prop figure
55
48
  @prop items = []
56
- @prop imgClass
57
49
  @prop class: className
58
50
  @prop classes
59
51
  @prop ...restProps
@@ -7,7 +7,6 @@ import type { GalleryProps } from "..";
7
7
  * @prop children
8
8
  * @prop figure
9
9
  * @prop items = []
10
- * @prop imgClass
11
10
  * @prop class: className
12
11
  * @prop classes
13
12
  * @prop ...restProps
@@ -1,7 +1,7 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const gallery = tv({
3
3
  slots: {
4
- image: "h-auto max-w-full rounded-lg",
4
+ image: "h-auto max-w-full rounded-base",
5
5
  div: "grid"
6
6
  }
7
7
  });
@@ -33,7 +33,7 @@
33
33
  @component
34
34
  [Go to docs](https://flowbite-svelte.com/)
35
35
  ## Type
36
- [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1039)
36
+ [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1038)
37
37
  ## Props
38
38
  @prop children
39
39
  @prop color = "brand"
@@ -2,7 +2,7 @@ import type { IndicatorProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1039)
5
+ * [IndicatorProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1038)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop color = "brand"
@@ -47,7 +47,7 @@
47
47
  @component
48
48
  [Go to docs](https://flowbite-svelte.com/)
49
49
  ## Type
50
- [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2170)
50
+ [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2119)
51
51
  ## Props
52
52
  @prop card
53
53
  @prop isDragging = false
@@ -2,7 +2,7 @@ import type { KanbanCardProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2170)
5
+ * [KanbanCardProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2119)
6
6
  * ## Props
7
7
  * @prop card
8
8
  * @prop isDragging = false
@@ -19,7 +19,7 @@
19
19
  @component
20
20
  [Go to docs](https://flowbite-svelte.com/)
21
21
  ## Type
22
- [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1050)
22
+ [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1049)
23
23
  ## Props
24
24
  @prop children
25
25
  @prop class: className
@@ -2,7 +2,7 @@ import type { KbdProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1050)
5
+ * [KbdProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1049)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop class: className
@@ -6,14 +6,17 @@
6
6
  import { getTheme } from "../theme/themeUtils";
7
7
  import { setListGroupContext } from "../context";
8
8
 
9
- let { children, items, active, onclick, horizontal, rounded, border, class: className, itemClass, iconClass, ...restProps }: ListgroupProps = $props();
9
+ let { children, items, active, onclick, horizontal, rounded, border, class: className, classes, ...restProps }: ListgroupProps = $props();
10
10
 
11
+ const styling = $derived(classes);
11
12
  const theme = $derived(getTheme("listGroup"));
12
13
 
13
- const base = $derived(listGroup({ rounded, border, horizontal, class: clsx(theme, className) }));
14
+ const { base, item: listItem, icon: listIcon } = $derived(listGroup({ rounded, border, horizontal }));
14
15
 
15
16
  let tag = $derived(active ? "div" : "ul");
16
17
 
18
+ let listIconCls = $derived(listIcon({ class: clsx(theme?.icon, styling?.icon) }));
19
+
17
20
  // Create reactive context using getters
18
21
  const context = {
19
22
  get active() {
@@ -35,15 +38,25 @@
35
38
  }
36
39
  </script>
37
40
 
38
- <svelte:element this={tag} {...restProps} class={base}>
41
+ <svelte:element this={tag} {...restProps} class={base({ class: clsx(theme?.base, className) })}>
39
42
  {#if items?.length}
40
43
  {#each items as item, i (i)}
41
44
  {#if children}
42
45
  {@render children(item)}
43
46
  {:else if typeof item === "string"}
44
- <ListgroupItem href={undefined} class={clsx(itemClass)} iconClass={clsx(iconClass)} {active} {horizontal} onclick={createItemClickHandler()}>{item}</ListgroupItem>
47
+ <ListgroupItem href={undefined} class={listItem({ class: clsx(theme?.item, styling?.item) })} classes={{ icon: listIconCls }} {active} {horizontal} onclick={createItemClickHandler()}>
48
+ {item}
49
+ </ListgroupItem>
45
50
  {:else}
46
- <ListgroupItem href={item.href} class={clsx(itemClass)} iconClass={clsx(iconClass)} {active} {horizontal} {...item} onclick={item.onclick ?? createItemClickHandler()} />
51
+ <ListgroupItem
52
+ href={item.href}
53
+ class={listItem({ class: clsx(theme?.item, styling?.item) })}
54
+ classes={{ icon: listIconCls }}
55
+ {active}
56
+ {horizontal}
57
+ {...item}
58
+ onclick={item.onclick ?? createItemClickHandler()}
59
+ />
47
60
  {/if}
48
61
  {/each}
49
62
  {:else}
@@ -55,7 +68,7 @@
55
68
  @component
56
69
  [Go to docs](https://flowbite-svelte.com/)
57
70
  ## Type
58
- [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1069)
71
+ [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1068)
59
72
  ## Props
60
73
  @prop children
61
74
  @prop items
@@ -65,7 +78,6 @@
65
78
  @prop rounded
66
79
  @prop border
67
80
  @prop class: className
68
- @prop itemClass
69
- @prop iconClass
81
+ @prop classes
70
82
  @prop ...restProps
71
83
  -->
@@ -2,7 +2,7 @@ import type { ListgroupProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1069)
5
+ * [ListgroupProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1068)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop items
@@ -12,8 +12,7 @@ import type { ListgroupProps } from "..";
12
12
  * @prop rounded
13
13
  * @prop border
14
14
  * @prop class: className
15
- * @prop itemClass
16
- * @prop iconClass
15
+ * @prop classes
17
16
  * @prop ...restProps
18
17
  */
19
18
  declare const Listgroup: import("svelte").Component<ListgroupProps, {}, "">;
@@ -1,12 +1,14 @@
1
1
  <script lang="ts">
2
+ import type { HTMLLiAttributes } from "svelte/elements";
2
3
  import clsx from "clsx";
3
4
  import type { ListgroupItemProps } from "..";
4
5
  import { listGroupItem, type ListgroupItemVariants } from "./theme";
5
6
  import { getTheme } from "../theme/themeUtils";
6
7
  import { getListGroupContext } from "../context";
7
8
 
8
- let { children, active, current, disabled, horizontal, name, Icon, class: className, iconClass = "me-2.5 h-15 w-15", ...restProps }: ListgroupItemProps = $props();
9
+ let { children, active, current, disabled, horizontal, name, Icon, class: className, classes, href, type, ...restProps }: ListgroupItemProps = $props();
9
10
 
11
+ const styling = $derived(classes);
10
12
  const theme = $derived(getTheme("listGroupItem"));
11
13
 
12
14
  const listGroupCtx = getListGroupContext();
@@ -14,12 +16,12 @@
14
16
  const finalHorizontal = $derived(horizontal ?? listGroupCtx?.horizontal);
15
17
 
16
18
  let state: ListgroupItemVariants["state"] = $derived(disabled ? "disabled" : current ? "current" : "normal");
17
- let itemClass = $derived(listGroupItem({ state, active: finalActive, horizontal: finalHorizontal, class: clsx(theme, className) }));
19
+ const { base, icon } = $derived(listGroupItem({ state, active: finalActive, horizontal: finalHorizontal }));
18
20
  </script>
19
21
 
20
22
  {#snippet nameOrChildren()}
21
23
  {#if Icon}
22
- <Icon class={clsx(iconClass)} />
24
+ <Icon class={icon({ class: clsx(theme?.icon, styling?.icon) })} />
23
25
  {/if}
24
26
  {#if children}
25
27
  {@render children()}
@@ -28,16 +30,16 @@
28
30
  {/if}
29
31
  {/snippet}
30
32
 
31
- {#if restProps.href === undefined && !active}
32
- <li class={itemClass}>
33
+ {#if href === undefined && !active}
34
+ <li {...restProps as HTMLLiAttributes} class={base({ class: clsx(theme?.base, className) })}>
33
35
  {@render nameOrChildren()}
34
36
  </li>
35
- {:else if restProps.href === undefined}
36
- <button type="button" {...restProps} class={itemClass} {disabled} aria-current={current}>
37
+ {:else if href === undefined}
38
+ <button type={type ?? "button"} {...restProps} class={base({ class: clsx(theme?.base, className) })} {disabled} aria-current={current}>
37
39
  {@render nameOrChildren()}
38
40
  </button>
39
41
  {:else}
40
- <a {...restProps} class={itemClass} aria-current={current}>
42
+ <a {href} {...restProps} class={base({ class: clsx(theme?.base, className) })} aria-current={current}>
41
43
  {@render nameOrChildren()}
42
44
  </a>
43
45
  {/if}
@@ -46,7 +48,7 @@
46
48
  @component
47
49
  [Go to docs](https://flowbite-svelte.com/)
48
50
  ## Type
49
- [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1080)
51
+ [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1078)
50
52
  ## Props
51
53
  @prop children
52
54
  @prop active
@@ -56,6 +58,8 @@
56
58
  @prop name
57
59
  @prop Icon
58
60
  @prop class: className
59
- @prop iconClass = "me-2.5 h-15 w-15"
61
+ @prop classes
62
+ @prop href
63
+ @prop type
60
64
  @prop ...restProps
61
65
  -->
@@ -2,7 +2,7 @@ import type { ListgroupItemProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1080)
5
+ * [ListgroupItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1078)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop active
@@ -12,7 +12,9 @@ import type { ListgroupItemProps } from "..";
12
12
  * @prop name
13
13
  * @prop Icon
14
14
  * @prop class: className
15
- * @prop iconClass = "me-2.5 h-15 w-15"
15
+ * @prop classes
16
+ * @prop href
17
+ * @prop type
16
18
  * @prop ...restProps
17
19
  */
18
20
  declare const ListgroupItem: import("svelte").Component<ListgroupItemProps, {}, "">;
@@ -1,46 +1,95 @@
1
1
  import { type VariantProps } from "tailwind-variants";
2
- export type ListgroupVariants = VariantProps<typeof listGroup>;
3
- export type ListgroupItemVariants = VariantProps<typeof listGroupItem>;
2
+ import type { Classes } from "../theme/themeUtils";
3
+ export type ListgroupVariants = VariantProps<typeof listGroup> & Classes<typeof listGroup>;
4
+ export type ListgroupItemVariants = VariantProps<typeof listGroupItem> & Classes<typeof listGroupItem>;
4
5
  export declare const listGroup: import("tailwind-variants").TVReturnType<{
5
6
  rounded: {
6
- true: string;
7
- false: string;
7
+ true: {
8
+ base: string;
9
+ };
10
+ false: {
11
+ base: string;
12
+ };
8
13
  };
9
14
  border: {
10
- true: string;
11
- false: string;
15
+ true: {
16
+ base: string;
17
+ };
18
+ false: {
19
+ base: string;
20
+ };
12
21
  };
13
22
  horizontal: {
14
- true: string;
15
- false: string;
16
- };
17
- }, undefined, "flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600", {
23
+ true: {
24
+ base: string;
25
+ };
26
+ false: {
27
+ base: string;
28
+ };
29
+ };
30
+ }, {
31
+ base: string;
32
+ item: string;
33
+ icon: string;
34
+ }, undefined, {
18
35
  rounded: {
19
- true: string;
20
- false: string;
36
+ true: {
37
+ base: string;
38
+ };
39
+ false: {
40
+ base: string;
41
+ };
21
42
  };
22
43
  border: {
23
- true: string;
24
- false: string;
44
+ true: {
45
+ base: string;
46
+ };
47
+ false: {
48
+ base: string;
49
+ };
25
50
  };
26
51
  horizontal: {
27
- true: string;
28
- false: string;
29
- };
30
- }, undefined, import("tailwind-variants").TVReturnType<{
52
+ true: {
53
+ base: string;
54
+ };
55
+ false: {
56
+ base: string;
57
+ };
58
+ };
59
+ }, {
60
+ base: string;
61
+ item: string;
62
+ icon: string;
63
+ }, import("tailwind-variants").TVReturnType<{
31
64
  rounded: {
32
- true: string;
33
- false: string;
65
+ true: {
66
+ base: string;
67
+ };
68
+ false: {
69
+ base: string;
70
+ };
34
71
  };
35
72
  border: {
36
- true: string;
37
- false: string;
73
+ true: {
74
+ base: string;
75
+ };
76
+ false: {
77
+ base: string;
78
+ };
38
79
  };
39
80
  horizontal: {
40
- true: string;
41
- false: string;
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>>;
81
+ true: {
82
+ base: string;
83
+ };
84
+ false: {
85
+ base: string;
86
+ };
87
+ };
88
+ }, {
89
+ base: string;
90
+ item: string;
91
+ icon: string;
92
+ }, undefined, unknown, unknown, undefined>>;
44
93
  export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
45
94
  state: {
46
95
  normal: string;
@@ -55,7 +104,10 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
55
104
  true: string;
56
105
  false: string;
57
106
  };
58
- }, undefined, "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2", {
107
+ }, {
108
+ base: string;
109
+ icon: string;
110
+ }, undefined, {
59
111
  state: {
60
112
  normal: string;
61
113
  current: string;
@@ -69,7 +121,10 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
69
121
  true: string;
70
122
  false: string;
71
123
  };
72
- }, undefined, import("tailwind-variants").TVReturnType<{
124
+ }, {
125
+ base: string;
126
+ icon: string;
127
+ }, import("tailwind-variants").TVReturnType<{
73
128
  state: {
74
129
  normal: string;
75
130
  current: string;
@@ -83,4 +138,7 @@ export declare const listGroupItem: import("tailwind-variants").TVReturnType<{
83
138
  true: string;
84
139
  false: string;
85
140
  };
86
- }, undefined, "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2", unknown, unknown, undefined>>;
141
+ }, {
142
+ base: string;
143
+ icon: string;
144
+ }, undefined, unknown, unknown, undefined>>;
@@ -1,24 +1,28 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const listGroup = tv({
3
- base: "flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600",
3
+ slots: {
4
+ base: "flex bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 divide-gray-200 dark:divide-gray-600",
5
+ item: "",
6
+ icon: ""
7
+ },
4
8
  variants: {
5
9
  rounded: {
6
- true: "rounded-lg",
7
- false: ""
10
+ true: { base: "rounded-lg" },
11
+ false: { base: "" }
8
12
  },
9
13
  border: {
10
- true: "border border-gray-200 dark:border-gray-700",
11
- false: ""
14
+ true: { base: "border border-gray-200 dark:border-gray-700" },
15
+ false: { base: "" }
12
16
  },
13
17
  horizontal: {
14
- true: "flex-row divide-x",
15
- false: "flex-col divide-y"
18
+ true: { base: "flex-row divide-x" },
19
+ false: { base: "flex-col divide-y" }
16
20
  }
17
21
  },
18
22
  compoundVariants: [
19
23
  {
20
24
  border: true,
21
- class: "divide-gray-200 dark:divide-gray-700"
25
+ class: { base: "divide-gray-200 dark:divide-gray-700" }
22
26
  }
23
27
  ],
24
28
  defaultVariants: {
@@ -28,12 +32,15 @@ export const listGroup = tv({
28
32
  }
29
33
  });
30
34
  export const listGroupItem = tv({
31
- base: "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2",
35
+ slots: {
36
+ base: "py-2 px-4 w-full text-sm font-medium list-none flex items-center text-left gap-2",
37
+ icon: "w-4 h-4 me-1.5"
38
+ },
32
39
  variants: {
33
40
  state: {
34
41
  normal: "",
35
42
  current: "text-white bg-primary-700 dark:text-white dark:bg-gray-800",
36
- disabled: "text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400"
43
+ disabled: "text-gray-900 bg-gray-100 dark:bg-gray-600 dark:text-gray-400 opacity-50"
37
44
  },
38
45
  active: {
39
46
  true: "",
@@ -55,13 +62,5 @@ export const listGroupItem = tv({
55
62
  state: "normal",
56
63
  class: "hover:bg-gray-100 hover:text-primary-700 dark:hover:bg-gray-600 dark:hover:text-white focus:z-40 focus:outline-hidden focus:ring-2 focus:ring-primary-700 focus:text-primary-700 dark:focus:ring-gray-500 dark:focus:text-white"
57
64
  }
58
- // {
59
- // horizontal: true,
60
- // class: "focus:first:rounded-s-lg focus:last:rounded-e-lg"
61
- // },
62
- // {
63
- // horizontal: false,
64
- // class: "focus:first:rounded-t-lg focus:last:rounded-b-lg"
65
- // }
66
65
  ]
67
66
  });
@@ -3,25 +3,18 @@
3
3
  import clsx from "clsx";
4
4
  import type { MegaMenuProps } from "..";
5
5
  import Popper from "../utils/Popper.svelte";
6
- import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
7
- import { untrack } from "svelte";
6
+ import { getTheme } from "../theme/themeUtils";
8
7
 
9
- let { children, extra, items = [], full, ulClass, isOpen = $bindable(false), class: className, extraClass, classes, ...restProps }: MegaMenuProps = $props();
8
+ let { children, extra, items = [], full, isOpen = $bindable(false), class: className, classes, ...restProps }: MegaMenuProps = $props();
10
9
 
11
- warnThemeDeprecation(
12
- "MegaMenu",
13
- untrack(() => ({ ulClass, extraClass })),
14
- { ulClass: "ul", extraClass: "extra" }
15
- );
16
-
17
- const styling = $derived(classes ?? { ul: ulClass, extra: extraClass });
10
+ const styling = $derived(classes);
18
11
  const theme = $derived(getTheme("megamenu"));
19
12
  const { base, div, ul, extra: extraCls } = $derived(megamenu({ full, hasExtra: !!extra }));
20
13
  </script>
21
14
 
22
15
  <Popper arrow={false} bind:isOpen trigger="click" placement="bottom" yOnly={full} {...restProps} class={base({ class: clsx(theme?.base, className) })}>
23
- <div class={div({ class: clsx(theme?.div, classes?.div) })}>
24
- <ul class={ul({ class: clsx(theme?.ul, styling.ul) })}>
16
+ <div class={div({ class: clsx(theme?.div, styling?.div) })}>
17
+ <ul class={ul({ class: clsx(theme?.ul, styling?.ul) })}>
25
18
  {#each items as item, index (item.name)}
26
19
  <li>
27
20
  {@render children({ item, index })}
@@ -30,7 +23,7 @@
30
23
  {@render children({ item: items[0], index: 0 })}
31
24
  {/each}
32
25
  </ul>
33
- {#if full && extra}<div class={extraCls({ class: clsx(theme?.extra, styling.extra) })}>{@render extra()}</div>{/if}
26
+ {#if full && extra}<div class={extraCls({ class: clsx(theme?.extra, styling?.extra) })}>{@render extra()}</div>{/if}
34
27
  </div>
35
28
  </Popper>
36
29
 
@@ -38,16 +31,14 @@
38
31
  @component
39
32
  [Go to docs](https://flowbite-svelte.com/)
40
33
  ## Type
41
- [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1091)
34
+ [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1088)
42
35
  ## Props
43
36
  @prop children
44
37
  @prop extra
45
38
  @prop items = []
46
39
  @prop full
47
- @prop ulClass
48
40
  @prop isOpen = $bindable(false)
49
41
  @prop class: className
50
- @prop extraClass
51
42
  @prop classes
52
43
  @prop ...restProps
53
44
  -->
@@ -2,16 +2,14 @@ import type { MegaMenuProps } from "..";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1091)
5
+ * [MegaMenuProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1088)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop extra
9
9
  * @prop items = []
10
10
  * @prop full
11
- * @prop ulClass
12
11
  * @prop isOpen = $bindable(false)
13
12
  * @prop class: className
14
- * @prop extraClass
15
13
  * @prop classes
16
14
  * @prop ...restProps
17
15
  */