@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.
- 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 +402 -399
- package/dist/components/modals/BaseModal.svelte.d.ts +1 -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 +1 -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,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,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,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,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,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,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
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export let
|
|
23
|
-
|
|
24
|
-
export let element: HTMLElement | null = null;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
"
|
|
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
|
-
<
|
|
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
|
|
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>
|