sv5ui-plus 5.0.4 → 5.0.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 (215) hide show
  1. package/README.md +6 -6
  2. package/dist/adapters/notify.d.ts +1 -1
  3. package/dist/adapters/notify.js +18 -18
  4. package/dist/compat.d.ts +2 -2
  5. package/dist/compat.js +2 -2
  6. package/dist/components/BentoGrid/BentoCard.svelte +33 -33
  7. package/dist/components/BentoGrid/BentoCard.svelte.d.ts +1 -1
  8. package/dist/components/BentoGrid/BentoGrid.svelte +1 -1
  9. package/dist/components/BentoGrid/BentoGrid.svelte.d.ts +1 -1
  10. package/dist/components/BentoGrid/bento-grid.types.d.ts +2 -2
  11. package/dist/components/BentoGrid/bento-grid.variants.d.ts +1 -1
  12. package/dist/components/BentoGrid/bento-grid.variants.js +10 -10
  13. package/dist/components/BentoGrid/index.d.ts +4 -4
  14. package/dist/components/BentoGrid/index.js +4 -4
  15. package/dist/components/Chart/Chart.svelte +1 -1
  16. package/dist/components/Chart/Chart.svelte.d.ts +1 -1
  17. package/dist/components/Chart/chart.types.d.ts +3 -3
  18. package/dist/components/Chart/index.d.ts +2 -2
  19. package/dist/components/Chart/index.js +2 -2
  20. package/dist/components/Chat/ChatBubble.svelte +19 -19
  21. package/dist/components/Chat/ChatBubble.svelte.d.ts +1 -1
  22. package/dist/components/Chat/ChatInput.svelte +26 -27
  23. package/dist/components/Chat/ChatInput.svelte.d.ts +1 -1
  24. package/dist/components/Chat/ChatMessage.svelte +1 -1
  25. package/dist/components/Chat/ChatMessage.svelte.d.ts +1 -1
  26. package/dist/components/Chat/chat.types.d.ts +6 -6
  27. package/dist/components/Chat/chat.variants.d.ts +1 -1
  28. package/dist/components/Chat/chat.variants.js +29 -29
  29. package/dist/components/Chat/index.d.ts +5 -5
  30. package/dist/components/Chat/index.js +5 -5
  31. package/dist/components/CodeBlock/CodeBlock.svelte +15 -15
  32. package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +1 -1
  33. package/dist/components/CodeBlock/code-block.types.d.ts +5 -5
  34. package/dist/components/CodeBlock/code-block.variants.d.ts +1 -1
  35. package/dist/components/CodeBlock/code-block.variants.js +40 -40
  36. package/dist/components/CodeBlock/index.d.ts +2 -2
  37. package/dist/components/CodeBlock/index.js +1 -1
  38. package/dist/components/ConfirmDialog/ConfirmDialog.svelte +93 -97
  39. package/dist/components/ConfirmDialog/ConfirmDialog.svelte.d.ts +1 -1
  40. package/dist/components/ConfirmDialog/confirm.d.ts +1 -1
  41. package/dist/components/ConfirmDialog/confirm.js +9 -9
  42. package/dist/components/ConfirmDialog/confirm.types.d.ts +4 -4
  43. package/dist/components/ConfirmDialog/index.d.ts +4 -4
  44. package/dist/components/ConfirmDialog/index.js +2 -2
  45. package/dist/components/DatePickerField/DatePickerField.svelte +11 -11
  46. package/dist/components/DatePickerField/DatePickerField.svelte.d.ts +2 -2
  47. package/dist/components/DatePickerField/date-picker-field.types.d.ts +1 -1
  48. package/dist/components/DatePickerField/index.d.ts +2 -2
  49. package/dist/components/DatePickerField/index.js +1 -1
  50. package/dist/components/DateRangePickerField/DateRangePickerField.svelte +26 -26
  51. package/dist/components/DateRangePickerField/DateRangePickerField.svelte.d.ts +2 -2
  52. package/dist/components/DateRangePickerField/date-range-picker-field.types.d.ts +1 -1
  53. package/dist/components/DateRangePickerField/index.d.ts +2 -2
  54. package/dist/components/DateRangePickerField/index.js +1 -1
  55. package/dist/components/Fonts/Fonts.svelte +12 -12
  56. package/dist/components/Fonts/Fonts.svelte.d.ts +1 -1
  57. package/dist/components/Fonts/fonts.d.ts +1 -1
  58. package/dist/components/Fonts/fonts.js +42 -42
  59. package/dist/components/Fonts/fonts.types.d.ts +6 -6
  60. package/dist/components/Fonts/index.d.ts +3 -3
  61. package/dist/components/Fonts/index.js +2 -2
  62. package/dist/components/FormSelect/FormSelect.svelte +4 -4
  63. package/dist/components/FormSelect/FormSelect.svelte.d.ts +2 -2
  64. package/dist/components/FormSelect/form-select.types.d.ts +3 -3
  65. package/dist/components/FormSelect/index.d.ts +2 -2
  66. package/dist/components/FormSelect/index.js +1 -1
  67. package/dist/components/List/List.svelte +1 -1
  68. package/dist/components/List/List.svelte.d.ts +1 -1
  69. package/dist/components/List/ListItem.svelte +31 -39
  70. package/dist/components/List/ListItem.svelte.d.ts +1 -1
  71. package/dist/components/List/index.d.ts +4 -4
  72. package/dist/components/List/index.js +4 -4
  73. package/dist/components/List/list.types.d.ts +4 -4
  74. package/dist/components/List/list.variants.d.ts +1 -1
  75. package/dist/components/List/list.variants.js +22 -22
  76. package/dist/components/LocaleButton/LocaleButton.svelte +104 -108
  77. package/dist/components/LocaleButton/LocaleButton.svelte.d.ts +1 -1
  78. package/dist/components/LocaleButton/index.d.ts +2 -2
  79. package/dist/components/LocaleButton/index.js +1 -1
  80. package/dist/components/LocaleButton/locale-button.types.d.ts +12 -12
  81. package/dist/components/LocaleButton/locale-button.variants.d.ts +2 -2
  82. package/dist/components/LocaleButton/locale-button.variants.js +68 -68
  83. package/dist/components/Marquee/Marquee.svelte +34 -34
  84. package/dist/components/Marquee/Marquee.svelte.d.ts +1 -1
  85. package/dist/components/Marquee/index.d.ts +3 -3
  86. package/dist/components/Marquee/index.js +3 -3
  87. package/dist/components/Marquee/marquee.types.d.ts +4 -4
  88. package/dist/components/Marquee/marquee.variants.d.ts +1 -1
  89. package/dist/components/Marquee/marquee.variants.js +15 -15
  90. package/dist/components/NavigationMenu/NavigationMenu.svelte +366 -379
  91. package/dist/components/NavigationMenu/NavigationMenu.svelte.d.ts +1 -1
  92. package/dist/components/NavigationMenu/index.d.ts +2 -2
  93. package/dist/components/NavigationMenu/index.js +1 -1
  94. package/dist/components/NavigationMenu/navigation-menu.types.d.ts +17 -17
  95. package/dist/components/NavigationMenu/navigation-menu.variants.d.ts +1 -1
  96. package/dist/components/NavigationMenu/navigation-menu.variants.js +177 -177
  97. package/dist/components/NumberTicker/NumberTicker.svelte +1 -5
  98. package/dist/components/NumberTicker/NumberTicker.svelte.d.ts +1 -1
  99. package/dist/components/NumberTicker/index.d.ts +3 -3
  100. package/dist/components/NumberTicker/index.js +3 -3
  101. package/dist/components/NumberTicker/number-ticker.types.d.ts +1 -1
  102. package/dist/components/NumberTicker/number-ticker.variants.d.ts +1 -1
  103. package/dist/components/NumberTicker/number-ticker.variants.js +3 -3
  104. package/dist/components/PasswordInput/PasswordInput.svelte +58 -58
  105. package/dist/components/PasswordInput/PasswordInput.svelte.d.ts +1 -1
  106. package/dist/components/PasswordInput/index.d.ts +2 -2
  107. package/dist/components/PasswordInput/index.js +1 -1
  108. package/dist/components/PasswordInput/password-input.types.d.ts +9 -9
  109. package/dist/components/PasswordInput/password-input.variants.d.ts +2 -2
  110. package/dist/components/PasswordInput/password-input.variants.js +62 -62
  111. package/dist/components/Prose/Prose.svelte +5 -5
  112. package/dist/components/Prose/Prose.svelte.d.ts +1 -1
  113. package/dist/components/Prose/index.d.ts +3 -3
  114. package/dist/components/Prose/index.js +3 -3
  115. package/dist/components/Prose/prose.types.d.ts +4 -4
  116. package/dist/components/Prose/prose.variants.d.ts +1 -1
  117. package/dist/components/Prose/prose.variants.js +27 -27
  118. package/dist/components/{Resizable/Resizable.svelte → ResizeContainer/ResizeContainer.svelte} +3 -3
  119. package/dist/components/ResizeContainer/ResizeContainer.svelte.d.ts +4 -0
  120. package/dist/components/ResizeContainer/index.d.ts +4 -0
  121. package/dist/components/ResizeContainer/index.js +4 -0
  122. package/dist/components/ResizeContainer/resize-container.types.d.ts +18 -0
  123. package/dist/components/ResizeContainer/resize-container.variants.d.ts +30 -0
  124. package/dist/components/ResizeContainer/resize-container.variants.js +17 -0
  125. package/dist/components/SafeTable/SafeTable.svelte +74 -74
  126. package/dist/components/SafeTable/SafeTable.svelte.d.ts +2 -2
  127. package/dist/components/SafeTable/index.d.ts +2 -2
  128. package/dist/components/SafeTable/index.js +1 -1
  129. package/dist/components/SafeTable/safe-table.types.d.ts +1 -1
  130. package/dist/components/Search/Search.svelte +63 -63
  131. package/dist/components/Search/Search.svelte.d.ts +1 -1
  132. package/dist/components/Search/index.d.ts +2 -2
  133. package/dist/components/Search/index.js +1 -1
  134. package/dist/components/Search/search.types.d.ts +5 -5
  135. package/dist/components/SortableGroup/SortableGroup.svelte +16 -10
  136. package/dist/components/SortableGroup/SortableGroup.svelte.d.ts +3 -3
  137. package/dist/components/SortableGroup/index.d.ts +1 -1
  138. package/dist/components/SortableGroup/index.js +1 -1
  139. package/dist/components/SortableList/SortableList.svelte +49 -46
  140. package/dist/components/SortableList/SortableList.svelte.d.ts +2 -2
  141. package/dist/components/SortableList/index.d.ts +2 -2
  142. package/dist/components/SortableList/index.js +1 -1
  143. package/dist/components/SortableList/sortable-list.types.d.ts +3 -3
  144. package/dist/components/Spotlight/Spotlight.svelte +13 -13
  145. package/dist/components/Spotlight/Spotlight.svelte.d.ts +1 -1
  146. package/dist/components/Spotlight/index.d.ts +3 -3
  147. package/dist/components/Spotlight/index.js +3 -3
  148. package/dist/components/Spotlight/spotlight.types.d.ts +2 -2
  149. package/dist/components/Spotlight/spotlight.variants.d.ts +1 -1
  150. package/dist/components/Spotlight/spotlight.variants.js +5 -5
  151. package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte +23 -23
  152. package/dist/components/TableBulkActionBar/TableBulkActionBar.svelte.d.ts +1 -1
  153. package/dist/components/TableBulkActionBar/index.d.ts +2 -2
  154. package/dist/components/TableBulkActionBar/index.js +1 -1
  155. package/dist/components/TableBulkActionBar/table-bulk-action-bar.types.d.ts +3 -3
  156. package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.d.ts +1 -1
  157. package/dist/components/TableBulkActionBar/table-bulk-action-bar.variants.js +7 -7
  158. package/dist/components/TreeView/TreeView.svelte +59 -59
  159. package/dist/components/TreeView/TreeView.svelte.d.ts +1 -1
  160. package/dist/components/TreeView/index.d.ts +3 -3
  161. package/dist/components/TreeView/index.js +2 -2
  162. package/dist/components/TreeView/tree-view.types.d.ts +4 -4
  163. package/dist/components/TreeView/tree-view.variants.d.ts +1 -1
  164. package/dist/components/TreeView/tree-view.variants.js +19 -19
  165. package/dist/config.d.ts +1 -1
  166. package/dist/config.js +28 -28
  167. package/dist/editor.d.ts +1 -1
  168. package/dist/editor.js +1 -1
  169. package/dist/form/resolve-form-field-name.js +1 -1
  170. package/dist/hooks/internal/DragDropProviderScope.svelte +1 -1
  171. package/dist/hooks/internal/DragDropProviderScope.svelte.d.ts +1 -1
  172. package/dist/hooks/internal/SortableProvider.svelte +16 -11
  173. package/dist/hooks/internal/SortableProvider.svelte.d.ts +1 -1
  174. package/dist/hooks/internal/drag-drop-context.d.ts +1 -1
  175. package/dist/hooks/internal/drag-drop-context.js +1 -1
  176. package/dist/hooks/internal/sortable-context.d.ts +6 -6
  177. package/dist/hooks/internal/sortable-context.js +2 -2
  178. package/dist/hooks/useDragDrop/index.d.ts +1 -1
  179. package/dist/hooks/useDragDrop/index.js +1 -1
  180. package/dist/hooks/useDragDrop/useDragDrop.svelte.d.ts +3 -3
  181. package/dist/hooks/useDragDrop/useDragDrop.svelte.js +15 -15
  182. package/dist/hooks/useSortable/index.d.ts +2 -2
  183. package/dist/hooks/useSortable/index.js +2 -2
  184. package/dist/hooks/useSortable/useSortable.svelte.d.ts +4 -4
  185. package/dist/hooks/useSortable/useSortable.svelte.js +23 -23
  186. package/dist/hooks/utils.js +1 -1
  187. package/dist/index.d.ts +29 -31
  188. package/dist/index.js +28 -30
  189. package/dist/mcp/install-template.mjs +44 -44
  190. package/dist/mcp/server.mjs +262 -263
  191. package/dist/mcp/sv5ui-plus-docs.data.json +4 -10
  192. package/package.json +17 -14
  193. package/dist/components/ColorPicker/ColorPicker.svelte +0 -109
  194. package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +0 -4
  195. package/dist/components/ColorPicker/color-picker.types.d.ts +0 -26
  196. package/dist/components/ColorPicker/color-picker.variants.d.ts +0 -69
  197. package/dist/components/ColorPicker/color-picker.variants.js +0 -13
  198. package/dist/components/ColorPicker/index.d.ts +0 -4
  199. package/dist/components/ColorPicker/index.js +0 -4
  200. package/dist/components/Resizable/Resizable.svelte.d.ts +0 -4
  201. package/dist/components/Resizable/index.d.ts +0 -4
  202. package/dist/components/Resizable/index.js +0 -4
  203. package/dist/components/Resizable/resizable.types.d.ts +0 -18
  204. package/dist/components/Resizable/resizable.types.js +0 -1
  205. package/dist/components/Resizable/resizable.variants.d.ts +0 -48
  206. package/dist/components/Resizable/resizable.variants.js +0 -17
  207. package/dist/components/ScrollArea/ScrollArea.svelte +0 -54
  208. package/dist/components/ScrollArea/ScrollArea.svelte.d.ts +0 -4
  209. package/dist/components/ScrollArea/index.d.ts +0 -4
  210. package/dist/components/ScrollArea/index.js +0 -4
  211. package/dist/components/ScrollArea/scroll-area.types.d.ts +0 -27
  212. package/dist/components/ScrollArea/scroll-area.types.js +0 -1
  213. package/dist/components/ScrollArea/scroll-area.variants.d.ts +0 -45
  214. package/dist/components/ScrollArea/scroll-area.variants.js +0 -27
  215. /package/dist/components/{ColorPicker/color-picker.types.js → ResizeContainer/resize-container.types.js} +0 -0
package/README.md CHANGED
@@ -12,7 +12,7 @@ bun add sv5ui sv5ui-plus
12
12
 
13
13
  ```css
14
14
  /* src/routes/layout.css */
15
- @import 'sv5ui/theme.css';
15
+ @import "sv5ui/theme.css";
16
16
  @source '../../node_modules/sv5ui-plus/dist';
17
17
  ```
18
18
 
@@ -20,15 +20,15 @@ Import core UI from SV5UI and addons from SV5UI Plus:
20
20
 
21
21
  ```svelte
22
22
  <script lang="ts">
23
- import { Button, Icon } from 'sv5ui'
24
- import { ColorPicker, ConfirmDialog, Search } from 'sv5ui-plus'
23
+ import { Button, Icon } from "sv5ui";
24
+ import { ConfirmDialog, Search } from "sv5ui-plus";
25
25
  </script>
26
26
  ```
27
27
 
28
28
  For an incremental migration from Svelora, `sv5ui-plus/compat` re-exports SV5UI together with SV5UI Plus addons:
29
29
 
30
30
  ```ts
31
- import { Button, ColorPicker } from 'sv5ui-plus/compat'
31
+ import { Button, ConfirmDialog } from "sv5ui-plus/compat";
32
32
  ```
33
33
 
34
34
  New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
@@ -36,8 +36,8 @@ New code should use the explicit `sv5ui` and `sv5ui-plus` imports.
36
36
  ## Addons
37
37
 
38
38
  - Content and display: `BentoGrid`, `Chart`, `Chat`, `CodeBlock`, `Fonts`, `List`, `Marquee`, `NumberTicker`, `Prose`, `Spotlight`
39
- - Forms and overlays: `ColorPicker`, `ConfirmDialog`, `LocaleButton`, `PasswordInput`, `Search`
40
- - Layout and data: `Resizable`, `ScrollArea`, `SafeTable`, `TableBulkActionBar`, `TreeView`
39
+ - Forms and overlays: `ConfirmDialog`, `LocaleButton`, `PasswordInput`, `Search`
40
+ - Layout and data: `ResizeContainer`, `SafeTable`, `TableBulkActionBar`, `TreeView`
41
41
  - Forms: `FormSelect`, `DatePickerField`, `DateRangePickerField`, `PasswordInput`
42
42
  - Drag and drop: `SortableGroup`, `SortableList`, `useDragDrop`, `useSortable`
43
43
  - SvelteKit adapter: `SvelteKitNavigationMenu`
@@ -1,4 +1,4 @@
1
- import { type ToastOptions } from 'sv5ui';
1
+ import { type ToastOptions } from "sv5ui";
2
2
  export interface NotifyOptions extends ToastOptions {
3
3
  /** Inline style values merged into the toast style string. */
4
4
  styles?: Record<string, string>;
@@ -1,18 +1,18 @@
1
- import { toast } from 'sv5ui';
1
+ import { toast } from "sv5ui";
2
2
  function errorMessage(error) {
3
- if (typeof error === 'string')
3
+ if (typeof error === "string")
4
4
  return error;
5
5
  if (error instanceof Error)
6
6
  return error.message;
7
- if (error && typeof error === 'object') {
7
+ if (error && typeof error === "object") {
8
8
  const value = error;
9
- if (typeof value.message === 'string')
9
+ if (typeof value.message === "string")
10
10
  return value.message;
11
- if (typeof value.error === 'string')
11
+ if (typeof value.error === "string")
12
12
  return value.error;
13
13
  return JSON.stringify(error);
14
14
  }
15
- return 'An unknown error occurred';
15
+ return "An unknown error occurred";
16
16
  }
17
17
  function resolveOptions(options) {
18
18
  if (!options)
@@ -21,13 +21,13 @@ function resolveOptions(options) {
21
21
  const style = styles
22
22
  ? Object.entries(styles)
23
23
  .map(([key, value]) => `${key}: ${value}`)
24
- .join('; ')
24
+ .join("; ")
25
25
  : undefined;
26
- const className = classes ? Object.values(classes).join(' ') : undefined;
26
+ const className = classes ? Object.values(classes).join(" ") : undefined;
27
27
  return {
28
28
  ...rest,
29
- style: [rest.style, style].filter(Boolean).join('; ') || undefined,
30
- class: [rest.class, className].filter(Boolean).join(' ') || undefined
29
+ style: [rest.style, style].filter(Boolean).join("; ") || undefined,
30
+ class: [rest.class, className].filter(Boolean).join(" ") || undefined,
31
31
  };
32
32
  }
33
33
  export const notify = {
@@ -46,14 +46,14 @@ export const notify = {
46
46
  loading(message, options) {
47
47
  return toast.loading(message, {
48
48
  duration: Number.POSITIVE_INFINITY,
49
- ...resolveOptions(options)
49
+ ...resolveOptions(options),
50
50
  });
51
51
  },
52
52
  processing(message, options) {
53
53
  return toast.loading(message, {
54
54
  duration: Number.POSITIVE_INFINITY,
55
- icon: 'lucide:loader-circle',
56
- ...resolveOptions(options)
55
+ icon: "lucide:loader-circle",
56
+ ...resolveOptions(options),
57
57
  });
58
58
  },
59
59
  default(message, options) {
@@ -67,22 +67,22 @@ export const notify = {
67
67
  .then(([data]) => {
68
68
  if (checkSuccess && !checkSuccess(data))
69
69
  throw data;
70
- notify.success(typeof success === 'function' ? success(data) : success, {
70
+ notify.success(typeof success === "function" ? success(data) : success, {
71
71
  ...shared,
72
72
  ...successOptions,
73
- id
73
+ id,
74
74
  });
75
75
  })
76
76
  .catch((reason) => {
77
- notify.error(typeof error === 'function' ? error(reason) : error, {
77
+ notify.error(typeof error === "function" ? error(reason) : error, {
78
78
  ...shared,
79
79
  ...errorOptions,
80
- id
80
+ id,
81
81
  });
82
82
  });
83
83
  return promise;
84
84
  },
85
85
  dismiss(id) {
86
86
  return toast.dismiss(id);
87
- }
87
+ },
88
88
  };
package/dist/compat.d.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  * Transitional entrypoint for applications migrating from Svelora 3.
3
3
  * New code should import core UI from `sv5ui` and addons from `sv5ui-plus`.
4
4
  */
5
- export * from 'sv5ui';
6
- export * from './index.js';
5
+ export * from "sv5ui";
6
+ export * from "./index.js";
package/dist/compat.js CHANGED
@@ -2,5 +2,5 @@
2
2
  * Transitional entrypoint for applications migrating from Svelora 3.
3
3
  * New code should import core UI from `sv5ui` and addons from `sv5ui-plus`.
4
4
  */
5
- export * from 'sv5ui';
6
- export * from './index.js';
5
+ export * from "sv5ui";
6
+ export * from "./index.js";
@@ -7,39 +7,39 @@ let styles = $derived(bentoGridVariants());
7
7
  </script>
8
8
 
9
9
  <div class={twMerge(styles.cardBase(), className)} {...restProps}>
10
- <div class={styles.cardBackground()}>
11
- {#if background}
12
- {@render background()}
13
- {/if}
14
- </div>
10
+ <div class={styles.cardBackground()}>
11
+ {#if background}
12
+ {@render background()}
13
+ {/if}
14
+ </div>
15
15
 
16
- <!-- Push content up slightly on hover by adjusting group styles or locally -->
17
- <div class={twMerge(styles.cardContent(), href && 'group-hover:-translate-y-4')}>
18
- {#if icon}
19
- <div class={styles.cardIconWrapper()}>
20
- <Icon {name} class="w-6 h-6" />
21
- </div>
22
- {/if}
23
-
24
- <h3 class={styles.cardTitle()}>{name}</h3>
25
-
26
- {#if description}
27
- <p class={styles.cardDescription()}>{description}</p>
28
- {/if}
29
- </div>
16
+ <!-- Push content up slightly on hover by adjusting group styles or locally -->
17
+ <div class={twMerge(styles.cardContent(), href && "group-hover:-translate-y-4")}>
18
+ {#if icon}
19
+ <div class={styles.cardIconWrapper()}>
20
+ <Icon {name} class="w-6 h-6" />
21
+ </div>
22
+ {/if}
30
23
 
31
- {#if href || actionSnippet}
32
- <div class={twMerge(styles.cardAction(), !href && !actionSnippet && 'hidden')}>
33
- {#if actionSnippet}
34
- {@render actionSnippet()}
35
- {:else if href}
36
- <Button {href} variant="ghost" size="sm" class="pl-0 hover:bg-transparent">
37
- {cta}
38
- {#snippet trailingSlot()}
39
- <Icon name="lucide:arrow-right" class="w-4 h-4 ml-1" />
40
- {/snippet}
41
- </Button>
42
- {/if}
43
- </div>
44
- {/if}
24
+ <h3 class={styles.cardTitle()}>{name}</h3>
25
+
26
+ {#if description}
27
+ <p class={styles.cardDescription()}>{description}</p>
28
+ {/if}
29
+ </div>
30
+
31
+ {#if href || actionSnippet}
32
+ <div class={twMerge(styles.cardAction(), !href && !actionSnippet && "hidden")}>
33
+ {#if actionSnippet}
34
+ {@render actionSnippet()}
35
+ {:else if href}
36
+ <Button {href} variant="ghost" size="sm" class="pl-0 hover:bg-transparent">
37
+ {cta}
38
+ {#snippet trailingSlot()}
39
+ <Icon name="lucide:arrow-right" class="w-4 h-4 ml-1" />
40
+ {/snippet}
41
+ </Button>
42
+ {/if}
43
+ </div>
44
+ {/if}
45
45
  </div>
@@ -1,4 +1,4 @@
1
- import type { BentoCardProps } from './bento-grid.types.js';
1
+ import type { BentoCardProps } from "./bento-grid.types.js";
2
2
  declare const BentoCard: import("svelte").Component<BentoCardProps, {}, "">;
3
3
  type BentoCard = ReturnType<typeof BentoCard>;
4
4
  export default BentoCard;
@@ -5,5 +5,5 @@ let styles = $derived(bentoGridVariants());
5
5
  </script>
6
6
 
7
7
  <div class={twMerge(styles.gridBase(), className)} {...restProps}>
8
- {@render children?.()}
8
+ {@render children?.()}
9
9
  </div>
@@ -1,4 +1,4 @@
1
- import type { BentoGridProps } from './bento-grid.types.js';
1
+ import type { BentoGridProps } from "./bento-grid.types.js";
2
2
  declare const BentoGrid: import("svelte").Component<BentoGridProps, {}, "">;
3
3
  type BentoGrid = ReturnType<typeof BentoGrid>;
4
4
  export default BentoGrid;
@@ -1,5 +1,5 @@
1
- import type { Snippet } from 'svelte';
2
- import type { HTMLAttributes } from 'svelte/elements';
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
3
  export interface BentoGridProps extends HTMLAttributes<HTMLDivElement> {
4
4
  /**
5
5
  * Additional CSS classes.
@@ -1,4 +1,4 @@
1
- import { type VariantProps } from 'tailwind-variants';
1
+ import { type VariantProps } from "tailwind-variants";
2
2
  export declare const bentoGridVariants: import("tailwind-variants").TVReturnType<{}, {
3
3
  gridBase: string;
4
4
  cardBase: string;
@@ -1,16 +1,16 @@
1
- import { tv } from 'tailwind-variants';
1
+ import { tv } from "tailwind-variants";
2
2
  export const bentoGridVariants = tv({
3
3
  slots: {
4
- gridBase: 'grid grid-cols-1 md:grid-cols-3 gap-4 max-w-7xl mx-auto w-full',
5
- cardBase: 'group relative flex flex-col justify-between overflow-hidden rounded-xl bg-surface-50 dark:bg-surface-900 border border-outline-variant transition-all hover:shadow-md dark:hover:shadow-surface-800/50',
6
- cardBackground: 'absolute inset-0 transition-all duration-300 pointer-events-none',
7
- cardContent: 'pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300',
8
- cardIconWrapper: 'mb-2 w-10 h-10 flex items-center justify-center rounded-lg bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400',
9
- cardTitle: 'text-lg font-semibold text-surface-900 dark:text-surface-50',
10
- cardDescription: 'text-sm text-surface-500 dark:text-surface-400',
11
- cardAction: 'pointer-events-auto absolute bottom-0 left-0 w-full p-6 opacity-0 translate-y-4 transition-all duration-300 group-hover:opacity-100 group-hover:translate-y-0'
4
+ gridBase: "grid grid-cols-1 md:grid-cols-3 gap-4 max-w-7xl mx-auto w-full",
5
+ cardBase: "group relative flex flex-col justify-between overflow-hidden rounded-xl bg-surface-50 dark:bg-surface-900 border border-outline-variant transition-all hover:shadow-md dark:hover:shadow-surface-800/50",
6
+ cardBackground: "absolute inset-0 transition-all duration-300 pointer-events-none",
7
+ cardContent: "pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300",
8
+ cardIconWrapper: "mb-2 w-10 h-10 flex items-center justify-center rounded-lg bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400",
9
+ cardTitle: "text-lg font-semibold text-surface-900 dark:text-surface-50",
10
+ cardDescription: "text-sm text-surface-500 dark:text-surface-400",
11
+ cardAction: "pointer-events-auto absolute bottom-0 left-0 w-full p-6 opacity-0 translate-y-4 transition-all duration-300 group-hover:opacity-100 group-hover:translate-y-0",
12
12
  },
13
13
  variants: {
14
14
  // Variants can be added if we want different styles of grids
15
- }
15
+ },
16
16
  });
@@ -1,5 +1,5 @@
1
- import BentoGrid from './BentoGrid.svelte';
2
- import BentoCard from './BentoCard.svelte';
1
+ import BentoGrid from "./BentoGrid.svelte";
2
+ import BentoCard from "./BentoCard.svelte";
3
3
  export { BentoGrid, BentoCard };
4
- export * from './bento-grid.types.js';
5
- export * from './bento-grid.variants.js';
4
+ export * from "./bento-grid.types.js";
5
+ export * from "./bento-grid.variants.js";
@@ -1,5 +1,5 @@
1
- import BentoGrid from './BentoGrid.svelte';
2
- import BentoCard from './BentoCard.svelte';
1
+ import BentoGrid from "./BentoGrid.svelte";
2
+ import BentoCard from "./BentoCard.svelte";
3
3
  export { BentoGrid, BentoCard };
4
- export * from './bento-grid.types.js';
5
- export * from './bento-grid.variants.js';
4
+ export * from "./bento-grid.types.js";
5
+ export * from "./bento-grid.variants.js";
@@ -59,4 +59,4 @@ $effect(() => {
59
59
  });
60
60
  </script>
61
61
 
62
- <div class={twMerge('w-full', className)} bind:this={chartContainer}></div>
62
+ <div class={twMerge("w-full", className)} bind:this={chartContainer}></div>
@@ -1,4 +1,4 @@
1
- import type { ChartProps } from './chart.types.js';
1
+ import type { ChartProps } from "./chart.types.js";
2
2
  declare const Chart: import("svelte").Component<ChartProps, {}, "">;
3
3
  type Chart = ReturnType<typeof Chart>;
4
4
  export default Chart;
@@ -1,5 +1,5 @@
1
- import type { ApexOptions } from 'apexcharts';
2
- import type { ClassNameValue } from 'tailwind-merge';
1
+ import type { ApexOptions } from "apexcharts";
2
+ import type { ClassNameValue } from "tailwind-merge";
3
3
  export interface ChartProps {
4
4
  /**
5
5
  * Configuration options for ApexCharts.
@@ -8,7 +8,7 @@ export interface ChartProps {
8
8
  /**
9
9
  * Series data. If provided, overrides options.series.
10
10
  */
11
- series?: ApexOptions['series'];
11
+ series?: ApexOptions["series"];
12
12
  /**
13
13
  * Tailwind class to apply to the chart container wrapper.
14
14
  */
@@ -1,2 +1,2 @@
1
- export { default as Chart } from './Chart.svelte';
2
- export * from './chart.types.js';
1
+ export { default as Chart } from "./Chart.svelte";
2
+ export * from "./chart.types.js";
@@ -1,2 +1,2 @@
1
- export { default as Chart } from './Chart.svelte';
2
- export * from './chart.types.js';
1
+ export { default as Chart } from "./Chart.svelte";
2
+ export * from "./chart.types.js";
@@ -8,23 +8,23 @@ setContext("chat-bubble-position", () => position);
8
8
  </script>
9
9
 
10
10
  <div class={twMerge(styles.bubbleBase() as string, className as string)} {...restProps}>
11
- {#if avatar}
12
- <div class={styles.bubbleAvatar()}>
13
- {@render avatar()}
14
- </div>
15
- {/if}
16
-
17
- <div class={styles.bubbleContent()}>
18
- {#if name || time}
19
- <div class={styles.bubbleHeader()}>
20
- {#if name}
21
- <span class={styles.bubbleName()}>{name}</span>
22
- {/if}
23
- {#if time}
24
- <span class={styles.bubbleTime()}>{time}</span>
25
- {/if}
26
- </div>
27
- {/if}
28
- {@render children?.()}
29
- </div>
11
+ {#if avatar}
12
+ <div class={styles.bubbleAvatar()}>
13
+ {@render avatar()}
14
+ </div>
15
+ {/if}
16
+
17
+ <div class={styles.bubbleContent()}>
18
+ {#if name || time}
19
+ <div class={styles.bubbleHeader()}>
20
+ {#if name}
21
+ <span class={styles.bubbleName()}>{name}</span>
22
+ {/if}
23
+ {#if time}
24
+ <span class={styles.bubbleTime()}>{time}</span>
25
+ {/if}
26
+ </div>
27
+ {/if}
28
+ {@render children?.()}
29
+ </div>
30
30
  </div>
@@ -1,4 +1,4 @@
1
- import type { ChatBubbleProps } from './chat.types.js';
1
+ import type { ChatBubbleProps } from "./chat.types.js";
2
2
  declare const ChatBubble: import("svelte").Component<ChatBubbleProps, {}, "">;
3
3
  type ChatBubble = ReturnType<typeof ChatBubble>;
4
4
  export default ChatBubble;
@@ -18,33 +18,32 @@ function autoResize(node) {
18
18
  </script>
19
19
 
20
20
  <div class={twMerge(styles.inputBase() as string, className as string)} {...restProps}>
21
- {#if leading}
22
- <div class={styles.inputActions()}>
23
- {@render leading()}
24
- </div>
25
- {/if}
21
+ {#if leading}
22
+ <div class={styles.inputActions()}>
23
+ {@render leading()}
24
+ </div>
25
+ {/if}
26
26
 
27
- <div class={styles.inputFieldWrapper()}>
28
- <textarea
29
- bind:value
30
- {placeholder}
31
- {disabled}
32
- rows="1"
33
- use:autoResize
34
- class={styles.inputField()}
35
- onkeydown={(e) => {
36
- // If you want Shift+Enter for new line, and Enter to submit:
37
- // if (e.key === 'Enter' && !e.shiftKey) {
38
- // e.preventDefault()
39
- // // Dispatch submit event
40
- // }
41
- }}
42
- ></textarea>
43
- </div>
27
+ <div class={styles.inputFieldWrapper()}>
28
+ <textarea
29
+ bind:value
30
+ {placeholder}
31
+ {disabled}
32
+ rows="1"
33
+ use:autoResize
34
+ class={styles.inputField()}
35
+ onkeydown={(e) => {
36
+ // If you want Shift+Enter for new line, and Enter to submit:
37
+ // if (e.key === 'Enter' && !e.shiftKey) {
38
+ // e.preventDefault()
39
+ // // Dispatch submit event
40
+ // }
41
+ }}></textarea>
42
+ </div>
44
43
 
45
- {#if trailing}
46
- <div class={styles.inputActions()}>
47
- {@render trailing()}
48
- </div>
49
- {/if}
44
+ {#if trailing}
45
+ <div class={styles.inputActions()}>
46
+ {@render trailing()}
47
+ </div>
48
+ {/if}
50
49
  </div>
@@ -1,4 +1,4 @@
1
- import type { ChatInputProps } from './chat.types.js';
1
+ import type { ChatInputProps } from "./chat.types.js";
2
2
  declare const ChatInput: import("svelte").Component<ChatInputProps, {}, "value">;
3
3
  type ChatInput = ReturnType<typeof ChatInput>;
4
4
  export default ChatInput;
@@ -11,5 +11,5 @@ let styles = $derived(chatVariants({
11
11
  </script>
12
12
 
13
13
  <div class={twMerge(styles.messageBase() as string, className as string)} {...restProps}>
14
- {@render children?.()}
14
+ {@render children?.()}
15
15
  </div>
@@ -1,4 +1,4 @@
1
- import type { ChatMessageProps } from './chat.types.js';
1
+ import type { ChatMessageProps } from "./chat.types.js";
2
2
  declare const ChatMessage: import("svelte").Component<ChatMessageProps, {}, "">;
3
3
  type ChatMessage = ReturnType<typeof ChatMessage>;
4
4
  export default ChatMessage;
@@ -1,12 +1,12 @@
1
- import type { Snippet } from 'svelte';
2
- import type { HTMLAttributes } from 'svelte/elements';
3
- import type { ChatVariantProps } from './chat.variants.js';
1
+ import type { Snippet } from "svelte";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import type { ChatVariantProps } from "./chat.variants.js";
4
4
  export interface ChatBubbleProps extends HTMLAttributes<HTMLDivElement> {
5
5
  /**
6
6
  * Position of the chat bubble (start for receiver, end for sender).
7
7
  * @default 'start'
8
8
  */
9
- position?: ChatVariantProps['position'];
9
+ position?: ChatVariantProps["position"];
10
10
  /**
11
11
  * Name of the sender.
12
12
  */
@@ -28,12 +28,12 @@ export interface ChatMessageProps extends HTMLAttributes<HTMLDivElement> {
28
28
  /**
29
29
  * Style variant of the message bubble.
30
30
  */
31
- variant?: ChatVariantProps['variant'];
31
+ variant?: ChatVariantProps["variant"];
32
32
  /**
33
33
  * Position inheritance (used internally for rounded corners).
34
34
  * Automatically inherited from ChatBubble if used within it.
35
35
  */
36
- position?: ChatVariantProps['position'];
36
+ position?: ChatVariantProps["position"];
37
37
  /**
38
38
  * The message text or content.
39
39
  */
@@ -1,4 +1,4 @@
1
- import { type VariantProps } from 'tailwind-variants';
1
+ import { type VariantProps } from "tailwind-variants";
2
2
  export declare const chatVariants: import("tailwind-variants").TVReturnType<{
3
3
  position: {
4
4
  start: {
@@ -1,47 +1,47 @@
1
- import { tv } from 'tailwind-variants';
1
+ import { tv } from "tailwind-variants";
2
2
  export const chatVariants = tv({
3
3
  slots: {
4
- bubbleBase: 'flex w-full gap-3 py-2',
5
- bubbleAvatar: 'shrink-0 mt-1',
6
- bubbleContent: 'flex flex-col gap-1 min-w-0 max-w-[80%]',
7
- bubbleHeader: 'flex items-center gap-2 text-xs text-surface-500 dark:text-surface-400',
8
- bubbleName: 'font-semibold text-surface-900 dark:text-surface-50',
9
- bubbleTime: '',
10
- messageBase: 'px-4 py-2.5 rounded-2xl text-sm break-words',
11
- inputBase: 'flex items-end gap-2 p-3 bg-surface-50 dark:bg-surface-900 border-t border-outline-variant',
12
- inputFieldWrapper: 'flex-1 relative bg-surface-100 dark:bg-surface-800 rounded-2xl border border-outline-variant focus-within:border-primary focus-within:ring-1 focus-within:ring-primary transition-colors',
13
- inputField: 'w-full bg-transparent border-0 px-4 py-3 min-h-[44px] max-h-32 resize-none focus:ring-0 text-sm outline-none',
14
- inputActions: 'shrink-0 flex items-center gap-1'
4
+ bubbleBase: "flex w-full gap-3 py-2",
5
+ bubbleAvatar: "shrink-0 mt-1",
6
+ bubbleContent: "flex flex-col gap-1 min-w-0 max-w-[80%]",
7
+ bubbleHeader: "flex items-center gap-2 text-xs text-surface-500 dark:text-surface-400",
8
+ bubbleName: "font-semibold text-surface-900 dark:text-surface-50",
9
+ bubbleTime: "",
10
+ messageBase: "px-4 py-2.5 rounded-2xl text-sm break-words",
11
+ inputBase: "flex items-end gap-2 p-3 bg-surface-50 dark:bg-surface-900 border-t border-outline-variant",
12
+ inputFieldWrapper: "flex-1 relative bg-surface-100 dark:bg-surface-800 rounded-2xl border border-outline-variant focus-within:border-primary focus-within:ring-1 focus-within:ring-primary transition-colors",
13
+ inputField: "w-full bg-transparent border-0 px-4 py-3 min-h-[44px] max-h-32 resize-none focus:ring-0 text-sm outline-none",
14
+ inputActions: "shrink-0 flex items-center gap-1",
15
15
  },
16
16
  variants: {
17
17
  position: {
18
18
  start: {
19
- bubbleBase: 'justify-start',
20
- bubbleContent: 'items-start',
21
- bubbleHeader: 'flex-row',
22
- messageBase: 'rounded-tl-sm'
19
+ bubbleBase: "justify-start",
20
+ bubbleContent: "items-start",
21
+ bubbleHeader: "flex-row",
22
+ messageBase: "rounded-tl-sm",
23
23
  },
24
24
  end: {
25
- bubbleBase: 'justify-end flex-row-reverse',
26
- bubbleContent: 'items-end',
27
- bubbleHeader: 'flex-row-reverse',
28
- messageBase: 'rounded-tr-sm'
29
- }
25
+ bubbleBase: "justify-end flex-row-reverse",
26
+ bubbleContent: "items-end",
27
+ bubbleHeader: "flex-row-reverse",
28
+ messageBase: "rounded-tr-sm",
29
+ },
30
30
  },
31
31
  variant: {
32
32
  primary: {
33
- messageBase: 'bg-primary text-on-primary'
33
+ messageBase: "bg-primary text-on-primary",
34
34
  },
35
35
  surface: {
36
- messageBase: 'bg-surface-200 dark:bg-surface-800 text-surface-900 dark:text-surface-50'
36
+ messageBase: "bg-surface-200 dark:bg-surface-800 text-surface-900 dark:text-surface-50",
37
37
  },
38
38
  outline: {
39
- messageBase: 'bg-transparent border border-outline-variant text-surface-900 dark:text-surface-50'
40
- }
41
- }
39
+ messageBase: "bg-transparent border border-outline-variant text-surface-900 dark:text-surface-50",
40
+ },
41
+ },
42
42
  },
43
43
  defaultVariants: {
44
- position: 'start',
45
- variant: 'surface'
46
- }
44
+ position: "start",
45
+ variant: "surface",
46
+ },
47
47
  });
@@ -1,6 +1,6 @@
1
- import ChatBubble from './ChatBubble.svelte';
2
- import ChatMessage from './ChatMessage.svelte';
3
- import ChatInput from './ChatInput.svelte';
1
+ import ChatBubble from "./ChatBubble.svelte";
2
+ import ChatMessage from "./ChatMessage.svelte";
3
+ import ChatInput from "./ChatInput.svelte";
4
4
  export { ChatBubble, ChatMessage, ChatInput };
5
- export * from './chat.types.js';
6
- export * from './chat.variants.js';
5
+ export * from "./chat.types.js";
6
+ export * from "./chat.variants.js";