@widgetic/design-system 0.5.21 → 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.
- package/README.md +2 -0
- package/dist/components/CopyableHeader.svelte +260 -448
- package/dist/components/CopyableHeader.svelte.d.ts +8 -5
- package/dist/components/EmptyState.svelte +100 -128
- package/dist/components/EmptyState.svelte.d.ts +16 -19
- package/dist/components/GenerateLoader.svelte +17 -10
- package/dist/components/PasswordInput.svelte +41 -44
- package/dist/components/PasswordInput.svelte.d.ts +2 -0
- package/dist/components/ThumbHashImage.svelte +117 -119
- package/dist/components/WScrollArea.svelte +47 -41
- package/dist/components/chat/ActivityRow.svelte +115 -0
- package/dist/components/chat/ActivityRow.svelte.d.ts +18 -0
- package/dist/components/chat/ChatHeader.svelte +114 -0
- package/dist/components/chat/ChatHeader.svelte.d.ts +26 -0
- package/dist/components/chat/Composer.svelte +172 -0
- package/dist/components/chat/Composer.svelte.d.ts +27 -0
- package/dist/components/chat/Message.svelte +158 -0
- package/dist/components/chat/Message.svelte.d.ts +28 -0
- package/dist/components/chat/OptionRow.svelte +59 -0
- package/dist/components/chat/OptionRow.svelte.d.ts +14 -0
- package/dist/components/chat/PlanCard.svelte +220 -0
- package/dist/components/chat/PlanCard.svelte.d.ts +34 -0
- package/dist/components/chat/QuestionCard.svelte +265 -0
- package/dist/components/chat/QuestionCard.svelte.d.ts +38 -0
- package/dist/components/chat/ScrollToBottom.svelte +51 -0
- package/dist/components/chat/ScrollToBottom.svelte.d.ts +11 -0
- package/dist/components/chat/SuggestionCard.svelte +79 -0
- package/dist/components/chat/SuggestionCard.svelte.d.ts +20 -0
- package/dist/components/chat/TaskRow.svelte +59 -0
- package/dist/components/chat/TaskRow.svelte.d.ts +11 -0
- package/dist/components/chat/composerLogic.d.ts +16 -0
- package/dist/components/chat/composerLogic.js +29 -0
- package/dist/components/chat/index.d.ts +16 -0
- package/dist/components/chat/index.js +16 -0
- package/dist/components/chat/questionCardLogic.d.ts +11 -0
- package/dist/components/chat/questionCardLogic.js +39 -0
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.js +10 -0
- package/dist/components/modals/ActionModal.svelte +186 -180
- package/dist/components/modals/BaseModal.svelte +404 -395
- package/dist/components/modals/BaseModal.svelte.d.ts +3 -0
- package/dist/components/modals/NewItemDialog.svelte +200 -243
- package/dist/components/modals/Portal.svelte +107 -105
- package/dist/components/modals/README.md +16 -2
- package/dist/components/modals/RenameDialog.svelte +234 -292
- package/dist/components/navigation/Breadcrumbs.svelte +415 -377
- package/dist/components/navigation/Breadcrumbs.svelte.d.ts +3 -2
- package/dist/components/navigation/types.d.ts +2 -0
- package/dist/components/pdf/PDFViewer.svelte +54 -1
- package/dist/components/search-input/SearchInput.svelte +51 -104
- package/dist/components/search-input/SearchInput.svelte.d.ts +9 -27
- package/dist/components/shad-editor/editor.css +1 -1
- package/dist/components/shad-editor/i18n/messages.d.ts +1 -1
- package/dist/components/shad-editor/i18n/messages.js +1 -1
- package/dist/components/shell/AppShell.svelte +52 -0
- package/dist/components/shell/AppShell.svelte.d.ts +13 -0
- package/dist/components/shell/Banner.svelte +90 -0
- package/dist/components/shell/Banner.svelte.d.ts +61 -0
- package/dist/components/shell/ErrorState.svelte +60 -0
- package/dist/components/shell/ErrorState.svelte.d.ts +13 -0
- package/dist/components/shell/Link.svelte +63 -0
- package/dist/components/shell/Link.svelte.d.ts +53 -0
- package/dist/components/shell/NavDrawer.svelte +117 -0
- package/dist/components/shell/NavDrawer.svelte.d.ts +10 -0
- package/dist/components/shell/NavRow.svelte +128 -0
- package/dist/components/shell/NavRow.svelte.d.ts +65 -0
- package/dist/components/shell/NavSectionLabel.svelte +27 -0
- package/dist/components/shell/NavSectionLabel.svelte.d.ts +9 -0
- package/dist/components/shell/NotificationRow.svelte +76 -0
- package/dist/components/shell/NotificationRow.svelte.d.ts +16 -0
- package/dist/components/shell/PageHeader.svelte +42 -0
- package/dist/components/shell/PageHeader.svelte.d.ts +12 -0
- package/dist/components/shell/ProfileRow.svelte +95 -0
- package/dist/components/shell/ProfileRow.svelte.d.ts +54 -0
- package/dist/components/shell/SettingsDialog.svelte +118 -0
- package/dist/components/shell/SettingsDialog.svelte.d.ts +19 -0
- package/dist/components/shell/SettingsNav.svelte +46 -0
- package/dist/components/shell/SettingsNav.svelte.d.ts +11 -0
- package/dist/components/shell/Sidebar.svelte +82 -0
- package/dist/components/shell/Sidebar.svelte.d.ts +25 -0
- package/dist/components/shell/Stat.svelte +63 -0
- package/dist/components/shell/Stat.svelte.d.ts +58 -0
- package/dist/components/shell/TopBar.svelte +37 -0
- package/dist/components/shell/TopBar.svelte.d.ts +11 -0
- package/dist/components/shell/WidgetRow.svelte +126 -0
- package/dist/components/shell/WidgetRow.svelte.d.ts +78 -0
- package/dist/components/shell/error-state-messages.d.ts +7 -0
- package/dist/components/shell/error-state-messages.js +9 -0
- package/dist/components/shell/index.d.ts +22 -0
- package/dist/components/shell/index.js +25 -0
- package/dist/components/shell/link-external.d.ts +2 -0
- package/dist/components/shell/link-external.js +7 -0
- package/dist/components/shell/messages.d.ts +7 -0
- package/dist/components/shell/messages.js +5 -0
- package/dist/components/shell/settings-nav-types.d.ts +12 -0
- package/dist/components/shell/settings-nav-types.js +3 -0
- package/dist/components/shell/shell-utils.d.ts +7 -0
- package/dist/components/shell/shell-utils.js +27 -0
- package/dist/components/shell/stat-tone.d.ts +3 -0
- package/dist/components/shell/stat-tone.js +11 -0
- package/dist/components/toast/ToasterModal.svelte +102 -168
- package/dist/components/toast/ToasterModal.svelte.d.ts +2 -12
- package/dist/components/ui/accordion/accordion-content.svelte +3 -2
- package/dist/components/ui/accordion/accordion-item.svelte +10 -1
- package/dist/components/ui/accordion/accordion-trigger.svelte +4 -3
- package/dist/components/ui/alert/alert-description.svelte +5 -1
- package/dist/components/ui/alert/alert-title.svelte +2 -1
- package/dist/components/ui/alert/index.d.ts +13 -11
- package/dist/components/ui/alert/index.js +4 -4
- package/dist/components/ui/avatar/avatar-utils.d.ts +2 -0
- package/dist/components/ui/avatar/avatar-utils.js +9 -0
- package/dist/components/ui/avatar/avatar.svelte +63 -0
- package/dist/components/ui/avatar/avatar.svelte.d.ts +80 -0
- package/dist/components/ui/avatar/index.d.ts +4 -0
- package/dist/components/ui/avatar/index.js +4 -0
- package/dist/components/ui/badge/badge.svelte +22 -10
- package/dist/components/ui/badge/badge.svelte.d.ts +14 -15
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +2 -2
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +2 -2
- package/dist/components/ui/button/button-padding.d.ts +9 -0
- package/dist/components/ui/button/button-padding.js +15 -0
- package/dist/components/ui/button/button.svelte +81 -31
- package/dist/components/ui/button/button.svelte.d.ts +48 -29
- package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-head-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-next-button.svelte +2 -2
- package/dist/components/ui/calendar/calendar-prev-button.svelte +2 -2
- package/dist/components/ui/card/card-description.svelte +1 -1
- package/dist/components/ui/card/card-title.svelte +1 -1
- package/dist/components/ui/card/card.svelte +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte +9 -5
- package/dist/components/ui/chip/chip.svelte +48 -0
- package/dist/components/ui/chip/chip.svelte.d.ts +13 -0
- package/dist/components/ui/chip/index.d.ts +2 -0
- package/dist/components/ui/chip/index.js +2 -0
- package/dist/components/ui/command/command-dialog.svelte +1 -1
- package/dist/components/ui/command/command-input.svelte +4 -4
- package/dist/components/ui/command/command-item.svelte +1 -1
- package/dist/components/ui/command/command.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +4 -4
- package/dist/components/ui/dialog/dialog-description.svelte +1 -1
- package/dist/components/ui/dialog/dialog-overlay.svelte +1 -1
- package/dist/components/ui/dialog/dialog-title.svelte +1 -1
- package/dist/components/ui/drawer/drawer-content.svelte +1 -1
- package/dist/components/ui/drawer/drawer-overlay.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +5 -5
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +20 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +5 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +3 -3
- package/dist/components/ui/field/field-ids.d.ts +7 -0
- package/dist/components/ui/field/field-ids.js +15 -0
- package/dist/components/ui/field/field.svelte +62 -0
- package/dist/components/ui/field/field.svelte.d.ts +21 -0
- package/dist/components/ui/field/index.d.ts +3 -0
- package/dist/components/ui/field/index.js +3 -0
- package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
- package/dist/components/ui/icon-button/icon-button.svelte +72 -0
- package/dist/components/ui/icon-button/icon-button.svelte.d.ts +90 -0
- package/dist/components/ui/icon-button/index.d.ts +2 -0
- package/dist/components/ui/icon-button/index.js +4 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/input.svelte +11 -4
- package/dist/components/ui/input/input.svelte.d.ts +4 -1
- package/dist/components/ui/input-otp/input-otp-separator.svelte +2 -2
- package/dist/components/ui/input-otp/input-otp-slot.svelte +5 -4
- package/dist/components/ui/input-otp/input-otp-slot.svelte.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.svelte +1 -1
- package/dist/components/ui/label/label.svelte +3 -2
- package/dist/components/ui/popover/popover-content.svelte +1 -1
- package/dist/components/ui/progress/progress.svelte +19 -5
- package/dist/components/ui/progress/progress.svelte.d.ts +4 -2
- package/dist/components/ui/radio-group/radio-group-item.svelte +4 -4
- package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +2 -2
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +2 -2
- package/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +4 -1
- package/dist/components/ui/scroll-area/scroll-area.svelte +1 -1
- package/dist/components/ui/select/select-content.svelte +1 -3
- package/dist/components/ui/select/select-item.svelte +5 -4
- package/dist/components/ui/select/select-scroll-down-button.svelte +2 -2
- package/dist/components/ui/select/select-scroll-up-button.svelte +2 -2
- package/dist/components/ui/select/select-trigger.svelte +4 -3
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/skeleton/index.js +2 -0
- package/dist/components/ui/skeleton/skeleton.svelte +24 -0
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +8 -0
- package/dist/components/ui/slider/slider.svelte +5 -10
- package/dist/components/ui/sonner/sonner.svelte +19 -13
- package/dist/components/ui/stepper-button/index.d.ts +3 -0
- package/dist/components/ui/stepper-button/index.js +2 -0
- package/dist/components/ui/stepper-button/stepper-button.svelte +37 -0
- package/dist/components/ui/stepper-button/stepper-button.svelte.d.ts +9 -0
- package/dist/components/ui/switch/switch.svelte +8 -3
- package/dist/components/ui/table/table-cell.svelte +1 -1
- package/dist/components/ui/table/table-head.svelte +1 -1
- package/dist/components/ui/table/table-row.svelte +1 -1
- package/dist/components/ui/tabs/tabs-list.svelte +1 -1
- package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
- package/dist/components/ui/tag/index.d.ts +2 -0
- package/dist/components/ui/tag/index.js +2 -0
- package/dist/components/ui/tag/tag.svelte +42 -0
- package/dist/components/ui/tag/tag.svelte.d.ts +11 -0
- package/dist/components/ui/textarea/textarea.svelte +4 -3
- package/dist/components/ui/textarea/textarea.svelte.d.ts +2 -2
- package/dist/components/ui/toggle/toggle.svelte +9 -9
- package/dist/components/ui/toggle/toggle.svelte.d.ts +14 -21
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/fonts/Inter/Inter-Black.woff2 +0 -0
- package/dist/fonts/Inter/Inter-BlackItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Bold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-BoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraBold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraBoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraLight-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ExtraLightItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Italic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Light-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-LightItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Medium.woff2 +0 -0
- package/dist/fonts/Inter/Inter-MediumItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Regular.woff2 +0 -0
- package/dist/fonts/Inter/Inter-SemiBold.woff2 +0 -0
- package/dist/fonts/Inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts/Inter/Inter-Thin-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-ThinItalic-BETA.woff2 +0 -0
- package/dist/fonts/Inter/Inter-italic.var.woff2 +0 -0
- package/dist/fonts/Inter/Inter-upright.var.woff2 +0 -0
- package/dist/fonts/Inter/Inter.var.woff2 +0 -0
- package/dist/fonts/JetBrainsMono/JetBrainsMono-Regular.woff2 +0 -0
- package/dist/i18n/audit/designSystemWords.d.ts +1 -1
- package/dist/i18n/audit/designSystemWords.js +1 -1
- package/dist/styles/fonts.css +18 -14
- package/dist/styles/global.css +7 -19
- package/dist/styles/tokens.css +332 -0
- package/dist/utils.d.ts +27 -0
- package/dist/utils.js +33 -2
- package/package.json +2 -1
- package/tailwind.config.ts +7 -47
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Widgetic design tokens (Figma Dashboard file GCC2aXrh3PEHlMWFaAOisR).
|
|
3
|
+
* Primitives + semantic Color, Spacing, Radius, Layout, Motion, typography utilities.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@theme {
|
|
7
|
+
--color-white: #ffffff;
|
|
8
|
+
--color-neutral-100: #f5f5f5;
|
|
9
|
+
--color-neutral-200: #e5e5e5;
|
|
10
|
+
--color-neutral-550: #676767;
|
|
11
|
+
--color-dark: #0f2010;
|
|
12
|
+
--color-deep-forest-green: #314f2f;
|
|
13
|
+
/* One red, 5.2:1 on white and 4.8:1 on a hover row (it was #e7000b, 4.4:1 on a hover row). */
|
|
14
|
+
--color-error: #dc0009;
|
|
15
|
+
/* Figma status/warning. Named by its hue because --color-warning is the Tailwind key of the semantic token below. */
|
|
16
|
+
--color-amber: #b45309;
|
|
17
|
+
--color-sage-green: #7ba668;
|
|
18
|
+
--color-light-green: #e3f0db;
|
|
19
|
+
|
|
20
|
+
--color-alpha-dark-04: color-mix(in oklab, var(--color-dark) 4%, transparent);
|
|
21
|
+
--color-alpha-dark-08: color-mix(in oklab, var(--color-dark) 8%, transparent);
|
|
22
|
+
--color-alpha-dark-30: color-mix(in oklab, var(--color-dark) 30%, transparent);
|
|
23
|
+
--color-alpha-light-10: color-mix(in oklab, var(--color-white) 10%, transparent);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:root {
|
|
27
|
+
/* Semantic colors (light mode). Add `.dark { ... }` when dark theme ships. */
|
|
28
|
+
--background: var(--color-white);
|
|
29
|
+
--foreground: var(--color-dark);
|
|
30
|
+
--card: var(--color-white);
|
|
31
|
+
--card-foreground: var(--color-dark);
|
|
32
|
+
--popover: var(--color-white);
|
|
33
|
+
--popover-foreground: var(--color-dark);
|
|
34
|
+
--primary: var(--color-deep-forest-green);
|
|
35
|
+
--primary-foreground: var(--color-white);
|
|
36
|
+
--secondary: var(--color-neutral-100);
|
|
37
|
+
--secondary-foreground: var(--color-dark);
|
|
38
|
+
--muted: var(--color-neutral-100);
|
|
39
|
+
--muted-foreground: var(--color-neutral-550);
|
|
40
|
+
--accent: var(--color-alpha-dark-04);
|
|
41
|
+
--accent-foreground: var(--color-dark);
|
|
42
|
+
/* Hover of a surface that is already accent (soft controls, the search field, the rows of the editor).
|
|
43
|
+
The Figma Hover variants stack a second accent fill on the first (4% over 4%); the nearest alpha primitive is 8%.
|
|
44
|
+
Derived from the primitives, not a Figma variable. */
|
|
45
|
+
--accent-hover: var(--color-alpha-dark-08);
|
|
46
|
+
--destructive: var(--color-error);
|
|
47
|
+
--destructive-foreground: var(--color-white);
|
|
48
|
+
/* Warning icon and text, 5.0:1 on white. For the Warning tone of a toast or a note, never a button or a surface. */
|
|
49
|
+
--warning: var(--color-amber);
|
|
50
|
+
--brand: var(--color-sage-green);
|
|
51
|
+
--brand-foreground: var(--color-dark);
|
|
52
|
+
--brand-subtle: var(--color-light-green);
|
|
53
|
+
--border: var(--color-neutral-200);
|
|
54
|
+
--border-strong: var(--color-alpha-dark-30);
|
|
55
|
+
--input: var(--color-neutral-200);
|
|
56
|
+
--ring: var(--color-deep-forest-green);
|
|
57
|
+
--sidebar: var(--color-neutral-100);
|
|
58
|
+
--sidebar-foreground: var(--color-dark);
|
|
59
|
+
--sidebar-primary: var(--color-deep-forest-green);
|
|
60
|
+
--sidebar-primary-foreground: var(--color-white);
|
|
61
|
+
--sidebar-accent: var(--color-alpha-dark-04);
|
|
62
|
+
--sidebar-accent-foreground: var(--color-dark);
|
|
63
|
+
--sidebar-border: var(--color-neutral-200);
|
|
64
|
+
--sidebar-ring: var(--color-deep-forest-green);
|
|
65
|
+
--shadow-soft: var(--color-alpha-dark-08);
|
|
66
|
+
--inverse: var(--color-dark);
|
|
67
|
+
--inverse-foreground: var(--color-white);
|
|
68
|
+
--inverse-muted: var(--color-alpha-light-10);
|
|
69
|
+
|
|
70
|
+
/* Spacing (Figma space/* → Tailwind spacing scale via --spacing = 0.25rem) */
|
|
71
|
+
--space-0-5: calc(var(--spacing) * 0.5);
|
|
72
|
+
--space-1: calc(var(--spacing) * 1);
|
|
73
|
+
--space-1-5: calc(var(--spacing) * 1.5);
|
|
74
|
+
--space-2: calc(var(--spacing) * 2);
|
|
75
|
+
--space-3: calc(var(--spacing) * 3);
|
|
76
|
+
--space-4: calc(var(--spacing) * 4);
|
|
77
|
+
--space-6: calc(var(--spacing) * 6);
|
|
78
|
+
--space-8: calc(var(--spacing) * 8);
|
|
79
|
+
--space-12: calc(var(--spacing) * 12);
|
|
80
|
+
|
|
81
|
+
/* Radius */
|
|
82
|
+
--radius-sm: 4px;
|
|
83
|
+
--radius-lg: 8px;
|
|
84
|
+
--radius-xl: 12px;
|
|
85
|
+
--radius-card: 18px;
|
|
86
|
+
--radius-panel: 24px;
|
|
87
|
+
--radius-full: 9999px;
|
|
88
|
+
|
|
89
|
+
/* Layout widths / heights */
|
|
90
|
+
--layout-sidebar-width: 280px;
|
|
91
|
+
--layout-chat-panel-width: 440px;
|
|
92
|
+
--layout-content-max-width: 728px;
|
|
93
|
+
--layout-settings-modal-width: 1024px;
|
|
94
|
+
--layout-settings-modal-height: 700px;
|
|
95
|
+
--layout-editor-panel-width: 450px;
|
|
96
|
+
--layout-editor-control-width: 185px;
|
|
97
|
+
--layout-picker-width: 374px;
|
|
98
|
+
--layout-auth-form-width: 360px;
|
|
99
|
+
--layout-auth-panel-width: 600px;
|
|
100
|
+
--layout-email-width: 440px;
|
|
101
|
+
--layout-dialog-width: 400px;
|
|
102
|
+
--layout-file-picker-width: 520px;
|
|
103
|
+
--layout-file-dialog-width: 566px;
|
|
104
|
+
|
|
105
|
+
/* Motion */
|
|
106
|
+
--duration-fast: 120ms;
|
|
107
|
+
--duration-base: 160ms;
|
|
108
|
+
--duration-slow: 250ms;
|
|
109
|
+
--duration-enter: 500ms;
|
|
110
|
+
--stagger-item: 50ms;
|
|
111
|
+
--ease-standard: ease;
|
|
112
|
+
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
113
|
+
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
|
|
114
|
+
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
|
|
115
|
+
--scale-press: 0.97;
|
|
116
|
+
--scale-enter: 0.95;
|
|
117
|
+
|
|
118
|
+
/* Shadow */
|
|
119
|
+
--shadow-floating: 0 4px 12px 0 var(--shadow-soft);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@theme inline {
|
|
123
|
+
--color-background: var(--background);
|
|
124
|
+
--color-foreground: var(--foreground);
|
|
125
|
+
--color-card: var(--card);
|
|
126
|
+
--color-card-foreground: var(--card-foreground);
|
|
127
|
+
--color-popover: var(--popover);
|
|
128
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
129
|
+
--color-primary: var(--primary);
|
|
130
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
131
|
+
--color-secondary: var(--secondary);
|
|
132
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
133
|
+
--color-muted: var(--muted);
|
|
134
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
135
|
+
--color-accent: var(--accent);
|
|
136
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
137
|
+
--color-accent-hover: var(--accent-hover);
|
|
138
|
+
--color-destructive: var(--destructive);
|
|
139
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
140
|
+
--color-warning: var(--warning);
|
|
141
|
+
--color-brand: var(--brand);
|
|
142
|
+
--color-brand-foreground: var(--brand-foreground);
|
|
143
|
+
--color-brand-subtle: var(--brand-subtle);
|
|
144
|
+
--color-border: var(--border);
|
|
145
|
+
--color-border-strong: var(--border-strong);
|
|
146
|
+
--color-input: var(--input);
|
|
147
|
+
--color-ring: var(--ring);
|
|
148
|
+
--color-sidebar: var(--sidebar);
|
|
149
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
150
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
151
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
152
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
153
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
154
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
155
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
156
|
+
--color-inverse: var(--inverse);
|
|
157
|
+
--color-inverse-foreground: var(--inverse-foreground);
|
|
158
|
+
--color-inverse-muted: var(--inverse-muted);
|
|
159
|
+
--color-shadow-soft: var(--shadow-soft);
|
|
160
|
+
|
|
161
|
+
--radius-sm: var(--radius-sm);
|
|
162
|
+
--radius-lg: var(--radius-lg);
|
|
163
|
+
--radius-xl: var(--radius-xl);
|
|
164
|
+
--radius-card: var(--radius-card);
|
|
165
|
+
--radius-panel: var(--radius-panel);
|
|
166
|
+
--radius-full: var(--radius-full);
|
|
167
|
+
|
|
168
|
+
--shadow-floating: 0 4px 12px 0 var(--shadow-soft);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Layout utilities */
|
|
172
|
+
@utility w-sidebar {
|
|
173
|
+
width: var(--layout-sidebar-width);
|
|
174
|
+
}
|
|
175
|
+
@utility w-chat-panel {
|
|
176
|
+
width: var(--layout-chat-panel-width);
|
|
177
|
+
}
|
|
178
|
+
@utility max-w-content {
|
|
179
|
+
max-width: var(--layout-content-max-width);
|
|
180
|
+
}
|
|
181
|
+
@utility w-editor-panel {
|
|
182
|
+
width: var(--layout-editor-panel-width);
|
|
183
|
+
}
|
|
184
|
+
@utility w-editor-control {
|
|
185
|
+
width: var(--layout-editor-control-width);
|
|
186
|
+
}
|
|
187
|
+
@utility w-picker {
|
|
188
|
+
width: var(--layout-picker-width);
|
|
189
|
+
}
|
|
190
|
+
@utility w-auth-form {
|
|
191
|
+
width: var(--layout-auth-form-width);
|
|
192
|
+
}
|
|
193
|
+
@utility w-auth-panel {
|
|
194
|
+
width: var(--layout-auth-panel-width);
|
|
195
|
+
}
|
|
196
|
+
@utility w-email {
|
|
197
|
+
width: var(--layout-email-width);
|
|
198
|
+
}
|
|
199
|
+
@utility w-dialog {
|
|
200
|
+
width: var(--layout-dialog-width);
|
|
201
|
+
}
|
|
202
|
+
@utility w-file-picker {
|
|
203
|
+
width: var(--layout-file-picker-width);
|
|
204
|
+
}
|
|
205
|
+
@utility w-file-dialog {
|
|
206
|
+
width: var(--layout-file-dialog-width);
|
|
207
|
+
}
|
|
208
|
+
@utility w-settings-modal {
|
|
209
|
+
width: var(--layout-settings-modal-width);
|
|
210
|
+
}
|
|
211
|
+
@utility h-settings-modal {
|
|
212
|
+
height: var(--layout-settings-modal-height);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Motion utilities */
|
|
216
|
+
@utility duration-fast {
|
|
217
|
+
transition-duration: var(--duration-fast);
|
|
218
|
+
}
|
|
219
|
+
@utility duration-base {
|
|
220
|
+
transition-duration: var(--duration-base);
|
|
221
|
+
}
|
|
222
|
+
@utility duration-slow {
|
|
223
|
+
transition-duration: var(--duration-slow);
|
|
224
|
+
}
|
|
225
|
+
@utility duration-enter {
|
|
226
|
+
transition-duration: var(--duration-enter);
|
|
227
|
+
}
|
|
228
|
+
@utility ease-standard {
|
|
229
|
+
transition-timing-function: var(--ease-standard);
|
|
230
|
+
}
|
|
231
|
+
@utility ease-out {
|
|
232
|
+
transition-timing-function: var(--ease-out);
|
|
233
|
+
}
|
|
234
|
+
@utility ease-in-out {
|
|
235
|
+
transition-timing-function: var(--ease-in-out);
|
|
236
|
+
}
|
|
237
|
+
@utility ease-drawer {
|
|
238
|
+
transition-timing-function: var(--ease-drawer);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@utility press-feedback {
|
|
242
|
+
transition: transform var(--duration-base) var(--ease-out);
|
|
243
|
+
|
|
244
|
+
&:active:not(:disabled):not([aria-disabled='true']) {
|
|
245
|
+
transform: scale(var(--scale-press));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@media (prefers-reduced-motion: reduce) {
|
|
249
|
+
&:active:not(:disabled):not([aria-disabled='true']) {
|
|
250
|
+
transform: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Figma text styles (prefixed with text- to avoid legacy typography utilities in fonts.css) */
|
|
256
|
+
@utility text-display-hero {
|
|
257
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
258
|
+
font-size: 40px;
|
|
259
|
+
line-height: 1.3;
|
|
260
|
+
font-weight: 400;
|
|
261
|
+
letter-spacing: -0.02em;
|
|
262
|
+
}
|
|
263
|
+
@utility text-heading-page {
|
|
264
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
265
|
+
font-size: 24px;
|
|
266
|
+
line-height: 32px;
|
|
267
|
+
font-weight: 600;
|
|
268
|
+
letter-spacing: -0.01em;
|
|
269
|
+
}
|
|
270
|
+
@utility text-heading-section {
|
|
271
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
272
|
+
font-size: 14px;
|
|
273
|
+
line-height: 20px;
|
|
274
|
+
font-weight: 600;
|
|
275
|
+
letter-spacing: 0;
|
|
276
|
+
}
|
|
277
|
+
@utility text-body {
|
|
278
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
279
|
+
font-size: 14px;
|
|
280
|
+
line-height: 20px;
|
|
281
|
+
font-weight: 400;
|
|
282
|
+
letter-spacing: 0;
|
|
283
|
+
}
|
|
284
|
+
@utility text-body-medium {
|
|
285
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
286
|
+
font-size: 14px;
|
|
287
|
+
line-height: 20px;
|
|
288
|
+
font-weight: 500;
|
|
289
|
+
letter-spacing: 0;
|
|
290
|
+
}
|
|
291
|
+
@utility text-body-large {
|
|
292
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
293
|
+
font-size: 20px;
|
|
294
|
+
line-height: 30px;
|
|
295
|
+
font-weight: 400;
|
|
296
|
+
letter-spacing: 0;
|
|
297
|
+
}
|
|
298
|
+
@utility text-caption {
|
|
299
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
300
|
+
font-size: 12px;
|
|
301
|
+
line-height: 16px;
|
|
302
|
+
font-weight: 400;
|
|
303
|
+
letter-spacing: 0;
|
|
304
|
+
}
|
|
305
|
+
@utility text-caption-medium {
|
|
306
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
307
|
+
font-size: 12px;
|
|
308
|
+
line-height: 16px;
|
|
309
|
+
font-weight: 500;
|
|
310
|
+
letter-spacing: 0;
|
|
311
|
+
}
|
|
312
|
+
@utility text-label {
|
|
313
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
314
|
+
font-size: 14px;
|
|
315
|
+
line-height: 20px;
|
|
316
|
+
font-weight: 500;
|
|
317
|
+
letter-spacing: 0;
|
|
318
|
+
}
|
|
319
|
+
@utility text-label-small {
|
|
320
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
321
|
+
font-size: 12px;
|
|
322
|
+
line-height: 16px;
|
|
323
|
+
font-weight: 500;
|
|
324
|
+
letter-spacing: 0;
|
|
325
|
+
}
|
|
326
|
+
@utility text-code {
|
|
327
|
+
font-family: 'JetBrains Mono', ui-monospace, monospace;
|
|
328
|
+
font-size: 12px;
|
|
329
|
+
line-height: 16px;
|
|
330
|
+
font-weight: 400;
|
|
331
|
+
letter-spacing: 0;
|
|
332
|
+
}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,2 +1,29 @@
|
|
|
1
1
|
import { type ClassValue } from "clsx";
|
|
2
|
+
/**
|
|
3
|
+
* The typography utilities of the design system (`@utility text-*` in `styles/tokens.css`).
|
|
4
|
+
* Each one sets the size, line height, weight and letter spacing together, like a Figma text style.
|
|
5
|
+
* Keep this list in step with tokens.css (the design check fails when a utility is missing here).
|
|
6
|
+
*/
|
|
7
|
+
export declare const typographyUtilityNames: readonly ["display-hero", "heading-page", "heading-section", "body", "body-medium", "body-large", "caption", "caption-medium", "label", "label-small", "code"];
|
|
8
|
+
/**
|
|
9
|
+
* Why this exists: tailwind-merge reads every `text-*` class it does not know as a text COLOR, so
|
|
10
|
+
* `cn('text-body', 'text-muted-foreground')` kept only the color and the typography was lost.
|
|
11
|
+
* Declared here as font sizes, a typography utility only replaces another font size, never a color.
|
|
12
|
+
*/
|
|
13
|
+
export declare const typographyClassGroups: {
|
|
14
|
+
"font-size": {
|
|
15
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
/** Joins class names and resolves conflicts (the last Tailwind utility of a group wins). Use this, never `twMerge` alone. */
|
|
2
19
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
20
|
+
/** `tv` with the same merge rules as `cn`: components that use tailwind-variants import this, not `tailwind-variants`. */
|
|
21
|
+
export declare const tv: import("tailwind-variants").CreateTV<{
|
|
22
|
+
twMergeConfig: {
|
|
23
|
+
classGroups: {
|
|
24
|
+
"font-size": {
|
|
25
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}>;
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
import { clsx } from "clsx";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
|
+
import { createTV } from "tailwind-variants";
|
|
4
|
+
/**
|
|
5
|
+
* The typography utilities of the design system (`@utility text-*` in `styles/tokens.css`).
|
|
6
|
+
* Each one sets the size, line height, weight and letter spacing together, like a Figma text style.
|
|
7
|
+
* Keep this list in step with tokens.css (the design check fails when a utility is missing here).
|
|
8
|
+
*/
|
|
9
|
+
export const typographyUtilityNames = [
|
|
10
|
+
"display-hero",
|
|
11
|
+
"heading-page",
|
|
12
|
+
"heading-section",
|
|
13
|
+
"body",
|
|
14
|
+
"body-medium",
|
|
15
|
+
"body-large",
|
|
16
|
+
"caption",
|
|
17
|
+
"caption-medium",
|
|
18
|
+
"label",
|
|
19
|
+
"label-small",
|
|
20
|
+
"code"
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Why this exists: tailwind-merge reads every `text-*` class it does not know as a text COLOR, so
|
|
24
|
+
* `cn('text-body', 'text-muted-foreground')` kept only the color and the typography was lost.
|
|
25
|
+
* Declared here as font sizes, a typography utility only replaces another font size, never a color.
|
|
26
|
+
*/
|
|
27
|
+
export const typographyClassGroups = {
|
|
28
|
+
"font-size": [{ text: [...typographyUtilityNames] }]
|
|
29
|
+
};
|
|
30
|
+
const mergeClasses = extendTailwindMerge({ extend: { classGroups: typographyClassGroups } });
|
|
31
|
+
/** Joins class names and resolves conflicts (the last Tailwind utility of a group wins). Use this, never `twMerge` alone. */
|
|
3
32
|
export function cn(...inputs) {
|
|
4
|
-
return
|
|
33
|
+
return mergeClasses(clsx(inputs));
|
|
5
34
|
}
|
|
35
|
+
/** `tv` with the same merge rules as `cn`: components that use tailwind-variants import this, not `tailwind-variants`. */
|
|
36
|
+
export const tv = createTV({ twMergeConfig: { classGroups: typographyClassGroups } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widgetic/design-system",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.23",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"check:strict": "tsc --noEmit && npm run check",
|
|
42
42
|
"check:deps": "check-runtime-deps",
|
|
43
43
|
"test": "node --test \"tests/**/*.test.ts\"",
|
|
44
|
+
"check:design": "node scripts/check-design-rules.mjs",
|
|
44
45
|
"test:deps": "check-runtime-deps-fixtures",
|
|
45
46
|
"pnpm-link": "zsh -c 'mkdir -p ~/.pnpm-global/bin && export PATH=\"$PATH:$HOME/.pnpm-global/bin\" && pnpm install -g pnpm && pnpm config set global-bin-dir ~/.pnpm-global/bin && echo \"export PATH=\\\"$PATH:$HOME/.pnpm-global/bin\\\"\" >> ~/.zshrc && source ~/.zshrc && pnpm link --global'",
|
|
46
47
|
"link-packs": "zsh -c 'mkdir -p ~/.pnpm-global/bin && export PATH=\"$PATH:$HOME/.pnpm-global/bin\" && pnpm install -g pnpm && pnpm config set global-bin-dir ~/.pnpm-global/bin && echo \"export PATH=\\\"$PATH:$HOME/.pnpm-global/bin\\\"\" >> ~/.zshrc && source ~/.zshrc && pnpm link --global @widgetic/api-sdk @widgetic/design-system'",
|
package/tailwind.config.ts
CHANGED
|
@@ -15,50 +15,7 @@ const config: Config = {
|
|
|
15
15
|
},
|
|
16
16
|
extend: {
|
|
17
17
|
colors: {
|
|
18
|
-
|
|
19
|
-
input: "hsl(var(--input) / <alpha-value>)",
|
|
20
|
-
ring: "hsl(var(--ring) / <alpha-value>)",
|
|
21
|
-
background: "hsl(var(--background) / <alpha-value>)",
|
|
22
|
-
foreground: "hsl(var(--foreground) / <alpha-value>)",
|
|
23
|
-
primary: {
|
|
24
|
-
DEFAULT: "hsl(var(--primary) / <alpha-value>)",
|
|
25
|
-
foreground: "hsl(var(--primary-foreground) / <alpha-value>)"
|
|
26
|
-
},
|
|
27
|
-
secondary: {
|
|
28
|
-
DEFAULT: "hsl(var(--secondary) / <alpha-value>)",
|
|
29
|
-
foreground: "hsl(var(--secondary-foreground) / <alpha-value>)"
|
|
30
|
-
},
|
|
31
|
-
destructive: {
|
|
32
|
-
DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
|
|
33
|
-
foreground: "hsl(var(--destructive-foreground) / <alpha-value>)"
|
|
34
|
-
},
|
|
35
|
-
muted: {
|
|
36
|
-
DEFAULT: "hsl(var(--muted) / <alpha-value>)",
|
|
37
|
-
foreground: "hsl(var(--muted-foreground) / <alpha-value>)"
|
|
38
|
-
},
|
|
39
|
-
accent: {
|
|
40
|
-
DEFAULT: "hsl(var(--accent) / <alpha-value>)",
|
|
41
|
-
foreground: "hsl(var(--accent-foreground) / <alpha-value>)"
|
|
42
|
-
},
|
|
43
|
-
popover: {
|
|
44
|
-
DEFAULT: "hsl(var(--popover) / <alpha-value>)",
|
|
45
|
-
foreground: "hsl(var(--popover-foreground) / <alpha-value>)"
|
|
46
|
-
},
|
|
47
|
-
card: {
|
|
48
|
-
DEFAULT: "hsl(var(--card) / <alpha-value>)",
|
|
49
|
-
foreground: "hsl(var(--card-foreground) / <alpha-value>)"
|
|
50
|
-
},
|
|
51
|
-
sidebar: {
|
|
52
|
-
DEFAULT: "hsl(var(--sidebar-background))",
|
|
53
|
-
foreground: "hsl(var(--sidebar-foreground))",
|
|
54
|
-
primary: "hsl(var(--sidebar-primary))",
|
|
55
|
-
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
|
|
56
|
-
accent: "hsl(var(--sidebar-accent))",
|
|
57
|
-
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
|
|
58
|
-
border: "hsl(var(--sidebar-border))",
|
|
59
|
-
ring: "hsl(var(--sidebar-ring))",
|
|
60
|
-
},
|
|
61
|
-
// Widgetic DS palette (CSS vars defined in global.css)
|
|
18
|
+
// Widgetic DS palette (CSS vars defined in global.css / tokens.css)
|
|
62
19
|
dark: "hsl(var(--dark) / <alpha-value>)",
|
|
63
20
|
"deep-forest-green": "hsl(var(--deep-forest-green) / <alpha-value>)",
|
|
64
21
|
"sage-green": "hsl(var(--sage-green) / <alpha-value>)",
|
|
@@ -94,10 +51,13 @@ const config: Config = {
|
|
|
94
51
|
cousine: ["Cousine", "monospace"],
|
|
95
52
|
},
|
|
96
53
|
borderRadius: {
|
|
97
|
-
|
|
98
|
-
lg: "var(--radius)",
|
|
54
|
+
sm: "var(--radius-sm)",
|
|
55
|
+
lg: "var(--radius-lg)",
|
|
56
|
+
xl: "var(--radius-xl)",
|
|
57
|
+
card: "var(--radius-card)",
|
|
58
|
+
panel: "var(--radius-panel)",
|
|
59
|
+
full: "var(--radius-full)",
|
|
99
60
|
md: "calc(var(--radius) - 2px)",
|
|
100
|
-
sm: "calc(var(--radius) - 4px)"
|
|
101
61
|
},
|
|
102
62
|
keyframes: {
|
|
103
63
|
"accordion-down": {
|