@widgetic/design-system 0.5.22 → 0.5.24
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 +495 -401
- package/dist/components/modals/BaseModal.svelte.d.ts +4 -0
- package/dist/components/modals/NewItemDialog.svelte +198 -243
- package/dist/components/modals/Portal.svelte +109 -105
- package/dist/components/modals/README.md +16 -2
- package/dist/components/modals/RenameDialog.svelte +232 -292
- package/dist/components/modals/modalStore.d.ts +9 -1
- package/dist/components/modals/modalStore.js +44 -11
- package/dist/components/navigation/Breadcrumbs.svelte +421 -377
- package/dist/components/navigation/Breadcrumbs.svelte.d.ts +3 -2
- package/dist/components/navigation/breadcrumbsAvailableWidth.d.ts +10 -0
- package/dist/components/navigation/breadcrumbsAvailableWidth.js +10 -0
- package/dist/components/navigation/types.d.ts +2 -0
- package/dist/components/pdf/PDFViewer.svelte +1 -1
- package/dist/components/search-input/SearchInput.svelte +63 -104
- package/dist/components/search-input/SearchInput.svelte.d.ts +13 -27
- package/dist/components/search-input/index2.d.ts +14 -9
- 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 +163 -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/nested-modal-guard.d.ts +25 -0
- package/dist/components/shell/nested-modal-guard.js +33 -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/calendar/calendar.svelte.d.ts +1 -1
- 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-link-item.svelte +1 -1
- package/dist/components/ui/command/command.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +11 -4
- package/dist/components/ui/dialog/dialog-description.svelte +1 -1
- package/dist/components/ui/dialog/dialog-overlay.svelte +8 -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/range-calendar/range-calendar.svelte.d.ts +1 -1
- 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 +10 -21
- package/dist/styles/tokens.css +332 -0
- package/dist/utils/overlayMotion.d.ts +49 -0
- package/dist/utils/overlayMotion.js +71 -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
|
@@ -14,8 +14,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
14
14
|
}
|
|
15
15
|
declare const Breadcrumbs: $$__sveltets_2_IsomorphicComponent<{
|
|
16
16
|
/***
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
* COMPONENT PROPS
|
|
18
|
+
**/ class?: string;
|
|
19
19
|
style?: string;
|
|
20
20
|
clientHeight?: number;
|
|
21
21
|
currentPath?: BreadcrumbsProps["currentPath"];
|
|
@@ -28,6 +28,7 @@ declare const Breadcrumbs: $$__sveltets_2_IsomorphicComponent<{
|
|
|
28
28
|
forwardLabel?: string;
|
|
29
29
|
rootLabel?: string;
|
|
30
30
|
breadcrumbLabel?: string;
|
|
31
|
+
compact?: boolean;
|
|
31
32
|
onNavigate?: BreadcrumbsProps["onNavigate"];
|
|
32
33
|
onBack?: BreadcrumbsProps["onBack"];
|
|
33
34
|
onForward?: BreadcrumbsProps["onForward"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for Breadcrumbs width math (header vs non-header container).
|
|
3
|
+
*/
|
|
4
|
+
export declare function breadcrumbsLayoutPaddingPx(headerAncestor: HTMLElement | null): number;
|
|
5
|
+
export declare function breadcrumbsAvailableWidthPx(options: {
|
|
6
|
+
containerWidthPx: number;
|
|
7
|
+
leftOffsetPx: number;
|
|
8
|
+
rightOffsetPx: number;
|
|
9
|
+
headerAncestor: HTMLElement | null;
|
|
10
|
+
}): number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for Breadcrumbs width math (header vs non-header container).
|
|
3
|
+
*/
|
|
4
|
+
export function breadcrumbsLayoutPaddingPx(headerAncestor) {
|
|
5
|
+
return headerAncestor ? 72 : 0;
|
|
6
|
+
}
|
|
7
|
+
export function breadcrumbsAvailableWidthPx(options) {
|
|
8
|
+
const layoutPaddingPx = breadcrumbsLayoutPaddingPx(options.headerAncestor);
|
|
9
|
+
return options.containerWidthPx - options.leftOffsetPx - options.rightOffsetPx - layoutPaddingPx;
|
|
10
|
+
}
|
|
@@ -17,4 +17,6 @@ export interface BreadcrumbsProps {
|
|
|
17
17
|
rootLabel?: string;
|
|
18
18
|
/** Screen reader name of the navigation. Default: "breadcrumb". */
|
|
19
19
|
breadcrumbLabel?: string;
|
|
20
|
+
/** Figma Crumbs Size=Compact: Heading/Section text and a 4px gap (a narrow header). Default: false (Size=Page). */
|
|
21
|
+
compact?: boolean;
|
|
20
22
|
}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
export let url = '';
|
|
57
57
|
export let enableCacheClearing: boolean = true; // Flag to enable/disable cache clearing shortcut
|
|
58
58
|
// words: a page that shows the viewer in another language passes its own
|
|
59
|
-
export let loadingLabel: string = 'Loading PDF
|
|
59
|
+
export let loadingLabel: string = 'Loading PDF…';
|
|
60
60
|
export let failedLabel: string = 'Failed to load PDF';
|
|
61
61
|
export let pageLabel: string = 'Page {page} of {total}'; // {total} is "?" until the page count is known
|
|
62
62
|
export let previousPageLabel: string = 'Previous page';
|
|
@@ -1,110 +1,69 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* - Consistent UI across all applications
|
|
7
|
-
* - Clear button for search term
|
|
8
|
-
* - Handles input, keydown, and paste events
|
|
9
|
-
* - Smooth transitions and hover states
|
|
10
|
-
* - Uses Widgetic design system styling
|
|
11
|
-
-->
|
|
2
|
+
Figma: Search Field (component set 189:1138, node 189:1138).
|
|
3
|
+
The same field works as a plain search control and as the textbox of a combobox: pass `inputAttributes` (role, aria-*,
|
|
4
|
+
autocomplete) from the parent; `type`, `value`, and the input `class` always come from this component so the look stays one.
|
|
5
|
+
-->
|
|
12
6
|
<script lang="ts">
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @param event The keyboard event
|
|
34
|
-
*/
|
|
35
|
-
export let onKeydown: (event: KeyboardEvent) => void = () => {};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Clear button event handler
|
|
39
|
-
*/
|
|
40
|
-
export let onClear: () => void = () => {
|
|
41
|
-
value = "";
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Paste event handler
|
|
46
|
-
* @param event The clipboard event
|
|
47
|
-
*/
|
|
48
|
-
export let onPaste: (event: ClipboardEvent) => void = () => {};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* CSS class to apply to the container
|
|
52
|
-
*/
|
|
53
|
-
export let containerClass = "";
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* CSS class to apply to the input element
|
|
57
|
-
*/
|
|
58
|
-
export let inputClass = "";
|
|
7
|
+
import IconSearch from '@tabler/icons-svelte/icons/search';
|
|
8
|
+
import IconX from '@tabler/icons-svelte/icons/x';
|
|
9
|
+
|
|
10
|
+
export let placeholder = 'Search…';
|
|
11
|
+
export let value = '';
|
|
12
|
+
export let onInput: (event: Event) => Promise<void> | void = () => {};
|
|
13
|
+
export let onKeydown: (event: KeyboardEvent) => void = () => {};
|
|
14
|
+
export let onClear: () => void = () => {
|
|
15
|
+
value = '';
|
|
16
|
+
};
|
|
17
|
+
export let onPaste: (event: ClipboardEvent) => void = () => {};
|
|
18
|
+
export let onFocus: (event: FocusEvent) => void = () => {};
|
|
19
|
+
export let onBlur: (event: FocusEvent) => void = () => {};
|
|
20
|
+
export let containerClass = '';
|
|
21
|
+
export let inputClass = '';
|
|
22
|
+
export let clearLabel = 'Clear search';
|
|
23
|
+
/** Bindable ref to the native input (e.g. combobox controllers call focus()). */
|
|
24
|
+
export let inputElement: HTMLInputElement | null = null;
|
|
25
|
+
/** Spread first; this component’s `type`, `value`, and `class` are set after so they override clashing keys from the spread. */
|
|
26
|
+
export let inputAttributes: Record<string, unknown> = {};
|
|
59
27
|
</script>
|
|
60
28
|
|
|
61
29
|
<div class="w-full {containerClass}">
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
30
|
+
<div
|
|
31
|
+
class="group bg-accent duration-fast focus-within:bg-accent hover:bg-accent-hover relative flex h-9 w-full items-center gap-2 rounded-lg px-3 transition-colors"
|
|
32
|
+
>
|
|
33
|
+
<IconSearch
|
|
34
|
+
class="text-muted-foreground duration-fast group-focus-within:text-foreground size-4 shrink-0 stroke-[1.333] transition-colors {value
|
|
35
|
+
? 'text-foreground'
|
|
36
|
+
: ''}"
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
/>
|
|
39
|
+
<input
|
|
40
|
+
{...inputAttributes}
|
|
41
|
+
type="search"
|
|
42
|
+
bind:this={inputElement}
|
|
43
|
+
{placeholder}
|
|
44
|
+
bind:value
|
|
45
|
+
oninput={onInput}
|
|
46
|
+
onkeydown={(e) => {
|
|
47
|
+
if (e.key === 'Backspace' && !value) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
onKeydown(e);
|
|
52
|
+
}}
|
|
53
|
+
onpaste={onPaste}
|
|
54
|
+
onfocus={onFocus}
|
|
55
|
+
onblur={onBlur}
|
|
56
|
+
class="text-body text-foreground placeholder:text-muted-foreground min-w-0 flex-1 border-0 bg-transparent focus:outline-hidden [&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden {inputClass}"
|
|
57
|
+
/>
|
|
58
|
+
{#if value}
|
|
59
|
+
<button
|
|
60
|
+
type="button"
|
|
61
|
+
class="text-muted-foreground duration-fast hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background inline-flex size-4 shrink-0 items-center justify-center transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden"
|
|
62
|
+
aria-label={clearLabel}
|
|
63
|
+
onclick={onClear}
|
|
64
|
+
>
|
|
65
|
+
<IconX class="size-4 stroke-[1.333]" aria-hidden="true" />
|
|
66
|
+
</button>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
99
69
|
</div>
|
|
100
|
-
|
|
101
|
-
<style>
|
|
102
|
-
/* Ensure smooth text color transitions */
|
|
103
|
-
input {
|
|
104
|
-
transition: color 300ms ease, background-color 300ms ease, border-color 300ms ease !important;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
input::placeholder {
|
|
108
|
-
transition: color 300ms ease !important;
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
@@ -12,33 +12,19 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
12
12
|
z_$$bindings?: Bindings;
|
|
13
13
|
}
|
|
14
14
|
declare const SearchInput: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/ onKeydown?: (event: KeyboardEvent) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Clear button event handler
|
|
31
|
-
*/ onClear?: () => void;
|
|
32
|
-
/**
|
|
33
|
-
* Paste event handler
|
|
34
|
-
* @param event The clipboard event
|
|
35
|
-
*/ onPaste?: (event: ClipboardEvent) => void;
|
|
36
|
-
/**
|
|
37
|
-
* CSS class to apply to the container
|
|
38
|
-
*/ containerClass?: string;
|
|
39
|
-
/**
|
|
40
|
-
* CSS class to apply to the input element
|
|
41
|
-
*/ inputClass?: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
onInput?: (event: Event) => Promise<void> | void;
|
|
18
|
+
onKeydown?: (event: KeyboardEvent) => void;
|
|
19
|
+
onClear?: () => void;
|
|
20
|
+
onPaste?: (event: ClipboardEvent) => void;
|
|
21
|
+
onFocus?: (event: FocusEvent) => void;
|
|
22
|
+
onBlur?: (event: FocusEvent) => void;
|
|
23
|
+
containerClass?: string;
|
|
24
|
+
inputClass?: string;
|
|
25
|
+
clearLabel?: string;
|
|
26
|
+
/** Bindable ref to the native input (e.g. combobox controllers call focus()). */ inputElement?: HTMLInputElement | null;
|
|
27
|
+
/** Spread first; this component’s `type`, `value`, and `class` are set after so they override clashing keys from the spread. */ inputAttributes?: Record<string, unknown>;
|
|
42
28
|
}, {
|
|
43
29
|
[evt: string]: CustomEvent<any>;
|
|
44
30
|
}, {}, {}, string>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { SvelteComponent } from 'svelte';
|
|
2
2
|
|
|
3
3
|
export interface SearchInputProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
onInput?: (event: Event) => Promise<void> | void;
|
|
7
|
+
onKeydown?: (event: KeyboardEvent) => void;
|
|
8
|
+
onClear?: () => void;
|
|
9
|
+
onPaste?: (event: ClipboardEvent) => void;
|
|
10
|
+
onFocus?: (event: FocusEvent) => void;
|
|
11
|
+
onBlur?: (event: FocusEvent) => void;
|
|
12
|
+
containerClass?: string;
|
|
13
|
+
inputClass?: string;
|
|
14
|
+
clearLabel?: string;
|
|
15
|
+
inputElement?: HTMLInputElement | null;
|
|
16
|
+
inputAttributes?: Record<string, unknown>;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
export default class SearchInput extends SvelteComponent<SearchInputProps> {}
|
|
19
|
+
export default class SearchInput extends SvelteComponent<SearchInputProps> {}
|
|
@@ -46,7 +46,7 @@ export declare const SHAD_EDITOR_MESSAGES: {
|
|
|
46
46
|
readonly 'shadEditor.image.tooltip': "Add Image";
|
|
47
47
|
readonly 'shadEditor.image.title': "Image";
|
|
48
48
|
readonly 'shadEditor.image.urlHint': "Insert image url";
|
|
49
|
-
readonly 'shadEditor.image.urlPlaceholder': "Enter image url
|
|
49
|
+
readonly 'shadEditor.image.urlPlaceholder': "Enter image url…";
|
|
50
50
|
readonly 'shadEditor.image.orPick': "OR Pick an Image";
|
|
51
51
|
readonly 'shadEditor.table.tooltip': "Table";
|
|
52
52
|
readonly 'shadEditor.table.insert': "Insert Table";
|
|
@@ -51,7 +51,7 @@ export const SHAD_EDITOR_MESSAGES = {
|
|
|
51
51
|
'shadEditor.image.tooltip': 'Add Image',
|
|
52
52
|
'shadEditor.image.title': 'Image',
|
|
53
53
|
'shadEditor.image.urlHint': 'Insert image url',
|
|
54
|
-
'shadEditor.image.urlPlaceholder': 'Enter image url
|
|
54
|
+
'shadEditor.image.urlPlaceholder': 'Enter image url…',
|
|
55
55
|
'shadEditor.image.orPick': 'OR Pick an Image',
|
|
56
56
|
// ===== The table menu =====
|
|
57
57
|
'shadEditor.table.tooltip': 'Table',
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!-- Figma: Responsive app shell (doc Responsive; ledger decisions.appShell / appShellConfirmed). -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import { cn } from '../../utils.js';
|
|
5
|
+
import NavDrawer from './NavDrawer.svelte';
|
|
6
|
+
import TopBar from './TopBar.svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
class: className,
|
|
10
|
+
topBarTitle,
|
|
11
|
+
menuLabel = 'Open navigation',
|
|
12
|
+
drawerOpen = $bindable(false),
|
|
13
|
+
sidebar,
|
|
14
|
+
children,
|
|
15
|
+
topBarAction
|
|
16
|
+
}: {
|
|
17
|
+
class?: string;
|
|
18
|
+
topBarTitle: string;
|
|
19
|
+
menuLabel?: string;
|
|
20
|
+
drawerOpen?: boolean;
|
|
21
|
+
sidebar?: Snippet;
|
|
22
|
+
children?: Snippet;
|
|
23
|
+
topBarAction?: Snippet;
|
|
24
|
+
} = $props();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div class={cn('bg-muted flex h-full min-h-screen', className)}>
|
|
28
|
+
<div class="hidden shrink-0 lg:block">{@render sidebar?.()}</div>
|
|
29
|
+
|
|
30
|
+
<div class="flex min-h-0 min-w-0 flex-1 flex-col">
|
|
31
|
+
<TopBar
|
|
32
|
+
title={topBarTitle}
|
|
33
|
+
{menuLabel}
|
|
34
|
+
onMenuClick={() => {
|
|
35
|
+
drawerOpen = true;
|
|
36
|
+
}}
|
|
37
|
+
action={topBarAction}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
<div class="flex min-h-0 flex-1 flex-col gap-2 p-2 lg:ps-0">
|
|
41
|
+
<div
|
|
42
|
+
class="rounded-panel border-border bg-background flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden border shadow-none"
|
|
43
|
+
>
|
|
44
|
+
{@render children?.()}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<NavDrawer bind:open={drawerOpen}>
|
|
50
|
+
{@render sidebar?.()}
|
|
51
|
+
</NavDrawer>
|
|
52
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
class?: string;
|
|
4
|
+
topBarTitle: string;
|
|
5
|
+
menuLabel?: string;
|
|
6
|
+
drawerOpen?: boolean;
|
|
7
|
+
sidebar?: Snippet;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
topBarAction?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
declare const AppShell: import("svelte").Component<$$ComponentProps, {}, "drawerOpen">;
|
|
12
|
+
type AppShell = ReturnType<typeof AppShell>;
|
|
13
|
+
export default AppShell;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Figma: Banner (component set 328:224, page Experiments)
|
|
3
|
+
-->
|
|
4
|
+
<script lang="ts" module>
|
|
5
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
8
|
+
|
|
9
|
+
export const bannerVariants = tv({
|
|
10
|
+
base: 'flex w-full max-w-content items-center gap-3 rounded-xl py-2.5 ps-4 pe-3',
|
|
11
|
+
variants: {
|
|
12
|
+
tone: {
|
|
13
|
+
default: 'bg-muted',
|
|
14
|
+
brand: 'bg-brand-subtle',
|
|
15
|
+
destructive: 'border border-destructive bg-background'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
tone: 'default'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type BannerTone = VariantProps<typeof bannerVariants>['tone'];
|
|
24
|
+
|
|
25
|
+
export type BannerProps = HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
class?: string;
|
|
27
|
+
tone?: BannerTone;
|
|
28
|
+
title?: string;
|
|
29
|
+
description: string;
|
|
30
|
+
icon?: Snippet;
|
|
31
|
+
actions?: Snippet;
|
|
32
|
+
showActions?: boolean;
|
|
33
|
+
dismissLabel?: string;
|
|
34
|
+
onDismiss?: () => void;
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import IconAlertTriangle from '@tabler/icons-svelte/icons/alert-triangle';
|
|
40
|
+
import IconCircleCheck from '@tabler/icons-svelte/icons/circle-check';
|
|
41
|
+
import IconInfoCircle from '@tabler/icons-svelte/icons/info-circle';
|
|
42
|
+
import IconX from '@tabler/icons-svelte/icons/x';
|
|
43
|
+
import { cn, tv } from '../../utils.js';
|
|
44
|
+
|
|
45
|
+
let {
|
|
46
|
+
class: className,
|
|
47
|
+
tone = 'default',
|
|
48
|
+
title = undefined,
|
|
49
|
+
description,
|
|
50
|
+
icon,
|
|
51
|
+
actions,
|
|
52
|
+
showActions = true,
|
|
53
|
+
dismissLabel = 'Dismiss',
|
|
54
|
+
onDismiss = undefined,
|
|
55
|
+
...restProps
|
|
56
|
+
}: BannerProps = $props();
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<div class={cn(bannerVariants({ tone }), className)} role="status" {...restProps}>
|
|
60
|
+
<span class="text-foreground inline-flex size-4 shrink-0 items-center">
|
|
61
|
+
{#if icon}
|
|
62
|
+
{@render icon()}
|
|
63
|
+
{:else if tone === 'brand'}
|
|
64
|
+
<IconCircleCheck class="size-4 stroke-[1.333]" aria-hidden="true" />
|
|
65
|
+
{:else if tone === 'destructive'}
|
|
66
|
+
<IconAlertTriangle class="size-4 stroke-[1.333]" aria-hidden="true" />
|
|
67
|
+
{:else}
|
|
68
|
+
<IconInfoCircle class="size-4 stroke-[1.333]" aria-hidden="true" />
|
|
69
|
+
{/if}
|
|
70
|
+
</span>
|
|
71
|
+
<div class="min-w-0 flex-1">
|
|
72
|
+
{#if title}
|
|
73
|
+
<p class="text-body-medium text-foreground">{title}</p>
|
|
74
|
+
{/if}
|
|
75
|
+
<p class={cn('text-body text-foreground', title && 'text-muted-foreground')}>{description}</p>
|
|
76
|
+
</div>
|
|
77
|
+
{#if showActions && actions}
|
|
78
|
+
<div class="flex shrink-0 items-center gap-2">{@render actions()}</div>
|
|
79
|
+
{/if}
|
|
80
|
+
{#if onDismiss}
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
class="text-muted-foreground duration-fast hover:bg-accent hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-background inline-flex size-8 shrink-0 items-center justify-center rounded-lg transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden"
|
|
84
|
+
aria-label={dismissLabel}
|
|
85
|
+
onclick={onDismiss}
|
|
86
|
+
>
|
|
87
|
+
<IconX class="size-4 stroke-[1.333]" aria-hidden="true" />
|
|
88
|
+
</button>
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { VariantProps } from 'tailwind-variants';
|
|
4
|
+
export declare const bannerVariants: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
tone: {
|
|
6
|
+
default: string;
|
|
7
|
+
brand: string;
|
|
8
|
+
destructive: string;
|
|
9
|
+
};
|
|
10
|
+
}, undefined, "flex w-full max-w-content items-center gap-3 rounded-xl py-2.5 ps-4 pe-3", {
|
|
11
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
12
|
+
tone?: boolean | (string | number | symbol)[] | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
15
|
+
twMergeConfig: {
|
|
16
|
+
classGroups: {
|
|
17
|
+
"font-size": {
|
|
18
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}, {
|
|
23
|
+
tone: {
|
|
24
|
+
default: string;
|
|
25
|
+
brand: string;
|
|
26
|
+
destructive: string;
|
|
27
|
+
};
|
|
28
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
29
|
+
tone: {
|
|
30
|
+
default: string;
|
|
31
|
+
brand: string;
|
|
32
|
+
destructive: string;
|
|
33
|
+
};
|
|
34
|
+
}, undefined, "flex w-full max-w-content items-center gap-3 rounded-xl py-2.5 ps-4 pe-3", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
35
|
+
tone: {
|
|
36
|
+
default: string;
|
|
37
|
+
brand: string;
|
|
38
|
+
destructive: string;
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
tone: {
|
|
42
|
+
default: string;
|
|
43
|
+
brand: string;
|
|
44
|
+
destructive: string;
|
|
45
|
+
};
|
|
46
|
+
}>, unknown, unknown, undefined>>;
|
|
47
|
+
export type BannerTone = VariantProps<typeof bannerVariants>['tone'];
|
|
48
|
+
export type BannerProps = HTMLAttributes<HTMLDivElement> & {
|
|
49
|
+
class?: string;
|
|
50
|
+
tone?: BannerTone;
|
|
51
|
+
title?: string;
|
|
52
|
+
description: string;
|
|
53
|
+
icon?: Snippet;
|
|
54
|
+
actions?: Snippet;
|
|
55
|
+
showActions?: boolean;
|
|
56
|
+
dismissLabel?: string;
|
|
57
|
+
onDismiss?: () => void;
|
|
58
|
+
};
|
|
59
|
+
declare const Banner: import("svelte").Component<BannerProps, {}, "">;
|
|
60
|
+
type Banner = ReturnType<typeof Banner>;
|
|
61
|
+
export default Banner;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!-- Figma: Error State (component set 139:2, node 139:2). -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
import IconAlertTriangle from '@tabler/icons-svelte/icons/alert-triangle';
|
|
5
|
+
import IconRefresh from '@tabler/icons-svelte/icons/refresh';
|
|
6
|
+
import { cn } from '../../utils.js';
|
|
7
|
+
import { Button } from '../ui/button/index.js';
|
|
8
|
+
import { defaultErrorStateMessages, type ErrorStateMessages } from './error-state-messages.js';
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
class: className,
|
|
12
|
+
messages = defaultErrorStateMessages,
|
|
13
|
+
onRetry,
|
|
14
|
+
onSupport,
|
|
15
|
+
actions
|
|
16
|
+
}: {
|
|
17
|
+
class?: string;
|
|
18
|
+
messages?: ErrorStateMessages;
|
|
19
|
+
onRetry?: () => void;
|
|
20
|
+
onSupport?: () => void;
|
|
21
|
+
/** Replace the default action row entirely. */
|
|
22
|
+
actions?: Snippet;
|
|
23
|
+
} = $props();
|
|
24
|
+
|
|
25
|
+
const copy = $derived({ ...defaultErrorStateMessages, ...messages });
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
class={cn(
|
|
30
|
+
'mx-auto flex max-w-[30rem] flex-col items-center gap-3 px-12 py-12 text-center',
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
role="alert"
|
|
34
|
+
>
|
|
35
|
+
<div class="relative flex size-12 items-center justify-center overflow-hidden rounded-xl">
|
|
36
|
+
<span class="bg-destructive absolute inset-0 rounded-xl opacity-10" aria-hidden="true"></span>
|
|
37
|
+
<IconAlertTriangle class="text-destructive relative size-4" aria-hidden="true" />
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="flex w-full flex-col gap-1">
|
|
41
|
+
<h2 class="text-heading-section text-foreground">{copy.title}</h2>
|
|
42
|
+
<p class="text-body text-muted-foreground">{copy.description}</p>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
{#if actions}
|
|
46
|
+
<div class="flex flex-wrap items-center justify-center gap-2 pt-3">{@render actions()}</div>
|
|
47
|
+
{:else}
|
|
48
|
+
<div class="flex flex-wrap items-center justify-center gap-2 pt-3">
|
|
49
|
+
{#if onRetry}
|
|
50
|
+
<Button onclick={onRetry}>
|
|
51
|
+
<IconRefresh />
|
|
52
|
+
{copy.retryLabel}
|
|
53
|
+
</Button>
|
|
54
|
+
{/if}
|
|
55
|
+
{#if onSupport}
|
|
56
|
+
<Button variant="outline" onclick={onSupport}>{copy.supportLabel}</Button>
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
{/if}
|
|
60
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type ErrorStateMessages } from './error-state-messages.js';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
class?: string;
|
|
5
|
+
messages?: ErrorStateMessages;
|
|
6
|
+
onRetry?: () => void;
|
|
7
|
+
onSupport?: () => void;
|
|
8
|
+
/** Replace the default action row entirely. */
|
|
9
|
+
actions?: Snippet;
|
|
10
|
+
};
|
|
11
|
+
declare const ErrorState: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
12
|
+
type ErrorState = ReturnType<typeof ErrorState>;
|
|
13
|
+
export default ErrorState;
|