flowbite-svelte 1.30.0 → 1.31.0

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 (195) hide show
  1. package/dist/accordion/Accordion.svelte +5 -4
  2. package/dist/accordion/AccordionItem.svelte +4 -4
  3. package/dist/alert/Alert.svelte +1 -1
  4. package/dist/avatar/Avatar.svelte +1 -1
  5. package/dist/badge/Badge.svelte +7 -3
  6. package/dist/banner/Banner.svelte +7 -3
  7. package/dist/bottom-navigation/BottomNav.svelte +7 -3
  8. package/dist/bottom-navigation/BottomNavHeader.svelte +7 -3
  9. package/dist/bottom-navigation/BottomNavHeaderItem.svelte +1 -1
  10. package/dist/bottom-navigation/BottomNavItem.svelte +7 -3
  11. package/dist/breadcrumb/Breadcrumb.svelte +7 -3
  12. package/dist/breadcrumb/BreadcrumbItem.svelte +1 -1
  13. package/dist/button-group/ButtonGroup.svelte +1 -1
  14. package/dist/buttons/Button.svelte +1 -1
  15. package/dist/buttons/GradientButton.svelte +1 -1
  16. package/dist/card/Card.svelte +7 -3
  17. package/dist/carousel/Carousel.svelte +7 -3
  18. package/dist/carousel/CarouselIndicators.svelte +1 -1
  19. package/dist/carousel/ControlButton.svelte +1 -1
  20. package/dist/carousel/Controls.svelte +1 -1
  21. package/dist/carousel/Slide.svelte +1 -1
  22. package/dist/carousel/Thumbnail.svelte +1 -1
  23. package/dist/carousel/Thumbnails.svelte +1 -1
  24. package/dist/clipboard/Clipboard.svelte +1 -1
  25. package/dist/clipboard-manager/ClipboardManager.svelte +1 -1
  26. package/dist/command-palette/CommandPalette.svelte +2 -2
  27. package/dist/command-palette/CommandPalette.svelte.d.ts +1 -1
  28. package/dist/context.d.ts +4 -1
  29. package/dist/context.js +0 -1
  30. package/dist/darkmode/DarkMode.svelte +1 -1
  31. package/dist/datepicker/Datepicker.svelte +1 -1
  32. package/dist/device-mockups/Android.svelte +2 -2
  33. package/dist/device-mockups/DefaultMockup.svelte +2 -2
  34. package/dist/device-mockups/Desktop.svelte +6 -2
  35. package/dist/device-mockups/Ios.svelte +2 -2
  36. package/dist/device-mockups/Laptop.svelte +2 -2
  37. package/dist/device-mockups/Smartwatch.svelte +2 -2
  38. package/dist/device-mockups/Tablet.svelte +2 -2
  39. package/dist/drawer/Drawer.svelte +1 -1
  40. package/dist/drawer/DrawerHandle.svelte +1 -1
  41. package/dist/drawer/Drawerhead.svelte +7 -3
  42. package/dist/dropdown/Dropdown.svelte +1 -1
  43. package/dist/dropdown/DropdownDivider.svelte +1 -1
  44. package/dist/dropdown/DropdownGroup.svelte +1 -1
  45. package/dist/dropdown/DropdownHeader.svelte +1 -1
  46. package/dist/dropdown/DropdownItem.svelte +7 -3
  47. package/dist/footer/Footer.svelte +1 -1
  48. package/dist/footer/FooterBrand.svelte +1 -1
  49. package/dist/footer/FooterCopyright.svelte +7 -3
  50. package/dist/footer/FooterIcon.svelte +1 -1
  51. package/dist/footer/FooterLink.svelte +7 -3
  52. package/dist/footer/FooterLinkGroup.svelte +1 -1
  53. package/dist/forms/button-toggle/ButtonToggle.svelte +7 -3
  54. package/dist/forms/button-toggle/ButtonToggleGroup.svelte +1 -1
  55. package/dist/forms/checkbox/Checkbox.svelte +7 -3
  56. package/dist/forms/checkbox/CheckboxButton.svelte +1 -1
  57. package/dist/forms/dropzone/Dropzone.svelte +1 -1
  58. package/dist/forms/fileupload/Fileupload.svelte +7 -3
  59. package/dist/forms/floating-label/FloatingLabelInput.svelte +3 -3
  60. package/dist/forms/helper/Helper.svelte +1 -1
  61. package/dist/forms/input-field/Input.svelte +3 -4
  62. package/dist/forms/label/Label.svelte +1 -1
  63. package/dist/forms/phoneinput/PhoneInput.svelte +1 -1
  64. package/dist/forms/radio/Radio.svelte +7 -3
  65. package/dist/forms/radio/RadioButton.svelte +1 -1
  66. package/dist/forms/range/Range.svelte +1 -1
  67. package/dist/forms/search/Search.svelte +7 -3
  68. package/dist/forms/select/MultiSelect.svelte +13 -6
  69. package/dist/forms/select/Select.svelte +7 -3
  70. package/dist/forms/tags/Tags.svelte +7 -4
  71. package/dist/forms/textarea/Textarea.svelte +3 -3
  72. package/dist/forms/timepicker/Timepicker.svelte +1 -1
  73. package/dist/forms/toggle/Toggle.svelte +7 -3
  74. package/dist/gallery/Gallery.svelte +7 -3
  75. package/dist/indicator/Indicator.svelte +1 -1
  76. package/dist/kanban/KanbanBoard.svelte +1 -1
  77. package/dist/kanban/KanbanCard.svelte +2 -2
  78. package/dist/kanban/KanbanCard.svelte.d.ts +1 -1
  79. package/dist/kbd/Kbd.svelte +1 -1
  80. package/dist/list-group/Listgroup.svelte +1 -1
  81. package/dist/list-group/ListgroupItem.svelte +1 -1
  82. package/dist/mega-menu/MegaMenu.svelte +7 -3
  83. package/dist/modal/Modal.svelte +7 -3
  84. package/dist/navbar/NavBrand.svelte +1 -1
  85. package/dist/navbar/NavContainer.svelte +1 -1
  86. package/dist/navbar/NavHamburger.svelte +7 -3
  87. package/dist/navbar/NavLi.svelte +1 -1
  88. package/dist/navbar/NavUl.svelte +7 -3
  89. package/dist/navbar/Navbar.svelte +1 -1
  90. package/dist/pagination/Pagination.svelte +1 -1
  91. package/dist/pagination/PaginationButton.svelte +1 -1
  92. package/dist/pagination/PaginationItem.svelte +1 -1
  93. package/dist/pagination/PaginationNav.svelte +7 -3
  94. package/dist/popover/Popover.svelte +7 -3
  95. package/dist/progress/Progressbar.svelte +1 -1
  96. package/dist/progress/Progressradial.svelte +1 -1
  97. package/dist/rating/AdvancedRating.svelte +3 -3
  98. package/dist/rating/Rating.svelte +7 -3
  99. package/dist/rating/Review.svelte +3 -3
  100. package/dist/rating/ScoreRating.svelte +1 -1
  101. package/dist/scroll-spy/ScrollSpy.svelte +2 -2
  102. package/dist/scroll-spy/ScrollSpy.svelte.d.ts +1 -1
  103. package/dist/sidebar/Sidebar.svelte +7 -3
  104. package/dist/sidebar/SidebarBrand.svelte +7 -3
  105. package/dist/sidebar/SidebarButton.svelte +1 -1
  106. package/dist/sidebar/SidebarCta.svelte +7 -3
  107. package/dist/sidebar/SidebarDropdownWrapper.svelte +7 -3
  108. package/dist/skeleton/CardPlaceholder.svelte +1 -1
  109. package/dist/skeleton/ImagePlaceholder.svelte +1 -1
  110. package/dist/skeleton/ListPlaceholder.svelte +1 -1
  111. package/dist/skeleton/Skeleton.svelte +1 -1
  112. package/dist/skeleton/TestimonialPlaceholder.svelte +1 -1
  113. package/dist/skeleton/TextPlaceholder.svelte +1 -1
  114. package/dist/skeleton/VideoPlaceholder.svelte +1 -1
  115. package/dist/skeleton/WidgetPlaceholder.svelte +1 -1
  116. package/dist/speed-dial/SpeedDial.svelte +7 -4
  117. package/dist/speed-dial/SpeedDialButton.svelte +7 -4
  118. package/dist/spinner/Spinner.svelte +1 -1
  119. package/dist/split-pane/Divider.svelte +4 -4
  120. package/dist/split-pane/Divider.svelte.d.ts +1 -1
  121. package/dist/split-pane/Pane.svelte +2 -2
  122. package/dist/split-pane/Pane.svelte.d.ts +1 -1
  123. package/dist/split-pane/SplitPane.svelte +2 -2
  124. package/dist/split-pane/SplitPane.svelte.d.ts +1 -1
  125. package/dist/step-indicator/StepIndicator.svelte +1 -1
  126. package/dist/stepper/BreadcrumbStepper.svelte +1 -1
  127. package/dist/stepper/DetailedStepper.svelte +1 -1
  128. package/dist/stepper/ProgressStepper.svelte +1 -1
  129. package/dist/stepper/Stepper.svelte +1 -1
  130. package/dist/stepper/TimelineStepper.svelte +1 -1
  131. package/dist/stepper/VerticalStepper.svelte +1 -1
  132. package/dist/table/Table.svelte +7 -3
  133. package/dist/table/TableBodyCell.svelte +1 -1
  134. package/dist/table/TableBodyRow.svelte +1 -1
  135. package/dist/table/TableHead.svelte +1 -1
  136. package/dist/table/TableHeadCell.svelte +1 -1
  137. package/dist/table/TableSearch.svelte +3 -3
  138. package/dist/tabs/TabItem.svelte +1 -1
  139. package/dist/tabs/Tabs.svelte +7 -3
  140. package/dist/theme/ThemeProvider.svelte +11 -6
  141. package/dist/theme/themeUtils.js +4 -2
  142. package/dist/timeline/Activity.svelte +1 -1
  143. package/dist/timeline/ActivityItem.svelte +3 -3
  144. package/dist/timeline/Group.svelte +3 -3
  145. package/dist/timeline/GroupItem.svelte +3 -3
  146. package/dist/timeline/Timeline.svelte +3 -5
  147. package/dist/timeline/TimelineItem.svelte +9 -5
  148. package/dist/timeline/TimelineItem.svelte.d.ts +1 -0
  149. package/dist/timeline/theme.d.ts +3 -0
  150. package/dist/timeline/theme.js +2 -1
  151. package/dist/toast/Toast.svelte +4 -4
  152. package/dist/toast/Toast.svelte.d.ts +1 -1
  153. package/dist/toast/ToastContainer.svelte +2 -2
  154. package/dist/toast/ToastContainer.svelte.d.ts +1 -1
  155. package/dist/toolbar/Toolbar.svelte +1 -1
  156. package/dist/toolbar/ToolbarButton.svelte +1 -1
  157. package/dist/toolbar/ToolbarGroup.svelte +1 -1
  158. package/dist/tooltip/Tooltip.svelte +1 -1
  159. package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
  160. package/dist/tour/Tour.svelte +1 -1
  161. package/dist/types.d.ts +1 -0
  162. package/dist/typography/a/A.svelte +2 -2
  163. package/dist/typography/a/A.svelte.d.ts +1 -1
  164. package/dist/typography/blockquote/Blockquote.svelte +2 -2
  165. package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
  166. package/dist/typography/descriptionlist/DescriptionList.svelte +2 -2
  167. package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
  168. package/dist/typography/heading/Heading.svelte +2 -2
  169. package/dist/typography/heading/Heading.svelte.d.ts +1 -1
  170. package/dist/typography/hr/Hr.svelte +3 -3
  171. package/dist/typography/img/Img.svelte +4 -4
  172. package/dist/typography/img/Img.svelte.d.ts +1 -1
  173. package/dist/typography/layout/Layout.svelte +2 -2
  174. package/dist/typography/layout/Layout.svelte.d.ts +1 -1
  175. package/dist/typography/list/Li.svelte +1 -1
  176. package/dist/typography/list/Li.svelte.d.ts +1 -1
  177. package/dist/typography/list/List.svelte +2 -2
  178. package/dist/typography/list/List.svelte.d.ts +1 -1
  179. package/dist/typography/mark/Mark.svelte +2 -2
  180. package/dist/typography/mark/Mark.svelte.d.ts +1 -1
  181. package/dist/typography/paragraph/P.svelte +2 -2
  182. package/dist/typography/paragraph/P.svelte.d.ts +1 -1
  183. package/dist/typography/secondary/Secondary.svelte +2 -2
  184. package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
  185. package/dist/typography/span/Span.svelte +2 -2
  186. package/dist/typography/span/Span.svelte.d.ts +1 -1
  187. package/dist/utils/Arrow.svelte +1 -1
  188. package/dist/utils/Arrow.svelte.d.ts +1 -1
  189. package/dist/utils/Popper.svelte +1 -1
  190. package/dist/utils/Popper.svelte.d.ts +1 -1
  191. package/dist/video/Video.svelte +2 -2
  192. package/dist/video/Video.svelte.d.ts +1 -1
  193. package/dist/virtual-masonry/VirtualMasonry.svelte +1 -1
  194. package/dist/virtuallist/VirtualList.svelte +1 -1
  195. package/package.json +22 -22
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { size = "sm", class: className, classes, ...restProps }: TextPlaceholderProps = $props();
8
8
 
9
- const theme = getTheme("textPlaceholder");
9
+ const theme = $derived(getTheme("textPlaceholder"));
10
10
 
11
11
  const { base, div, lineA, lineB } = $derived(
12
12
  textPlaceholder({
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { size = "sm", class: className }: VideoPlaceholderProps = $props();
8
8
 
9
- const theme = getTheme("videoPlaceholder");
9
+ const theme = $derived(getTheme("videoPlaceholder"));
10
10
 
11
11
  const base = $derived(videoPlaceholder({ size, class: clsx(theme, className) }));
12
12
  </script>
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { class: className, classes }: WidgetPlaceholderProps = $props();
8
8
 
9
- const theme = getTheme("widgetPlaceholder");
9
+ const theme = $derived(getTheme("widgetPlaceholder"));
10
10
 
11
11
  const { base, wrapper, vLine, hLine } = widgetPlaceholder({});
12
12
  </script>
@@ -2,7 +2,7 @@
2
2
  import clsx from "clsx";
3
3
  import Popper from "../utils/Popper.svelte";
4
4
  import { getSideAxis } from "@floating-ui/utils";
5
- import { setContext } from "svelte";
5
+ import { setContext, untrack } from "svelte";
6
6
  import { speedDial } from "./theme";
7
7
  import type { SpeedDialProps, SpeedCtxType } from "../types";
8
8
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
@@ -21,8 +21,11 @@
21
21
  ...restProps
22
22
  }: SpeedDialProps = $props();
23
23
 
24
- // svelte-ignore state_referenced_locally
25
- warnThemeDeprecation("SpeedDial", { popperClass }, { popperClass: "popper" });
24
+ warnThemeDeprecation(
25
+ "SpeedDial",
26
+ untrack(() => ({ popperClass })),
27
+ { popperClass: "popper" }
28
+ );
26
29
 
27
30
  const styling = $derived(
28
31
  classes ?? {
@@ -30,7 +33,7 @@
30
33
  }
31
34
  );
32
35
 
33
- const theme = getTheme("speedDial");
36
+ const theme = $derived(getTheme("speedDial"));
34
37
 
35
38
  $effect(() => {
36
39
  setContext<SpeedCtxType>("speed-dial", { pill, tooltip, textOutside });
@@ -2,7 +2,7 @@
2
2
  import Button from "../buttons/Button.svelte";
3
3
  import Tooltip from "../tooltip/Tooltip.svelte";
4
4
  import type { Placement } from "@floating-ui/dom";
5
- import { getContext } from "svelte";
5
+ import { getContext, untrack } from "svelte";
6
6
  import { speedDialButton } from "./theme";
7
7
  import type { SpeedCtxType, SpeedDialButtonProps } from "../types";
8
8
  import clsx from "clsx";
@@ -23,8 +23,11 @@
23
23
  ...restProps
24
24
  }: SpeedDialButtonProps = $props();
25
25
 
26
- // svelte-ignore state_referenced_locally
27
- warnThemeDeprecation("SpeedDialButton", { textClass }, { textClass: "span" });
26
+ warnThemeDeprecation(
27
+ "SpeedDialButton",
28
+ untrack(() => ({ textClass })),
29
+ { textClass: "span" }
30
+ );
28
31
 
29
32
  const styling = $derived(
30
33
  classes ?? {
@@ -34,7 +37,7 @@
34
37
 
35
38
  let tooltip = $derived<Placement | "none">(_tooltip ?? context.tooltip);
36
39
 
37
- const theme = getTheme("speedDialButton");
40
+ const theme = $derived(getTheme("speedDialButton"));
38
41
 
39
42
  let { base, span } = $derived(speedDialButton({ textOutside, noTooltip: tooltip === "none" }));
40
43
  let spanCls = $derived(tooltip === "none" || textOutside ? span({ class: clsx(theme?.span, styling.span) }) : "sr-only");
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { type = "default", color = "primary", size = "8", class: className, currentFill = "inherit", currentColor = "currentColor", ...restProps }: SpinnerProps = $props();
8
8
 
9
- const theme = getTheme("spinner");
9
+ const theme = $derived(getTheme("spinner"));
10
10
  let spinnerClass = $derived(spinner({ type, color, size, class: clsx(theme, className) }));
11
11
  </script>
12
12
 
@@ -7,8 +7,8 @@
7
7
 
8
8
  let { direction, index, onMouseDown, onTouchStart, onKeyDown, isDragging, currentSize, class: className = "" }: DividerProps = $props();
9
9
 
10
- const themePane = getTheme("divider");
11
- const themeDividerHitArea = getTheme("dividerHitArea");
10
+ const themeDivider = $derived(getTheme("divider"));
11
+ const themeDividerHitArea = $derived(getTheme("dividerHitArea"));
12
12
 
13
13
  const isHorizontal = $derived(direction === "horizontal");
14
14
  const roundedSize = $derived(Math.round(currentSize));
@@ -25,7 +25,7 @@
25
25
  aria-valuemin="0"
26
26
  aria-valuemax="100"
27
27
  aria-valuetext={`${roundedSize} percent`}
28
- class={divider({ direction, isDragging, class: clsx(themePane, className) })}
28
+ class={divider({ direction, isDragging, class: clsx(themeDivider, className) })}
29
29
  onmousedown={(e) => onMouseDown(e, index)}
30
30
  use:nonPassiveTouch={(e) => onTouchStart(e, index)}
31
31
  onkeydown={(e) => onKeyDown(e, index)}
@@ -37,7 +37,7 @@
37
37
  @component
38
38
  [Go to docs](https://flowbite-svelte.com/)
39
39
  ## Type
40
- [DividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2258)
40
+ [DividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2259)
41
41
  ## Props
42
42
  @prop direction
43
43
  @prop index
@@ -2,7 +2,7 @@ import type { DividerProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [DividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2258)
5
+ * [DividerProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2259)
6
6
  * ## Props
7
7
  * @prop direction
8
8
  * @prop index
@@ -8,7 +8,7 @@
8
8
 
9
9
  let { children, class: className = "", style = "" }: PaneProps = $props();
10
10
 
11
- const theme = getTheme("pane");
11
+ const theme = $derived(getTheme("pane"));
12
12
 
13
13
  const context = getSplitPaneContext();
14
14
  const paneIndex = context ? context.registerPane() : 0;
@@ -47,7 +47,7 @@
47
47
  @component
48
48
  [Go to docs](https://flowbite-svelte.com/)
49
49
  ## Type
50
- [PaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2252)
50
+ [PaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2253)
51
51
  ## Props
52
52
  @prop children
53
53
  @prop class: className = ""
@@ -2,7 +2,7 @@ import type { PaneProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [PaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2252)
5
+ * [PaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2253)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop class: className = ""
@@ -40,7 +40,7 @@
40
40
  transition = transitionProp;
41
41
  }
42
42
  });
43
- const theme = getTheme("splitpane");
43
+ const theme = $derived(getTheme("splitpane"));
44
44
 
45
45
  let isDragging = $state(false);
46
46
  let startPos = $state(0);
@@ -385,7 +385,7 @@
385
385
  @component
386
386
  [Go to docs](https://flowbite-svelte.com/)
387
387
  ## Type
388
- [SplitPaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2238)
388
+ [SplitPaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2239)
389
389
  ## Props
390
390
  @prop direction = "horizontal"
391
391
  @prop minSize = 100
@@ -2,7 +2,7 @@ import type { SplitPaneProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [SplitPaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2238)
5
+ * [SplitPaneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L2239)
6
6
  * ## Props
7
7
  * @prop direction = "horizontal"
8
8
  * @prop minSize = 100
@@ -20,7 +20,7 @@
20
20
  ...restProps
21
21
  }: StepIndicatorProps = $props();
22
22
 
23
- const theme = getTheme("stepIndicator");
23
+ const theme = $derived(getTheme("stepIndicator"));
24
24
 
25
25
  const { base, label, container, wrapper, step: stepCls, glow: stepGlow, incomplete } = $derived(stepIndicator({ size, color, glow, hideLabel }));
26
26
 
@@ -14,7 +14,7 @@
14
14
  if (current > steps.length && steps.length > 0) current = steps.length;
15
15
  });
16
16
 
17
- const theme = getTheme("breadcrumbStepper");
17
+ const theme = $derived(getTheme("breadcrumbStepper"));
18
18
 
19
19
  const { base, item, indicator } = $derived(breadcrumbStepper());
20
20
 
@@ -13,7 +13,7 @@
13
13
  if (current > steps.length && steps.length > 0) current = steps.length;
14
14
  });
15
15
 
16
- const theme = getTheme("detailedStepper");
16
+ const theme = $derived(getTheme("detailedStepper"));
17
17
 
18
18
  // Override the theme to make current step also highlighted
19
19
  const stepperTheme = $derived(() => {
@@ -31,7 +31,7 @@
31
31
  }
32
32
  });
33
33
 
34
- const theme = getTheme("progressStepper");
34
+ const theme = $derived(getTheme("progressStepper"));
35
35
 
36
36
  const { base, item, circle, line, progressLine } = $derived(progressStepper());
37
37
 
@@ -14,7 +14,7 @@
14
14
  if (current > steps.length && steps.length > 0) current = steps.length;
15
15
  });
16
16
 
17
- const theme = getTheme("stepper");
17
+ const theme = $derived(getTheme("stepper"));
18
18
 
19
19
  const { base, item, content } = $derived(stepper());
20
20
 
@@ -15,7 +15,7 @@
15
15
  if (current > steps.length && steps.length > 0) current = steps.length;
16
16
  });
17
17
 
18
- const theme = getTheme("timelineStepper");
18
+ const theme = $derived(getTheme("timelineStepper"));
19
19
 
20
20
  const { base, item, circle } = $derived(timelineStepper());
21
21
 
@@ -14,7 +14,7 @@
14
14
  if (current > steps.length && steps.length > 0) current = steps.length;
15
15
  });
16
16
 
17
- const theme = getTheme("verticalStepper");
17
+ const theme = $derived(getTheme("verticalStepper"));
18
18
 
19
19
  const { base, card, content } = $derived(verticalStepper());
20
20
 
@@ -6,18 +6,22 @@
6
6
  import clsx from "clsx";
7
7
  import type { TableProps, TableContextType } from "../types";
8
8
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
9
+ import { untrack } from "svelte";
9
10
 
10
11
  let { children, footerSlot, captionSlot, items, divClass, striped, hoverable, border = true, shadow, color = "default", class: className, classes, ...restProps }: TableProps = $props();
11
12
 
12
- // svelte-ignore state_referenced_locally
13
- warnThemeDeprecation("Table", { divClass }, { divClass: "div" });
13
+ warnThemeDeprecation(
14
+ "Table",
15
+ untrack(() => ({ divClass })),
16
+ { divClass: "div" }
17
+ );
14
18
 
15
19
  const styling = $derived(
16
20
  classes ?? {
17
21
  div: divClass
18
22
  }
19
23
  );
20
- const theme = getTheme("table");
24
+ const theme = $derived(getTheme("table"));
21
25
 
22
26
  const { div, table } = $derived(tableCls({ color, shadow }));
23
27
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { children, class: className, colspan, onclick, ...restProps }: TableBodyCellProps = $props();
8
8
 
9
- const theme = getTheme("tableBodyCell");
9
+ const theme = $derived(getTheme("tableBodyCell"));
10
10
  </script>
11
11
 
12
12
  <td {...restProps} class={tableBodyCell({ class: clsx(theme, className) })} colspan={colspan ?? 1}>
@@ -7,7 +7,7 @@
7
7
 
8
8
  let { children, class: className, color, striped, hoverable, border, ...restProps }: TableBodyRowProps = $props();
9
9
 
10
- const theme = getTheme("tableBodyRow");
10
+ const theme = $derived(getTheme("tableBodyRow"));
11
11
 
12
12
  const tableCtx = getTableContext();
13
13
  // for reactivity with svelte context
@@ -8,7 +8,7 @@
8
8
 
9
9
  let { children, headerSlot, color, striped, border, class: className, headItems, defaultRow = true, ...restProps }: TableHeadProps = $props();
10
10
 
11
- const theme = getTheme("tableHead");
11
+ const theme = $derived(getTheme("tableHead"));
12
12
 
13
13
  const tableCtx = getTableContext();
14
14
  // for reactivity with svelte context
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { children, class: className, ...restProps }: TableHeadCellProps = $props();
8
8
 
9
- const theme = getTheme("tableHeadCell");
9
+ const theme = $derived(getTheme("tableHeadCell"));
10
10
  </script>
11
11
 
12
12
  <th {...restProps} class={tableHeadCell({ class: clsx(theme, className) })}>
@@ -4,6 +4,7 @@
4
4
  import clsx from "clsx";
5
5
  import { tableSearch } from "./theme";
6
6
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
7
+ import { untrack } from "svelte";
7
8
 
8
9
  let {
9
10
  children,
@@ -27,10 +28,9 @@
27
28
  ...restProps
28
29
  }: TableSearchProps = $props();
29
30
 
30
- // svelte-ignore state_referenced_locally
31
31
  warnThemeDeprecation(
32
32
  "TableSearch",
33
- { divClass, innerDivClass, inputClass, searchClass, svgDivClass, svgClass, tableClass },
33
+ untrack(() => ({ divClass, innerDivClass, inputClass, searchClass, svgDivClass, svgClass, tableClass })),
34
34
  { divClass: "root", innerDivClass: "inner", inputClass: "input", searchClass: "search", svgDivClass: "svgDiv", svgClass: "svg", tableClass: "table" }
35
35
  );
36
36
 
@@ -46,7 +46,7 @@
46
46
  }
47
47
  );
48
48
 
49
- const theme = getTheme("tableSearch");
49
+ const theme = $derived(getTheme("tableSearch"));
50
50
 
51
51
  const themeColor = $derived(color === "custom" ? "default" : (color as "default" | "blue" | "green" | "red" | "yellow" | "purple" | "indigo" | "pink"));
52
52
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  let { children, titleSlot, open = $bindable(false), title = "Tab title", key, activeClass, inactiveClass, class: className, classes, disabled, tabStyle, ...restProps }: TabitemProps = $props();
10
10
 
11
- const theme = getTheme("tabItem");
11
+ const theme = $derived(getTheme("tabItem"));
12
12
  const tabsCtx = getTabsContext();
13
13
 
14
14
  if (!tabsCtx) {
@@ -5,15 +5,19 @@
5
5
  import clsx from "clsx";
6
6
  import { tabs } from "./theme";
7
7
  import { setTabsContext } from "../context";
8
+ import { untrack } from "svelte";
8
9
 
9
10
  let { children, selected = $bindable(), tabStyle = "none", ulClass, contentClass, divider = true, class: className, classes, ...restProps }: TabsProps = $props();
10
11
 
11
12
  const activeClasses = $derived(typeof classes?.active === "string" ? classes.active : undefined);
12
13
 
13
- // svelte-ignore state_referenced_locally
14
- warnThemeDeprecation("Tabs", { ulClass, contentClass }, { ulClass: "class", contentClass: "content" });
14
+ warnThemeDeprecation(
15
+ "Tabs",
16
+ untrack(() => ({ ulClass, contentClass })),
17
+ { ulClass: "class", contentClass: "content" }
18
+ );
15
19
 
16
- const theme = getTheme("tabs");
20
+ const theme = $derived(getTheme("tabs"));
17
21
  const styling = $derived(classes ?? { content: contentClass });
18
22
  const { base, content, divider: dividerClass } = $derived(tabs({ tabStyle, hasDivider: divider }));
19
23
 
@@ -10,13 +10,18 @@
10
10
 
11
11
  let { children, theme }: ThemeProviderProps = $props();
12
12
 
13
- $effect(() => {
14
- if (theme) {
15
- setThemeContext(theme);
16
- } else {
17
- console.log("ThemeProvider: No theme provided");
13
+ // Create a stable object with a reactive getter that will be tracked
14
+ // when accessed inside $derived expressions in child components
15
+ const themeContext: { value?: ThemeConfig } = {
16
+ get value() {
17
+ // This getter makes the theme reactive - when accessed in a $derived,
18
+ // it will track the theme prop and update when it changes
19
+ return theme;
18
20
  }
19
- });
21
+ };
22
+
23
+ // Set the context once with the stable object
24
+ setThemeContext(themeContext);
20
25
  </script>
21
26
 
22
27
  {@render children()}
@@ -1,8 +1,10 @@
1
1
  import { getThemeContext } from "../context";
2
2
  import { DEV } from "esm-env";
3
3
  export function getTheme(componentKey) {
4
- const theme = getThemeContext();
5
- return theme?.[componentKey];
4
+ const themeState = getThemeContext();
5
+ const theme = themeState && "value" in themeState ? themeState.value : themeState;
6
+ const finalTheme = theme;
7
+ return finalTheme?.[componentKey];
6
8
  }
7
9
  /**
8
10
  * Warns about deprecated theme-related props and suggests modern alternatives.
@@ -6,7 +6,7 @@
6
6
 
7
7
  let { children, class: className, ...restProps }: ActivityProps = $props();
8
8
 
9
- const theme = getTheme("activity");
9
+ const theme = $derived(getTheme("activity"));
10
10
  </script>
11
11
 
12
12
  <ol {...restProps} class={activity({ class: clsx(theme, className) })}>
@@ -3,13 +3,13 @@
3
3
  import type { ActivityItemProps } from "../types";
4
4
  import clsx from "clsx";
5
5
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
6
+ import { untrack } from "svelte";
6
7
 
7
8
  let { activities, liClass, spanClass, imgClass, outerDivClass, innerDivClass, timeClass, titleClass, textClass, class: className, classes, ...restProps }: ActivityItemProps = $props();
8
9
 
9
- // svelte-ignore state_referenced_locally
10
10
  warnThemeDeprecation(
11
11
  "ActivityItem",
12
- { liClass, spanClass, imgClass, outerDivClass, innerDivClass, timeClass, titleClass, textClass },
12
+ untrack(() => ({ liClass, spanClass, imgClass, outerDivClass, innerDivClass, timeClass, titleClass, textClass })),
13
13
  {
14
14
  liClass: "class",
15
15
  spanClass: "span",
@@ -34,7 +34,7 @@
34
34
  }
35
35
  );
36
36
 
37
- const theme = getTheme("activityItem");
37
+ const theme = $derived(getTheme("activityItem"));
38
38
 
39
39
  const { li, span, img, outer, inner, time, title, text } = $derived(activityItem());
40
40
  </script>
@@ -3,13 +3,13 @@
3
3
  import type { GroupProps } from "../types";
4
4
  import clsx from "clsx";
5
5
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
6
+ import { untrack } from "svelte";
6
7
 
7
8
  let { children, divClass, timeClass, date, olClass, class: className, classes, ...restProps }: GroupProps = $props();
8
9
 
9
- // svelte-ignore state_referenced_locally
10
10
  warnThemeDeprecation(
11
11
  "Group",
12
- { divClass, timeClass, olClass },
12
+ untrack(() => ({ divClass, timeClass, olClass })),
13
13
  {
14
14
  divClass: "class",
15
15
  timeClass: "time",
@@ -22,7 +22,7 @@
22
22
  ol: olClass
23
23
  });
24
24
 
25
- const theme = getTheme("group");
25
+ const theme = $derived(getTheme("group"));
26
26
 
27
27
  const { div, time, ol } = $derived(group());
28
28
  </script>
@@ -3,13 +3,13 @@
3
3
  import type { GroupItemProps } from "../types";
4
4
  import clsx from "clsx";
5
5
  import { getTheme, warnThemeDeprecation } from "../theme/themeUtils";
6
+ import { untrack } from "svelte";
6
7
 
7
8
  let { timelines, aClass, imgClass, divClass, titleClass, spanClass, class: className, classes, ...restProps }: GroupItemProps = $props();
8
9
 
9
- // svelte-ignore state_referenced_locally
10
10
  warnThemeDeprecation(
11
11
  "GroupItem",
12
- { aClass, imgClass, divClass, titleClass, spanClass },
12
+ untrack(() => ({ aClass, imgClass, divClass, titleClass, spanClass })),
13
13
  {
14
14
  aClass: "class",
15
15
  imgClass: "img",
@@ -28,7 +28,7 @@
28
28
  a: aClass
29
29
  }
30
30
  );
31
- const theme = getTheme("groupItem");
31
+ const theme = $derived(getTheme("groupItem"));
32
32
 
33
33
  const { base, a, img, div, title, span, svg } = $derived(groupItem());
34
34
  </script>
@@ -7,11 +7,9 @@
7
7
 
8
8
  let { children, order = "default", class: className, ...restProps }: TimelineProps = $props();
9
9
 
10
- const theme = getTheme("timeline");
11
-
12
- $effect(() => {
13
- setContext<TimelineVariants["order"]>("order", order);
14
- });
10
+ const theme = $derived(getTheme("timeline"));
11
+ // svelte-ignore state_referenced_locally
12
+ setContext<TimelineVariants["order"]>("order", order);
15
13
  const olCls = $derived(timeline({ order, class: clsx(theme, className) }));
16
14
  </script>
17
15
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { getContext } from "svelte";
2
+ import { getContext, untrack } from "svelte";
3
3
  import { timelineItem, type TimelineVariants } from "./theme";
4
4
  import type { TimelineItemProps, DateFormat } from "../types";
5
5
  import clsx from "clsx";
@@ -15,6 +15,7 @@
15
15
  isLast = false,
16
16
  svgClass,
17
17
  liClass,
18
+ defaultDivClass,
18
19
  divClass,
19
20
  timeClass,
20
21
  h3Class,
@@ -25,10 +26,9 @@
25
26
  ...restProps
26
27
  }: TimelineItemProps = $props();
27
28
 
28
- // svelte-ignore state_referenced_locally
29
29
  warnThemeDeprecation(
30
30
  "TimelineItem",
31
- { svgClass, liClass, divClass, timeClass, h3Class, connectorClass },
31
+ untrack(() => ({ svgClass, liClass, divClass, timeClass, h3Class, connectorClass })),
32
32
  {
33
33
  liClass: "class",
34
34
  svgClass: "svg",
@@ -47,10 +47,12 @@
47
47
  connector: connectorClass
48
48
  });
49
49
 
50
- const theme = getTheme("timelineItem");
50
+ const theme = $derived(getTheme("timelineItem"));
51
51
  let order = getContext<TimelineVariants["order"]>("order");
52
52
 
53
- const { base, div, time, h3, svg, connector } = $derived(timelineItem({ order, color, isLast }));
53
+ const { base, div, defaultDiv, time, h3, svg, connector } = $derived(timelineItem({ order, color, isLast }));
54
+
55
+ const defaultDivCls = $derived(defaultDivClass ? defaultDivClass : defaultDiv());
54
56
 
55
57
  function formatDisplayDate(dateStr: string, format: DateFormat) {
56
58
  const date = new Date(dateStr);
@@ -102,6 +104,7 @@
102
104
  </div>
103
105
  {/if}
104
106
  {:else if date}
107
+ <div class={defaultDivCls} aria-hidden="true"></div>
105
108
  <time datetime={date} class={time({ class: clsx(theme?.time, styling.time) })}>
106
109
  {datePrefix}
107
110
  {formatDisplayDate(date, dateFormat)}
@@ -141,6 +144,7 @@
141
144
  @prop isLast = false
142
145
  @prop svgClass
143
146
  @prop liClass
147
+ @prop defaultDivClass
144
148
  @prop divClass
145
149
  @prop timeClass
146
150
  @prop h3Class
@@ -13,6 +13,7 @@ import type { TimelineItemProps } from "../types";
13
13
  * @prop isLast = false
14
14
  * @prop svgClass
15
15
  * @prop liClass
16
+ * @prop defaultDivClass
16
17
  * @prop divClass
17
18
  * @prop timeClass
18
19
  * @prop h3Class
@@ -247,6 +247,7 @@ export declare const timelineItem: import("tailwind-variants").TVReturnType<{
247
247
  }, {
248
248
  base: string;
249
249
  div: string;
250
+ defaultDiv: string;
250
251
  time: string;
251
252
  h3: string;
252
253
  svg: string;
@@ -302,6 +303,7 @@ export declare const timelineItem: import("tailwind-variants").TVReturnType<{
302
303
  }, {
303
304
  base: string;
304
305
  div: string;
306
+ defaultDiv: string;
305
307
  time: string;
306
308
  h3: string;
307
309
  svg: string;
@@ -357,6 +359,7 @@ export declare const timelineItem: import("tailwind-variants").TVReturnType<{
357
359
  }, {
358
360
  base: string;
359
361
  div: string;
362
+ defaultDiv: string;
360
363
  time: string;
361
364
  h3: string;
362
365
  svg: string;