gridsmith-ui 0.24.0 → 0.25.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.
Files changed (78) hide show
  1. package/README.md +8 -6
  2. package/dist/MentionList-CoNBRFGR.d.ts +8 -0
  3. package/dist/charts.d.ts +42 -1
  4. package/dist/charts.js +320 -89
  5. package/dist/charts.js.map +1 -1
  6. package/dist/chat.js +5 -4
  7. package/dist/chat.js.map +1 -1
  8. package/dist/{chunk-MV7JXWXK.js → chunk-3CUKJ4VP.js} +7 -6
  9. package/dist/chunk-3CUKJ4VP.js.map +1 -0
  10. package/dist/{chunk-SBTBMAIU.js → chunk-FHMCAOAH.js} +6 -6
  11. package/dist/{chunk-SBTBMAIU.js.map → chunk-FHMCAOAH.js.map} +1 -1
  12. package/dist/chunk-HP7WUZPK.js +80 -0
  13. package/dist/chunk-HP7WUZPK.js.map +1 -0
  14. package/dist/{chunk-4LDYR7QP.js → chunk-HYMXAIXN.js} +53 -13
  15. package/dist/chunk-HYMXAIXN.js.map +1 -0
  16. package/dist/{chunk-7TOJ4G7S.js → chunk-HZIP4EJI.js} +14 -9
  17. package/dist/chunk-HZIP4EJI.js.map +1 -0
  18. package/dist/{chunk-CXMV7SXJ.js → chunk-MD2EFMES.js} +5 -77
  19. package/dist/chunk-MD2EFMES.js.map +1 -0
  20. package/dist/{chunk-IVCVNAXG.js → chunk-OTCEJN64.js} +3 -3
  21. package/dist/{chunk-IVCVNAXG.js.map → chunk-OTCEJN64.js.map} +1 -1
  22. package/dist/{chunk-SVP2IG4S.js → chunk-QGSCF7PN.js} +7 -7
  23. package/dist/chunk-QGSCF7PN.js.map +1 -0
  24. package/dist/{chunk-2PWGJ4PK.js → chunk-QM4SJKWV.js} +11 -6
  25. package/dist/chunk-QM4SJKWV.js.map +1 -0
  26. package/dist/chunk-RWKCAKN3.js +209 -0
  27. package/dist/chunk-RWKCAKN3.js.map +1 -0
  28. package/dist/{chunk-6XAU44U4.js → chunk-W7GCEJEH.js} +9 -22
  29. package/dist/chunk-W7GCEJEH.js.map +1 -0
  30. package/dist/{chunk-NCIZQYXQ.js → chunk-X2HEV7FB.js} +33 -3
  31. package/dist/chunk-X2HEV7FB.js.map +1 -0
  32. package/dist/data-grid.d.ts +1 -1
  33. package/dist/data-grid.js +12 -11
  34. package/dist/data-grid.js.map +1 -1
  35. package/dist/editor-mentions.d.ts +30 -0
  36. package/dist/editor-mentions.js +160 -0
  37. package/dist/editor-mentions.js.map +1 -0
  38. package/dist/editor.d.ts +23 -3
  39. package/dist/editor.js +57 -8
  40. package/dist/editor.js.map +1 -1
  41. package/dist/{feather-2JFSFLXN.js → feather-W26ERBQV.js} +11 -3
  42. package/dist/feather-W26ERBQV.js.map +1 -0
  43. package/dist/{heroicons-4AQ4YBVG.js → heroicons-MY43466C.js} +21 -7
  44. package/dist/heroicons-MY43466C.js.map +1 -0
  45. package/dist/icons.d.ts +11 -4
  46. package/dist/icons.js +1 -1
  47. package/dist/index.d.ts +150 -28
  48. package/dist/index.js +299 -218
  49. package/dist/index.js.map +1 -1
  50. package/dist/kanban.js +6 -5
  51. package/dist/kanban.js.map +1 -1
  52. package/dist/{lucide-RZC2FEMS.js → lucide-CMPVM3PS.js} +11 -3
  53. package/dist/lucide-CMPVM3PS.js.map +1 -0
  54. package/dist/{phosphor-CEN25FLM.js → phosphor-RMHZOW2O.js} +11 -3
  55. package/dist/phosphor-RMHZOW2O.js.map +1 -0
  56. package/dist/resizable.js +8 -7
  57. package/dist/resizable.js.map +1 -1
  58. package/dist/roots.css +10 -0
  59. package/dist/{tabler-YXXC7Y6B.js → tabler-MJVEYHA5.js} +11 -3
  60. package/dist/tabler-MJVEYHA5.js.map +1 -0
  61. package/dist/{use-pagination-DiJo0aW5.d.ts → use-pagination-BnKOnBdz.d.ts} +3 -0
  62. package/dist/virtualized.d.ts +1 -1
  63. package/dist/virtualized.js +6 -5
  64. package/dist/virtualized.js.map +1 -1
  65. package/package.json +29 -21
  66. package/dist/chunk-2PWGJ4PK.js.map +0 -1
  67. package/dist/chunk-4LDYR7QP.js.map +0 -1
  68. package/dist/chunk-6XAU44U4.js.map +0 -1
  69. package/dist/chunk-7TOJ4G7S.js.map +0 -1
  70. package/dist/chunk-CXMV7SXJ.js.map +0 -1
  71. package/dist/chunk-MV7JXWXK.js.map +0 -1
  72. package/dist/chunk-NCIZQYXQ.js.map +0 -1
  73. package/dist/chunk-SVP2IG4S.js.map +0 -1
  74. package/dist/feather-2JFSFLXN.js.map +0 -1
  75. package/dist/heroicons-4AQ4YBVG.js.map +0 -1
  76. package/dist/lucide-RZC2FEMS.js.map +0 -1
  77. package/dist/phosphor-CEN25FLM.js.map +0 -1
  78. package/dist/tabler-YXXC7Y6B.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,30 +1,33 @@
1
- import { useAppShell, REACT_VERSION_PROBLEM, Breadcrumbs, useCrumbFollow, crumbGoes, useOverlayMark, useDirtyGuard, useScrollbarInset, DrawerFooterCtx, OverlayMarkScope, OverlayCloseCtx, insetLessScrollbar, DiscardConfirm, OVERLAY_ROOT_ATTR, OverlayMarkCtx, useCompact, useElementWidth, DrawerPanel, useCloseSettle, Drawer, useRememberedWidth, pxOf, ResizeEdge, defaultMaxWidth } from './chunk-MV7JXWXK.js';
2
- export { AppShell, Breadcrumbs, Drawer, SkipLink, useAppShell, useUnsavedChanges } from './chunk-MV7JXWXK.js';
3
- import { Skeleton, TITLE_TEXT } from './chunk-NCIZQYXQ.js';
4
- export { Skeleton } from './chunk-NCIZQYXQ.js';
1
+ import { inferColumnKinds, useCardsSwitch, CARDS_BELOW, kindOfRenderedText, CardValue } from './chunk-OTCEJN64.js';
2
+ import { useWholeListCheck, pagerPart, Pagination, Input, CHECK_FILL, Dropdown, FilterRowContext, SWITCH_KNOB_ON, SWITCH_KNOB_OFF, SWITCH_KNOB_MOTION, SWITCH_TRACK_ON, SWITCH_TRACK_OFF, useFieldControl, useField, Label, InlineFieldError, AddAnotherRowCtx, Field } from './chunk-W7GCEJEH.js';
3
+ export { Dropdown, Field, InlineFieldError, Input, Label, NumberInput, Pagination, Popover, Textarea, Toggle, usePagination } from './chunk-W7GCEJEH.js';
4
+ import { useAppShell, REACT_VERSION_PROBLEM, Breadcrumbs, useCrumbFollow, crumbGoes, useOverlayMark, useDirtyGuard, useScrollbarInset, DrawerFooterCtx, OverlayMarkScope, OverlayCloseCtx, insetLessScrollbar, DiscardConfirm, OVERLAY_ROOT_ATTR, OverlayMarkCtx, useCompact, useElementWidth, DrawerPanel, useCloseSettle, Drawer, useRememberedWidth, pxOf, ResizeEdge, defaultMaxWidth } from './chunk-3CUKJ4VP.js';
5
+ export { AppShell, Breadcrumbs, Drawer, SkipLink, useAppShell, useUnsavedChanges } from './chunk-3CUKJ4VP.js';
6
+ import { Button, ControlSizeContext, triggerType, Spinner, useShellPreferences, PREFERENCE_HOUSE_DEFAULTS, preferenceActionKey } from './chunk-HZIP4EJI.js';
7
+ export { Button, ButtonSizeContext, ControlSizeContext, PreferencesContext, Spinner, preferenceActionKey, usePreferences } from './chunk-HZIP4EJI.js';
8
+ import { Skeleton, TITLE_TEXT, formatLocale } from './chunk-X2HEV7FB.js';
9
+ export { Skeleton } from './chunk-X2HEV7FB.js';
5
10
  import { useScrollEdges, EDGE_FADE } from './chunk-3BRQRKDO.js';
6
- import { Link } from './chunk-SVP2IG4S.js';
7
- export { CodeBlock, Divider, Link } from './chunk-SVP2IG4S.js';
8
- import { useFillHeight, FillContext } from './chunk-2YSEME33.js';
9
- import { Badge } from './chunk-SBTBMAIU.js';
10
- export { Badge } from './chunk-SBTBMAIU.js';
11
- import { inferColumnKinds, useCardsSwitch, CARDS_BELOW, kindOfRenderedText, CardValue } from './chunk-IVCVNAXG.js';
12
- import { useWholeListCheck, pagerPart, Pagination, Input, CHECK_FILL, Dropdown, FilterRowContext, SWITCH_KNOB_ON, SWITCH_KNOB_OFF, SWITCH_KNOB_MOTION, SWITCH_TRACK_ON, SWITCH_TRACK_OFF, useFieldControl, useField, warnOnce, Label, InlineFieldError, AddAnotherRowCtx, Field } from './chunk-6XAU44U4.js';
13
- export { Dropdown, Field, InlineFieldError, Input, Label, NumberInput, Pagination, Popover, Textarea, Toggle, usePagination } from './chunk-6XAU44U4.js';
14
- import { Button, ControlSizeContext, triggerType, Spinner, useShellPreferences, preferenceActionKey } from './chunk-7TOJ4G7S.js';
15
- export { Button, ButtonSizeContext, ControlSizeContext, PreferencesContext, Spinner, preferenceActionKey, usePreferences } from './chunk-7TOJ4G7S.js';
16
11
  import { useBreakpoint, readBreakpointPx } from './chunk-CRQ6KCRD.js';
17
12
  export { BreakpointWidthProvider, useBreakpoint } from './chunk-CRQ6KCRD.js';
18
13
  import { FormChangeCtx, useReportedChange, useOptionalFormContext, FormCtx } from './chunk-XVB55M3N.js';
19
14
  export { useFormContext } from './chunk-XVB55M3N.js';
20
- import { CardSurfaceCtx, useScrollsInside, SplitPaneCtx, PageActionsCtx, SurfaceBoundary, useFramesItself, TableCardCtx } from './chunk-2PWGJ4PK.js';
15
+ import { Avatar, foldForSearch, useActiveOptionInView, shownMentions, matchMentions, mentionOptionId, MentionList, initialsOf } from './chunk-RWKCAKN3.js';
16
+ export { Avatar } from './chunk-RWKCAKN3.js';
17
+ import { Link } from './chunk-QGSCF7PN.js';
18
+ export { CodeBlock, Divider, Link } from './chunk-QGSCF7PN.js';
19
+ import { useFillHeight, FillContext } from './chunk-2YSEME33.js';
20
+ import { CardSurfaceCtx, useScrollsInside, SplitPaneCtx, RowsCtx, PageActionsCtx, SurfaceBoundary, useFramesItself, TableCardCtx } from './chunk-QM4SJKWV.js';
21
21
  import { FOCUSABLE, usePopupFocus, FIELD, ZOOM_KEYS, useOverlayLayer, useFocusTrap, useFocusBeforeOpen, rememberFocus, focusInitial, OVERLAY_CLOSE_ATTR, rovingTabStop, useGridKeyboard, focusAfterRemoval, useNonModalDialog, useReturnFocus, useCloseOnFocusOut } from './chunk-JXANCXK6.js';
22
22
  export { useGridKeyboard } from './chunk-JXANCXK6.js';
23
- import { useTextOverflow, Tooltip, usePosition } from './chunk-CXMV7SXJ.js';
24
- export { Tooltip, useTextOverflow } from './chunk-CXMV7SXJ.js';
23
+ import { Badge } from './chunk-FHMCAOAH.js';
24
+ export { Badge } from './chunk-FHMCAOAH.js';
25
+ import { useTextOverflow, Tooltip } from './chunk-MD2EFMES.js';
26
+ export { Tooltip, useTextOverflow } from './chunk-MD2EFMES.js';
25
27
  import { mergeRefs, Slot } from './chunk-7Q46JXSK.js';
28
+ import { Icon, slotIcon, warnOnce } from './chunk-HYMXAIXN.js';
29
+ import { usePosition } from './chunk-HP7WUZPK.js';
26
30
  import { useLatest } from './chunk-WH2FUFAC.js';
27
- import { Icon } from './chunk-4LDYR7QP.js';
28
31
  import { cn, GLASS_SURFACE, GLASS_BACKDROP, GLASS_DROPDOWN, lockBodyScroll, unlockBodyScroll, OVERLAY_SURFACE, GLASS_OVERLAY, ERROR_HAS_FOCUS_RING, HAS_FOCUS_RING, ACTIVE_RING, ERROR_ACTIVE_RING, ERROR_FOCUS_RING, FOCUS_RING, FOCUS_WITHIN_RING } from './chunk-M2QRNBDQ.js';
29
32
  import { createContext, forwardRef, useState, useRef, useCallback, useLayoutEffect, useMemo, useContext, isValidElement, useId, memo, useEffect, useImperativeHandle, Children, Fragment as Fragment$1, cloneElement, useSyncExternalStore } from 'react';
30
33
  import { createPortal, flushSync } from 'react-dom';
@@ -227,7 +230,7 @@ var TEXT_SIZE = {
227
230
  md: "text-sm",
228
231
  lg: "text-base"
229
232
  };
230
- function Combobox({ value, onChange: onChangeProp, options, placeholder = "Search\u2026", disabled, loading = false, className, ref, container, error = false, size: sizeProp, ...wiring }) {
233
+ function Combobox({ value, onChange: onChangeProp, options, placeholder = "Search\u2026", disabled, loading = false, className, ref, container, error = false, size: sizeProp, "aria-label": ariaLabel, ...wiring }) {
231
234
  const onChange = useReportedChange(onChangeProp, value);
232
235
  const contextSize = useContext(ControlSizeContext);
233
236
  const control = useFieldControl({ ...wiring, error: error || void 0 });
@@ -244,8 +247,9 @@ function Combobox({ value, onChange: onChangeProp, options, placeholder = "Searc
244
247
  const listboxId = useId();
245
248
  const pos = usePosition(triggerRef, listRef, open, { side: "bottom", align: "start", offset: 4, flip: true });
246
249
  const filtered = options.filter(
247
- (o) => !o.disabled && o.label.toLowerCase().includes(query.toLowerCase())
250
+ (o) => !o.disabled && foldForSearch(o.label).includes(foldForSearch(query))
248
251
  );
252
+ useActiveOptionInView(listRef, open && filtered[highlightIdx] ? `${listboxId}-opt-${highlightIdx}` : void 0);
249
253
  const selectedLabel = options.find((o) => o.value === value)?.label ?? "";
250
254
  const { ref: overflowRef, isTruncated: labelTruncated } = useTextOverflow({ lines: 1, content: selectedLabel, disabled: open });
251
255
  const [prevQuery, setPrevQuery] = useState(query);
@@ -359,6 +363,7 @@ function Combobox({ value, onChange: onChangeProp, options, placeholder = "Searc
359
363
  id: control.id,
360
364
  role: "combobox",
361
365
  "aria-labelledby": wiring["aria-labelledby"],
366
+ "aria-label": control.labelId ? void 0 : ariaLabel,
362
367
  "aria-describedby": control.describedBy,
363
368
  "aria-invalid": control.invalid || void 0,
364
369
  "aria-required": control.required || void 0,
@@ -454,6 +459,165 @@ function Combobox({ value, onChange: onChangeProp, options, placeholder = "Searc
454
459
  ] });
455
460
  return /* @__PURE__ */ jsx(Tooltip, { content: selectedLabel, disabled: !labelTruncated || open, children: triggerContent });
456
461
  }
462
+ function canonicalTimeZone(zone) {
463
+ try {
464
+ return new Intl.DateTimeFormat("en-US", { timeZone: zone }).resolvedOptions().timeZone;
465
+ } catch {
466
+ return zone;
467
+ }
468
+ }
469
+ function browserTimeZone() {
470
+ try {
471
+ return canonicalTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC");
472
+ } catch {
473
+ return "UTC";
474
+ }
475
+ }
476
+ function timeZoneOffset(zone, at = /* @__PURE__ */ new Date()) {
477
+ try {
478
+ return new Intl.DateTimeFormat(formatLocale(), { timeZone: zone, timeZoneName: "shortOffset" }).formatToParts(at).find((p) => p.type === "timeZoneName")?.value ?? "";
479
+ } catch {
480
+ return "";
481
+ }
482
+ }
483
+ function timeZones() {
484
+ const listed = typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : [];
485
+ const zones = [...new Set(listed.map(canonicalTimeZone))].filter((z) => z !== "UTC").sort((a, b) => a.localeCompare(b));
486
+ return ["UTC", ...zones];
487
+ }
488
+ var labelOf = (zone, at) => {
489
+ const offset = timeZoneOffset(zone, at);
490
+ return offset ? `${zone.replace(/_/g, " ")} (${offset})` : zone.replace(/_/g, " ");
491
+ };
492
+ var HOUR = 36e5;
493
+ var zoneList = null;
494
+ function zoneOptions() {
495
+ const now = Date.now();
496
+ if (!zoneList || now - zoneList.at > HOUR) {
497
+ const at = new Date(now);
498
+ zoneList = { at: now, options: timeZones().map((zone) => ({ value: zone, label: labelOf(zone, at) })) };
499
+ }
500
+ return zoneList.options;
501
+ }
502
+ function TimezoneSelect({ value, onChange, placeholder = "Search time zones\u2026", ...rest }) {
503
+ const zones = zoneOptions();
504
+ const stored = value ? canonicalTimeZone(value) : "";
505
+ const options = useMemo(() => {
506
+ if (!stored) {
507
+ const mine = browserTimeZone();
508
+ const label = zones.find((o) => o.value === mine)?.label ?? labelOf(mine, /* @__PURE__ */ new Date());
509
+ return [{ value: mine, label: `${label} \xB7 your time zone` }, ...zones.filter((o) => o.value !== mine)];
510
+ }
511
+ return zones.some((o) => o.value === stored) ? zones : [{ value: stored, label: labelOf(stored, /* @__PURE__ */ new Date()) }, ...zones];
512
+ }, [zones, stored]);
513
+ return /* @__PURE__ */ jsx(Combobox, { value: stored, onChange, options, placeholder, ...rest });
514
+ }
515
+ var MINUTE = 6e4;
516
+ var HOUR2 = 60 * MINUTE;
517
+ var DAY = 24 * HOUR2;
518
+ var LONGEST_WAIT = DAY;
519
+ var CONTROL_ANCESTOR = 'a[href], button, summary, label, [role="button"], [role="link"], [role="option"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="tab"], [role="treeitem"], [role="row"], [role="gridcell"], [role="checkbox"], [role="radio"], [role="switch"]';
520
+ var noChange = () => () => {
521
+ };
522
+ var inBrowser = () => true;
523
+ var onServer = () => false;
524
+ function toMillis(time) {
525
+ if (time instanceof Date) return time.getTime();
526
+ if (typeof time === "number") return time;
527
+ if (typeof time !== "string") return NaN;
528
+ const day = /^(\d{4})-(\d{2})-(\d{2})$/.exec(time.trim());
529
+ if (day) return new Date(Number(day[1]), Number(day[2]) - 1, Number(day[3])).getTime();
530
+ return Date.parse(time);
531
+ }
532
+ function thresholdOf(hours, from) {
533
+ if (typeof hours === "number" && Number.isFinite(hours) && hours >= 0) return hours;
534
+ const house = PREFERENCE_HOUSE_DEFAULTS.relativeThresholdHours;
535
+ warnOnce(from, `a threshold of ${String(hours)} isn't a number of hours, so the house's ${house} is used.`);
536
+ return house;
537
+ }
538
+ function midnight(t) {
539
+ const d = new Date(t);
540
+ d.setHours(0, 0, 0, 0);
541
+ return d.getTime();
542
+ }
543
+ function formatRelativeTime(time, options) {
544
+ const at = toMillis(time);
545
+ if (!Number.isFinite(at)) return "";
546
+ const now = options.now ?? Date.now();
547
+ const diff = at - now;
548
+ const age = Math.abs(diff);
549
+ if (age > thresholdOf(options.thresholdHours, "formatRelativeTime") * HOUR2) return new Intl.DateTimeFormat(formatLocale(), { dateStyle: "medium", timeStyle: "short" }).format(at);
550
+ const rtf = new Intl.RelativeTimeFormat(formatLocale(), { numeric: "auto" });
551
+ if (age < MINUTE) return rtf.format(0, "second");
552
+ if (age < HOUR2) return rtf.format(Math.trunc(diff / MINUTE), "minute");
553
+ if (age < DAY) return rtf.format(Math.trunc(diff / HOUR2), "hour");
554
+ return rtf.format(Math.round((midnight(at) - midnight(now)) / DAY), "day");
555
+ }
556
+ function useRelativeTimeFormat() {
557
+ const thresholdHours = useShellPreferences().relativeThresholdHours ?? PREFERENCE_HOUSE_DEFAULTS.relativeThresholdHours;
558
+ return (time) => formatRelativeTime(time, { thresholdHours });
559
+ }
560
+ function formatFullTime(time) {
561
+ const at = toMillis(time);
562
+ return Number.isFinite(at) ? new Intl.DateTimeFormat(formatLocale(), { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "2-digit", timeZoneName: "short" }).format(at) : "";
563
+ }
564
+ function nextChange(at, now, threshold) {
565
+ const diff = at - now;
566
+ const age = Math.abs(diff);
567
+ let wait;
568
+ if (age > threshold) {
569
+ if (diff <= 0) return null;
570
+ wait = age - threshold + 1;
571
+ } else {
572
+ const step = age < HOUR2 ? MINUTE : HOUR2;
573
+ const untilStep = diff > 0 ? age % step + 1 : step - age % step;
574
+ wait = diff > 0 ? untilStep : Math.min(untilStep, threshold - age + 1);
575
+ }
576
+ return Number.isFinite(wait) ? Math.min(Math.max(1e3, wait), LONGEST_WAIT) : null;
577
+ }
578
+ function RelativeTime({ time, thresholdHours, className }) {
579
+ const shellThreshold = useShellPreferences().relativeThresholdHours;
580
+ const hours = thresholdOf(thresholdHours ?? shellThreshold ?? PREFERENCE_HOUSE_DEFAULTS.relativeThresholdHours, "RelativeTime");
581
+ const at = toMillis(time);
582
+ if (!Number.isFinite(at)) {
583
+ warnOnce("RelativeTime", `${JSON.stringify(time) ?? String(time)} isn't a time (an ISO string, a Date or milliseconds), so nothing is drawn.`);
584
+ return null;
585
+ }
586
+ return /* @__PURE__ */ jsx(RelativeTimeAt, { at, hours, className }, `${at}:${hours}`);
587
+ }
588
+ function RelativeTimeAt({ at, hours, className }) {
589
+ const inRows = useContext(RowsCtx);
590
+ const [now, setNow] = useState(() => Date.now());
591
+ const [inControl, setInControl] = useState(false);
592
+ const placed = useCallback((el) => {
593
+ const inside = !!el?.parentElement?.closest(CONTROL_ANCESTOR);
594
+ if (inside) el.removeAttribute("tabindex");
595
+ if (el) setInControl(inside);
596
+ }, []);
597
+ const mounted = useSyncExternalStore(noChange, inBrowser, onServer);
598
+ useEffect(() => {
599
+ const wait = nextChange(at, now, hours * HOUR2);
600
+ if (wait === null) return;
601
+ const timer = setTimeout(() => setNow(Date.now()), wait);
602
+ return () => clearTimeout(timer);
603
+ }, [at, now, hours]);
604
+ const full = formatFullTime(at);
605
+ return /* @__PURE__ */ jsx(Tooltip, { content: full, ref: placed, children: /* @__PURE__ */ jsxs(
606
+ "time",
607
+ {
608
+ tabIndex: inRows || inControl ? void 0 : 0,
609
+ dateTime: new Date(at).toISOString(),
610
+ "data-relative-time": "",
611
+ suppressHydrationWarning: true,
612
+ className: cn("rounded-[var(--ds-radius-sm)] focus-visible:outline-2 focus-visible:outline-[var(--ds-accent-primary)] focus-visible:outline-offset-2", className),
613
+ children: [
614
+ formatRelativeTime(at, { thresholdHours: hours, now }),
615
+ /* @__PURE__ */ jsx("span", { className: "sr-only", suppressHydrationWarning: true, children: `, ${full}` })
616
+ ]
617
+ },
618
+ mounted ? "browser" : "first"
619
+ ) });
620
+ }
457
621
  var CHECKBOX_SIZES = {
458
622
  sm: { box: "h-[16px] w-[16px]", glyph: 10, label: "text-xs" },
459
623
  md: { box: "h-[18px] w-[18px]", glyph: 12, label: "text-sm" }
@@ -753,7 +917,7 @@ function formatDate(d) {
753
917
  }
754
918
  function localeDayFirst() {
755
919
  try {
756
- const parts = new Intl.DateTimeFormat(void 0).formatToParts(new Date(2e3, 11, 25));
920
+ const parts = new Intl.DateTimeFormat(formatLocale()).formatToParts(new Date(2e3, 11, 25));
757
921
  return parts.findIndex((p) => p.type === "day") < parts.findIndex((p) => p.type === "month");
758
922
  } catch {
759
923
  return true;
@@ -3515,7 +3679,7 @@ var Alert = forwardRef(function Alert2({
3515
3679
  isAccent ? cn("border-[length:var(--ds-border-width)] border-current", actionColorsByVariant[variant]) : cn("border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]", "text-[var(--ds-text-secondary)] hover:text-[var(--ds-text-primary)] hover:bg-[var(--ds-tab-hover-bg)]")
3516
3680
  ),
3517
3681
  children: [
3518
- a.iconLeft && /* @__PURE__ */ jsx("span", { className: "inline-flex mr-ds-1", children: a.iconLeft }),
3682
+ a.iconLeft && /* @__PURE__ */ jsx("span", { className: "inline-flex mr-ds-1", children: slotIcon(a.iconLeft, 14, "an Alert action's iconLeft") }),
3519
3683
  a.label
3520
3684
  ]
3521
3685
  },
@@ -4065,102 +4229,6 @@ function PanelCheckbox({ checked, indeterminate, onClick, label }) {
4065
4229
  }
4066
4230
  );
4067
4231
  }
4068
-
4069
- // ../../showcase/src/lib/initials.ts
4070
- function initialsOf(name) {
4071
- return name.trim().split(/\s+/).filter(Boolean).slice(0, 2).map((word) => Array.from(word)[0] ?? "").join("").toUpperCase();
4072
- }
4073
- function toInitials(value) {
4074
- const s = value.trim();
4075
- if (!s) return "";
4076
- if (!/\s/.test(s) && Array.from(s).length <= 3) return s;
4077
- return initialsOf(s);
4078
- }
4079
- var sizeStyles2 = {
4080
- sm: "h-8 w-8 text-xs",
4081
- md: "h-10 w-10 text-sm",
4082
- lg: "h-12 w-12 text-base"
4083
- };
4084
- var paletteStyles = {
4085
- 1: "bg-[var(--ds-palette-1-bg,var(--ds-bg-muted))] text-[var(--ds-palette-1-text,var(--ds-text-secondary))]",
4086
- 2: "bg-[var(--ds-palette-2-bg,var(--ds-bg-muted))] text-[var(--ds-palette-2-text,var(--ds-text-secondary))]",
4087
- 3: "bg-[var(--ds-palette-3-bg,var(--ds-bg-muted))] text-[var(--ds-palette-3-text,var(--ds-text-secondary))]",
4088
- 4: "bg-[var(--ds-palette-4-bg,var(--ds-bg-muted))] text-[var(--ds-palette-4-text,var(--ds-text-secondary))]",
4089
- 5: "bg-[var(--ds-palette-5-bg,var(--ds-bg-muted))] text-[var(--ds-palette-5-text,var(--ds-text-secondary))]"
4090
- };
4091
- function paletteFor(seed) {
4092
- let h = 0;
4093
- for (const ch of seed) h = h * 31 + ch.charCodeAt(0) >>> 0;
4094
- return h % 5 + 1;
4095
- }
4096
- function colorStyles(color, seed) {
4097
- if (color === "accent") return "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]";
4098
- if (color === "neutral") return "bg-[var(--ds-bg-muted)] text-[var(--ds-text-secondary)]";
4099
- return paletteStyles[color === "auto" ? paletteFor(seed) : color];
4100
- }
4101
- function PresenceMark({ status }) {
4102
- return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", focusable: "false", "data-presence": status, className: "block", children: [
4103
- status === "online" && /* @__PURE__ */ jsx("circle", { cx: "5", cy: "5", r: "5", className: "fill-[var(--ds-status-success)]" }),
4104
- status === "away" && /* @__PURE__ */ jsx("circle", { cx: "5", cy: "5", r: "4", fill: "none", strokeWidth: "2", className: "stroke-[var(--ds-status-warning)]" }),
4105
- status === "busy" && /* @__PURE__ */ jsxs(Fragment, { children: [
4106
- /* @__PURE__ */ jsx("circle", { cx: "5", cy: "5", r: "5", className: "fill-[var(--ds-status-error)]" }),
4107
- /* @__PURE__ */ jsx("rect", { x: "2.5", y: "4.1", width: "5", height: "1.8", rx: "0.9", className: "fill-[var(--ds-bg-canvas)]" })
4108
- ] }),
4109
- status === "offline" && /* @__PURE__ */ jsxs(Fragment, { children: [
4110
- /* @__PURE__ */ jsx("circle", { cx: "5", cy: "5", r: "4", fill: "none", strokeWidth: "2", className: "stroke-[var(--ds-text-muted)]" }),
4111
- /* @__PURE__ */ jsx("line", { x1: "3.1", y1: "6.9", x2: "6.9", y2: "3.1", strokeWidth: "1.5", strokeLinecap: "round", className: "stroke-[var(--ds-text-muted)]" })
4112
- ] })
4113
- ] });
4114
- }
4115
- function Avatar({ initials, src, alt, size = "md", status, color = "auto", className }) {
4116
- const who = alt ?? initials ?? "";
4117
- const named = status ? [who, status].filter(Boolean).join(", ") : void 0;
4118
- const base = cn(
4119
- "inline-flex items-center justify-center font-medium shrink-0",
4120
- "rounded-[var(--ds-radius-full)]",
4121
- sizeStyles2[size],
4122
- className
4123
- );
4124
- const avatarElement = src ? /* @__PURE__ */ jsx(
4125
- "img",
4126
- {
4127
- "data-avatar": "",
4128
- src,
4129
- alt: named ?? alt ?? initials ?? "",
4130
- className: cn(base, "object-cover")
4131
- }
4132
- ) : /* @__PURE__ */ jsx(
4133
- "div",
4134
- {
4135
- "data-avatar": "",
4136
- role: named ? "img" : void 0,
4137
- "aria-label": named,
4138
- className: cn(
4139
- base,
4140
- colorStyles(color, alt ?? initials ?? ""),
4141
- "border-[length:var(--ds-border-width)] border-transparent"
4142
- ),
4143
- children: initials != null ? toInitials(initials) : null
4144
- }
4145
- );
4146
- if (!status) return avatarElement;
4147
- return /* @__PURE__ */ jsxs("div", { className: "relative inline-flex", children: [
4148
- avatarElement,
4149
- /* @__PURE__ */ jsx(
4150
- "span",
4151
- {
4152
- className: cn(
4153
- "absolute",
4154
- size === "sm" && "bottom-[-4px] right-[-4px]",
4155
- size === "md" && "bottom-[-2px] right-[-2px]",
4156
- size === "lg" && "bottom-[0px] right-[0px]"
4157
- ),
4158
- "aria-hidden": "true",
4159
- children: /* @__PURE__ */ jsx("span", { className: "block rounded-[var(--ds-radius-full)] bg-[var(--ds-bg-canvas)] shadow-[0_0_0_2px_var(--ds-bg-canvas)]", children: /* @__PURE__ */ jsx(PresenceMark, { status }) })
4160
- }
4161
- )
4162
- ] });
4163
- }
4164
4232
  function MentionInput({
4165
4233
  value: controlledValue,
4166
4234
  onChange: onChangeProp,
@@ -4168,8 +4236,12 @@ function MentionInput({
4168
4236
  trigger = "@",
4169
4237
  placeholder,
4170
4238
  disabled,
4171
- className
4239
+ className,
4240
+ error = false,
4241
+ "aria-label": ariaLabel,
4242
+ ...wiring
4172
4243
  }) {
4244
+ const control = useFieldControl({ ...wiring, error: error || void 0 });
4173
4245
  const [internalValue, setInternalValue] = useState("");
4174
4246
  const value = controlledValue ?? internalValue;
4175
4247
  const onChange = useReportedChange(onChangeProp, value);
@@ -4177,14 +4249,14 @@ function MentionInput({
4177
4249
  const [showPopup, setShowPopup] = useState(false);
4178
4250
  const [activeIndex, setActiveIndex] = useState(0);
4179
4251
  const [triggerStart, setTriggerStart] = useState(-1);
4180
- const [popupPos, setPopupPos] = useState({ top: 0, left: 0 });
4252
+ const [anchor, setAnchor] = useState(null);
4181
4253
  const inputRef = useRef(null);
4182
4254
  const popupRef = useRef(null);
4183
4255
  const mirrorRef = useRef(null);
4184
- const filtered = suggestions.filter(
4185
- (s) => s.label.toLowerCase().includes(query.toLowerCase()) || s.description?.toLowerCase().includes(query.toLowerCase())
4186
- );
4187
- useOverlayLayer(showPopup && filtered.length > 0);
4256
+ const listId = useId();
4257
+ const { items: filtered, more } = shownMentions(matchMentions(suggestions, query));
4258
+ const listShown = showPopup && filtered.length > 0;
4259
+ useOverlayLayer(listShown);
4188
4260
  const updateValue = useCallback(
4189
4261
  (v) => {
4190
4262
  if (controlledValue === void 0) setInternalValue(v);
@@ -4227,13 +4299,15 @@ function MentionInput({
4227
4299
  const span = document.createElement("span");
4228
4300
  span.textContent = trigger;
4229
4301
  mirror.appendChild(span);
4230
- const rect = el.getBoundingClientRect();
4231
4302
  const spanRect = span.getBoundingClientRect();
4232
4303
  const mirrorRect = mirror.getBoundingClientRect();
4233
- setPopupPos({
4234
- top: rect.top + (spanRect.top - mirrorRect.top) + span.offsetHeight + 4,
4235
- left: rect.left + (spanRect.left - mirrorRect.left)
4236
- });
4304
+ setAnchor({ x: spanRect.left - mirrorRect.left, y: spanRect.top - mirrorRect.top, width: spanRect.width, height: span.offsetHeight });
4305
+ };
4306
+ const anchorRect = () => {
4307
+ const el = inputRef.current;
4308
+ if (!el || !anchor) return null;
4309
+ const field = el.getBoundingClientRect();
4310
+ return new DOMRect(field.left + anchor.x, field.top + anchor.y - el.scrollTop, anchor.width, anchor.height);
4237
4311
  };
4238
4312
  const insertMention = (suggestion) => {
4239
4313
  const el = inputRef.current;
@@ -4252,13 +4326,15 @@ function MentionInput({
4252
4326
  });
4253
4327
  };
4254
4328
  const handleKeyDown = (e) => {
4255
- if (!showPopup || filtered.length === 0) return;
4329
+ if (!listShown) return;
4256
4330
  if (e.key === "ArrowDown") {
4257
4331
  e.preventDefault();
4258
4332
  setActiveIndex((i) => (i + 1) % filtered.length);
4259
4333
  } else if (e.key === "ArrowUp") {
4260
4334
  e.preventDefault();
4261
4335
  setActiveIndex((i) => (i - 1 + filtered.length) % filtered.length);
4336
+ } else if (e.key === "Tab" && e.shiftKey) {
4337
+ flushSync(() => setShowPopup(false));
4262
4338
  } else if (e.key === "Enter" || e.key === "Tab") {
4263
4339
  e.preventDefault();
4264
4340
  insertMention(filtered[activeIndex]);
@@ -4282,21 +4358,30 @@ function MentionInput({
4282
4358
  "textarea",
4283
4359
  {
4284
4360
  ref: inputRef,
4361
+ id: control.id,
4362
+ "aria-labelledby": wiring["aria-labelledby"],
4363
+ "aria-label": control.labelId ? void 0 : ariaLabel,
4364
+ "aria-describedby": control.describedBy,
4365
+ "aria-invalid": control.invalid || void 0,
4366
+ "aria-required": control.required || void 0,
4285
4367
  value,
4286
4368
  onChange: handleInput,
4287
4369
  onKeyDown: handleKeyDown,
4370
+ "aria-autocomplete": "list",
4371
+ "aria-controls": listShown ? listId : void 0,
4372
+ "aria-activedescendant": listShown ? mentionOptionId(listId, activeIndex) : void 0,
4288
4373
  placeholder,
4289
4374
  disabled,
4290
4375
  rows: 3,
4291
4376
  className: cn(
4292
4377
  "flex w-full px-ds-3 py-ds-2 text-sm resize-none",
4293
4378
  "bg-[var(--ds-input-bg)] text-[var(--ds-text-primary)]",
4294
- "border-[length:var(--ds-border-width)] border-[var(--ds-input-border)]",
4379
+ "border-[length:var(--ds-border-width)]",
4380
+ control.invalid ? "border-[var(--ds-status-error)]" : "border-[var(--ds-input-border)] hover:border-[var(--ds-input-border-hover)]",
4295
4381
  "rounded-[var(--ds-radius-md)]",
4296
4382
  "shadow-[var(--ds-input-shadow)]",
4297
4383
  "placeholder:text-[var(--ds-text-muted)]",
4298
- "hover:border-[var(--ds-input-border-hover)]",
4299
- FOCUS_RING,
4384
+ control.invalid ? ERROR_FOCUS_RING : FOCUS_RING,
4300
4385
  "disabled:cursor-not-allowed disabled:opacity-disabled disabled:hover:border-[var(--ds-input-border)]",
4301
4386
  "transition-colors duration-[var(--ds-transition-speed)]"
4302
4387
  )
@@ -4310,59 +4395,19 @@ function MentionInput({
4310
4395
  className: "fixed top-0 left-0 -z-50 opacity-0 pointer-events-none"
4311
4396
  }
4312
4397
  ),
4313
- showPopup && filtered.length > 0 && createPortal(
4314
- /* @__PURE__ */ jsx(
4315
- "div",
4316
- {
4317
- ref: popupRef,
4318
- role: "listbox",
4319
- className: cn(
4320
- "fixed z-[var(--ds-z-popover)] min-w-[200px] max-h-[200px] overflow-y-auto",
4321
- "bg-[var(--ds-bg-surface-elevated)]",
4322
- "[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
4323
- "border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
4324
- "rounded-[var(--ds-radius-md)] shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]",
4325
- "py-ds-1"
4326
- ),
4327
- style: { top: popupPos.top, left: popupPos.left },
4328
- children: filtered.map((s, i) => /* @__PURE__ */ jsxs(
4329
- "button",
4330
- {
4331
- type: "button",
4332
- role: "option",
4333
- "aria-selected": i === activeIndex,
4334
- className: cn(
4335
- "flex items-center gap-ds-2.5 w-full px-ds-3 py-ds-1.5 text-left text-sm cursor-pointer",
4336
- "transition-colors duration-[var(--ds-transition-speed)]",
4337
- i === activeIndex ? "bg-[var(--ds-bg-muted)] text-[var(--ds-text-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)] hover:text-[var(--ds-text-primary)]"
4338
- ),
4339
- onMouseDown: (e) => {
4340
- e.preventDefault();
4341
- insertMention(s);
4342
- },
4343
- onMouseEnter: () => setActiveIndex(i),
4344
- children: [
4345
- /* @__PURE__ */ jsx(
4346
- Avatar,
4347
- {
4348
- src: s.avatar,
4349
- initials: s.label.charAt(0).toUpperCase(),
4350
- alt: s.label,
4351
- size: "sm",
4352
- className: "!h-6 !w-6 !text-2xs"
4353
- }
4354
- ),
4355
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
4356
- /* @__PURE__ */ jsx("div", { className: "font-medium text-[var(--ds-text-primary)] truncate", children: s.label }),
4357
- s.description && /* @__PURE__ */ jsx("div", { className: "text-xs text-[var(--ds-text-muted)] truncate", children: s.description })
4358
- ] })
4359
- ]
4360
- },
4361
- s.id
4362
- ))
4363
- }
4364
- ),
4365
- document.body
4398
+ listShown && /* @__PURE__ */ jsx(
4399
+ MentionList,
4400
+ {
4401
+ id: listId,
4402
+ label: "Suggestions",
4403
+ items: filtered,
4404
+ more,
4405
+ activeIndex,
4406
+ onActiveIndexChange: setActiveIndex,
4407
+ onPick: insertMention,
4408
+ anchorRect,
4409
+ listRef: popupRef
4410
+ }
4366
4411
  )
4367
4412
  ] });
4368
4413
  }
@@ -5025,7 +5070,7 @@ function CardGrid({ minWidth, maxColumns = 4, compare = false, gap = "var(--ds-s
5025
5070
  }
5026
5071
  );
5027
5072
  }
5028
- var sizeStyles3 = {
5073
+ var sizeStyles2 = {
5029
5074
  sm: { gap: "gap-ds-0.5", label: "text-[length:var(--ds-font-size-xs)]", value: "text-[length:var(--ds-font-size-xs)]", iconSize: 12, py: "py-ds-1.5" },
5030
5075
  md: { gap: "gap-ds-1", label: "text-[length:var(--ds-font-size-sm)]", value: "text-[length:var(--ds-font-size-sm)]", iconSize: 14, py: "py-ds-2.5" },
5031
5076
  lg: { gap: "gap-ds-1.5", label: "text-[length:var(--ds-font-size-base)]", value: "text-[length:var(--ds-font-size-base)]", iconSize: 16, py: "py-ds-3" }
@@ -5071,7 +5116,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5071
5116
  stackBelow: stackBelowProp,
5072
5117
  className
5073
5118
  }, ref) {
5074
- const s = sizeStyles3[size];
5119
+ const s = sizeStyles2[size];
5075
5120
  const stackBelow = stackBelowProp ?? (columns > 1 ? "sm" : void 0);
5076
5121
  const templateClass = (layout) => columns > 1 && stackBelow !== "none" ? autoColumnClasses[layout][columns] : columnClasses[columns];
5077
5122
  if (orientation === "vertical") {
@@ -5367,17 +5412,31 @@ function clickIsRows(e) {
5367
5412
  const control = target.closest(ROW_CONTROL);
5368
5413
  return !control || control === e.currentTarget || !e.currentTarget.contains(control);
5369
5414
  }
5415
+ var ISO_MOMENT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
5370
5416
  function sortableValue(v) {
5371
5417
  if (v === null || v === void 0 || v === "") return void 0;
5372
5418
  if (v instanceof Date) return v.getTime();
5419
+ if (typeof v === "string" && ISO_MOMENT.test(v)) {
5420
+ const at = Date.parse(v);
5421
+ if (Number.isFinite(at)) return at;
5422
+ }
5373
5423
  if (typeof v === "string" || typeof v === "number") return v;
5374
5424
  if (typeof v === "boolean") return v ? 1 : 0;
5375
5425
  return isValidElement(v) || typeof v === "object" ? null : String(v);
5376
5426
  }
5377
- var COLLATOR = new Intl.Collator(void 0, { numeric: true });
5427
+ var COLLATORS = /* @__PURE__ */ new Map();
5428
+ function collator() {
5429
+ const locale = formatLocale() ?? "";
5430
+ let c = COLLATORS.get(locale);
5431
+ if (!c) {
5432
+ c = new Intl.Collator(locale || void 0, { numeric: true });
5433
+ COLLATORS.set(locale, c);
5434
+ }
5435
+ return c;
5436
+ }
5378
5437
  function compareValues(a, b) {
5379
5438
  if (typeof a === "number" && typeof b === "number") return a - b;
5380
- return COLLATOR.compare(String(a), String(b));
5439
+ return collator().compare(String(a), String(b));
5381
5440
  }
5382
5441
  var UNIT_SCALE = {
5383
5442
  "": 1,
@@ -5782,7 +5841,7 @@ function Table({
5782
5841
  if (title) return titledCards(/* @__PURE__ */ jsx("div", { className: "py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", children: emptyState }));
5783
5842
  return /* @__PURE__ */ jsx("div", { ref: setRoot, "data-ds-list": "", "data-gs": "table", className: cn("py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", className), children: emptyState });
5784
5843
  }
5785
- const cards = /* @__PURE__ */ jsx(TableCardCtx, { value: true, children: /* @__PURE__ */ jsxs("div", { ref: title ? void 0 : listRoot, "data-ds-list": title ? void 0 : "", "data-gs": title ? void 0 : "table", className: cn("flex flex-col gap-ds-3 overflow-y-auto", title ? "min-h-0" : listClass), onFocus: title ? void 0 : noteFocus, onBlur: title ? void 0 : forgetFocus, children: [
5844
+ const cards = /* @__PURE__ */ jsx(TableCardCtx, { value: true, children: /* @__PURE__ */ jsx(RowsCtx, { value: true, children: /* @__PURE__ */ jsxs("div", { ref: title ? void 0 : listRoot, "data-ds-list": title ? void 0 : "", "data-gs": title ? void 0 : "table", className: cn("flex flex-col gap-ds-3 overflow-y-auto", title ? "min-h-0" : listClass), onFocus: title ? void 0 : noteFocus, onBlur: title ? void 0 : forgetFocus, children: [
5786
5845
  selectable && /* @__PURE__ */ jsx("span", { hidden: true, id: `${headingId}-select`, children: "Select" }),
5787
5846
  drawn.map(({ row, originalIdx }) => {
5788
5847
  const isSelected = selectedSet.has(originalIdx);
@@ -5865,7 +5924,7 @@ function Table({
5865
5924
  String(id)
5866
5925
  );
5867
5926
  })
5868
- ] }) });
5927
+ ] }) }) });
5869
5928
  return withControl(title ? titledCards(cards) : cards);
5870
5929
  }
5871
5930
  const cellCount = columns.length + lead;
@@ -5934,7 +5993,7 @@ function Table({
5934
5993
  );
5935
5994
  })
5936
5995
  ] }) }),
5937
- /* @__PURE__ */ jsx("tbody", { children: loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5996
+ /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsx(RowsCtx, { value: true, children: loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5938
5997
  "td",
5939
5998
  {
5940
5999
  colSpan: cellCount,
@@ -6063,7 +6122,7 @@ function Table({
6063
6122
  }
6064
6123
  ) })
6065
6124
  ] }, String(id));
6066
- }) })
6125
+ }) }) })
6067
6126
  ] });
6068
6127
  const region = scrollable || regionFocused ? { tabIndex: 0, role: "region", ...title ? { "aria-labelledby": titleId } : { "aria-label": ariaLabel ?? "Table" } } : {};
6069
6128
  return withControl(
@@ -6095,7 +6154,7 @@ function Table({
6095
6154
  },
6096
6155
  ...fade,
6097
6156
  ...region,
6098
- className: cn("min-h-0 overflow-x-auto focus-visible:outline-none", title ? "rounded-b-[inherit]" : "rounded-[inherit]"),
6157
+ className: cn("relative min-h-0 overflow-x-auto focus-visible:outline-none", title ? "rounded-b-[inherit]" : "rounded-[inherit]"),
6099
6158
  children: table
6100
6159
  }
6101
6160
  )
@@ -6530,7 +6589,7 @@ function OverflowPopover({
6530
6589
  {
6531
6590
  ref: floatingRef,
6532
6591
  role: "dialog",
6533
- "aria-label": date.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric" }),
6592
+ "aria-label": date.toLocaleDateString(formatLocale(), { weekday: "long", month: "long", day: "numeric" }),
6534
6593
  className: cn(
6535
6594
  "fixed z-[var(--ds-z-popover)] w-56 max-h-48 overflow-y-auto",
6536
6595
  "bg-[var(--ds-bg-surface-elevated)]",
@@ -6544,7 +6603,7 @@ function OverflowPopover({
6544
6603
  onClick: (e) => e.stopPropagation(),
6545
6604
  onMouseDown: (e) => e.stopPropagation(),
6546
6605
  children: [
6547
- /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-1", children: date.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) }),
6606
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-1", children: date.toLocaleDateString(formatLocale(), { weekday: "short", month: "short", day: "numeric" }) }),
6548
6607
  events.map((event) => /* @__PURE__ */ jsx(
6549
6608
  EventBar,
6550
6609
  {
@@ -6810,7 +6869,7 @@ function WeekView({
6810
6869
  ),
6811
6870
  onClick: () => onDayClick?.(day),
6812
6871
  children: [
6813
- /* @__PURE__ */ jsx("div", { className: "text-xs text-[var(--ds-text-muted)] font-medium", children: day.toLocaleDateString(void 0, { weekday: "short" }) }),
6872
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-[var(--ds-text-muted)] font-medium", children: day.toLocaleDateString(formatLocale(), { weekday: "short" }) }),
6814
6873
  /* @__PURE__ */ jsx(
6815
6874
  "div",
6816
6875
  {
@@ -7003,7 +7062,7 @@ function DayCellWithPopover({
7003
7062
  style: { top: pos.top, left: pos.left },
7004
7063
  role: "tooltip",
7005
7064
  children: [
7006
- /* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-0.5", children: day.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) }),
7065
+ /* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-0.5", children: day.toLocaleDateString(formatLocale(), { weekday: "short", month: "short", day: "numeric" }) }),
7007
7066
  dayEvents.map((event) => /* @__PURE__ */ jsx(
7008
7067
  EventBar,
7009
7068
  {
@@ -7242,7 +7301,7 @@ function CompactDayCell({
7242
7301
  style: { top: pos.top, left: pos.left },
7243
7302
  role: "tooltip",
7244
7303
  children: [
7245
- /* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-0.5", children: day.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) }),
7304
+ /* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-0.5", children: day.toLocaleDateString(formatLocale(), { weekday: "short", month: "short", day: "numeric" }) }),
7246
7305
  dayEvents.map((event) => /* @__PURE__ */ jsx(
7247
7306
  EventBar,
7248
7307
  {
@@ -7930,7 +7989,7 @@ var defaultIcons = {
7930
7989
  };
7931
7990
  var FRAME_ICON_SIZE = 28;
7932
7991
  function renderIcon(icon) {
7933
- if (typeof icon === "string") return /* @__PURE__ */ jsx(Icon, { name: icon, size: FRAME_ICON_SIZE, className: "text-[var(--ds-text-muted)]" });
7992
+ if (typeof icon === "string") return /* @__PURE__ */ jsx(Icon, { name: icon, size: FRAME_ICON_SIZE, className: "text-[var(--ds-text-muted)]", from: "EmptyState's icon" });
7934
7993
  if (isValidElement(icon) && icon.type === Icon) return cloneElement(icon, { size: FRAME_ICON_SIZE });
7935
7994
  return icon;
7936
7995
  }
@@ -8109,7 +8168,7 @@ function TableToolbar({
8109
8168
  var ICON_TEXT_OFFSET = "calc((2rem - 1.25rem) / 2)";
8110
8169
  function Marker({ item, vertical }) {
8111
8170
  if (item.icon) {
8112
- return /* @__PURE__ */ jsx("div", { "data-timeline-icon": "", className: "shrink-0 w-8 h-8 flex items-center justify-center *:max-w-8 *:max-h-8", children: item.icon });
8171
+ return /* @__PURE__ */ jsx("div", { "data-timeline-icon": "", className: "shrink-0 w-8 h-8 flex items-center justify-center *:max-w-8 *:max-h-8", children: slotIcon(item.icon, 16, "a Timeline item's icon") });
8113
8172
  }
8114
8173
  return /* @__PURE__ */ jsx(
8115
8174
  "div",
@@ -8156,7 +8215,7 @@ function ExpandableDescription({ children, className }) {
8156
8215
  );
8157
8216
  }
8158
8217
  function HorizontalLayout({ items, minItemWidth, className }) {
8159
- return /* @__PURE__ */ jsx("div", { "data-timeline-row": "", className: cn("flex items-start overflow-x-auto snap-x", className), children: items.map((item, i) => {
8218
+ return /* @__PURE__ */ jsx("div", { "data-timeline-row": "", className: cn("relative flex items-start overflow-x-auto snap-x", className), children: items.map((item, i) => {
8160
8219
  const isFirst = i === 0;
8161
8220
  const isLast = i === items.length - 1;
8162
8221
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-1 shrink-0 flex-col items-center snap-start", style: { minWidth: minItemWidth }, children: [
@@ -8189,8 +8248,8 @@ function HorizontalLayout({ items, minItemWidth, className }) {
8189
8248
  ] }, i);
8190
8249
  }) });
8191
8250
  }
8192
- var EXACT = new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" });
8193
- var EXACT_DAY = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
8251
+ var EXACT = { format: (d) => new Intl.DateTimeFormat(formatLocale(), { dateStyle: "medium", timeStyle: "short" }).format(d) };
8252
+ var EXACT_DAY = { format: (d) => new Intl.DateTimeFormat(formatLocale(), { dateStyle: "medium" }).format(d) };
8194
8253
  var DATE_ONLY = /^(\d{4})-(\d{2})-(\d{2})$/;
8195
8254
  function exactTime(value) {
8196
8255
  if (typeof value === "string") {
@@ -8205,6 +8264,9 @@ function exactTime(value) {
8205
8264
  return Number.isNaN(date.getTime()) ? null : { iso: date.toISOString(), text: EXACT.format(date) };
8206
8265
  }
8207
8266
  function ItemTime({ item }) {
8267
+ if (item.time !== void 0) {
8268
+ return /* @__PURE__ */ jsx("p", { className: "text-2xs text-[var(--ds-text-muted)] mt-ds-0.5 tabular-nums", children: /* @__PURE__ */ jsx(RelativeTime, { time: item.time }) });
8269
+ }
8208
8270
  const exact = item.dateTime ? exactTime(item.dateTime) : null;
8209
8271
  if (!item.timestamp && !exact) return null;
8210
8272
  return /* @__PURE__ */ jsx("p", { className: "text-2xs text-[var(--ds-text-muted)] mt-ds-0.5 tabular-nums", children: exact ? /* @__PURE__ */ jsxs("time", { dateTime: exact.iso, title: exact.text, children: [
@@ -8242,7 +8304,7 @@ function Timeline({ items: allItems, orientation = "vertical", minItemWidth = 20
8242
8304
  }, [ref]);
8243
8305
  const fits = width === 0 || width >= items.length * minItemWidth;
8244
8306
  const horizontal = orientation === "horizontal" || orientation === "responsive" && fits;
8245
- const list = /* @__PURE__ */ jsx("div", { ref: setRefs, "data-ds-list": "", "data-timeline-orientation": horizontal ? "horizontal" : "vertical", className: pager ? void 0 : className, children: horizontal ? /* @__PURE__ */ jsx(HorizontalLayout, { items, minItemWidth }) : /* @__PURE__ */ jsx(VerticalLayout, { items }) });
8307
+ const list = /* @__PURE__ */ jsx("div", { ref: setRefs, "data-ds-list": "", "data-timeline-orientation": horizontal ? "horizontal" : "vertical", className: pager ? void 0 : className, children: /* @__PURE__ */ jsx(RowsCtx, { value: true, children: horizontal ? /* @__PURE__ */ jsx(HorizontalLayout, { items, minItemWidth }) : /* @__PURE__ */ jsx(VerticalLayout, { items }) }) });
8246
8308
  if (!pager) return list;
8247
8309
  return /* @__PURE__ */ jsxs("div", { "data-gs-paged": "", className: cn("flex flex-col min-w-0", className), children: [
8248
8310
  list,
@@ -8811,7 +8873,7 @@ function Carousel({
8811
8873
  );
8812
8874
  }
8813
8875
  function formatTime2(d) {
8814
- return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
8876
+ return d.toLocaleTimeString(formatLocale(), { hour: "2-digit", minute: "2-digit" });
8815
8877
  }
8816
8878
  function isSameMinute(a, b) {
8817
8879
  return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate() && a.getHours() === b.getHours() && a.getMinutes() === b.getMinutes();
@@ -9602,7 +9664,7 @@ var StackedList = forwardRef(function StackedList2({
9602
9664
  !pager && className
9603
9665
  ),
9604
9666
  role: "list",
9605
- children: shown.map((item) => {
9667
+ children: /* @__PURE__ */ jsx(RowsCtx, { value: true, children: shown.map((item) => {
9606
9668
  const isSelected = item.selected ?? (selectedId !== void 0 && item.id === selectedId);
9607
9669
  const interactive = !!item.onClick;
9608
9670
  const hasEmphasis = item.unread !== void 0;
@@ -9691,7 +9753,7 @@ var StackedList = forwardRef(function StackedList2({
9691
9753
  ]
9692
9754
  }
9693
9755
  ) }, item.id);
9694
- })
9756
+ }) })
9695
9757
  }
9696
9758
  );
9697
9759
  if (!pager) return list;
@@ -9765,7 +9827,8 @@ function periodAfter(unit, start) {
9765
9827
  return utcDay(y + 1, 0, 1);
9766
9828
  }
9767
9829
  var formats = /* @__PURE__ */ new Map();
9768
- function formatter(locale, options) {
9830
+ function formatter(given, options) {
9831
+ const locale = given ?? formatLocale();
9769
9832
  const key = `${locale ?? ""}|${JSON.stringify(options)}`;
9770
9833
  let f = formats.get(key);
9771
9834
  if (!f) {
@@ -9878,10 +9941,10 @@ function extendTimeScaleTo(scale, endDay) {
9878
9941
  }
9879
9942
  var noSubscription = () => () => {
9880
9943
  };
9881
- var inBrowser = () => true;
9882
- var onServer = () => false;
9944
+ var inBrowser2 = () => true;
9945
+ var onServer2 = () => false;
9883
9946
  function useTimeScale({ start, end, zoom, today, weekStartsOn = 1, locale, pxPerDay, pad: pad3 = 0 }) {
9884
- const readable = useSyncExternalStore(noSubscription, inBrowser, onServer);
9947
+ const readable = useSyncExternalStore(noSubscription, inBrowser2, onServer2);
9885
9948
  const [mounted] = useState(() => toMinute(dayOf(/* @__PURE__ */ new Date())));
9886
9949
  const pending = today === void 0 && !readable;
9887
9950
  const from = dayOf(start);
@@ -10856,7 +10919,7 @@ function Gantt({
10856
10919
  const byKey = useMemo(() => new Map(rows.map((r) => [r.key, r])), [rows]);
10857
10920
  const names = useMemo(() => {
10858
10921
  const byId = new Map(tasks.map((i) => [i.id, i]));
10859
- const list = new Intl.ListFormat(locale, { type: "conjunction" });
10922
+ const list = new Intl.ListFormat(locale ?? formatLocale(), { type: "conjunction" });
10860
10923
  const out = /* @__PURE__ */ new Map();
10861
10924
  for (const item of tasks) {
10862
10925
  const dates = datesOf(item);
@@ -15986,7 +16049,7 @@ function HoverCard({
15986
16049
  className
15987
16050
  ),
15988
16051
  style: { top: pos.top, left: pos.left },
15989
- children: content
16052
+ children: /* @__PURE__ */ jsx(RowsCtx, { value: false, children: content })
15990
16053
  }
15991
16054
  ),
15992
16055
  container ?? document.body
@@ -17115,6 +17178,7 @@ var SectionHeading = forwardRef(function SectionHeading2({
17115
17178
  title,
17116
17179
  onTitleChange,
17117
17180
  titleLabel = "Title",
17181
+ titleId,
17118
17182
  description,
17119
17183
  actions,
17120
17184
  badge,
@@ -17150,7 +17214,7 @@ var SectionHeading = forwardRef(function SectionHeading2({
17150
17214
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-2", children: [
17151
17215
  editable ? (
17152
17216
  // the field is the title: the heading holds it, so the page's headings still name the view by its title
17153
- /* @__PURE__ */ jsx("h2", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(
17217
+ /* @__PURE__ */ jsx("h2", { id: titleId, className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(
17154
17218
  Input,
17155
17219
  {
17156
17220
  size: "md",
@@ -17160,7 +17224,7 @@ var SectionHeading = forwardRef(function SectionHeading2({
17160
17224
  className: "font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]"
17161
17225
  }
17162
17226
  ) })
17163
- ) : /* @__PURE__ */ jsx("h2", { className: cn("font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]", pane ? "truncate" : "min-w-0 break-words"), children: title }),
17227
+ ) : /* @__PURE__ */ jsx("h2", { id: titleId, className: cn("font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]", pane ? "truncate" : "min-w-0 break-words"), children: title }),
17164
17228
  badge,
17165
17229
  count !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: count })
17166
17230
  ] }),
@@ -17216,6 +17280,23 @@ var ActionPanelGroup = forwardRef(function ActionPanelGroup2({
17216
17280
  }
17217
17281
  );
17218
17282
  });
17283
+ function DangerZone({ title = "Danger zone", description, children, className }) {
17284
+ const titleId = useId();
17285
+ return /* @__PURE__ */ jsxs("section", { "aria-labelledby": titleId, "data-gs": "danger-zone", className, children: [
17286
+ /* @__PURE__ */ jsx(SectionHeading, { title, titleId, description }),
17287
+ /* @__PURE__ */ jsx(
17288
+ "div",
17289
+ {
17290
+ "data-danger-frame": "",
17291
+ className: cn(
17292
+ "rounded-[var(--ds-radius-md)] bg-[var(--ds-bg-surface)] border-[length:var(--ds-border-width)] border-[var(--ds-status-error)] px-ds-5",
17293
+ GLASS_SURFACE
17294
+ ),
17295
+ children: /* @__PURE__ */ jsx(ActionPanelGroup, { children })
17296
+ }
17297
+ )
17298
+ ] });
17299
+ }
17219
17300
  var lineClampClasses = {
17220
17301
  1: "truncate",
17221
17302
  2: "line-clamp-2",
@@ -17267,6 +17348,6 @@ var TextOverflow = forwardRef(function TextOverflow2({
17267
17348
  return /* @__PURE__ */ jsx(Tooltip, { content: resolvedTooltipContent, children: content });
17268
17349
  });
17269
17350
 
17270
- export { Accordion, ActionPanel, ActionPanelGroup, AddAnother, Alert, AsidePanel, Avatar, AvatarGroup, BottomNav, BulkActionBar, Calendar, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, ChatMessageList, ChatPanel, Checkbox, CheckboxGroup, CheckboxGroupItem, Collapsible, ColorPicker, Combobox, CommandPalette, ContextMenu, CornerPanel, DEFAULT_DATE_RANGE_PRESETS, DataList, DatePicker, DateRangePicker, DescriptionList, Dialog, Dock, DropdownMenu, EmptyState, EntityCell, FileUpload, FlowSaved, FormWrapper, Gantt, HoverCard, Kbd, Launcher, MentionInput, MobileHeaderMenu, NavItem, NavMenu, Navbar, NotificationCenter, PageActions, PageContainer, PageHeader, PinInput, Progress, RadioGroup, Rating, ScrollArea, SectionHeading, SegmentedControl, SettingsLayout, Sheet, Sidebar, SidebarNav, SliderRange, StackedList, StatsCard, StatusDot, Stepper, TIME_ZOOMS, Table, TableToolbar, Tabs, Tag, TagInput, TextOverflow, TimeBar, TimePicker, TimeRow, TimeScaleHeader, TimeViewport, Timeline, Toast, ToastProvider, Tour, TransferList, TreeView, dateOfDay, dayOf, endDayOf, fitLabel, fitLabels, formatDateRange, readFlowProgress, timeExtent, useContentWidth, useDestructiveAction, useFittedLabels, useFlowSteps, useSidebar, useTextMeasure, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional };
17351
+ export { Accordion, ActionPanel, ActionPanelGroup, AddAnother, Alert, AsidePanel, AvatarGroup, BottomNav, BulkActionBar, Calendar, Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, ChatMessageList, ChatPanel, Checkbox, CheckboxGroup, CheckboxGroupItem, Collapsible, ColorPicker, Combobox, CommandPalette, ContextMenu, CornerPanel, DEFAULT_DATE_RANGE_PRESETS, DangerZone, DataList, DatePicker, DateRangePicker, DescriptionList, Dialog, Dock, DropdownMenu, EmptyState, EntityCell, FileUpload, FlowSaved, FormWrapper, Gantt, HoverCard, Kbd, Launcher, MentionInput, MobileHeaderMenu, NavItem, NavMenu, Navbar, NotificationCenter, PageActions, PageContainer, PageHeader, PinInput, Progress, RadioGroup, Rating, RelativeTime, ScrollArea, SectionHeading, SegmentedControl, SettingsLayout, Sheet, Sidebar, SidebarNav, SliderRange, StackedList, StatsCard, StatusDot, Stepper, TIME_ZOOMS, Table, TableToolbar, Tabs, Tag, TagInput, TextOverflow, TimeBar, TimePicker, TimeRow, TimeScaleHeader, TimeViewport, Timeline, TimezoneSelect, Toast, ToastProvider, Tour, TransferList, TreeView, browserTimeZone, canonicalTimeZone, dateOfDay, dayOf, endDayOf, fitLabel, fitLabels, formatDateRange, formatFullTime, formatRelativeTime, readFlowProgress, timeExtent, timeZoneOffset, useContentWidth, useDestructiveAction, useFittedLabels, useFlowSteps, useRelativeTimeFormat, useSidebar, useTextMeasure, useTimeScale, useTimeViewport, useTimeViewportLayout, useToast, useToastOptional };
17271
17352
  //# sourceMappingURL=index.js.map
17272
17353
  //# sourceMappingURL=index.js.map