@widgetic/design-system 0.5.22 → 0.5.23

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 (246) hide show
  1. package/README.md +2 -0
  2. package/dist/components/CopyableHeader.svelte +260 -448
  3. package/dist/components/CopyableHeader.svelte.d.ts +8 -5
  4. package/dist/components/EmptyState.svelte +100 -128
  5. package/dist/components/EmptyState.svelte.d.ts +16 -19
  6. package/dist/components/GenerateLoader.svelte +17 -10
  7. package/dist/components/PasswordInput.svelte +41 -44
  8. package/dist/components/PasswordInput.svelte.d.ts +2 -0
  9. package/dist/components/ThumbHashImage.svelte +117 -119
  10. package/dist/components/WScrollArea.svelte +47 -41
  11. package/dist/components/chat/ActivityRow.svelte +115 -0
  12. package/dist/components/chat/ActivityRow.svelte.d.ts +18 -0
  13. package/dist/components/chat/ChatHeader.svelte +114 -0
  14. package/dist/components/chat/ChatHeader.svelte.d.ts +26 -0
  15. package/dist/components/chat/Composer.svelte +172 -0
  16. package/dist/components/chat/Composer.svelte.d.ts +27 -0
  17. package/dist/components/chat/Message.svelte +158 -0
  18. package/dist/components/chat/Message.svelte.d.ts +28 -0
  19. package/dist/components/chat/OptionRow.svelte +59 -0
  20. package/dist/components/chat/OptionRow.svelte.d.ts +14 -0
  21. package/dist/components/chat/PlanCard.svelte +220 -0
  22. package/dist/components/chat/PlanCard.svelte.d.ts +34 -0
  23. package/dist/components/chat/QuestionCard.svelte +265 -0
  24. package/dist/components/chat/QuestionCard.svelte.d.ts +38 -0
  25. package/dist/components/chat/ScrollToBottom.svelte +51 -0
  26. package/dist/components/chat/ScrollToBottom.svelte.d.ts +11 -0
  27. package/dist/components/chat/SuggestionCard.svelte +79 -0
  28. package/dist/components/chat/SuggestionCard.svelte.d.ts +20 -0
  29. package/dist/components/chat/TaskRow.svelte +59 -0
  30. package/dist/components/chat/TaskRow.svelte.d.ts +11 -0
  31. package/dist/components/chat/composerLogic.d.ts +16 -0
  32. package/dist/components/chat/composerLogic.js +29 -0
  33. package/dist/components/chat/index.d.ts +16 -0
  34. package/dist/components/chat/index.js +16 -0
  35. package/dist/components/chat/questionCardLogic.d.ts +11 -0
  36. package/dist/components/chat/questionCardLogic.js +39 -0
  37. package/dist/components/index.d.ts +10 -1
  38. package/dist/components/index.js +10 -0
  39. package/dist/components/modals/ActionModal.svelte +186 -180
  40. package/dist/components/modals/BaseModal.svelte +402 -399
  41. package/dist/components/modals/BaseModal.svelte.d.ts +1 -0
  42. package/dist/components/modals/NewItemDialog.svelte +200 -243
  43. package/dist/components/modals/Portal.svelte +107 -105
  44. package/dist/components/modals/README.md +16 -2
  45. package/dist/components/modals/RenameDialog.svelte +234 -292
  46. package/dist/components/navigation/Breadcrumbs.svelte +415 -377
  47. package/dist/components/navigation/Breadcrumbs.svelte.d.ts +3 -2
  48. package/dist/components/navigation/types.d.ts +2 -0
  49. package/dist/components/pdf/PDFViewer.svelte +1 -1
  50. package/dist/components/search-input/SearchInput.svelte +51 -104
  51. package/dist/components/search-input/SearchInput.svelte.d.ts +9 -27
  52. package/dist/components/shad-editor/editor.css +1 -1
  53. package/dist/components/shad-editor/i18n/messages.d.ts +1 -1
  54. package/dist/components/shad-editor/i18n/messages.js +1 -1
  55. package/dist/components/shell/AppShell.svelte +52 -0
  56. package/dist/components/shell/AppShell.svelte.d.ts +13 -0
  57. package/dist/components/shell/Banner.svelte +90 -0
  58. package/dist/components/shell/Banner.svelte.d.ts +61 -0
  59. package/dist/components/shell/ErrorState.svelte +60 -0
  60. package/dist/components/shell/ErrorState.svelte.d.ts +13 -0
  61. package/dist/components/shell/Link.svelte +63 -0
  62. package/dist/components/shell/Link.svelte.d.ts +53 -0
  63. package/dist/components/shell/NavDrawer.svelte +117 -0
  64. package/dist/components/shell/NavDrawer.svelte.d.ts +10 -0
  65. package/dist/components/shell/NavRow.svelte +128 -0
  66. package/dist/components/shell/NavRow.svelte.d.ts +65 -0
  67. package/dist/components/shell/NavSectionLabel.svelte +27 -0
  68. package/dist/components/shell/NavSectionLabel.svelte.d.ts +9 -0
  69. package/dist/components/shell/NotificationRow.svelte +76 -0
  70. package/dist/components/shell/NotificationRow.svelte.d.ts +16 -0
  71. package/dist/components/shell/PageHeader.svelte +42 -0
  72. package/dist/components/shell/PageHeader.svelte.d.ts +12 -0
  73. package/dist/components/shell/ProfileRow.svelte +95 -0
  74. package/dist/components/shell/ProfileRow.svelte.d.ts +54 -0
  75. package/dist/components/shell/SettingsDialog.svelte +118 -0
  76. package/dist/components/shell/SettingsDialog.svelte.d.ts +19 -0
  77. package/dist/components/shell/SettingsNav.svelte +46 -0
  78. package/dist/components/shell/SettingsNav.svelte.d.ts +11 -0
  79. package/dist/components/shell/Sidebar.svelte +82 -0
  80. package/dist/components/shell/Sidebar.svelte.d.ts +25 -0
  81. package/dist/components/shell/Stat.svelte +63 -0
  82. package/dist/components/shell/Stat.svelte.d.ts +58 -0
  83. package/dist/components/shell/TopBar.svelte +37 -0
  84. package/dist/components/shell/TopBar.svelte.d.ts +11 -0
  85. package/dist/components/shell/WidgetRow.svelte +126 -0
  86. package/dist/components/shell/WidgetRow.svelte.d.ts +78 -0
  87. package/dist/components/shell/error-state-messages.d.ts +7 -0
  88. package/dist/components/shell/error-state-messages.js +9 -0
  89. package/dist/components/shell/index.d.ts +22 -0
  90. package/dist/components/shell/index.js +25 -0
  91. package/dist/components/shell/link-external.d.ts +2 -0
  92. package/dist/components/shell/link-external.js +7 -0
  93. package/dist/components/shell/messages.d.ts +7 -0
  94. package/dist/components/shell/messages.js +5 -0
  95. package/dist/components/shell/settings-nav-types.d.ts +12 -0
  96. package/dist/components/shell/settings-nav-types.js +3 -0
  97. package/dist/components/shell/shell-utils.d.ts +7 -0
  98. package/dist/components/shell/shell-utils.js +27 -0
  99. package/dist/components/shell/stat-tone.d.ts +3 -0
  100. package/dist/components/shell/stat-tone.js +11 -0
  101. package/dist/components/toast/ToasterModal.svelte +102 -168
  102. package/dist/components/toast/ToasterModal.svelte.d.ts +2 -12
  103. package/dist/components/ui/accordion/accordion-content.svelte +3 -2
  104. package/dist/components/ui/accordion/accordion-item.svelte +10 -1
  105. package/dist/components/ui/accordion/accordion-trigger.svelte +4 -3
  106. package/dist/components/ui/alert/alert-description.svelte +5 -1
  107. package/dist/components/ui/alert/alert-title.svelte +2 -1
  108. package/dist/components/ui/alert/index.d.ts +13 -11
  109. package/dist/components/ui/alert/index.js +4 -4
  110. package/dist/components/ui/avatar/avatar-utils.d.ts +2 -0
  111. package/dist/components/ui/avatar/avatar-utils.js +9 -0
  112. package/dist/components/ui/avatar/avatar.svelte +63 -0
  113. package/dist/components/ui/avatar/avatar.svelte.d.ts +80 -0
  114. package/dist/components/ui/avatar/index.d.ts +4 -0
  115. package/dist/components/ui/avatar/index.js +4 -0
  116. package/dist/components/ui/badge/badge.svelte +22 -10
  117. package/dist/components/ui/badge/badge.svelte.d.ts +14 -15
  118. package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +2 -2
  119. package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +1 -1
  120. package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +1 -1
  121. package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +2 -2
  122. package/dist/components/ui/button/button-padding.d.ts +9 -0
  123. package/dist/components/ui/button/button-padding.js +15 -0
  124. package/dist/components/ui/button/button.svelte +81 -31
  125. package/dist/components/ui/button/button.svelte.d.ts +48 -29
  126. package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
  127. package/dist/components/ui/calendar/calendar-head-cell.svelte +1 -1
  128. package/dist/components/ui/calendar/calendar-next-button.svelte +2 -2
  129. package/dist/components/ui/calendar/calendar-prev-button.svelte +2 -2
  130. package/dist/components/ui/card/card-description.svelte +1 -1
  131. package/dist/components/ui/card/card-title.svelte +1 -1
  132. package/dist/components/ui/card/card.svelte +1 -1
  133. package/dist/components/ui/checkbox/checkbox.svelte +9 -5
  134. package/dist/components/ui/chip/chip.svelte +48 -0
  135. package/dist/components/ui/chip/chip.svelte.d.ts +13 -0
  136. package/dist/components/ui/chip/index.d.ts +2 -0
  137. package/dist/components/ui/chip/index.js +2 -0
  138. package/dist/components/ui/command/command-dialog.svelte +1 -1
  139. package/dist/components/ui/command/command-input.svelte +4 -4
  140. package/dist/components/ui/command/command-item.svelte +1 -1
  141. package/dist/components/ui/command/command.svelte +1 -1
  142. package/dist/components/ui/dialog/dialog-content.svelte +4 -4
  143. package/dist/components/ui/dialog/dialog-description.svelte +1 -1
  144. package/dist/components/ui/dialog/dialog-overlay.svelte +1 -1
  145. package/dist/components/ui/dialog/dialog-title.svelte +1 -1
  146. package/dist/components/ui/drawer/drawer-content.svelte +1 -1
  147. package/dist/components/ui/drawer/drawer-overlay.svelte +1 -1
  148. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +5 -5
  149. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
  150. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
  151. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +20 -2
  152. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +4 -0
  153. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +5 -1
  154. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +3 -3
  155. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -1
  156. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
  157. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +3 -3
  158. package/dist/components/ui/field/field-ids.d.ts +7 -0
  159. package/dist/components/ui/field/field-ids.js +15 -0
  160. package/dist/components/ui/field/field.svelte +62 -0
  161. package/dist/components/ui/field/field.svelte.d.ts +21 -0
  162. package/dist/components/ui/field/index.d.ts +3 -0
  163. package/dist/components/ui/field/index.js +3 -0
  164. package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
  165. package/dist/components/ui/icon-button/icon-button.svelte +72 -0
  166. package/dist/components/ui/icon-button/icon-button.svelte.d.ts +90 -0
  167. package/dist/components/ui/icon-button/index.d.ts +2 -0
  168. package/dist/components/ui/icon-button/index.js +4 -0
  169. package/dist/components/ui/input/index.d.ts +1 -0
  170. package/dist/components/ui/input/input.svelte +11 -4
  171. package/dist/components/ui/input/input.svelte.d.ts +4 -1
  172. package/dist/components/ui/input-otp/input-otp-separator.svelte +2 -2
  173. package/dist/components/ui/input-otp/input-otp-slot.svelte +5 -4
  174. package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +1 -1
  175. package/dist/components/ui/input-otp/input-otp.svelte +1 -1
  176. package/dist/components/ui/label/label.svelte +3 -2
  177. package/dist/components/ui/popover/popover-content.svelte +1 -1
  178. package/dist/components/ui/progress/progress.svelte +19 -5
  179. package/dist/components/ui/progress/progress.svelte.d.ts +4 -2
  180. package/dist/components/ui/radio-group/radio-group-item.svelte +4 -4
  181. package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
  182. package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +2 -2
  183. package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +2 -2
  184. package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +4 -1
  185. package/dist/components/ui/scroll-area/scroll-area.svelte +1 -1
  186. package/dist/components/ui/select/select-content.svelte +1 -3
  187. package/dist/components/ui/select/select-item.svelte +5 -4
  188. package/dist/components/ui/select/select-scroll-down-button.svelte +2 -2
  189. package/dist/components/ui/select/select-scroll-up-button.svelte +2 -2
  190. package/dist/components/ui/select/select-trigger.svelte +4 -3
  191. package/dist/components/ui/skeleton/index.d.ts +2 -0
  192. package/dist/components/ui/skeleton/index.js +2 -0
  193. package/dist/components/ui/skeleton/skeleton.svelte +24 -0
  194. package/dist/components/ui/skeleton/skeleton.svelte.d.ts +8 -0
  195. package/dist/components/ui/slider/slider.svelte +5 -10
  196. package/dist/components/ui/sonner/sonner.svelte +19 -13
  197. package/dist/components/ui/stepper-button/index.d.ts +3 -0
  198. package/dist/components/ui/stepper-button/index.js +2 -0
  199. package/dist/components/ui/stepper-button/stepper-button.svelte +37 -0
  200. package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +9 -0
  201. package/dist/components/ui/switch/switch.svelte +8 -3
  202. package/dist/components/ui/table/table-cell.svelte +1 -1
  203. package/dist/components/ui/table/table-head.svelte +1 -1
  204. package/dist/components/ui/table/table-row.svelte +1 -1
  205. package/dist/components/ui/tabs/tabs-list.svelte +1 -1
  206. package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
  207. package/dist/components/ui/tag/index.d.ts +2 -0
  208. package/dist/components/ui/tag/index.js +2 -0
  209. package/dist/components/ui/tag/tag.svelte +42 -0
  210. package/dist/components/ui/tag/tag.svelte.d.ts +11 -0
  211. package/dist/components/ui/textarea/textarea.svelte +4 -3
  212. package/dist/components/ui/textarea/textarea.svelte.d.ts +2 -2
  213. package/dist/components/ui/toggle/toggle.svelte +9 -9
  214. package/dist/components/ui/toggle/toggle.svelte.d.ts +14 -21
  215. package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
  216. package/dist/fonts/Inter/Inter-Black.woff2 +0 -0
  217. package/dist/fonts/Inter/Inter-BlackItalic.woff2 +0 -0
  218. package/dist/fonts/Inter/Inter-Bold.woff2 +0 -0
  219. package/dist/fonts/Inter/Inter-BoldItalic.woff2 +0 -0
  220. package/dist/fonts/Inter/Inter-ExtraBold.woff2 +0 -0
  221. package/dist/fonts/Inter/Inter-ExtraBoldItalic.woff2 +0 -0
  222. package/dist/fonts/Inter/Inter-ExtraLight-BETA.woff2 +0 -0
  223. package/dist/fonts/Inter/Inter-ExtraLightItalic-BETA.woff2 +0 -0
  224. package/dist/fonts/Inter/Inter-Italic.woff2 +0 -0
  225. package/dist/fonts/Inter/Inter-Light-BETA.woff2 +0 -0
  226. package/dist/fonts/Inter/Inter-LightItalic-BETA.woff2 +0 -0
  227. package/dist/fonts/Inter/Inter-Medium.woff2 +0 -0
  228. package/dist/fonts/Inter/Inter-MediumItalic.woff2 +0 -0
  229. package/dist/fonts/Inter/Inter-Regular.woff2 +0 -0
  230. package/dist/fonts/Inter/Inter-SemiBold.woff2 +0 -0
  231. package/dist/fonts/Inter/Inter-SemiBoldItalic.woff2 +0 -0
  232. package/dist/fonts/Inter/Inter-Thin-BETA.woff2 +0 -0
  233. package/dist/fonts/Inter/Inter-ThinItalic-BETA.woff2 +0 -0
  234. package/dist/fonts/Inter/Inter-italic.var.woff2 +0 -0
  235. package/dist/fonts/Inter/Inter-upright.var.woff2 +0 -0
  236. package/dist/fonts/Inter/Inter.var.woff2 +0 -0
  237. package/dist/fonts/JetBrainsMono/JetBrainsMono-Regular.woff2 +0 -0
  238. package/dist/i18n/audit/designSystemWords.d.ts +1 -1
  239. package/dist/i18n/audit/designSystemWords.js +1 -1
  240. package/dist/styles/fonts.css +18 -14
  241. package/dist/styles/global.css +7 -19
  242. package/dist/styles/tokens.css +332 -0
  243. package/dist/utils.d.ts +27 -0
  244. package/dist/utils.js +33 -2
  245. package/package.json +2 -1
  246. package/tailwind.config.ts +7 -47
@@ -0,0 +1,78 @@
1
+ export declare const widgetRowVariants: import("tailwind-variants").TVReturnType<{
2
+ selected: {
3
+ true: string;
4
+ false: string;
5
+ };
6
+ loading: {
7
+ true: string;
8
+ false: string;
9
+ };
10
+ }, undefined, "group/widget-row flex min-h-16 w-full max-w-content items-center gap-4 rounded-xl py-3 ps-4 pe-4 transition-colors duration-fast focus-within:outline-hidden", {
11
+ responsiveVariants?: boolean | (string | number | symbol)[] | {
12
+ selected?: boolean | (string | number | symbol)[] | undefined;
13
+ loading?: boolean | (string | number | symbol)[] | undefined;
14
+ } | undefined;
15
+ } & import("tailwind-variants/dist/config.js").TWMConfig & {
16
+ twMergeConfig: {
17
+ classGroups: {
18
+ "font-size": {
19
+ text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
20
+ }[];
21
+ };
22
+ };
23
+ }, {
24
+ selected: {
25
+ true: string;
26
+ false: string;
27
+ };
28
+ loading: {
29
+ true: string;
30
+ false: string;
31
+ };
32
+ }, undefined, import("tailwind-variants").TVReturnType<{
33
+ selected: {
34
+ true: string;
35
+ false: string;
36
+ };
37
+ loading: {
38
+ true: string;
39
+ false: string;
40
+ };
41
+ }, undefined, "group/widget-row flex min-h-16 w-full max-w-content items-center gap-4 rounded-xl py-3 ps-4 pe-4 transition-colors duration-fast focus-within:outline-hidden", import("tailwind-variants/dist/config.js").TVConfig<{
42
+ selected: {
43
+ true: string;
44
+ false: string;
45
+ };
46
+ loading: {
47
+ true: string;
48
+ false: string;
49
+ };
50
+ }, {
51
+ selected: {
52
+ true: string;
53
+ false: string;
54
+ };
55
+ loading: {
56
+ true: string;
57
+ false: string;
58
+ };
59
+ }>, unknown, unknown, undefined>>;
60
+ export type WidgetRowVisualState = 'default' | 'hover' | 'focus' | 'selected' | 'loading';
61
+ import type { HTMLAttributes } from 'svelte/elements';
62
+ import type { Snippet } from 'svelte';
63
+ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
64
+ title: string;
65
+ meta?: string;
66
+ showBadge?: boolean;
67
+ badgeLabel?: string;
68
+ selected?: boolean;
69
+ loading?: boolean;
70
+ visualState?: WidgetRowVisualState;
71
+ /** Touch / mobile: keep row actions visible without hover. */
72
+ actionsAlwaysVisible?: boolean;
73
+ thumbnail?: Snippet;
74
+ actions?: Snippet;
75
+ };
76
+ declare const WidgetRow: import("svelte").Component<$$ComponentProps, {}, "">;
77
+ type WidgetRow = ReturnType<typeof WidgetRow>;
78
+ export default WidgetRow;
@@ -0,0 +1,7 @@
1
+ export interface ErrorStateMessages {
2
+ title: string;
3
+ description: string;
4
+ retryLabel: string;
5
+ supportLabel: string;
6
+ }
7
+ export declare const defaultErrorStateMessages: ErrorStateMessages;
@@ -0,0 +1,9 @@
1
+ // The words of the Figma Error State: the title says what failed in a few words, the description gives the likely cause
2
+ // and what to try. "Something went wrong" stays only for a failure whose cause is not known, and a page gives that as
3
+ // its own `messages`.
4
+ export const defaultErrorStateMessages = {
5
+ title: 'We could not load your widgets',
6
+ description: 'Check your connection and try again.',
7
+ retryLabel: 'Try again',
8
+ supportLabel: 'Contact support'
9
+ };
@@ -0,0 +1,22 @@
1
+ export { default as NavRow, navRowVariants } from './NavRow.svelte';
2
+ export { default as NavSectionLabel } from './NavSectionLabel.svelte';
3
+ export { default as ProfileRow, profileRowVariants } from './ProfileRow.svelte';
4
+ export { default as Sidebar } from './Sidebar.svelte';
5
+ export type { SidebarNavItem } from './Sidebar.svelte';
6
+ export { default as WidgetRow, widgetRowVariants } from './WidgetRow.svelte';
7
+ export { default as PageHeader } from './PageHeader.svelte';
8
+ export { default as TopBar } from './TopBar.svelte';
9
+ export { default as NavDrawer } from './NavDrawer.svelte';
10
+ export { default as AppShell } from './AppShell.svelte';
11
+ export { default as ErrorState } from './ErrorState.svelte';
12
+ export { defaultErrorStateMessages, type ErrorStateMessages } from './error-state-messages.js';
13
+ export { default as NotificationRow, type NotificationRowProps } from './NotificationRow.svelte';
14
+ export { default as SettingsNav, type SettingsNavProps } from './SettingsNav.svelte';
15
+ export { default as SettingsDialog, type SettingsDialogProps } from './SettingsDialog.svelte';
16
+ export { default as Stat, type StatProps, statVariants } from './Stat.svelte';
17
+ export { default as Banner, type BannerProps, type BannerTone, bannerVariants } from './Banner.svelte';
18
+ export { default as Link, type LinkProps, type LinkSize, linkVariants } from './Link.svelte';
19
+ export { type SettingsNavGroup, type SettingsNavItem, settingsNavItemIsActive } from './settings-nav-types.js';
20
+ export { externalLinkAttributes } from './link-external.js';
21
+ export { statHintClass, type StatTone } from './stat-tone.js';
22
+ export { type SettingsDialogMessages, defaultSettingsDialogMessages } from './messages.js';
@@ -0,0 +1,25 @@
1
+ // Shell components (app shell, navigation, status, settings) built from the Figma design system.
2
+ // Each component is exported here by the agent that owns src/lib/components/shell.
3
+ // [S1 exports]
4
+ export { default as NavRow, navRowVariants } from './NavRow.svelte';
5
+ export { default as NavSectionLabel } from './NavSectionLabel.svelte';
6
+ export { default as ProfileRow, profileRowVariants } from './ProfileRow.svelte';
7
+ export { default as Sidebar } from './Sidebar.svelte';
8
+ export { default as WidgetRow, widgetRowVariants } from './WidgetRow.svelte';
9
+ export { default as PageHeader } from './PageHeader.svelte';
10
+ export { default as TopBar } from './TopBar.svelte';
11
+ export { default as NavDrawer } from './NavDrawer.svelte';
12
+ export { default as AppShell } from './AppShell.svelte';
13
+ export { default as ErrorState } from './ErrorState.svelte';
14
+ export { defaultErrorStateMessages } from './error-state-messages.js';
15
+ // [S2 exports]
16
+ export { default as NotificationRow } from './NotificationRow.svelte';
17
+ export { default as SettingsNav } from './SettingsNav.svelte';
18
+ export { default as SettingsDialog } from './SettingsDialog.svelte';
19
+ export { default as Stat, statVariants } from './Stat.svelte';
20
+ export { default as Banner, bannerVariants } from './Banner.svelte';
21
+ export { default as Link, linkVariants } from './Link.svelte';
22
+ export { settingsNavItemIsActive } from './settings-nav-types.js';
23
+ export { externalLinkAttributes } from './link-external.js';
24
+ export { statHintClass } from './stat-tone.js';
25
+ export { defaultSettingsDialogMessages } from './messages.js';
@@ -0,0 +1,2 @@
1
+ /** rel/target for links that open in a new tab. */
2
+ export declare function externalLinkAttributes(): Pick<HTMLAnchorElement, 'rel' | 'target'>;
@@ -0,0 +1,7 @@
1
+ /** rel/target for links that open in a new tab. */
2
+ export function externalLinkAttributes() {
3
+ return {
4
+ rel: 'noopener noreferrer',
5
+ target: '_blank'
6
+ };
7
+ }
@@ -0,0 +1,7 @@
1
+ /** Footer links in SettingsDialog (Figma Settings Dialog 107:618). */
2
+ export interface SettingsDialogMessages {
3
+ privacyPolicy: string;
4
+ termsOfService: string;
5
+ cookieSettings: string;
6
+ }
7
+ export declare const defaultSettingsDialogMessages: SettingsDialogMessages;
@@ -0,0 +1,5 @@
1
+ export const defaultSettingsDialogMessages = {
2
+ privacyPolicy: 'Privacy policy',
3
+ termsOfService: 'Terms of service',
4
+ cookieSettings: 'Cookie settings'
5
+ };
@@ -0,0 +1,12 @@
1
+ import type { Snippet } from 'svelte';
2
+ export type SettingsNavItem = {
3
+ id: string;
4
+ label: string;
5
+ icon?: Snippet;
6
+ };
7
+ export type SettingsNavGroup = {
8
+ id: string;
9
+ label: string;
10
+ items: SettingsNavItem[];
11
+ };
12
+ export declare function settingsNavItemIsActive(activeId: string, itemId: string): boolean;
@@ -0,0 +1,3 @@
1
+ export function settingsNavItemIsActive(activeId, itemId) {
2
+ return activeId === itemId;
3
+ }
@@ -0,0 +1,7 @@
1
+ /** Drawer motion from Figma Responsive / appShell ledger (ms). */
2
+ export declare function navDrawerTransitionMs(open: boolean): number;
3
+ export declare function navDrawerTransitionEasing(open: boolean): 'var(--ease-drawer)' | 'var(--ease-out)';
4
+ export declare function navDrawerEffectiveTransitionMs(open: boolean, reducedMotion: boolean): number;
5
+ export declare function getFocusableElements(root: HTMLElement): HTMLElement[];
6
+ /** Returns the next element to focus when Tab / Shift+Tab is pressed inside `root`. */
7
+ export declare function navDrawerTabTarget(root: HTMLElement, active: HTMLElement, shiftKey: boolean): HTMLElement | null;
@@ -0,0 +1,27 @@
1
+ /** Drawer motion from Figma Responsive / appShell ledger (ms). */
2
+ export function navDrawerTransitionMs(open) {
3
+ return open ? 320 : 220;
4
+ }
5
+ export function navDrawerTransitionEasing(open) {
6
+ return open ? 'var(--ease-drawer)' : 'var(--ease-out)';
7
+ }
8
+ export function navDrawerEffectiveTransitionMs(open, reducedMotion) {
9
+ return reducedMotion ? 0 : navDrawerTransitionMs(open);
10
+ }
11
+ const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
12
+ export function getFocusableElements(root) {
13
+ return [...root.querySelectorAll(FOCUSABLE)].filter((el) => !el.hasAttribute('disabled') && el.getAttribute('aria-hidden') !== 'true');
14
+ }
15
+ /** Returns the next element to focus when Tab / Shift+Tab is pressed inside `root`. */
16
+ export function navDrawerTabTarget(root, active, shiftKey) {
17
+ const focusables = getFocusableElements(root);
18
+ if (focusables.length === 0)
19
+ return null;
20
+ const index = focusables.indexOf(active);
21
+ if (index === -1)
22
+ return focusables[0] ?? null;
23
+ if (shiftKey) {
24
+ return index === 0 ? focusables[focusables.length - 1] : focusables[index - 1];
25
+ }
26
+ return index === focusables.length - 1 ? focusables[0] : focusables[index + 1];
27
+ }
@@ -0,0 +1,3 @@
1
+ export type StatTone = 'default' | 'positive' | 'negative';
2
+ /** Hint line colour for Stat tones (Figma Stat 327:243). */
3
+ export declare function statHintClass(tone: StatTone): string;
@@ -0,0 +1,11 @@
1
+ /** Hint line colour for Stat tones (Figma Stat 327:243). */
2
+ export function statHintClass(tone) {
3
+ switch (tone) {
4
+ case 'positive':
5
+ return 'text-brand-foreground';
6
+ case 'negative':
7
+ return 'text-destructive';
8
+ default:
9
+ return 'text-muted-foreground';
10
+ }
11
+ }
@@ -1,180 +1,114 @@
1
1
  <script lang="ts" module>
2
- // Import Toast Component from UI Folder
3
- import { toast, Toaster } from '../ui/sonner';
4
-
5
- // Import Icons from Icons Folder
6
- import Exclamation from '../../icons/Exclamation.svelte';
7
- import Checked from '../../icons/Checked.svelte';
8
-
9
- // Where the toasters are drawn (the page's document, or a shadow root): see ./toasterRoots.ts
10
- import { toastLookupRoots } from './toasterRoots';
11
-
12
- // Import Toast Types directly from the svelte-sonner module
13
- // import type { ToastTypes } from 'svelte-sonner';
14
- // Define the ToastTypes type
15
- type ToastTypes = 'success' | 'error' | 'warning' | 'info' | 'loading';
16
-
17
- /* COMPONENT PROPS */
18
- let className = '';
19
- export { className as class };
20
- export let style: string = '';
21
- // Default Duration
22
- export let defaultDuration: number = 3000;
23
- // root element reference
24
- export let element: HTMLElement | null = null;
25
-
26
-
27
- /* STATE VARIABLES */
28
- let toastMainClass = 'toast-modal';
29
- // Track toast visibility to prevent multiple toasts
30
- let isToastVisible = false;
31
-
32
- /**
33
- * Shows a toast notification with consistent styling and positioning
34
- * @param type Type of toast message (success, error, warning)
35
- * @param title Main message text
36
- * @param options Additional options including description
37
- */
38
- export function showToast(type: string = 'success', title: string, options: any = null) {
39
-
40
-
41
- // Prevent multiple toasts from appearing simultaneously
42
- // if (isToastVisible) return;
43
-
44
- // Set the toast visibility to true
45
- isToastVisible = true;
46
-
47
- // If options is null, set it to an empty object
48
- if (options === null) {
49
- options = {};
50
- }
51
-
52
- // Get the duration from the options or use the default duration
53
- const duration = options?.duration || defaultDuration;
54
-
55
- // set close icon - not working !!!
56
- options.closeIcon = Exclamation;
57
-
58
- // Get the title color from the options or use the default color
59
- const titleColor = type === 'success' ? '--grey7' : type === 'error' ? '--error' : '--dark';
60
-
61
- // set icon depending on the type of toast
62
- if(type === 'error') options.icon = Exclamation;
63
- if(type === 'success') options.icon = Checked;
64
-
65
- // set icon background fill color
66
- if(type === 'success') options.iconBgFillColor = '--icon-success';
67
- if(type === 'error') options.iconBgFillColor = '--icon-error';
68
- if(type === 'warning') options.iconBgFillColor = '--sunny-yellow';
69
- // console.log('showToast:', type, title, titleColor, duration);
70
-
71
- // set style of the data-icon element
72
- setTimeout(() => {
73
- // The elements are looked for in the root the toaster is drawn in: `document.querySelector` does not look inside
74
- // a shadow root, so for a toaster in a module's shadow root the icon and the title kept the library's colours.
75
- for (const lookupRoot of toastLookupRoots(document)) {
76
- // set the close button color
77
- let closeButtonElement = lookupRoot.querySelector('.' + toastMainClass + '-close-button') as HTMLElement; //console.log('closeButtonElement:', closeButtonElement);
78
- // if(closeButtonElement) closeButtonElement.style.backgroundColor = 'hsl(var(' + options.closeBgFillColor + '))';
79
-
80
- // set icon background fill color
81
- let iconElement = lookupRoot.querySelector('.' + toastMainClass + '> [data-icon] > svg') as HTMLElement; //console.log('iconElement:', iconElement);
82
- if(iconElement) iconElement.style.color = 'hsl(var(' + options.iconBgFillColor + '))';
83
-
84
- // set the title color
85
- let titleElement = lookupRoot.querySelector('.' + toastMainClass + '-title') as HTMLElement; //console.log('titleElement:', titleElement);
86
- if(titleElement) titleElement.style.color = 'hsl(var(' + titleColor + '))';
87
- }
88
- }, 20);
89
-
90
- // Call toast with custom styling
91
- return toast[type as ToastTypes](title, {
92
- ...options,
93
- duration,
94
- unstyled: true,
95
- onAutoClose: () => {
96
- isToastVisible = false;
97
- },
98
- onDismiss: () => {
99
- isToastVisible = false;
100
- }
101
- });
102
- }
103
-
2
+ import { toast, Toaster } from '../ui/sonner';
3
+ import IconAlertTriangle from '@tabler/icons-svelte/icons/alert-triangle';
4
+ import IconCircleCheck from '@tabler/icons-svelte/icons/circle-check';
5
+ import IconExclamationCircle from '@tabler/icons-svelte/icons/exclamation-circle';
6
+ import IconInfoCircle from '@tabler/icons-svelte/icons/info-circle';
7
+ import { toastLookupRoots } from './toasterRoots';
8
+
9
+ type ToastTypes = 'success' | 'error' | 'warning' | 'info' | 'loading';
10
+
11
+ // Icon of each tone: the same glyphs as the Tone variants of the Toast in Figma (135:87).
12
+ // `info` is the Default tone of Figma. `loading` keeps the spinner of the library.
13
+ const toneIcons: Partial<Record<ToastTypes, typeof IconInfoCircle>> = {
14
+ info: IconInfoCircle,
15
+ success: IconCircleCheck,
16
+ warning: IconExclamationCircle,
17
+ error: IconAlertTriangle
18
+ };
19
+
20
+ let className = '';
21
+ export { className as class };
22
+ export let style: string = '';
23
+ export let defaultDuration: number = 3000;
24
+ export let element: HTMLElement | null = null;
25
+
26
+ let toastMainClass = 'toast-modal';
27
+ let isToastVisible = false;
28
+
29
+ export function showToast(
30
+ type: string = 'success',
31
+ title: string,
32
+ options: Record<string, unknown> | null = null
33
+ ) {
34
+ isToastVisible = true;
35
+
36
+ if (options === null) {
37
+ options = {};
38
+ }
39
+
40
+ const duration = (options?.duration as number | undefined) || defaultDuration;
41
+
42
+ // Every tone has its own icon, the same one as in Figma, so a caller does not swap it.
43
+ const toneIcon = toneIcons[type as ToastTypes];
44
+ if (toneIcon) options.icon = toneIcon;
45
+
46
+ // A type the library does not know is shown as info instead of throwing, and says so once.
47
+ let toastKey: ToastTypes = type as ToastTypes;
48
+ if (typeof toast[toastKey] !== 'function') {
49
+ console.warn(`[showToast] Unknown toast type "${type}", showing it as info.`);
50
+ toastKey = 'info';
51
+ }
52
+
53
+ return toast[toastKey](title, {
54
+ ...options,
55
+ duration,
56
+ unstyled: true,
57
+ onAutoClose: () => {
58
+ isToastVisible = false;
59
+ },
60
+ onDismiss: () => {
61
+ isToastVisible = false;
62
+ }
63
+ });
64
+ }
104
65
  </script>
105
66
 
106
67
  <script lang="ts">
107
- import { onMount } from 'svelte';
108
- import { registerToasterRoot } from './toasterRoots';
109
- import { useTextDirection } from '../textDirection.js';
68
+ import { onMount } from 'svelte';
69
+ import { registerToasterRoot } from './toasterRoots';
70
+ import { useTextDirection } from '../textDirection.js';
110
71
 
111
- /**
112
- * The words a screen reader hears: the region that holds the toasts ("Notifications", read with the key that moves
113
- * focus to it) and the button that closes one ("Close toast"). A page in another language gives its own words;
114
- * left out, the English ones of the library are used.
115
- */
116
- export let containerAriaLabel: string | undefined = undefined;
117
- export let closeButtonAriaLabel: string | undefined = undefined;
72
+ export let containerAriaLabel: string | undefined = undefined;
73
+ export let closeButtonAriaLabel: string | undefined = undefined;
118
74
 
119
- // An element with no size that is only here to ask which root (the page's document, or a shadow root) this toaster is
120
- // drawn in, so that `showToast` looks for the toast's icon and title there.
121
- let rootMarker: HTMLElement;
122
- onMount(() => registerToasterRoot(rootMarker.getRootNode() as Document | ShadowRoot));
75
+ let rootMarker: HTMLElement;
76
+ onMount(() => registerToasterRoot(rootMarker.getRootNode() as Document | ShadowRoot));
123
77
 
124
- // The toaster reads the direction of the PAGE's <html> unless it is told, and a module on a left to right page that
125
- // speaks Arabic (or the other way around) must follow its own screen. The toasts sit in the corner at the end of the
126
- // line: the right in a left to right screen, the left in a right to left one.
127
- const textDirection = useTextDirection();
78
+ const textDirection = useTextDirection();
128
79
  </script>
129
80
 
130
- <!-- HTML Template -->
131
81
  <span hidden bind:this={rootMarker}></span>
132
82
  <Toaster
133
- theme="light"
134
- dir={$textDirection}
135
- position={$textDirection === 'rtl' ? 'bottom-left' : 'bottom-right'}
136
- {containerAriaLabel}
137
- {closeButtonAriaLabel}
138
- richColors
139
- closeButton
140
- toastOptions={{
141
- style: "box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1); !important;",
142
- classes: {
143
- toast: toastMainClass + " widgetic-colors widgetic-radius !bg-white !rounded-small !border !border-[hsl(var(--forest-green))] " +
144
- "!min-w-[334px] !max-w-[450px] " +
145
- "!fixed !top-auto !bottom-[20px] !end-[20px] " +
146
- "!flex !items-center !gap-[24px] !p-[16px] !px-[24px] " +
147
- // Icon Styling
148
- "*:data-icon:!w-[24px] *:data-icon:!h-[24px] *:data-icon:!m-0 " +
149
- "[&>[data-icon]>svg]:!w-full [&>[data-icon]>svg]:!h-full " +
150
- // Content Styling
151
- "[&>[data-content]>svg]:flex [&>[data-content]>svg]:flex-col [&>[data-content]>svg]:gap-[2px]",
152
- // Title Styling
153
- title: toastMainClass + "-title body-medium",
154
- // Description Styling
155
- description: toastMainClass + "-description caption !text-[hsl(var(--grey5))]",
156
- // Action Button Styling
157
- actionButton: "",
158
- // Cancel Button Styling
159
- cancelButton: "",
160
- // Close Button Styling
161
- closeButton: toastMainClass + '-close-button !w-[16px] !h-[16px] !absolute !top-[-4px] !start-[-4px] z-10 ' +
162
- '!flex !items-center !justify-center ' +
163
- '!bg-[hsl(var(--grey7))] !border !border-[hsl(var(--grey5))] !rounded-full !text-white ' +
164
- '[&_svg]:!text-white [&_svg]:!fill-white [&_svg]:!stroke-white'
165
- }
166
- }}
167
- expand={false}
168
- visibleToasts={1}
169
- offset="1rem"
83
+ theme="light"
84
+ dir={$textDirection}
85
+ position={$textDirection === 'rtl' ? 'bottom-left' : 'bottom-right'}
86
+ {containerAriaLabel}
87
+ {closeButtonAriaLabel}
88
+ closeButton
89
+ toastOptions={{
90
+ classes: {
91
+ toast:
92
+ toastMainClass +
93
+ ' !fixed !bottom-5 !end-5 !flex !min-w-[20rem] !max-w-[22.25rem] !items-start !gap-3 !rounded-xl !border !border-border !bg-popover !p-4 !text-popover-foreground !shadow-none [&>[data-icon]]:!mt-0.5 [&>[data-icon]]:!size-4 [&>[data-icon]_svg]:!size-4 [&>[data-icon]_svg]:!stroke-[1.333]',
94
+ title: toastMainClass + '-title text-body-medium text-foreground',
95
+ description: toastMainClass + '-description text-body text-muted-foreground',
96
+ actionButton:
97
+ '!h-8 !rounded-lg !border !border-input !bg-background !px-2 !text-label !text-foreground hover:!bg-accent',
98
+ cancelButton: '',
99
+ closeButton:
100
+ toastMainClass +
101
+ '-close-button !absolute !-start-2 !-top-2 !flex !size-5 !items-center !justify-center !rounded-full !border !border-border !bg-foreground !text-primary-foreground [&_svg]:!size-3 [&_svg]:!stroke-[1.333]',
102
+ // The icon takes the colour of its tone, the Icon modes of Figma: Muted for info (Default), Brand, Warning and Destructive.
103
+ info: '[&>[data-icon]]:!text-muted-foreground',
104
+ success: '[&>[data-icon]]:!text-brand',
105
+ warning: '[&>[data-icon]]:!text-warning',
106
+ error: '[&>[data-icon]]:!text-destructive'
107
+ }
108
+ }}
109
+ expand={false}
110
+ visibleToasts={1}
111
+ offset="1rem"
112
+ class={className}
113
+ {style}
170
114
  />
171
-
172
- <style>
173
- /* svelte-sonner close SVG ignores button `color` / Tailwind text-white. */
174
- :global(.toast-modal-close-button svg),
175
- :global(.toast-modal-close-button path) {
176
- color: #ffffff !important;
177
- fill: #ffffff !important;
178
- stroke: #ffffff !important;
179
- }
180
- </style>
@@ -3,13 +3,7 @@ export { className as class };
3
3
  export declare let style: string;
4
4
  export declare let defaultDuration: number;
5
5
  export declare let element: HTMLElement | null;
6
- /**
7
- * Shows a toast notification with consistent styling and positioning
8
- * @param type Type of toast message (success, error, warning)
9
- * @param title Main message text
10
- * @param options Additional options including description
11
- */
12
- export declare function showToast(type: string | undefined, title: string, options?: any): string | number;
6
+ export declare function showToast(type: string | undefined, title: string, options?: Record<string, unknown> | null): string | number;
13
7
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
14
8
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
15
9
  $$bindings?: Bindings;
@@ -24,11 +18,7 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
18
  z_$$bindings?: Bindings;
25
19
  }
26
20
  declare const ToasterModal: $$__sveltets_2_IsomorphicComponent<{
27
- /**
28
- * The words a screen reader hears: the region that holds the toasts ("Notifications", read with the key that moves
29
- * focus to it) and the button that closes one ("Close toast"). A page in another language gives its own words;
30
- * left out, the English ones of the library are used.
31
- */ containerAriaLabel?: string | undefined;
21
+ containerAriaLabel?: string | undefined;
32
22
  closeButtonAriaLabel?: string | undefined;
33
23
  }, {
34
24
  [evt: string]: CustomEvent<any>;
@@ -13,12 +13,13 @@
13
13
  <AccordionPrimitive.Content
14
14
  bind:ref
15
15
  class={cn(
16
- "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",
16
+ "text-body data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden transition-all",
17
17
  className
18
18
  )}
19
19
  {...restProps}
20
20
  >
21
- <div class="pb-4 pt-0">
21
+ <!-- Figma "Accordion Item" body: 4 on top, 16 on the sides and below. -->
22
+ <div class="px-4 pt-1 pb-4">
22
23
  {@render children?.()}
23
24
  </div>
24
25
  </AccordionPrimitive.Content>
@@ -9,4 +9,13 @@
9
9
  }: AccordionPrimitive.ItemProps = $props();
10
10
  </script>
11
11
 
12
- <AccordionPrimitive.Item bind:ref class={cn("border-b", className)} {...restProps} />
12
+ <!-- Figma "Accordion Item": a card (popover fill, 1px inside stroke, radius xl) that clips its trigger and body.
13
+ The stroke is an inset ring, not a border, so it takes no room: the trigger and the rows keep the full 402px of the Figma frame. -->
14
+ <AccordionPrimitive.Item
15
+ bind:ref
16
+ class={cn(
17
+ "bg-popover text-popover-foreground ring-border overflow-hidden rounded-xl ring-1 ring-inset",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ />
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
3
- import ChevronDown from "lucide-svelte/icons/chevron-down";
3
+ import IconChevronDown from "@tabler/icons-svelte/icons/chevron-down";
4
4
  import { cn } from "../../../utils.js";
5
5
 
6
6
  let {
@@ -18,12 +18,13 @@
18
18
  <AccordionPrimitive.Trigger
19
19
  bind:ref
20
20
  class={cn(
21
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
21
+ // Figma "Accordion Trigger": 48 high, 16 on the sides, 8 between the title and the chevron; hover = accent fill, focus = 2px ring inside.
22
+ "text-body-medium text-foreground focus-visible:ring-ring flex h-12 flex-1 items-center justify-between gap-2 px-4 text-start transition-colors duration-fast outline-none hover:bg-accent focus-visible:rounded-xl focus-visible:ring-2 focus-visible:ring-inset [&[data-state=open]>svg]:rotate-180",
22
23
  className
23
24
  )}
24
25
  {...restProps}
25
26
  >
26
27
  {@render children?.()}
27
- <ChevronDown class="size-4 shrink-0 transition-transform duration-200" />
28
+ <IconChevronDown class="size-4 shrink-0 stroke-[1.333] transition-transform duration-base" />
28
29
  </AccordionPrimitive.Trigger>
29
30
  </AccordionPrimitive.Header>
@@ -8,6 +8,10 @@
8
8
  export { className as class };
9
9
  </script>
10
10
 
11
- <div class={cn("text-sm [&_p]:leading-relaxed", className)} {...$$restProps}>
11
+ <div
12
+ data-slot="alert-description"
13
+ class={cn("text-body text-muted-foreground [&_p]:leading-relaxed", className)}
14
+ {...$$restProps}
15
+ >
12
16
  <slot />
13
17
  </div>