@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
|
@@ -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>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
2
|
import Root from "./alert.svelte";
|
|
3
3
|
import Description from "./alert-description.svelte";
|
|
4
4
|
import Title from "./alert-title.svelte";
|
|
@@ -7,27 +7,29 @@ export declare const alertVariants: import("tailwind-variants").TVReturnType<{
|
|
|
7
7
|
default: string;
|
|
8
8
|
destructive: string;
|
|
9
9
|
};
|
|
10
|
-
}, undefined, "
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
}, undefined, "relative grid w-full grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 rounded-xl border border-border bg-background p-3 pe-4 ps-4 text-foreground [&>svg]:col-start-1 [&>svg]:row-start-1 [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:stroke-[1.333] [&_[data-slot=alert-title]]:col-start-2 [&_[data-slot=alert-title]]:row-start-1 [&_[data-slot=alert-description]]:col-start-2 [&_[data-slot=alert-description]]:row-start-2", {
|
|
11
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
12
|
+
variant?: 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
|
+
};
|
|
14
21
|
};
|
|
15
22
|
}, {
|
|
16
23
|
variant: {
|
|
17
24
|
default: string;
|
|
18
25
|
destructive: string;
|
|
19
26
|
};
|
|
20
|
-
}>, {
|
|
21
|
-
variant: {
|
|
22
|
-
default: string;
|
|
23
|
-
destructive: string;
|
|
24
|
-
};
|
|
25
27
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
26
28
|
variant: {
|
|
27
29
|
default: string;
|
|
28
30
|
destructive: string;
|
|
29
31
|
};
|
|
30
|
-
}, undefined, "
|
|
32
|
+
}, undefined, "relative grid w-full grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 rounded-xl border border-border bg-background p-3 pe-4 ps-4 text-foreground [&>svg]:col-start-1 [&>svg]:row-start-1 [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:stroke-[1.333] [&_[data-slot=alert-title]]:col-start-2 [&_[data-slot=alert-title]]:row-start-1 [&_[data-slot=alert-description]]:col-start-2 [&_[data-slot=alert-description]]:row-start-2", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
31
33
|
variant: {
|
|
32
34
|
default: string;
|
|
33
35
|
destructive: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { tv } from "
|
|
1
|
+
import { tv } from "../../../utils.js";
|
|
2
2
|
import Root from "./alert.svelte";
|
|
3
3
|
import Description from "./alert-description.svelte";
|
|
4
4
|
import Title from "./alert-title.svelte";
|
|
5
5
|
export const alertVariants = tv({
|
|
6
|
-
base: "
|
|
6
|
+
base: "relative grid w-full grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 rounded-xl border border-border bg-background p-3 pe-4 ps-4 text-foreground [&>svg]:col-start-1 [&>svg]:row-start-1 [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:stroke-[1.333] [&_[data-slot=alert-title]]:col-start-2 [&_[data-slot=alert-title]]:row-start-1 [&_[data-slot=alert-description]]:col-start-2 [&_[data-slot=alert-description]]:row-start-2",
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
|
-
default: "
|
|
10
|
-
destructive: "
|
|
9
|
+
default: "text-foreground [&>svg]:text-foreground",
|
|
10
|
+
destructive: "[&>svg]:text-destructive [&_[data-slot=alert-title]]:text-destructive [&_[data-slot=alert-description]]:text-destructive/90",
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
defaultVariants: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Derive one or two letter initials from a display name (Figma Avatar / Type=Initials). */
|
|
2
|
+
export function avatarInitials(name) {
|
|
3
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
4
|
+
if (parts.length === 0)
|
|
5
|
+
return "?";
|
|
6
|
+
if (parts.length === 1)
|
|
7
|
+
return parts[0].slice(0, 2).toUpperCase();
|
|
8
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
9
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Figma: Avatar (component set 50:17, node 50:3). -->
|
|
2
|
+
<script lang="ts" module>
|
|
3
|
+
import type { VariantProps } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
export const avatarVariants = tv({
|
|
6
|
+
base: "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-brand-subtle text-brand-foreground",
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "size-6 text-caption-medium",
|
|
10
|
+
default: "size-8 text-caption-medium",
|
|
11
|
+
lg: "size-10 text-label-small",
|
|
12
|
+
},
|
|
13
|
+
type: {
|
|
14
|
+
initials: "bg-brand-subtle text-brand-foreground",
|
|
15
|
+
icon: "bg-muted text-foreground",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "sm",
|
|
20
|
+
type: "initials",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type AvatarSize = VariantProps<typeof avatarVariants>["size"];
|
|
25
|
+
export type AvatarType = VariantProps<typeof avatarVariants>["type"];
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
30
|
+
import type { Snippet } from "svelte";
|
|
31
|
+
import { cn, tv } from "../../../utils.js";
|
|
32
|
+
import { avatarInitials } from "./avatar-utils.js";
|
|
33
|
+
|
|
34
|
+
let {
|
|
35
|
+
class: className,
|
|
36
|
+
size = "sm",
|
|
37
|
+
type = "initials",
|
|
38
|
+
src = undefined,
|
|
39
|
+
alt = "",
|
|
40
|
+
name = "",
|
|
41
|
+
icon,
|
|
42
|
+
...restProps
|
|
43
|
+
}: HTMLAttributes<HTMLSpanElement> & {
|
|
44
|
+
size?: AvatarSize;
|
|
45
|
+
type?: AvatarType;
|
|
46
|
+
src?: string;
|
|
47
|
+
alt?: string;
|
|
48
|
+
name?: string;
|
|
49
|
+
icon?: Snippet;
|
|
50
|
+
} = $props();
|
|
51
|
+
|
|
52
|
+
const initials = $derived(avatarInitials(name || alt));
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<span class={cn(avatarVariants({ size, type }), className)} {...restProps}>
|
|
56
|
+
{#if src}
|
|
57
|
+
<img {src} {alt} class="size-full object-cover" />
|
|
58
|
+
{:else if type === "icon" && icon}
|
|
59
|
+
<span class="flex items-center justify-center">{@render icon()}</span>
|
|
60
|
+
{:else}
|
|
61
|
+
<span aria-hidden="true">{initials}</span>
|
|
62
|
+
{/if}
|
|
63
|
+
</span>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const avatarVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
sm: string;
|
|
5
|
+
default: string;
|
|
6
|
+
lg: string;
|
|
7
|
+
};
|
|
8
|
+
type: {
|
|
9
|
+
initials: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-brand-subtle text-brand-foreground", {
|
|
13
|
+
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
14
|
+
size?: boolean | (string | number | symbol)[] | undefined;
|
|
15
|
+
type?: boolean | (string | number | symbol)[] | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
} & import("tailwind-variants/dist/config.js").TWMConfig & {
|
|
18
|
+
twMergeConfig: {
|
|
19
|
+
classGroups: {
|
|
20
|
+
"font-size": {
|
|
21
|
+
text: ("display-hero" | "heading-page" | "heading-section" | "body" | "body-medium" | "body-large" | "caption" | "caption-medium" | "label" | "label-small" | "code")[];
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
size: {
|
|
27
|
+
sm: string;
|
|
28
|
+
default: string;
|
|
29
|
+
lg: string;
|
|
30
|
+
};
|
|
31
|
+
type: {
|
|
32
|
+
initials: string;
|
|
33
|
+
icon: string;
|
|
34
|
+
};
|
|
35
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
36
|
+
size: {
|
|
37
|
+
sm: string;
|
|
38
|
+
default: string;
|
|
39
|
+
lg: string;
|
|
40
|
+
};
|
|
41
|
+
type: {
|
|
42
|
+
initials: string;
|
|
43
|
+
icon: string;
|
|
44
|
+
};
|
|
45
|
+
}, undefined, "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-brand-subtle text-brand-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
46
|
+
size: {
|
|
47
|
+
sm: string;
|
|
48
|
+
default: string;
|
|
49
|
+
lg: string;
|
|
50
|
+
};
|
|
51
|
+
type: {
|
|
52
|
+
initials: string;
|
|
53
|
+
icon: string;
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
size: {
|
|
57
|
+
sm: string;
|
|
58
|
+
default: string;
|
|
59
|
+
lg: string;
|
|
60
|
+
};
|
|
61
|
+
type: {
|
|
62
|
+
initials: string;
|
|
63
|
+
icon: string;
|
|
64
|
+
};
|
|
65
|
+
}>, unknown, unknown, undefined>>;
|
|
66
|
+
export type AvatarSize = VariantProps<typeof avatarVariants>["size"];
|
|
67
|
+
export type AvatarType = VariantProps<typeof avatarVariants>["type"];
|
|
68
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
69
|
+
import type { Snippet } from "svelte";
|
|
70
|
+
type $$ComponentProps = HTMLAttributes<HTMLSpanElement> & {
|
|
71
|
+
size?: AvatarSize;
|
|
72
|
+
type?: AvatarType;
|
|
73
|
+
src?: string;
|
|
74
|
+
alt?: string;
|
|
75
|
+
name?: string;
|
|
76
|
+
icon?: Snippet;
|
|
77
|
+
};
|
|
78
|
+
declare const Avatar: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
79
|
+
type Avatar = ReturnType<typeof Avatar>;
|
|
80
|
+
export default Avatar;
|