@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,385 +1,429 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
2
|
+
// Svelte Imports
|
|
3
|
+
import { onMount, onDestroy } from 'svelte';
|
|
4
|
+
|
|
5
|
+
// Components Imports
|
|
6
|
+
import * as Breadcrumb from '../ui/breadcrumb';
|
|
7
|
+
import * as DropdownMenu from '../ui/dropdown-menu';
|
|
8
|
+
import * as Tooltip from '../ui/tooltip';
|
|
9
|
+
import { IconButton } from '../ui/icon-button';
|
|
10
|
+
|
|
11
|
+
// Icons Imports
|
|
12
|
+
// import { IconArrowLeft, IconArrowRight } from '@widgetic/design-system/icons';
|
|
13
|
+
import { IconArrowLeft, IconArrowRight } from '@tabler/icons-svelte';
|
|
14
|
+
|
|
15
|
+
// Types Import
|
|
16
|
+
import type { BreadcrumbsProps } from './types.js';
|
|
17
|
+
import { dirForUserText, useTextDirection } from '../textDirection.js';
|
|
18
|
+
import { breadcrumbsAvailableWidthPx } from './breadcrumbsAvailableWidth.js';
|
|
19
|
+
|
|
20
|
+
// Environment Import
|
|
21
|
+
// import { browser } from '$app/environment';
|
|
22
|
+
const browser = typeof window !== 'undefined';
|
|
23
|
+
|
|
24
|
+
/***
|
|
25
|
+
* COMPONENT PROPS
|
|
26
|
+
**/
|
|
27
|
+
// class && style props
|
|
28
|
+
let className = '';
|
|
29
|
+
export { className as class };
|
|
30
|
+
export let style = '';
|
|
31
|
+
// Breadcrumbs
|
|
32
|
+
export let clientHeight: number = 0;
|
|
33
|
+
// path settings
|
|
34
|
+
export let currentPath: BreadcrumbsProps['currentPath'] = [];
|
|
35
|
+
export let currentPathNames: BreadcrumbsProps['currentPathNames'] = [];
|
|
36
|
+
// loading settings
|
|
37
|
+
export let isLoading: BreadcrumbsProps['isLoading'] = false;
|
|
38
|
+
// navigation settings
|
|
39
|
+
export let showNavigationButtons: BreadcrumbsProps['showNavigationButtons'] = true;
|
|
40
|
+
export let canGoBack: BreadcrumbsProps['canGoBack'] = false;
|
|
41
|
+
export let canGoForward: BreadcrumbsProps['canGoForward'] = false;
|
|
42
|
+
// words (tooltips and screen readers): a page that shows this in another language passes its own
|
|
43
|
+
export let backLabel: string = 'Back';
|
|
44
|
+
export let forwardLabel: string = 'Forward';
|
|
45
|
+
export let rootLabel: string = 'Files';
|
|
46
|
+
export let breadcrumbLabel: string = 'breadcrumb';
|
|
47
|
+
// Figma Crumbs Size=Compact (a header under 700px wide): Heading/Section text and a 4px gap instead of Heading/Page and 6px
|
|
48
|
+
export let compact: boolean = false;
|
|
49
|
+
// event handlers
|
|
50
|
+
export let onNavigate: BreadcrumbsProps['onNavigate'] = () => {};
|
|
51
|
+
export let onBack: BreadcrumbsProps['onBack'] = () => {};
|
|
52
|
+
export let onForward: BreadcrumbsProps['onForward'] = () => {};
|
|
53
|
+
// debug settings
|
|
54
|
+
export let showDebugVisualizer: boolean = false;
|
|
55
|
+
|
|
56
|
+
// A name a visitor wrote keeps a direction of its own on a right to left screen (a Latin folder name reads left to
|
|
57
|
+
// right inside it); on a left to right screen no attribute is written and nothing changes.
|
|
58
|
+
const textDirection = useTextDirection();
|
|
59
|
+
$: nameDirection = dirForUserText($textDirection);
|
|
60
|
+
|
|
61
|
+
/***
|
|
62
|
+
* COMPONENT STATE VARIABLES
|
|
63
|
+
**/
|
|
64
|
+
let navElement: HTMLElement;
|
|
65
|
+
let headerElement: HTMLElement | null = null;
|
|
66
|
+
let isDesktop = false;
|
|
67
|
+
let mediaQuery: MediaQueryList | null = null;
|
|
68
|
+
let shouldShowEllipsis = false;
|
|
69
|
+
let availableWidth = 0;
|
|
70
|
+
let itemsToShow = 0;
|
|
71
|
+
let breadcrumbsContainer: HTMLElement;
|
|
72
|
+
let breadcrumbsPositioned = false;
|
|
73
|
+
let showLogs = false;
|
|
74
|
+
let showBackTooltip = false;
|
|
75
|
+
let showForwardTooltip = false;
|
|
76
|
+
// The text style and the gap between crumbs come from the Figma size of the crumbs
|
|
77
|
+
$: crumbTextClass = compact ? 'text-heading-section' : 'text-heading-page';
|
|
78
|
+
$: crumbGapClass = compact ? 'gap-1' : 'gap-1.5';
|
|
79
|
+
// Calculate how many items we can show based on available width
|
|
80
|
+
// Assuming each item takes roughly 150px on average (including separator)
|
|
81
|
+
$: if (availableWidth > 0) {
|
|
82
|
+
const averageItemWidth = 200; // Adjust this value based on actual measurements
|
|
83
|
+
const maxItems = Math.floor(availableWidth / averageItemWidth);
|
|
84
|
+
// Always show at least 2 items (first and last)
|
|
85
|
+
itemsToShow = Math.max(2, maxItems);
|
|
86
|
+
shouldShowEllipsis = currentPath?.length > itemsToShow;
|
|
87
|
+
|
|
88
|
+
// Mark breadcrumbs as positioned once we have calculated the available width
|
|
89
|
+
breadcrumbsPositioned = true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Only log on mount and significant changes
|
|
93
|
+
$: if (browser && currentPath?.length) {
|
|
94
|
+
// if(showLogs) console.log('Breadcrumbs significant update:', {
|
|
95
|
+
// currentPath,
|
|
96
|
+
// currentPathNames,
|
|
97
|
+
// shouldShowEllipsis,
|
|
98
|
+
// availableWidth,
|
|
99
|
+
// itemsToShow,
|
|
100
|
+
// breadcrumbsPositioned
|
|
101
|
+
// });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/***
|
|
105
|
+
* COMPONENT METHODS
|
|
106
|
+
**/
|
|
107
|
+
function updateAvailableWidth() {
|
|
108
|
+
if (!browser || !navElement || !breadcrumbsContainer) return;
|
|
109
|
+
|
|
110
|
+
const headerAncestor = navElement.closest('header');
|
|
111
|
+
const containerElement = headerAncestor || navElement;
|
|
112
|
+
headerElement = containerElement;
|
|
113
|
+
|
|
114
|
+
// Get all the measurements we need
|
|
115
|
+
const measurements = {
|
|
116
|
+
container: containerElement.getBoundingClientRect(),
|
|
117
|
+
navButtons: showNavigationButtons
|
|
118
|
+
? navElement.querySelector('.nav-buttons')?.getBoundingClientRect()
|
|
119
|
+
: null,
|
|
120
|
+
rightContent: containerElement
|
|
121
|
+
.querySelector('.pe-5, .pr-5, .right-content')
|
|
122
|
+
?.getBoundingClientRect(),
|
|
123
|
+
breadcrumbs: breadcrumbsContainer.getBoundingClientRect()
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// Calculate fixed spaces
|
|
127
|
+
const leftOffset = measurements.navButtons ? measurements.navButtons.width : 0;
|
|
128
|
+
const rightOffset = measurements.rightContent ? measurements.rightContent.width : 24;
|
|
129
|
+
|
|
130
|
+
// Calculate available width for breadcrumbs
|
|
131
|
+
availableWidth = breadcrumbsAvailableWidthPx({
|
|
132
|
+
containerWidthPx: measurements.container.width,
|
|
133
|
+
leftOffsetPx: leftOffset,
|
|
134
|
+
rightOffsetPx: rightOffset,
|
|
135
|
+
headerAncestor
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function handleMediaQuery(e: MediaQueryListEvent | MediaQueryList) {
|
|
140
|
+
isDesktop = e.matches;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
$: showFullPath = isDesktop;
|
|
144
|
+
|
|
145
|
+
function handleClick(event: MouseEvent, index: number) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
if (!isLoading) {
|
|
148
|
+
onNavigate(index);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function handleKeyDown(event: KeyboardEvent, index: number) {
|
|
153
|
+
if (event.key === 'Enter') {
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
if (!isLoading) {
|
|
156
|
+
onNavigate(index);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/***
|
|
162
|
+
* COMPONENT LIFECYCLE METHODS
|
|
163
|
+
**/
|
|
164
|
+
onMount(() => {
|
|
165
|
+
if (!browser) return;
|
|
166
|
+
|
|
167
|
+
mediaQuery = window.matchMedia('(min-width: 768px)');
|
|
168
|
+
handleMediaQuery(mediaQuery);
|
|
169
|
+
mediaQuery.addEventListener('change', handleMediaQuery);
|
|
170
|
+
|
|
171
|
+
// First try to get the header from FileBrowser structure
|
|
172
|
+
if (navElement) {
|
|
173
|
+
const header = navElement.closest('header');
|
|
174
|
+
if (header) {
|
|
175
|
+
headerElement = header;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Initial width calculation
|
|
180
|
+
updateAvailableWidth();
|
|
181
|
+
|
|
182
|
+
// Set up resize observer
|
|
183
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
184
|
+
updateAvailableWidth();
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
resizeObserver.observe(navElement);
|
|
188
|
+
if (headerElement) {
|
|
189
|
+
resizeObserver.observe(headerElement);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return () => {
|
|
193
|
+
resizeObserver.disconnect();
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
onDestroy(() => {
|
|
198
|
+
if (browser && mediaQuery) {
|
|
199
|
+
mediaQuery.removeEventListener('change', handleMediaQuery);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
188
202
|
</script>
|
|
189
203
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
204
|
+
<!--
|
|
205
|
+
Figma: Crumbs (component set 268:1008) with the back and forward buttons of Browser Header (268:1088).
|
|
206
|
+
Size=Page is `Heading/Page` with a 6px gap; Size=Compact (the `compact` prop) is `Heading/Section` with a 4px gap.
|
|
207
|
+
The last crumb is the page you are on (foreground); the ones before it are links (muted, foreground on hover).
|
|
208
|
+
-->
|
|
209
|
+
<nav
|
|
210
|
+
bind:this={navElement}
|
|
211
|
+
bind:clientHeight
|
|
212
|
+
aria-label={breadcrumbLabel}
|
|
213
|
+
class="{className
|
|
214
|
+
? className + ' '
|
|
215
|
+
: ''}breadcrumbs-component relative flex min-h-8 w-full items-center gap-2"
|
|
216
|
+
{style}
|
|
196
217
|
>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
<!-- NAVIGATION BUTTONS -->
|
|
219
|
+
{#if showNavigationButtons}
|
|
220
|
+
<Tooltip.Provider delayDuration={300}>
|
|
221
|
+
<div class="nav-buttons flex shrink-0 items-center gap-1">
|
|
222
|
+
<Tooltip.Root open={showBackTooltip}>
|
|
223
|
+
<!-- Figma Icon Button Ghost 32px: the disabled state is the 50% opacity of the Figma "Disabled" state. -->
|
|
224
|
+
<IconButton
|
|
225
|
+
variant="ghost"
|
|
226
|
+
label={backLabel}
|
|
227
|
+
disabled={!canGoBack || isLoading}
|
|
228
|
+
onmouseenter={() => {
|
|
229
|
+
showBackTooltip = true;
|
|
230
|
+
}}
|
|
231
|
+
onmouseleave={() => {
|
|
232
|
+
showBackTooltip = false;
|
|
233
|
+
}}
|
|
234
|
+
onclick={() => {
|
|
235
|
+
if (!isLoading) onBack();
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
<IconArrowLeft aria-hidden="true" class="rtl:-scale-x-100" />
|
|
239
|
+
</IconButton>
|
|
240
|
+
{#if showBackTooltip}
|
|
241
|
+
<!-- Portaled to <body>: the header row around this nav is overflow-hidden, which
|
|
219
242
|
otherwise clips the tooltip at the header's bottom edge. -->
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
243
|
+
<Tooltip.Portal>
|
|
244
|
+
<Tooltip.Content
|
|
245
|
+
side="bottom"
|
|
246
|
+
sideOffset={6}
|
|
247
|
+
class="bg-inverse text-inverse-foreground text-caption z-[200000] rounded-lg px-2 py-1"
|
|
248
|
+
>
|
|
249
|
+
{backLabel}
|
|
250
|
+
</Tooltip.Content>
|
|
251
|
+
</Tooltip.Portal>
|
|
252
|
+
{/if}
|
|
253
|
+
</Tooltip.Root>
|
|
254
|
+
|
|
255
|
+
<Tooltip.Root open={showForwardTooltip}>
|
|
256
|
+
<IconButton
|
|
257
|
+
variant="ghost"
|
|
258
|
+
label={forwardLabel}
|
|
259
|
+
disabled={!canGoForward || isLoading}
|
|
260
|
+
onmouseenter={() => {
|
|
261
|
+
showForwardTooltip = true;
|
|
262
|
+
}}
|
|
263
|
+
onmouseleave={() => {
|
|
264
|
+
showForwardTooltip = false;
|
|
265
|
+
}}
|
|
266
|
+
onclick={() => {
|
|
267
|
+
if (!isLoading) onForward();
|
|
268
|
+
}}
|
|
269
|
+
>
|
|
270
|
+
<IconArrowRight aria-hidden="true" class="rtl:-scale-x-100" />
|
|
271
|
+
</IconButton>
|
|
272
|
+
{#if showForwardTooltip}
|
|
273
|
+
<Tooltip.Portal>
|
|
274
|
+
<Tooltip.Content
|
|
275
|
+
side="bottom"
|
|
276
|
+
sideOffset={6}
|
|
277
|
+
class="bg-inverse text-inverse-foreground text-caption z-[200000] rounded-lg px-2 py-1"
|
|
278
|
+
>
|
|
279
|
+
{forwardLabel}
|
|
280
|
+
</Tooltip.Content>
|
|
281
|
+
</Tooltip.Portal>
|
|
282
|
+
{/if}
|
|
283
|
+
</Tooltip.Root>
|
|
284
|
+
</div>
|
|
285
|
+
</Tooltip.Provider>
|
|
286
|
+
{/if}
|
|
287
|
+
|
|
288
|
+
<!-- BREADCRUMBS CONTAINER -->
|
|
289
|
+
<div bind:this={breadcrumbsContainer} class="min-w-0 flex-1 overflow-hidden">
|
|
290
|
+
<Breadcrumb.Root aria-label={breadcrumbLabel}>
|
|
291
|
+
<Breadcrumb.List class="breadcrumbs-list inline-flex min-w-0 items-center">
|
|
292
|
+
<div class="inline-flex min-h-5 min-w-0 items-center {crumbGapClass}">
|
|
293
|
+
<!-- Root Breadcrumb Item -->
|
|
294
|
+
<Breadcrumb.Item class="shrink-0">
|
|
295
|
+
{#if currentPath.length === 0}
|
|
296
|
+
<!-- At the root the root crumb is the page you are on (Figma Crumbs Depth=Root: foreground) -->
|
|
297
|
+
<span class="{crumbTextClass} text-foreground whitespace-nowrap" aria-current="page">
|
|
298
|
+
{rootLabel}
|
|
299
|
+
</span>
|
|
300
|
+
{:else}
|
|
301
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
302
|
+
<span
|
|
303
|
+
role="link"
|
|
304
|
+
tabindex="0"
|
|
305
|
+
class="{crumbTextClass} text-muted-foreground hover:text-foreground cursor-pointer whitespace-nowrap transition-colors duration-fast hover:underline"
|
|
306
|
+
class:opacity-50={isLoading}
|
|
307
|
+
style="pointer-events: {isLoading ? 'none' : 'auto'};"
|
|
308
|
+
on:click={(e) => handleClick(e, -1)}
|
|
309
|
+
on:keydown={(e) => handleKeyDown(e, -1)}
|
|
310
|
+
>
|
|
311
|
+
{rootLabel}
|
|
312
|
+
</span>
|
|
313
|
+
{/if}
|
|
314
|
+
</Breadcrumb.Item>
|
|
315
|
+
|
|
316
|
+
{#if !isLoading && currentPath.length > 0 && breadcrumbsPositioned}
|
|
317
|
+
{#if shouldShowEllipsis && currentPath.length > itemsToShow}
|
|
318
|
+
<!-- Breadcrumb Separator -->
|
|
319
|
+
<Breadcrumb.Separator class="text-muted-foreground shrink-0 [&>svg]:size-4" />
|
|
320
|
+
|
|
321
|
+
<!-- Dropdown Menu for Ellipsis -->
|
|
322
|
+
<Breadcrumb.Item class="shrink-0">
|
|
323
|
+
<DropdownMenu.Root>
|
|
324
|
+
<DropdownMenu.Trigger class="flex cursor-pointer items-center gap-1">
|
|
325
|
+
<span class="{crumbTextClass} text-muted-foreground">...</span>
|
|
326
|
+
</DropdownMenu.Trigger>
|
|
327
|
+
<DropdownMenu.Content align="start" class="min-w-[200px]">
|
|
328
|
+
{#each currentPath.slice(0, -itemsToShow + 1) as _, index}
|
|
329
|
+
<DropdownMenu.Item>
|
|
330
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
331
|
+
<span
|
|
332
|
+
dir={nameDirection}
|
|
333
|
+
role="link"
|
|
334
|
+
tabindex="0"
|
|
335
|
+
class="block w-full cursor-pointer"
|
|
336
|
+
on:click={(e) => handleClick(e, index)}
|
|
337
|
+
>
|
|
338
|
+
{currentPathNames[index]}
|
|
339
|
+
</span>
|
|
340
|
+
</DropdownMenu.Item>
|
|
341
|
+
{/each}
|
|
342
|
+
</DropdownMenu.Content>
|
|
343
|
+
</DropdownMenu.Root>
|
|
344
|
+
</Breadcrumb.Item>
|
|
345
|
+
|
|
346
|
+
<!-- Always show last N segments based on available width -->
|
|
347
|
+
{#each currentPath.slice(-itemsToShow + 1) as _, index}
|
|
348
|
+
<Breadcrumb.Separator class="text-muted-foreground shrink-0 [&>svg]:size-4" />
|
|
349
|
+
<Breadcrumb.Item class="shrink-0">
|
|
350
|
+
{#if index === itemsToShow - 2}
|
|
351
|
+
<span dir={nameDirection} class="{crumbTextClass} text-foreground" aria-current="page">
|
|
352
|
+
{currentPathNames[currentPath.length - 1]}
|
|
353
|
+
</span>
|
|
354
|
+
{:else}
|
|
355
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
356
|
+
<span
|
|
357
|
+
dir={nameDirection}
|
|
358
|
+
role="link"
|
|
359
|
+
tabindex="0"
|
|
360
|
+
class="{crumbTextClass} text-muted-foreground hover:text-foreground cursor-pointer transition-colors duration-fast hover:underline"
|
|
361
|
+
class:opacity-50={isLoading}
|
|
362
|
+
style="pointer-events: {isLoading ? 'none' : 'auto'};"
|
|
363
|
+
on:click={(e) => handleClick(e, currentPath.length - itemsToShow + 1 + index)}
|
|
364
|
+
on:keydown={(e) =>
|
|
365
|
+
handleKeyDown(e, currentPath.length - itemsToShow + 1 + index)}
|
|
366
|
+
>
|
|
367
|
+
{currentPathNames[currentPath.length - itemsToShow + 1 + index]}
|
|
368
|
+
</span>
|
|
369
|
+
{/if}
|
|
370
|
+
</Breadcrumb.Item>
|
|
371
|
+
{/each}
|
|
372
|
+
{:else}
|
|
373
|
+
{#each currentPath as _, index}
|
|
374
|
+
<Breadcrumb.Separator class="text-muted-foreground shrink-0 [&>svg]:size-4" />
|
|
375
|
+
<Breadcrumb.Item class="shrink-0">
|
|
376
|
+
{#if index === currentPath.length - 1}
|
|
377
|
+
<span dir={nameDirection} class="{crumbTextClass} text-foreground" aria-current="page">
|
|
378
|
+
{currentPathNames[index]}
|
|
379
|
+
</span>
|
|
380
|
+
{:else}
|
|
381
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
382
|
+
<span
|
|
383
|
+
dir={nameDirection}
|
|
384
|
+
role="link"
|
|
385
|
+
tabindex="0"
|
|
386
|
+
class="{crumbTextClass} text-muted-foreground hover:text-foreground cursor-pointer transition-colors duration-fast hover:underline"
|
|
387
|
+
class:opacity-50={isLoading}
|
|
388
|
+
style="pointer-events: {isLoading ? 'none' : 'auto'};"
|
|
389
|
+
on:click={(e) => handleClick(e, index)}
|
|
390
|
+
on:keydown={(e) => handleKeyDown(e, index)}
|
|
391
|
+
>
|
|
392
|
+
{currentPathNames[index]}
|
|
393
|
+
</span>
|
|
394
|
+
{/if}
|
|
395
|
+
</Breadcrumb.Item>
|
|
396
|
+
{/each}
|
|
397
|
+
{/if}
|
|
398
|
+
{/if}
|
|
399
|
+
</div>
|
|
400
|
+
</Breadcrumb.List>
|
|
401
|
+
</Breadcrumb.Root>
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
{#if showDebugVisualizer}
|
|
405
|
+
<div
|
|
406
|
+
class="bg-background text-caption text-brand absolute end-1 bottom-1 rounded-sm px-1 shadow-2xs"
|
|
407
|
+
>
|
|
408
|
+
Available width: {Math.round(availableWidth)}px
|
|
409
|
+
<br />
|
|
410
|
+
Items to show: {itemsToShow}
|
|
411
|
+
<br />
|
|
412
|
+
Should show ellipsis: {shouldShowEllipsis}
|
|
413
|
+
<br />
|
|
414
|
+
Positioned: {breadcrumbsPositioned}
|
|
415
|
+
<br />
|
|
416
|
+
Context: {navElement?.closest('header') ? 'FileBrowser' : 'Direct'}
|
|
417
|
+
</div>
|
|
418
|
+
{/if}
|
|
375
419
|
</nav>
|
|
376
420
|
|
|
377
421
|
<style>
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
</style>
|
|
422
|
+
:global(.breadcrumb-separator) {
|
|
423
|
+
margin: 0 0.5rem;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:global(.breadcrumbs-list) {
|
|
427
|
+
width: 100%;
|
|
428
|
+
}
|
|
429
|
+
</style>
|