@eifi1/ui-kit 0.9.0 → 0.11.0
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 +37 -23
- package/dist/components/alert-banner.d.ts +57 -5
- package/dist/components/alert-banner.js +63 -17
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/amount-input.d.ts +6 -0
- package/dist/components/breadcrumbs.d.ts +60 -0
- package/dist/components/breadcrumbs.js +88 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/bulk-action-bar.d.ts +112 -0
- package/dist/components/bulk-action-bar.js +196 -0
- package/dist/components/bulk-action-bar.js.map +1 -0
- package/dist/components/button-group.d.ts +58 -3
- package/dist/components/button-group.js +56 -5
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/calculator.d.ts +6 -0
- package/dist/components/calendar-heatmap.d.ts +124 -0
- package/dist/components/calendar-heatmap.js +295 -0
- package/dist/components/calendar-heatmap.js.map +1 -0
- package/dist/components/chip.d.ts +31 -5
- package/dist/components/chip.js +85 -5
- package/dist/components/chip.js.map +1 -1
- package/dist/components/choice-card.d.ts +34 -2
- package/dist/components/choice-card.js +49 -0
- package/dist/components/choice-card.js.map +1 -1
- package/dist/components/copy-button.d.ts +14 -4
- package/dist/components/copy-button.js +17 -4
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table.js +2 -0
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.d.ts +22 -2
- package/dist/components/date-picker.js +11 -3
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/description-list.d.ts +43 -6
- package/dist/components/description-list.js +91 -11
- package/dist/components/description-list.js.map +1 -1
- package/dist/components/dialog-frame.d.ts +7 -0
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/disclosure.d.ts +57 -2
- package/dist/components/disclosure.js +24 -12
- package/dist/components/disclosure.js.map +1 -1
- package/dist/components/field.d.ts +43 -0
- package/dist/components/field.js +52 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/file-button.d.ts +1 -0
- package/dist/components/file-dropzone.d.ts +4 -4
- package/dist/components/file-dropzone.js +2 -1
- package/dist/components/file-dropzone.js.map +1 -1
- package/dist/components/floating-panel.d.ts +147 -4
- package/dist/components/floating-panel.js +188 -28
- package/dist/components/floating-panel.js.map +1 -1
- package/dist/components/full-bleed-dialog.d.ts +23 -4
- package/dist/components/full-bleed-dialog.js +11 -2
- package/dist/components/full-bleed-dialog.js.map +1 -1
- package/dist/components/list.d.ts +187 -0
- package/dist/components/list.js +221 -0
- package/dist/components/list.js.map +1 -0
- package/dist/components/menu-item.d.ts +109 -0
- package/dist/components/menu-item.js +88 -0
- package/dist/components/menu-item.js.map +1 -0
- package/dist/components/mini-calendar.d.ts +70 -5
- package/dist/components/mini-calendar.js +166 -62
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +23 -1
- package/dist/components/modal.js +36 -10
- package/dist/components/modal.js.map +1 -1
- package/dist/components/nav-pills.d.ts +66 -0
- package/dist/components/nav-pills.js +65 -0
- package/dist/components/nav-pills.js.map +1 -0
- package/dist/components/number-field.d.ts +6 -0
- package/dist/components/number-input.d.ts +6 -0
- package/dist/components/numpad-sheet.d.ts +6 -0
- package/dist/components/page-contents.js +1 -2
- package/dist/components/page-contents.js.map +1 -1
- package/dist/components/page-header.d.ts +37 -0
- package/dist/components/page-header.js +36 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/progress-bar.d.ts +31 -2
- package/dist/components/progress-bar.js +73 -7
- package/dist/components/progress-bar.js.map +1 -1
- package/dist/components/series-chart-labels.d.ts +3 -0
- package/dist/components/series-chart-labels.js +2 -1
- package/dist/components/series-chart-labels.js.map +1 -1
- package/dist/components/series-chart.d.ts +32 -0
- package/dist/components/series-chart.js +141 -4
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/settings-fields.d.ts +1 -0
- package/dist/components/status-dot.d.ts +53 -0
- package/dist/components/status-dot.js +57 -0
- package/dist/components/status-dot.js.map +1 -0
- package/dist/components/table.d.ts +78 -13
- package/dist/components/table.js +84 -11
- package/dist/components/table.js.map +1 -1
- package/dist/components/text.d.ts +70 -0
- package/dist/components/text.js +24 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/time-input.d.ts +1 -0
- package/dist/components/toast.d.ts +167 -0
- package/dist/components/toast.js +226 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.d.ts +44 -1
- package/dist/components/toggle-group.js +73 -4
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/tooltip.d.ts +46 -15
- package/dist/components/tooltip.js +87 -47
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/ui.d.ts +158 -7
- package/dist/components/ui.js +191 -10
- package/dist/components/ui.js.map +1 -1
- package/dist/components/user-avatar.d.ts +25 -3
- package/dist/components/user-avatar.js +32 -3
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/hooks/use-close-transition.d.ts +7 -1
- package/dist/hooks/use-close-transition.js +5 -2
- package/dist/hooks/use-close-transition.js.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -1
- package/dist/hooks/use-file-drop.d.ts +1 -0
- package/dist/i18n/defaults.d.ts +6 -0
- package/dist/i18n/defaults.js +11 -1
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +11 -0
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/de-CH-informal.d.ts +6 -0
- package/dist/i18n/locales/de-CH.d.ts +6 -0
- package/dist/i18n/locales/de-informal.d.ts +6 -0
- package/dist/i18n/locales/de.d.ts +6 -0
- package/dist/i18n/locales/de.js +30 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +6 -0
- package/dist/i18n/locales/es.js +30 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +6 -0
- package/dist/i18n/locales/fr.js +30 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +6 -0
- package/dist/i18n/locales/hu.js +30 -2
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +6 -0
- package/dist/i18n/locales/it.js +30 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +6 -0
- package/dist/i18n/locales/zh.js +30 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.d.ts +27 -15
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/clipping.d.ts +25 -0
- package/dist/lib/clipping.js +17 -0
- package/dist/lib/clipping.js.map +1 -0
- package/dist/lib/dates.d.ts +17 -1
- package/dist/lib/dates.js +19 -0
- package/dist/lib/dates.js.map +1 -1
- package/dist/rhf/form.d.ts +1 -0
- package/dist/rhf/use-rhf-wizard-step.d.ts +22 -0
- package/dist/rhf/use-rhf-wizard-step.js +38 -0
- package/dist/rhf/use-rhf-wizard-step.js.map +1 -0
- package/dist/rhf.d.ts +2 -0
- package/dist/rhf.js +1 -0
- package/dist/rhf.js.map +1 -1
- package/dist/search/command-palette.d.ts +19 -2
- package/dist/search/command-palette.js +16 -5
- package/dist/search/command-palette.js.map +1 -1
- package/dist/search/global-search.d.ts +26 -1
- package/dist/search/global-search.js +29 -13
- package/dist/search/global-search.js.map +1 -1
- package/dist/search.d.ts +1 -1
- package/dist/shell/topbar-action-menu.d.ts +73 -3
- package/dist/shell/topbar-action-menu.js +100 -27
- package/dist/shell/topbar-action-menu.js.map +1 -1
- package/dist/shell.d.ts +2 -1
- package/dist/wizard/stepper-nav.d.ts +1 -0
- package/dist/wizard/stepper-nav.js +1 -1
- package/dist/wizard/stepper-nav.js.map +1 -1
- package/dist/wizard/types.d.ts +2 -2
- package/dist/wizard/types.js.map +1 -1
- package/dist/wizard/use-wizard.js +1 -1
- package/dist/wizard/use-wizard.js.map +1 -1
- package/dist/wizard/wizard-context.d.ts +7 -1
- package/dist/wizard/wizard-context.js +4 -0
- package/dist/wizard/wizard-context.js.map +1 -1
- package/dist/wizard/wizard-summary.js +3 -3
- package/dist/wizard/wizard-summary.js.map +1 -1
- package/dist/wizard.d.ts +2 -1
- package/package.json +16 -12
- package/src/components/alert-banner.tsx +149 -21
- package/src/components/breadcrumbs.tsx +168 -0
- package/src/components/bulk-action-bar.tsx +362 -0
- package/src/components/button-group.tsx +124 -4
- package/src/components/calendar-heatmap.tsx +504 -0
- package/src/components/chip.tsx +128 -7
- package/src/components/choice-card.tsx +97 -1
- package/src/components/copy-button.tsx +29 -7
- package/src/components/data-table.tsx +7 -0
- package/src/components/date-picker.tsx +49 -1
- package/src/components/description-list.tsx +168 -15
- package/src/components/dialog-frame.tsx +7 -0
- package/src/components/disclosure.tsx +93 -21
- package/src/components/field.tsx +137 -0
- package/src/components/file-dropzone.tsx +9 -10
- package/src/components/floating-panel.tsx +366 -15
- package/src/components/full-bleed-dialog.tsx +42 -5
- package/src/components/list.tsx +443 -0
- package/src/components/menu-item.tsx +235 -0
- package/src/components/mini-calendar.tsx +245 -54
- package/src/components/modal.tsx +80 -17
- package/src/components/nav-pills.tsx +145 -0
- package/src/components/page-contents.tsx +4 -4
- package/src/components/page-header.tsx +68 -0
- package/src/components/progress-bar.tsx +129 -11
- package/src/components/series-chart-labels.ts +4 -0
- package/src/components/series-chart.tsx +274 -3
- package/src/components/status-dot.tsx +107 -0
- package/src/components/table.tsx +176 -17
- package/src/components/text.tsx +97 -0
- package/src/components/toast.tsx +441 -0
- package/src/components/toggle-group.tsx +128 -4
- package/src/components/tooltip.tsx +200 -100
- package/src/components/ui.tsx +381 -14
- package/src/components/user-avatar.tsx +57 -3
- package/src/hooks/use-close-transition.ts +14 -5
- package/src/hooks/use-copy-to-clipboard.ts +1 -1
- package/src/i18n/defaults.ts +10 -0
- package/src/i18n/kit-labels.tsx +10 -0
- package/src/i18n/locales/de.ts +29 -0
- package/src/i18n/locales/es.ts +29 -0
- package/src/i18n/locales/fr.ts +29 -0
- package/src/i18n/locales/hu.ts +29 -0
- package/src/i18n/locales/it.ts +29 -0
- package/src/i18n/locales/zh.ts +29 -0
- package/src/index.ts +31 -0
- package/src/lib/clipping.ts +34 -0
- package/src/lib/dates.ts +37 -0
- package/src/rhf/use-rhf-wizard-step.ts +113 -0
- package/src/rhf.ts +2 -0
- package/src/search/command-palette.tsx +42 -5
- package/src/search/global-search.tsx +59 -18
- package/src/shell/topbar-action-menu.tsx +239 -49
- package/src/wizard/stepper-nav.tsx +2 -1
- package/src/wizard/types.ts +2 -2
- package/src/wizard/use-wizard.ts +3 -3
- package/src/wizard/wizard-context.tsx +9 -0
- package/src/wizard/wizard-summary.tsx +14 -10
- package/tokens.css +97 -0
package/src/i18n/defaults.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_DATA_TABLE_LABELS } from "../components/data-table-labels";
|
|
2
2
|
import { DEFAULT_MINI_CALENDAR_LABELS } from "../components/mini-calendar";
|
|
3
|
+
import { DEFAULT_CALENDAR_HEATMAP_LABELS } from "../components/calendar-heatmap";
|
|
3
4
|
import { DEFAULT_MONTH_PICKER_LABELS } from "../components/month-picker";
|
|
4
5
|
import { DEFAULT_PAGE_CONTENTS_LABELS } from "../components/page-contents";
|
|
5
6
|
import { DEFAULT_POPOVER_LABELS } from "../components/popover";
|
|
@@ -25,6 +26,10 @@ import { DEFAULT_CONFIRM_DIALOG_LABELS } from "../components/confirm-dialog";
|
|
|
25
26
|
import { DEFAULT_FLOATING_PANEL_LABELS } from "../components/floating-panel";
|
|
26
27
|
import { DEFAULT_FEEDBACK_ATTACHMENT_LABELS } from "../feedback/feedback-attachment";
|
|
27
28
|
import { DEFAULT_COPY_BUTTON_LABELS } from "../components/copy-button";
|
|
29
|
+
import { DEFAULT_BULK_ACTION_BAR_LABELS } from "../components/bulk-action-bar";
|
|
30
|
+
import { DEFAULT_LIST_LABELS } from "../components/list";
|
|
31
|
+
import { DEFAULT_BREADCRUMBS_LABELS } from "../components/breadcrumbs";
|
|
32
|
+
import { DEFAULT_TOAST_LABELS } from "../components/toast";
|
|
28
33
|
import {
|
|
29
34
|
DEFAULT_APP_SHELL_LABELS,
|
|
30
35
|
DEFAULT_CALCULATOR_LABELS,
|
|
@@ -52,6 +57,7 @@ export const DEFAULT_UI_KIT_LABELS: UiKitLabels = {
|
|
|
52
57
|
common: DEFAULT_COMMON_LABELS,
|
|
53
58
|
dataTable: DEFAULT_DATA_TABLE_LABELS,
|
|
54
59
|
miniCalendar: DEFAULT_MINI_CALENDAR_LABELS,
|
|
60
|
+
calendarHeatmap: DEFAULT_CALENDAR_HEATMAP_LABELS,
|
|
55
61
|
datePicker: DEFAULT_DATE_PICKER_LABELS,
|
|
56
62
|
monthPicker: DEFAULT_MONTH_PICKER_LABELS,
|
|
57
63
|
popover: DEFAULT_POPOVER_LABELS,
|
|
@@ -88,4 +94,8 @@ export const DEFAULT_UI_KIT_LABELS: UiKitLabels = {
|
|
|
88
94
|
confirmDialog: DEFAULT_CONFIRM_DIALOG_LABELS,
|
|
89
95
|
floatingPanel: DEFAULT_FLOATING_PANEL_LABELS,
|
|
90
96
|
copyButton: DEFAULT_COPY_BUTTON_LABELS,
|
|
97
|
+
bulkActionBar: DEFAULT_BULK_ACTION_BAR_LABELS,
|
|
98
|
+
list: DEFAULT_LIST_LABELS,
|
|
99
|
+
breadcrumbs: DEFAULT_BREADCRUMBS_LABELS,
|
|
100
|
+
toast: DEFAULT_TOAST_LABELS,
|
|
91
101
|
};
|
package/src/i18n/kit-labels.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { createContext, useContext, useMemo } from "react";
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type { DataTableLabels } from "../components/data-table-labels";
|
|
4
4
|
import type { MiniCalendarLabels, WeekDay } from "../components/mini-calendar";
|
|
5
|
+
import type { CalendarHeatmapLabels } from "../components/calendar-heatmap";
|
|
5
6
|
import type { PopoverLabels } from "../components/popover";
|
|
6
7
|
import type { ChipInputLabels } from "../components/chip";
|
|
7
8
|
import type { FieldSyncLabels } from "../components/field-sync";
|
|
@@ -27,6 +28,10 @@ import type { FeedbackAttachmentFieldLabels } from "../feedback/feedback-attachm
|
|
|
27
28
|
import type { ConfirmDialogLabels } from "../components/confirm-dialog";
|
|
28
29
|
import type { FloatingPanelLabels } from "../components/floating-panel";
|
|
29
30
|
import type { CopyButtonLabels } from "../components/copy-button";
|
|
31
|
+
import type { BulkActionBarLabels } from "../components/bulk-action-bar";
|
|
32
|
+
import type { ListLabels } from "../components/list";
|
|
33
|
+
import type { BreadcrumbsLabels } from "../components/breadcrumbs";
|
|
34
|
+
import type { ToastLabels } from "../components/toast";
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
37
|
* EVERY string the kit renders, as one typed tree — and an optional provider that
|
|
@@ -193,6 +198,7 @@ export interface UiKitLabels {
|
|
|
193
198
|
common: CommonLabels;
|
|
194
199
|
dataTable: DataTableLabels;
|
|
195
200
|
miniCalendar: MiniCalendarLabels;
|
|
201
|
+
calendarHeatmap: CalendarHeatmapLabels;
|
|
196
202
|
datePicker: DatePickerLabels;
|
|
197
203
|
monthPicker: MonthPickerLabels;
|
|
198
204
|
popover: PopoverLabels;
|
|
@@ -229,6 +235,10 @@ export interface UiKitLabels {
|
|
|
229
235
|
confirmDialog: ConfirmDialogLabels;
|
|
230
236
|
floatingPanel: FloatingPanelLabels;
|
|
231
237
|
copyButton: CopyButtonLabels;
|
|
238
|
+
bulkActionBar: BulkActionBarLabels;
|
|
239
|
+
list: ListLabels;
|
|
240
|
+
breadcrumbs: BreadcrumbsLabels;
|
|
241
|
+
toast: ToastLabels;
|
|
232
242
|
}
|
|
233
243
|
|
|
234
244
|
/** Any subset of the tree, one level deep — each namespace may be partial, and a
|
package/src/i18n/locales/de.ts
CHANGED
|
@@ -118,6 +118,14 @@ export function uiKitLabelsDe(numberLocale = "de-DE"): UiKitLabels {
|
|
|
118
118
|
rangeSelected: (from, to) =>
|
|
119
119
|
`Zeitraum ${from} bis ${to} gewählt. Wählen Sie ein Startdatum, um neu zu beginnen.`,
|
|
120
120
|
},
|
|
121
|
+
calendarHeatmap: {
|
|
122
|
+
grid: "Tageswerte",
|
|
123
|
+
day: (date, value) => `${date}: ${value}`,
|
|
124
|
+
less: "Weniger",
|
|
125
|
+
more: "Mehr",
|
|
126
|
+
truncated: (count) =>
|
|
127
|
+
`Die neuesten Tage werden angezeigt; ${n(count)} ${count === 1 ? "früherer Tag wird" : "frühere Tage werden"} nicht angezeigt.`,
|
|
128
|
+
},
|
|
121
129
|
datePicker: {
|
|
122
130
|
apply: "Übernehmen",
|
|
123
131
|
cancel: "Abbrechen",
|
|
@@ -239,6 +247,11 @@ export function uiKitLabelsDe(numberLocale = "de-DE"): UiKitLabels {
|
|
|
239
247
|
dialogFrame: {
|
|
240
248
|
close: "Schließen",
|
|
241
249
|
},
|
|
250
|
+
bulkActionBar: {
|
|
251
|
+
selected: (count) => `${n(count)} ausgewählt`,
|
|
252
|
+
clear: "Auswahl aufheben",
|
|
253
|
+
cleared: "Auswahl aufgehoben",
|
|
254
|
+
},
|
|
242
255
|
swipeableRow: {
|
|
243
256
|
actions: "Zeilenaktionen",
|
|
244
257
|
},
|
|
@@ -379,6 +392,7 @@ export function uiKitLabelsDe(numberLocale = "de-DE"): UiKitLabels {
|
|
|
379
392
|
"Zum Zoomen ziehen: Eine annähernd quadratische Auswahl zoomt beide Achsen, eine lange, schmale nur ihre eigene. Doppelklick setzt zurück.",
|
|
380
393
|
empty: "Keine Daten",
|
|
381
394
|
legend: "Datenreihen",
|
|
395
|
+
points: "Diagrammwerte",
|
|
382
396
|
},
|
|
383
397
|
confirmDialog: {
|
|
384
398
|
confirm: "Bestätigen",
|
|
@@ -386,6 +400,7 @@ export function uiKitLabelsDe(numberLocale = "de-DE"): UiKitLabels {
|
|
|
386
400
|
},
|
|
387
401
|
floatingPanel: {
|
|
388
402
|
close: "Schließen",
|
|
403
|
+
badge: (count) => `${n(count)} neu`,
|
|
389
404
|
},
|
|
390
405
|
copyButton: {
|
|
391
406
|
copy: "Kopieren",
|
|
@@ -394,6 +409,20 @@ export function uiKitLabelsDe(numberLocale = "de-DE"): UiKitLabels {
|
|
|
394
409
|
copiedAnnouncement: "In die Zwischenablage kopiert",
|
|
395
410
|
failedAnnouncement: "Kopieren in die Zwischenablage fehlgeschlagen",
|
|
396
411
|
},
|
|
412
|
+
list: {
|
|
413
|
+
unread: "Ungelesen",
|
|
414
|
+
opensInNewTab: "öffnet in einem neuen Tab",
|
|
415
|
+
},
|
|
416
|
+
breadcrumbs: {
|
|
417
|
+
label: "Brotkrümelnavigation",
|
|
418
|
+
showAll: "Vollständigen Pfad anzeigen",
|
|
419
|
+
},
|
|
420
|
+
toast: {
|
|
421
|
+
close: "Benachrichtigung schließen",
|
|
422
|
+
notifications: "Benachrichtigungen",
|
|
423
|
+
undo: "Rückgängig",
|
|
424
|
+
redo: "Wiederholen",
|
|
425
|
+
},
|
|
397
426
|
};
|
|
398
427
|
}
|
|
399
428
|
|
package/src/i18n/locales/es.ts
CHANGED
|
@@ -125,6 +125,14 @@ export function uiKitLabelsEs(numberLocale = "es-ES"): UiKitLabels {
|
|
|
125
125
|
panel: "Elegir un mes",
|
|
126
126
|
month: (monthYear) => monthYear,
|
|
127
127
|
},
|
|
128
|
+
calendarHeatmap: {
|
|
129
|
+
grid: "Valores diarios",
|
|
130
|
+
day: (date, value) => `${date}: ${value}`,
|
|
131
|
+
less: "Menos",
|
|
132
|
+
more: "Más",
|
|
133
|
+
truncated: (count) =>
|
|
134
|
+
`Se muestran los días más recientes; ${count === 1 ? "no se muestra 1 día anterior" : `no se muestran ${n(count)} días anteriores`}.`,
|
|
135
|
+
},
|
|
128
136
|
datePicker: {
|
|
129
137
|
apply: "Aplicar",
|
|
130
138
|
cancel: "Cancelar",
|
|
@@ -236,6 +244,11 @@ export function uiKitLabelsEs(numberLocale = "es-ES"): UiKitLabels {
|
|
|
236
244
|
dialogFrame: {
|
|
237
245
|
close: "Cerrar",
|
|
238
246
|
},
|
|
247
|
+
bulkActionBar: {
|
|
248
|
+
selected: (count) => `${n(count)} ${count === 1 ? "seleccionado" : "seleccionados"}`,
|
|
249
|
+
clear: "Borrar selección",
|
|
250
|
+
cleared: "Selección borrada",
|
|
251
|
+
},
|
|
239
252
|
swipeableRow: {
|
|
240
253
|
actions: "Acciones de la fila",
|
|
241
254
|
},
|
|
@@ -372,6 +385,7 @@ export function uiKitLabelsEs(numberLocale = "es-ES"): UiKitLabels {
|
|
|
372
385
|
"Arrastra para ampliar: una selección más o menos cuadrada amplía ambos ejes; una larga y estrecha, solo el suyo. Haz doble clic para restablecer.",
|
|
373
386
|
empty: "Sin datos",
|
|
374
387
|
legend: "Series",
|
|
388
|
+
points: "Valores del gráfico",
|
|
375
389
|
},
|
|
376
390
|
confirmDialog: {
|
|
377
391
|
confirm: "Confirmar",
|
|
@@ -379,6 +393,7 @@ export function uiKitLabelsEs(numberLocale = "es-ES"): UiKitLabels {
|
|
|
379
393
|
},
|
|
380
394
|
floatingPanel: {
|
|
381
395
|
close: "Cerrar",
|
|
396
|
+
badge: (count) => `${n(count)} ${plural(count, "nuevo", "nuevos")}`,
|
|
382
397
|
},
|
|
383
398
|
copyButton: {
|
|
384
399
|
copy: "Copiar",
|
|
@@ -387,6 +402,20 @@ export function uiKitLabelsEs(numberLocale = "es-ES"): UiKitLabels {
|
|
|
387
402
|
copiedAnnouncement: "Copiado al portapapeles",
|
|
388
403
|
failedAnnouncement: "No se pudo copiar al portapapeles",
|
|
389
404
|
},
|
|
405
|
+
list: {
|
|
406
|
+
unread: "No leído",
|
|
407
|
+
opensInNewTab: "se abre en una pestaña nueva",
|
|
408
|
+
},
|
|
409
|
+
breadcrumbs: {
|
|
410
|
+
label: "Ruta de navegación",
|
|
411
|
+
showAll: "Mostrar la ruta completa",
|
|
412
|
+
},
|
|
413
|
+
toast: {
|
|
414
|
+
close: "Cerrar notificación",
|
|
415
|
+
notifications: "Notificaciones",
|
|
416
|
+
undo: "Deshacer",
|
|
417
|
+
redo: "Rehacer",
|
|
418
|
+
},
|
|
390
419
|
};
|
|
391
420
|
}
|
|
392
421
|
|
package/src/i18n/locales/fr.ts
CHANGED
|
@@ -122,6 +122,14 @@ export function uiKitLabelsFr(numberLocale = "fr-FR"): UiKitLabels {
|
|
|
122
122
|
rangeSelected: (from, to) =>
|
|
123
123
|
`Période du ${from} au ${to} sélectionnée. Choisissez une date de début pour recommencer.`,
|
|
124
124
|
},
|
|
125
|
+
calendarHeatmap: {
|
|
126
|
+
grid: "Valeurs quotidiennes",
|
|
127
|
+
day: (date, value) => `${date} : ${value}`,
|
|
128
|
+
less: "Moins",
|
|
129
|
+
more: "Plus",
|
|
130
|
+
truncated: (count) =>
|
|
131
|
+
`Affichage des jours les plus récents ; ${n(count)} ${count === 1 ? "jour antérieur n’est pas affiché" : "jours antérieurs ne sont pas affichés"}.`,
|
|
132
|
+
},
|
|
125
133
|
datePicker: {
|
|
126
134
|
apply: "Appliquer",
|
|
127
135
|
cancel: "Annuler",
|
|
@@ -241,6 +249,11 @@ export function uiKitLabelsFr(numberLocale = "fr-FR"): UiKitLabels {
|
|
|
241
249
|
dialogFrame: {
|
|
242
250
|
close: "Fermer",
|
|
243
251
|
},
|
|
252
|
+
bulkActionBar: {
|
|
253
|
+
selected: (count) => `${n(count)} ${count === 1 ? "sélectionné" : "sélectionnés"}`,
|
|
254
|
+
clear: "Effacer la sélection",
|
|
255
|
+
cleared: "Sélection effacée",
|
|
256
|
+
},
|
|
244
257
|
swipeableRow: {
|
|
245
258
|
actions: "Actions de la ligne",
|
|
246
259
|
},
|
|
@@ -385,6 +398,7 @@ export function uiKitLabelsFr(numberLocale = "fr-FR"): UiKitLabels {
|
|
|
385
398
|
"Faites glisser pour zoomer\u00a0: une sélection à peu près carrée zoome sur les deux axes, une sélection longue et étroite sur son seul axe. Double-cliquez pour réinitialiser.",
|
|
386
399
|
empty: "Aucune donnée",
|
|
387
400
|
legend: "Séries",
|
|
401
|
+
points: "Valeurs du graphique",
|
|
388
402
|
},
|
|
389
403
|
confirmDialog: {
|
|
390
404
|
confirm: "Confirmer",
|
|
@@ -392,6 +406,7 @@ export function uiKitLabelsFr(numberLocale = "fr-FR"): UiKitLabels {
|
|
|
392
406
|
},
|
|
393
407
|
floatingPanel: {
|
|
394
408
|
close: "Fermer",
|
|
409
|
+
badge: (count) => `${n(count)} ${plural(count, "nouveau", "nouveaux")}`,
|
|
395
410
|
},
|
|
396
411
|
copyButton: {
|
|
397
412
|
copy: "Copier",
|
|
@@ -400,6 +415,20 @@ export function uiKitLabelsFr(numberLocale = "fr-FR"): UiKitLabels {
|
|
|
400
415
|
copiedAnnouncement: "Copié dans le presse-papiers",
|
|
401
416
|
failedAnnouncement: "Impossible de copier dans le presse-papiers",
|
|
402
417
|
},
|
|
418
|
+
list: {
|
|
419
|
+
unread: "Non lu",
|
|
420
|
+
opensInNewTab: "s’ouvre dans un nouvel onglet",
|
|
421
|
+
},
|
|
422
|
+
breadcrumbs: {
|
|
423
|
+
label: "Fil d’Ariane",
|
|
424
|
+
showAll: "Afficher le chemin complet",
|
|
425
|
+
},
|
|
426
|
+
toast: {
|
|
427
|
+
close: "Fermer la notification",
|
|
428
|
+
notifications: "Notifications",
|
|
429
|
+
undo: "Annuler",
|
|
430
|
+
redo: "Rétablir",
|
|
431
|
+
},
|
|
403
432
|
};
|
|
404
433
|
}
|
|
405
434
|
|
package/src/i18n/locales/hu.ts
CHANGED
|
@@ -121,6 +121,14 @@ export function uiKitLabelsHu(numberLocale = "hu-HU"): UiKitLabels {
|
|
|
121
121
|
panel: "Hónap kiválasztása",
|
|
122
122
|
month: (monthYear) => monthYear,
|
|
123
123
|
},
|
|
124
|
+
calendarHeatmap: {
|
|
125
|
+
grid: "Napi értékek",
|
|
126
|
+
day: (date, value) => `${date}: ${value}`,
|
|
127
|
+
less: "Kevesebb",
|
|
128
|
+
more: "Több",
|
|
129
|
+
truncated: (count) =>
|
|
130
|
+
`A legutóbbi napok láthatók; ${n(count)} korábbi nap nem látható.`,
|
|
131
|
+
},
|
|
124
132
|
datePicker: {
|
|
125
133
|
apply: "Alkalmaz",
|
|
126
134
|
cancel: "Mégse",
|
|
@@ -234,6 +242,11 @@ export function uiKitLabelsHu(numberLocale = "hu-HU"): UiKitLabels {
|
|
|
234
242
|
dialogFrame: {
|
|
235
243
|
close: "Bezárás",
|
|
236
244
|
},
|
|
245
|
+
bulkActionBar: {
|
|
246
|
+
selected: (count) => `${n(count)} kijelölve`,
|
|
247
|
+
clear: "Kijelölés törlése",
|
|
248
|
+
cleared: "Kijelölés törölve",
|
|
249
|
+
},
|
|
237
250
|
swipeableRow: {
|
|
238
251
|
actions: "Sorműveletek",
|
|
239
252
|
},
|
|
@@ -373,6 +386,7 @@ export function uiKitLabelsHu(numberLocale = "hu-HU"): UiKitLabels {
|
|
|
373
386
|
"Húzással nagyíthat: a nagyjából négyzetes kijelölés mindkét tengelyt nagyítja, a hosszú, keskeny csak a saját tengelyét. Dupla kattintással visszaállíthatja.",
|
|
374
387
|
empty: "Nincs adat",
|
|
375
388
|
legend: "Adatsorok",
|
|
389
|
+
points: "Diagramértékek",
|
|
376
390
|
},
|
|
377
391
|
confirmDialog: {
|
|
378
392
|
confirm: "Megerősítés",
|
|
@@ -380,6 +394,7 @@ export function uiKitLabelsHu(numberLocale = "hu-HU"): UiKitLabels {
|
|
|
380
394
|
},
|
|
381
395
|
floatingPanel: {
|
|
382
396
|
close: "Bezárás",
|
|
397
|
+
badge: (count) => `${n(count)} új`,
|
|
383
398
|
},
|
|
384
399
|
copyButton: {
|
|
385
400
|
copy: "Másolás",
|
|
@@ -388,6 +403,20 @@ export function uiKitLabelsHu(numberLocale = "hu-HU"): UiKitLabels {
|
|
|
388
403
|
copiedAnnouncement: "Vágólapra másolva",
|
|
389
404
|
failedAnnouncement: "Nem sikerült a vágólapra másolni",
|
|
390
405
|
},
|
|
406
|
+
list: {
|
|
407
|
+
unread: "Olvasatlan",
|
|
408
|
+
opensInNewTab: "új lapon nyílik meg",
|
|
409
|
+
},
|
|
410
|
+
breadcrumbs: {
|
|
411
|
+
label: "Morzsamenü",
|
|
412
|
+
showAll: "Teljes útvonal megjelenítése",
|
|
413
|
+
},
|
|
414
|
+
toast: {
|
|
415
|
+
close: "Értesítés bezárása",
|
|
416
|
+
notifications: "Értesítések",
|
|
417
|
+
undo: "Visszavonás",
|
|
418
|
+
redo: "Újra",
|
|
419
|
+
},
|
|
391
420
|
};
|
|
392
421
|
}
|
|
393
422
|
|
package/src/i18n/locales/it.ts
CHANGED
|
@@ -125,6 +125,14 @@ export function uiKitLabelsIt(numberLocale = "it-IT"): UiKitLabels {
|
|
|
125
125
|
panel: "Scegli un mese",
|
|
126
126
|
month: (monthYear) => monthYear,
|
|
127
127
|
},
|
|
128
|
+
calendarHeatmap: {
|
|
129
|
+
grid: "Valori giornalieri",
|
|
130
|
+
day: (date, value) => `${date}: ${value}`,
|
|
131
|
+
less: "Meno",
|
|
132
|
+
more: "Più",
|
|
133
|
+
truncated: (count) =>
|
|
134
|
+
`Vengono mostrati i giorni più recenti; ${count === 1 ? "1 giorno precedente non è mostrato" : `${n(count)} giorni precedenti non sono mostrati`}.`,
|
|
135
|
+
},
|
|
128
136
|
datePicker: {
|
|
129
137
|
apply: "Applica",
|
|
130
138
|
cancel: "Annulla",
|
|
@@ -237,6 +245,11 @@ export function uiKitLabelsIt(numberLocale = "it-IT"): UiKitLabels {
|
|
|
237
245
|
dialogFrame: {
|
|
238
246
|
close: "Chiudi",
|
|
239
247
|
},
|
|
248
|
+
bulkActionBar: {
|
|
249
|
+
selected: (count) => `${n(count)} ${count === 1 ? "selezionato" : "selezionati"}`,
|
|
250
|
+
clear: "Annulla selezione",
|
|
251
|
+
cleared: "Selezione annullata",
|
|
252
|
+
},
|
|
240
253
|
swipeableRow: {
|
|
241
254
|
actions: "Azioni della riga",
|
|
242
255
|
},
|
|
@@ -374,6 +387,7 @@ export function uiKitLabelsIt(numberLocale = "it-IT"): UiKitLabels {
|
|
|
374
387
|
"Trascina per ingrandire: una selezione più o meno quadrata ingrandisce entrambi gli assi, una lunga e sottile solo il proprio. Fai doppio clic per ripristinare.",
|
|
375
388
|
empty: "Nessun dato",
|
|
376
389
|
legend: "Serie",
|
|
390
|
+
points: "Valori del grafico",
|
|
377
391
|
},
|
|
378
392
|
confirmDialog: {
|
|
379
393
|
confirm: "Conferma",
|
|
@@ -381,6 +395,7 @@ export function uiKitLabelsIt(numberLocale = "it-IT"): UiKitLabels {
|
|
|
381
395
|
},
|
|
382
396
|
floatingPanel: {
|
|
383
397
|
close: "Chiudi",
|
|
398
|
+
badge: (count) => `${n(count)} ${plural(count, "nuovo", "nuovi")}`,
|
|
384
399
|
},
|
|
385
400
|
copyButton: {
|
|
386
401
|
copy: "Copia",
|
|
@@ -389,6 +404,20 @@ export function uiKitLabelsIt(numberLocale = "it-IT"): UiKitLabels {
|
|
|
389
404
|
copiedAnnouncement: "Copiato negli appunti",
|
|
390
405
|
failedAnnouncement: "Impossibile copiare negli appunti",
|
|
391
406
|
},
|
|
407
|
+
list: {
|
|
408
|
+
unread: "Non letto",
|
|
409
|
+
opensInNewTab: "si apre in una nuova scheda",
|
|
410
|
+
},
|
|
411
|
+
breadcrumbs: {
|
|
412
|
+
label: "Percorso di navigazione",
|
|
413
|
+
showAll: "Mostra percorso completo",
|
|
414
|
+
},
|
|
415
|
+
toast: {
|
|
416
|
+
close: "Chiudi notifica",
|
|
417
|
+
notifications: "Notifiche",
|
|
418
|
+
undo: "Annulla",
|
|
419
|
+
redo: "Ripeti",
|
|
420
|
+
},
|
|
392
421
|
};
|
|
393
422
|
}
|
|
394
423
|
|
package/src/i18n/locales/zh.ts
CHANGED
|
@@ -120,6 +120,14 @@ export function uiKitLabelsZh(numberLocale = "zh-CN"): UiKitLabels {
|
|
|
120
120
|
panel: "选择月份",
|
|
121
121
|
month: (monthYear) => monthYear,
|
|
122
122
|
},
|
|
123
|
+
calendarHeatmap: {
|
|
124
|
+
grid: "每日数值",
|
|
125
|
+
day: (date, value) => `${date}:${value}`,
|
|
126
|
+
less: "较少",
|
|
127
|
+
more: "较多",
|
|
128
|
+
truncated: (count) =>
|
|
129
|
+
`仅显示最近的日期;另有 ${n(count)} 天未显示。`,
|
|
130
|
+
},
|
|
123
131
|
datePicker: {
|
|
124
132
|
apply: "应用",
|
|
125
133
|
cancel: "取消",
|
|
@@ -231,6 +239,11 @@ export function uiKitLabelsZh(numberLocale = "zh-CN"): UiKitLabels {
|
|
|
231
239
|
dialogFrame: {
|
|
232
240
|
close: "关闭",
|
|
233
241
|
},
|
|
242
|
+
bulkActionBar: {
|
|
243
|
+
selected: (count) => `已选择 ${n(count)} 项`,
|
|
244
|
+
clear: "清除选择",
|
|
245
|
+
cleared: "已清除选择",
|
|
246
|
+
},
|
|
234
247
|
swipeableRow: {
|
|
235
248
|
actions: "行操作",
|
|
236
249
|
},
|
|
@@ -362,6 +375,7 @@ export function uiKitLabelsZh(numberLocale = "zh-CN"): UiKitLabels {
|
|
|
362
375
|
"拖动以缩放:近似正方形的选区同时缩放两条坐标轴,细长的选区只缩放其所沿的那条轴。双击可重置。",
|
|
363
376
|
empty: "无数据",
|
|
364
377
|
legend: "数据系列",
|
|
378
|
+
points: "图表数值",
|
|
365
379
|
},
|
|
366
380
|
confirmDialog: {
|
|
367
381
|
confirm: "确认",
|
|
@@ -369,6 +383,7 @@ export function uiKitLabelsZh(numberLocale = "zh-CN"): UiKitLabels {
|
|
|
369
383
|
},
|
|
370
384
|
floatingPanel: {
|
|
371
385
|
close: "关闭",
|
|
386
|
+
badge: (count) => `${n(count)} 条新内容`,
|
|
372
387
|
},
|
|
373
388
|
copyButton: {
|
|
374
389
|
copy: "复制",
|
|
@@ -377,6 +392,20 @@ export function uiKitLabelsZh(numberLocale = "zh-CN"): UiKitLabels {
|
|
|
377
392
|
copiedAnnouncement: "已复制到剪贴板",
|
|
378
393
|
failedAnnouncement: "无法复制到剪贴板",
|
|
379
394
|
},
|
|
395
|
+
list: {
|
|
396
|
+
unread: "未读",
|
|
397
|
+
opensInNewTab: "在新标签页中打开",
|
|
398
|
+
},
|
|
399
|
+
breadcrumbs: {
|
|
400
|
+
label: "面包屑导航",
|
|
401
|
+
showAll: "显示完整路径",
|
|
402
|
+
},
|
|
403
|
+
toast: {
|
|
404
|
+
close: "关闭通知",
|
|
405
|
+
notifications: "通知",
|
|
406
|
+
undo: "撤销",
|
|
407
|
+
redo: "重做",
|
|
408
|
+
},
|
|
380
409
|
};
|
|
381
410
|
}
|
|
382
411
|
|
package/src/index.ts
CHANGED
|
@@ -56,6 +56,8 @@ export * from "./theme/palette-store";
|
|
|
56
56
|
|
|
57
57
|
// ── components ───────────────────────────────────────────────────────────────
|
|
58
58
|
export * from "./components/ui";
|
|
59
|
+
// The label-ABOVE field group (label, hint, error, required), inside wizards or out.
|
|
60
|
+
export * from "./components/field";
|
|
59
61
|
export * from "./components/search-field";
|
|
60
62
|
export * from "./components/dropdown";
|
|
61
63
|
export * from "./components/popover";
|
|
@@ -96,6 +98,8 @@ export * from "./components/danger-confirm";
|
|
|
96
98
|
export * from "./components/confirm-dialog";
|
|
97
99
|
// A non-modal corner panel and its round trigger (keksdose's assistant launcher).
|
|
98
100
|
export * from "./components/floating-panel";
|
|
101
|
+
// The count / clear / actions bar a selection brings up (keksdose's three copies).
|
|
102
|
+
export * from "./components/bulk-action-bar";
|
|
99
103
|
export * from "./components/swatch-picker";
|
|
100
104
|
export * from "./components/icon-picker";
|
|
101
105
|
export * from "./components/choice-card";
|
|
@@ -124,6 +128,8 @@ export * from "./components/series-chart-labels";
|
|
|
124
128
|
export * from "./components/account-settings";
|
|
125
129
|
export * from "./components/alert-banner";
|
|
126
130
|
export * from "./components/toggle-group";
|
|
131
|
+
// A wrapping set of links/buttons marked `aria-current` — Tabs-like looks, not tabs.
|
|
132
|
+
export * from "./components/nav-pills";
|
|
127
133
|
// A pill carrying one VALUE — inert, a link, or a toggle, depending on which prop it is
|
|
128
134
|
// given — and the list field built from it. Distinct from Button on purpose: a row of
|
|
129
135
|
// buttons reads as "choose an action", a row of chips as "here are the things".
|
|
@@ -135,6 +141,7 @@ export * from "./components/full-bleed-dialog";
|
|
|
135
141
|
export * from "./components/grouped-picker";
|
|
136
142
|
export * from "./components/file-dropzone";
|
|
137
143
|
export * from "./components/mini-calendar";
|
|
144
|
+
export * from "./components/calendar-heatmap";
|
|
138
145
|
export * from "./components/date-picker";
|
|
139
146
|
export * from "./components/tree-view";
|
|
140
147
|
export * from "./components/chart";
|
|
@@ -151,6 +158,30 @@ export * from "./components/separator";
|
|
|
151
158
|
// Named: scroll-area.tsx also holds the overflow hook and scrollbar class Table shares.
|
|
152
159
|
export { ScrollArea } from "./components/scroll-area";
|
|
153
160
|
export type { ScrollAreaProps } from "./components/scroll-area";
|
|
161
|
+
// 0.10.0 rows, menu rows, text primitives and page chrome the apps drew by hand.
|
|
162
|
+
export * from "./components/list";
|
|
163
|
+
export * from "./components/menu-item";
|
|
164
|
+
export * from "./components/text";
|
|
165
|
+
export * from "./components/status-dot";
|
|
166
|
+
export * from "./components/page-header";
|
|
167
|
+
export * from "./components/breadcrumbs";
|
|
168
|
+
// The toast layer over sonner (an OPTIONAL peer, loaded lazily): `toast` mirrors sonner's
|
|
169
|
+
// API so apps migrate by swapping the import; `<Toaster>` carries the placement, theme,
|
|
170
|
+
// tones and z-index both apps had wired by hand.
|
|
171
|
+
export { toast, Toaster, DEFAULT_TOAST_LABELS, TOAST_ACTION_DURATION } from "./components/toast";
|
|
172
|
+
export type {
|
|
173
|
+
ToastId,
|
|
174
|
+
ToastAction,
|
|
175
|
+
ToastOptions,
|
|
176
|
+
ToastPromiseOptions,
|
|
177
|
+
ToastUndoOptions,
|
|
178
|
+
ToastRedoOptions,
|
|
179
|
+
ToastLabels,
|
|
180
|
+
ToastPosition,
|
|
181
|
+
ToastSwipeDirection,
|
|
182
|
+
ToasterOffset,
|
|
183
|
+
ToasterProps,
|
|
184
|
+
} from "./components/toast";
|
|
154
185
|
|
|
155
186
|
// ── data-table suite ─────────────────────────────────────────────────────────
|
|
156
187
|
export * from "./components/data-table-labels";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Internal (not exported from the package): the Tooltip's auto-portal check. The
|
|
2
|
+
* attribute name itself IS exported, as `CLIPS_ATTRIBUTE` from the tooltip module. */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The explicit "this element clips or scrolls" marker. A container carrying it counts
|
|
6
|
+
* as clipping whatever its computed `overflow` says.
|
|
7
|
+
*
|
|
8
|
+
* Why a marker as well as the computed style: the kit's containers get their
|
|
9
|
+
* `overflow` from Tailwind classes, and jsdom computes no stylesheet — so under test
|
|
10
|
+
* every scroller reads `overflow: visible`, the Tooltip stays in place, and its always-
|
|
11
|
+
* mounted bubble shows up in the cell's text (keksdose 0.10: "CheckingChecking"). The
|
|
12
|
+
* browser and the test then disagreed about where the bubble lives, and apps pinned
|
|
13
|
+
* `portal` on every tooltip in a table to make them agree. The kit's own scrollers
|
|
14
|
+
* (DataTable's body, Table's wrapper) carry the marker, so the answer is the same in
|
|
15
|
+
* both; an app marks its own with `{ [CLIPS_ATTRIBUTE]: "" }` or a literal `data-clips`.
|
|
16
|
+
*/
|
|
17
|
+
export const CLIPS_ATTRIBUTE = "data-clips";
|
|
18
|
+
|
|
19
|
+
/** Whether anything between `el` and `<body>` clips or scrolls its content — the
|
|
20
|
+
* containers an absolutely positioned bubble would be cut off by, or would widen.
|
|
21
|
+
* Either the computed `overflow` says so or the element carries
|
|
22
|
+
* {@link CLIPS_ATTRIBUTE}. `<body>` and `<html>` are not counted: their `overflow`
|
|
23
|
+
* belongs to the viewport (a dialog's scroll lock sets it), and the viewport clips a
|
|
24
|
+
* portalled bubble just the same. */
|
|
25
|
+
export function hasClippingAncestor(el: Element | null): boolean {
|
|
26
|
+
if (typeof window === "undefined" || !el) return false;
|
|
27
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
28
|
+
if (node === document.body || node === document.documentElement) return false;
|
|
29
|
+
if (node.hasAttribute(CLIPS_ATTRIBUTE)) return true;
|
|
30
|
+
const style = window.getComputedStyle(node);
|
|
31
|
+
if (style.overflowX !== "visible" || style.overflowY !== "visible") return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
package/src/lib/dates.ts
CHANGED
|
@@ -149,6 +149,43 @@ export function addDaysIso(iso: string, days: number): string {
|
|
|
149
149
|
return toLocalIso(d);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* `d` moved by whole months, keeping the day of the month where the target has one.
|
|
154
|
+
* `setMonth` alone ROLLS OVER — 31 January + 1 month is 3 March — which would skip
|
|
155
|
+
* February entirely for anyone paging through the year with PageDown. Returns a new
|
|
156
|
+
* Date; `d` is not touched.
|
|
157
|
+
*/
|
|
158
|
+
export function addMonthsClamped(d: Date, months: number): Date {
|
|
159
|
+
const day = d.getDate();
|
|
160
|
+
const out = new Date(d.getFullYear(), d.getMonth() + months, 1);
|
|
161
|
+
const lastOfTarget = new Date(out.getFullYear(), out.getMonth() + 1, 0).getDate();
|
|
162
|
+
out.setDate(Math.min(day, lastOfTarget));
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The first day of the week in `locale`, as a `Date#getDay` index (0 = Sunday).
|
|
168
|
+
*
|
|
169
|
+
* `Intl.Locale#getWeekInfo()` is the standard spelling; V8 shipped it first as the
|
|
170
|
+
* `weekInfo` accessor, and Firefox has neither yet — hence both reads and a Monday
|
|
171
|
+
* fallback, which is ISO 8601. Its `firstDay` counts 1 = Monday … 7 = Sunday, so `% 7`
|
|
172
|
+
* maps it onto `getDay`. `undefined` asks for the runtime's default locale.
|
|
173
|
+
*/
|
|
174
|
+
export function localeWeekStart(locale: string | undefined): 0 | 1 | 2 | 3 | 4 | 5 | 6 {
|
|
175
|
+
try {
|
|
176
|
+
const tag = locale ?? new Intl.DateTimeFormat().resolvedOptions().locale;
|
|
177
|
+
const loc = new Intl.Locale(tag) as Intl.Locale & {
|
|
178
|
+
getWeekInfo?: () => { firstDay: number };
|
|
179
|
+
weekInfo?: { firstDay: number };
|
|
180
|
+
};
|
|
181
|
+
const firstDay = (loc.getWeekInfo?.() ?? loc.weekInfo)?.firstDay;
|
|
182
|
+
if (typeof firstDay === "number") return (firstDay % 7) as 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
183
|
+
} catch {
|
|
184
|
+
// A malformed tag throws from `Intl.Locale`; a calendar still has to render.
|
|
185
|
+
}
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
152
189
|
/** Whether two Dates fall on the same local calendar day. */
|
|
153
190
|
export function sameYmd(a: Date, b: Date): boolean {
|
|
154
191
|
return (
|