@homebound/beam 4.42.1 → 4.44.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/dist/index.js CHANGED
@@ -16,95 +16,95 @@ import {
16
16
 
17
17
  // src/Css.ts
18
18
  import { __invertTrussMediaQuery, trussProps, useRuntimeStyle as _useRuntimeStyle } from "@homebound/truss/runtime";
19
- var Tokens = /* @__PURE__ */ ((Tokens65) => {
20
- Tokens65["AiFieldBg"] = "--b-ai-field-bg";
21
- Tokens65["AiFieldFg"] = "--b-ai-field-fg";
22
- Tokens65["ButtonCautionDisabledBg"] = "--b-button-caution-disabled-bg";
23
- Tokens65["ButtonCautionDisabledFg"] = "--b-button-caution-disabled-fg";
24
- Tokens65["ButtonDangerDisabledBg"] = "--b-button-danger-disabled-bg";
25
- Tokens65["ButtonDangerDisabledFg"] = "--b-button-danger-disabled-fg";
26
- Tokens65["ButtonGhostDisabledFg"] = "--b-button-ghost-disabled-fg";
27
- Tokens65["ButtonGhostFg"] = "--b-button-ghost-fg";
28
- Tokens65["ButtonPrimaryDisabledBg"] = "--b-button-primary-disabled-bg";
29
- Tokens65["ButtonPrimaryDisabledFg"] = "--b-button-primary-disabled-fg";
30
- Tokens65["ButtonSecondaryFg"] = "--b-button-secondary-fg";
31
- Tokens65["ButtonTertiaryFg"] = "--b-button-tertiary-fg";
32
- Tokens65["ButtonTertiaryFgPressed"] = "--b-button-tertiary-fg-pressed";
33
- Tokens65["ChoiceDisabled"] = "--b-choice-disabled";
34
- Tokens65["ChoiceSelected"] = "--b-choice-selected";
35
- Tokens65["Danger"] = "--b-danger";
36
- Tokens65["DangerPressed"] = "--b-danger-pressed";
37
- Tokens65["EnvBrandDev"] = "--b-env-brand-dev";
38
- Tokens65["EnvBrandLocalProd"] = "--b-env-brand-local-prod";
39
- Tokens65["EnvBrandProd"] = "--b-env-brand-prod";
40
- Tokens65["EnvBrandQa"] = "--b-env-brand-qa";
41
- Tokens65["FieldBgDefault"] = "--b-field-bg-default";
42
- Tokens65["FieldBgDisabled"] = "--b-field-bg-disabled";
43
- Tokens65["FieldBgHover"] = "--b-field-bg-hover";
44
- Tokens65["FieldBorderDefault"] = "--b-field-border-default";
45
- Tokens65["FieldBorderError"] = "--b-field-border-error";
46
- Tokens65["FieldBorderFocus"] = "--b-field-border-focus";
47
- Tokens65["FieldBorderHover"] = "--b-field-border-hover";
48
- Tokens65["FieldTextDisabled"] = "--b-field-text-disabled";
49
- Tokens65["FocusRingInset"] = "--b-focus-ring-inset";
50
- Tokens65["FocusRingMuted"] = "--b-focus-ring-muted";
51
- Tokens65["LoaderFill"] = "--b-loader-fill";
52
- Tokens65["LoaderSpinner"] = "--b-loader-spinner";
53
- Tokens65["LoaderTrack"] = "--b-loader-track";
54
- Tokens65["NavGlobalItemBgActive"] = "--b-nav-global-item-bg-active";
55
- Tokens65["NavGlobalItemBgHover"] = "--b-nav-global-item-bg-hover";
56
- Tokens65["NavGlobalItemBgPressed"] = "--b-nav-global-item-bg-pressed";
57
- Tokens65["NavGlobalText"] = "--b-nav-global-text";
58
- Tokens65["NavGlobalTextActive"] = "--b-nav-global-text-active";
59
- Tokens65["NavGlobalTextDisabled"] = "--b-nav-global-text-disabled";
60
- Tokens65["NavItemBgActive"] = "--b-nav-item-bg-active";
61
- Tokens65["NavItemBgHover"] = "--b-nav-item-bg-hover";
62
- Tokens65["NavItemBgPressed"] = "--b-nav-item-bg-pressed";
63
- Tokens65["NavText"] = "--b-nav-text";
64
- Tokens65["NavTextActive"] = "--b-nav-text-active";
65
- Tokens65["NavTextDisabled"] = "--b-nav-text-disabled";
66
- Tokens65["NavTextFocusVisible"] = "--b-nav-text-focus-visible";
67
- Tokens65["NavTextPressed"] = "--b-nav-text-pressed";
68
- Tokens65["NeutralFillHover"] = "--b-neutral-fill-hover";
69
- Tokens65["NeutralFillHoverStrong"] = "--b-neutral-fill-hover-strong";
70
- Tokens65["NeutralFillHoverSubtle"] = "--b-neutral-fill-hover-subtle";
71
- Tokens65["NeutralFillPressed"] = "--b-neutral-fill-pressed";
72
- Tokens65["NeutralSurfacePressed"] = "--b-neutral-surface-pressed";
73
- Tokens65["OnPrimary"] = "--b-on-primary";
74
- Tokens65["OnSurface"] = "--b-on-surface";
75
- Tokens65["OnSurfaceActive"] = "--b-on-surface-active";
76
- Tokens65["OnSurfaceActiveDisabled"] = "--b-on-surface-active-disabled";
77
- Tokens65["OnSurfaceDisabled"] = "--b-on-surface-disabled";
78
- Tokens65["OnSurfaceMuted"] = "--b-on-surface-muted";
79
- Tokens65["OnSurfaceRaisedHover"] = "--b-on-surface-raised-hover";
80
- Tokens65["OnSurfaceRaisedPressed"] = "--b-on-surface-raised-pressed";
81
- Tokens65["Primary"] = "--b-primary";
82
- Tokens65["PrimaryHover"] = "--b-primary-hover";
83
- Tokens65["PrimaryPressed"] = "--b-primary-pressed";
84
- Tokens65["Scrim"] = "--b-scrim";
85
- Tokens65["SelectionFill"] = "--b-selection-fill";
86
- Tokens65["SelectionIndicator"] = "--b-selection-indicator";
87
- Tokens65["Surface"] = "--b-surface";
88
- Tokens65["SurfaceActive"] = "--b-surface-active";
89
- Tokens65["SurfaceActiveBorder"] = "--b-surface-active-border";
90
- Tokens65["SurfaceActiveHover"] = "--b-surface-active-hover";
91
- Tokens65["SurfaceDisabled"] = "--b-surface-disabled";
92
- Tokens65["SurfaceHover"] = "--b-surface-hover";
93
- Tokens65["SurfaceRaised"] = "--b-surface-raised";
94
- Tokens65["SurfaceRaisedHover"] = "--b-surface-raised-hover";
95
- Tokens65["SurfaceRaisedPressed"] = "--b-surface-raised-pressed";
96
- Tokens65["SurfaceSeparator"] = "--b-surface-separator";
97
- Tokens65["SurfaceSubtle"] = "--b-surface-subtle";
98
- Tokens65["TextDisabled"] = "--b-text-disabled";
99
- Tokens65["TextHelper"] = "--b-text-helper";
100
- Tokens65["TextLabel"] = "--b-text-label";
101
- Tokens65["TextLinkDefault"] = "--b-text-link-default";
102
- Tokens65["TextLinkDisabled"] = "--b-text-link-disabled";
103
- Tokens65["TextLinkHover"] = "--b-text-link-hover";
104
- Tokens65["TextLinkPressed"] = "--b-text-link-pressed";
105
- Tokens65["TextPlaceholder"] = "--b-text-placeholder";
106
- Tokens65["TextSelection"] = "--b-text-selection";
107
- return Tokens65;
19
+ var Tokens = /* @__PURE__ */ ((Tokens69) => {
20
+ Tokens69["AiFieldBg"] = "--b-ai-field-bg";
21
+ Tokens69["AiFieldFg"] = "--b-ai-field-fg";
22
+ Tokens69["ButtonCautionDisabledBg"] = "--b-button-caution-disabled-bg";
23
+ Tokens69["ButtonCautionDisabledFg"] = "--b-button-caution-disabled-fg";
24
+ Tokens69["ButtonDangerDisabledBg"] = "--b-button-danger-disabled-bg";
25
+ Tokens69["ButtonDangerDisabledFg"] = "--b-button-danger-disabled-fg";
26
+ Tokens69["ButtonGhostDisabledFg"] = "--b-button-ghost-disabled-fg";
27
+ Tokens69["ButtonGhostFg"] = "--b-button-ghost-fg";
28
+ Tokens69["ButtonPrimaryDisabledBg"] = "--b-button-primary-disabled-bg";
29
+ Tokens69["ButtonPrimaryDisabledFg"] = "--b-button-primary-disabled-fg";
30
+ Tokens69["ButtonSecondaryFg"] = "--b-button-secondary-fg";
31
+ Tokens69["ButtonTertiaryFg"] = "--b-button-tertiary-fg";
32
+ Tokens69["ButtonTertiaryFgPressed"] = "--b-button-tertiary-fg-pressed";
33
+ Tokens69["ChoiceDisabled"] = "--b-choice-disabled";
34
+ Tokens69["ChoiceSelected"] = "--b-choice-selected";
35
+ Tokens69["Danger"] = "--b-danger";
36
+ Tokens69["DangerPressed"] = "--b-danger-pressed";
37
+ Tokens69["EnvBrandDev"] = "--b-env-brand-dev";
38
+ Tokens69["EnvBrandLocalProd"] = "--b-env-brand-local-prod";
39
+ Tokens69["EnvBrandProd"] = "--b-env-brand-prod";
40
+ Tokens69["EnvBrandQa"] = "--b-env-brand-qa";
41
+ Tokens69["FieldBgDefault"] = "--b-field-bg-default";
42
+ Tokens69["FieldBgDisabled"] = "--b-field-bg-disabled";
43
+ Tokens69["FieldBgHover"] = "--b-field-bg-hover";
44
+ Tokens69["FieldBorderDefault"] = "--b-field-border-default";
45
+ Tokens69["FieldBorderError"] = "--b-field-border-error";
46
+ Tokens69["FieldBorderFocus"] = "--b-field-border-focus";
47
+ Tokens69["FieldBorderHover"] = "--b-field-border-hover";
48
+ Tokens69["FieldTextDisabled"] = "--b-field-text-disabled";
49
+ Tokens69["FocusRingInset"] = "--b-focus-ring-inset";
50
+ Tokens69["FocusRingMuted"] = "--b-focus-ring-muted";
51
+ Tokens69["LoaderFill"] = "--b-loader-fill";
52
+ Tokens69["LoaderSpinner"] = "--b-loader-spinner";
53
+ Tokens69["LoaderTrack"] = "--b-loader-track";
54
+ Tokens69["NavGlobalItemBgActive"] = "--b-nav-global-item-bg-active";
55
+ Tokens69["NavGlobalItemBgHover"] = "--b-nav-global-item-bg-hover";
56
+ Tokens69["NavGlobalItemBgPressed"] = "--b-nav-global-item-bg-pressed";
57
+ Tokens69["NavGlobalText"] = "--b-nav-global-text";
58
+ Tokens69["NavGlobalTextActive"] = "--b-nav-global-text-active";
59
+ Tokens69["NavGlobalTextDisabled"] = "--b-nav-global-text-disabled";
60
+ Tokens69["NavItemBgActive"] = "--b-nav-item-bg-active";
61
+ Tokens69["NavItemBgHover"] = "--b-nav-item-bg-hover";
62
+ Tokens69["NavItemBgPressed"] = "--b-nav-item-bg-pressed";
63
+ Tokens69["NavText"] = "--b-nav-text";
64
+ Tokens69["NavTextActive"] = "--b-nav-text-active";
65
+ Tokens69["NavTextDisabled"] = "--b-nav-text-disabled";
66
+ Tokens69["NavTextFocusVisible"] = "--b-nav-text-focus-visible";
67
+ Tokens69["NavTextPressed"] = "--b-nav-text-pressed";
68
+ Tokens69["NeutralFillHover"] = "--b-neutral-fill-hover";
69
+ Tokens69["NeutralFillHoverStrong"] = "--b-neutral-fill-hover-strong";
70
+ Tokens69["NeutralFillHoverSubtle"] = "--b-neutral-fill-hover-subtle";
71
+ Tokens69["NeutralFillPressed"] = "--b-neutral-fill-pressed";
72
+ Tokens69["NeutralSurfacePressed"] = "--b-neutral-surface-pressed";
73
+ Tokens69["OnPrimary"] = "--b-on-primary";
74
+ Tokens69["OnSurface"] = "--b-on-surface";
75
+ Tokens69["OnSurfaceActive"] = "--b-on-surface-active";
76
+ Tokens69["OnSurfaceActiveDisabled"] = "--b-on-surface-active-disabled";
77
+ Tokens69["OnSurfaceDisabled"] = "--b-on-surface-disabled";
78
+ Tokens69["OnSurfaceMuted"] = "--b-on-surface-muted";
79
+ Tokens69["OnSurfaceRaisedHover"] = "--b-on-surface-raised-hover";
80
+ Tokens69["OnSurfaceRaisedPressed"] = "--b-on-surface-raised-pressed";
81
+ Tokens69["Primary"] = "--b-primary";
82
+ Tokens69["PrimaryHover"] = "--b-primary-hover";
83
+ Tokens69["PrimaryPressed"] = "--b-primary-pressed";
84
+ Tokens69["Scrim"] = "--b-scrim";
85
+ Tokens69["SelectionFill"] = "--b-selection-fill";
86
+ Tokens69["SelectionIndicator"] = "--b-selection-indicator";
87
+ Tokens69["Surface"] = "--b-surface";
88
+ Tokens69["SurfaceActive"] = "--b-surface-active";
89
+ Tokens69["SurfaceActiveBorder"] = "--b-surface-active-border";
90
+ Tokens69["SurfaceActiveHover"] = "--b-surface-active-hover";
91
+ Tokens69["SurfaceDisabled"] = "--b-surface-disabled";
92
+ Tokens69["SurfaceHover"] = "--b-surface-hover";
93
+ Tokens69["SurfaceRaised"] = "--b-surface-raised";
94
+ Tokens69["SurfaceRaisedHover"] = "--b-surface-raised-hover";
95
+ Tokens69["SurfaceRaisedPressed"] = "--b-surface-raised-pressed";
96
+ Tokens69["SurfaceSeparator"] = "--b-surface-separator";
97
+ Tokens69["SurfaceSubtle"] = "--b-surface-subtle";
98
+ Tokens69["TextDisabled"] = "--b-text-disabled";
99
+ Tokens69["TextHelper"] = "--b-text-helper";
100
+ Tokens69["TextLabel"] = "--b-text-label";
101
+ Tokens69["TextLinkDefault"] = "--b-text-link-default";
102
+ Tokens69["TextLinkDisabled"] = "--b-text-link-disabled";
103
+ Tokens69["TextLinkHover"] = "--b-text-link-hover";
104
+ Tokens69["TextLinkPressed"] = "--b-text-link-pressed";
105
+ Tokens69["TextPlaceholder"] = "--b-text-placeholder";
106
+ Tokens69["TextSelection"] = "--b-text-selection";
107
+ return Tokens69;
108
108
  })(Tokens || {});
109
109
  var Keyframes = /* @__PURE__ */ ((Keyframes2) => {
110
110
  Keyframes2["LoadingDots"] = "loadingDots";
@@ -7838,7 +7838,7 @@ function CompanionRowImpl(props) {
7838
7838
  companion,
7839
7839
  position = "trailing",
7840
7840
  levelIndent,
7841
- rowCss,
7841
+ rowCss: rowCss2,
7842
7842
  cellCss
7843
7843
  } = props;
7844
7844
  const RowTag = as === "table" ? "tr" : "div";
@@ -7871,7 +7871,7 @@ function CompanionRowImpl(props) {
7871
7871
  }]
7872
7872
  },
7873
7873
  ...isLastBodyRow && style.lastRowCss,
7874
- ...rowCss
7874
+ ...rowCss2
7875
7875
  }), "data-gridrow": true, ...tid[rowId], children: /* @__PURE__ */ jsx19(CellTag, { ...trussProps12({
7876
7876
  ...style.cellCss,
7877
7877
  ...style.betweenRowsCss,
@@ -10519,7 +10519,7 @@ function RowImpl(props) {
10519
10519
  }
10520
10520
  };
10521
10521
  const rowHoverBg = maybeCssVar(aiMode && !reservedRowKinds.includes(row.kind) ? "rgba(237, 233, 254, 1)" /* Purple100 */ : style.rowHoverColor !== void 0 && style.rowHoverColor !== "none" ? style.rowHoverColor : "--b-surface-hover" /* SurfaceHover */);
10522
- const rowCss = {
10522
+ const rowCss2 = {
10523
10523
  ...!reservedRowKinds.includes(row.kind) && style.nonHeaderRowCss,
10524
10524
  ...isFirstBodyRow && style.firstBodyRowCss,
10525
10525
  ...isFirstHeadRow && style.firstRowCss,
@@ -10559,7 +10559,7 @@ function RowImpl(props) {
10559
10559
  const ref = useRef12(null);
10560
10560
  const dragOverCallback = useCallback10((row2, evt) => onDragOver?.(row2, evt), [onDragOver]);
10561
10561
  const onDragOverDebounced = useDebouncedCallback3(dragOverCallback, 100);
10562
- const RowContent = () => /* @__PURE__ */ jsx32(RowTag, { ...mergeProps_12(`${BorderHoverParent}${showRowHoverColor ? ` ${RowHoverClass}` : ""}`, void 0, rowCss), ...others, "data-gridrow": true, ...getCount(row.id), ref, children: isKeptGroupRow ? /* @__PURE__ */ jsx32(KeptGroupRow, { as, style, columnSizes, row, colSpan: columns.length, isLastBodyRow }) : columns.map((column2, columnIndex) => {
10562
+ const RowContent = () => /* @__PURE__ */ jsx32(RowTag, { ...mergeProps_12(`${BorderHoverParent}${showRowHoverColor ? ` ${RowHoverClass}` : ""}`, void 0, rowCss2), ...others, "data-gridrow": true, ...getCount(row.id), ref, children: isKeptGroupRow ? /* @__PURE__ */ jsx32(KeptGroupRow, { as, style, columnSizes, row, colSpan: columns.length, isLastBodyRow }) : columns.map((column2, columnIndex) => {
10563
10563
  const maybeExpandedColumn = expandColumnHidden ? columns[columnIndex - 1] : column2;
10564
10564
  const isExpanded = tableState.isExpandedColumn(maybeExpandedColumn.id);
10565
10565
  if (column2.hideOnExpand && isExpanded) {
@@ -32340,12 +32340,1087 @@ function Autocomplete(props) {
32340
32340
  ] });
32341
32341
  }
32342
32342
 
32343
+ // src/inputs/MenuSelectField/internal/AnchoredOverlay.tsx
32344
+ import { useRef as useRef80 } from "react";
32345
+ import { FocusScope as FocusScope6 } from "react-aria";
32346
+
32347
+ // src/inputs/MenuSelectField/internal/useAnchoredPosition.ts
32348
+ import { useLayoutEffect as useLayoutEffect21 } from "react";
32349
+ import { useOverlayPosition as useOverlayPosition7 } from "react-aria";
32350
+ function useAnchoredPosition(triggerRef, popoverRef, isOpen2) {
32351
+ const { overlayProps, updatePosition } = useOverlayPosition7({
32352
+ targetRef: triggerRef,
32353
+ overlayRef: popoverRef,
32354
+ isOpen: isOpen2,
32355
+ shouldFlip: true,
32356
+ placement: "bottom start",
32357
+ offset: overlayOffset,
32358
+ containerPadding: viewportPadding,
32359
+ maxHeight: menuMaxHeight
32360
+ });
32361
+ useLayoutEffect21(() => {
32362
+ if (!isOpen2) return;
32363
+ const onScroll = (event) => {
32364
+ const target = event.target;
32365
+ if (!(target instanceof Node) || !triggerRef.current || !target.contains(triggerRef.current)) return;
32366
+ updatePosition();
32367
+ };
32368
+ window.addEventListener("scroll", onScroll, true);
32369
+ return () => window.removeEventListener("scroll", onScroll, true);
32370
+ }, [isOpen2, updatePosition, triggerRef]);
32371
+ useLayoutEffect21(() => {
32372
+ if (!isOpen2) return;
32373
+ applyMenuFrame(popoverRef.current, triggerRef.current);
32374
+ });
32375
+ return {
32376
+ ...overlayProps,
32377
+ style: {
32378
+ ...overlayProps.style,
32379
+ zIndex: zIndices.popover
32380
+ }
32381
+ };
32382
+ }
32383
+ var overlayOffset = 4;
32384
+ var viewportPadding = 8;
32385
+ var menuMaxHeight = 512;
32386
+ function applyMenuFrame(overlay, trigger) {
32387
+ if (!overlay) return;
32388
+ const height = overlay.style.maxHeight;
32389
+ if (height && overlay.style.getPropertyValue("--menu-max-height") !== height) {
32390
+ overlay.style.setProperty("--menu-max-height", height);
32391
+ }
32392
+ if (!trigger) return;
32393
+ const width2 = `${trigger.offsetWidth}px`;
32394
+ if (overlay.style.minWidth !== width2) overlay.style.minWidth = width2;
32395
+ }
32396
+
32397
+ // src/inputs/MenuSelectField/internal/AnchoredOverlay.tsx
32398
+ import { jsx as jsx265 } from "react/jsx-runtime";
32399
+ function AnchoredOverlay(props) {
32400
+ const { triggerRef, isOpen: isOpen2, onClose, children } = props;
32401
+ const popoverRef = useRef80(null);
32402
+ const tid = useTestIds(props, "anchoredOverlay");
32403
+ const positionProps = useAnchoredPosition(triggerRef, popoverRef, isOpen2);
32404
+ if (!isOpen2) return null;
32405
+ return /* @__PURE__ */ jsx265(
32406
+ Popover,
32407
+ {
32408
+ triggerRef,
32409
+ popoverRef,
32410
+ positionProps: { ...positionProps, ...tid.overlay },
32411
+ onClose,
32412
+ isOpen: isOpen2,
32413
+ shouldCloseOnInteractOutside: (el) => {
32414
+ if (!triggerRef.current?.contains(el) && shouldDismissOverlay(el, triggerRef.current)) onClose();
32415
+ return false;
32416
+ },
32417
+ children: /* @__PURE__ */ jsx265(FocusScope6, { children })
32418
+ }
32419
+ );
32420
+ }
32421
+
32422
+ // src/inputs/MenuSelectField/internal/BottomSheet.tsx
32423
+ import { useLayoutEffect as useLayoutEffect22, useRef as useRef81 } from "react";
32424
+ import { FocusScope as FocusScope7, mergeProps as mergeProps47, useDialog as useDialog2, useOverlay as useOverlay3, usePreventScroll as usePreventScroll4 } from "react-aria";
32425
+ import { createPortal as createPortal11 } from "react-dom";
32426
+ import { trussProps as trussProps151, maybeCssVar as maybeCssVar74 } from "@homebound/truss/runtime";
32427
+ import { jsx as jsx266, jsxs as jsxs142 } from "react/jsx-runtime";
32428
+ function BottomSheet(props) {
32429
+ const {
32430
+ isOpen: isOpen2,
32431
+ onClose,
32432
+ label,
32433
+ children
32434
+ } = props;
32435
+ const frameRef = useRef81(null);
32436
+ const sheetRef = useRef81(null);
32437
+ const contrast = useContrastScope();
32438
+ const tid = useTestIds(props, "bottomSheet");
32439
+ useVisualViewportFrame(frameRef, isOpen2);
32440
+ usePreventScroll4({
32441
+ isDisabled: !isOpen2
32442
+ });
32443
+ const {
32444
+ overlayProps,
32445
+ underlayProps
32446
+ } = useOverlay3({
32447
+ isOpen: isOpen2,
32448
+ onClose,
32449
+ isDismissable: true
32450
+ }, sheetRef);
32451
+ const {
32452
+ dialogProps
32453
+ } = useDialog2({
32454
+ "aria-label": label
32455
+ }, sheetRef);
32456
+ if (!isOpen2) return null;
32457
+ return createPortal11(/* @__PURE__ */ jsxs142("div", { ref: frameRef, ...trussProps151(frameCss), "data-theme": contrast ? contrastDataTheme : void 0, children: [
32458
+ /* @__PURE__ */ jsx266("div", { ...underlayProps, ...trussProps151(scrimCss), ...tid.sheetScrim }),
32459
+ /* @__PURE__ */ jsx266(FocusScope7, { contain: true, restoreFocus: true, children: /* @__PURE__ */ jsxs142("div", { ...mergeProps47(overlayProps, dialogProps), ref: sheetRef, ...trussProps151(sheetCss), ...tid.sheet, children: [
32460
+ /* @__PURE__ */ jsxs142("div", { ...trussProps151({
32461
+ display: "df",
32462
+ alignItems: "aic",
32463
+ justifyContent: "jcsb",
32464
+ gap: "g_1",
32465
+ paddingLeft: "pl2",
32466
+ paddingRight: "pr2",
32467
+ height: ["h_var", {
32468
+ "--height": `${sheetHeaderHeight}px`
32469
+ }],
32470
+ borderBottomStyle: "bbs_solid",
32471
+ borderBottomWidth: "bbw_1px",
32472
+ borderColor: ["bc_var", {
32473
+ "--borderColor": "var(--b-surface-separator)"
32474
+ }]
32475
+ }), children: [
32476
+ /* @__PURE__ */ jsx266("span", { className: "fw6 fz_14px lh_20px wsnw oh to_ellipsis", children: label }),
32477
+ /* @__PURE__ */ jsx266(Button, { label: "Done", variant: "tertiary", onClick: onClose, ...tid.sheetDone })
32478
+ ] }),
32479
+ children
32480
+ ] }) })
32481
+ ] }), document.body);
32482
+ }
32483
+ function useVisualViewportFrame(frameRef, isOpen2) {
32484
+ useLayoutEffect22(() => {
32485
+ const frame = frameRef.current;
32486
+ if (!isOpen2 || !frame) return;
32487
+ let raf = 0;
32488
+ const apply = () => {
32489
+ raf = 0;
32490
+ const vv = window.visualViewport;
32491
+ const top = vv?.offsetTop ?? 0;
32492
+ const height = vv?.height ?? window.innerHeight;
32493
+ frame.style.top = `${top}px`;
32494
+ frame.style.height = `${height}px`;
32495
+ frame.style.setProperty("--menu-max-height", `${Math.max(0, Math.round(height * sheetMaxRatio) - sheetHeaderHeight)}px`);
32496
+ };
32497
+ const schedule = () => {
32498
+ if (!raf) raf = requestAnimationFrame(apply);
32499
+ };
32500
+ apply();
32501
+ window.visualViewport?.addEventListener("resize", schedule);
32502
+ window.visualViewport?.addEventListener("scroll", schedule);
32503
+ window.addEventListener("resize", schedule);
32504
+ return () => {
32505
+ if (raf) cancelAnimationFrame(raf);
32506
+ window.visualViewport?.removeEventListener("resize", schedule);
32507
+ window.visualViewport?.removeEventListener("scroll", schedule);
32508
+ window.removeEventListener("resize", schedule);
32509
+ };
32510
+ }, [frameRef, isOpen2]);
32511
+ }
32512
+ var sheetHeaderHeight = 48;
32513
+ var sheetMaxRatio = 0.85;
32514
+ var frameCss = {
32515
+ position: "fixed",
32516
+ left: "l_0",
32517
+ width: "w100",
32518
+ top: "top0",
32519
+ display: "df",
32520
+ flexDirection: "fdc",
32521
+ justifyContent: "jcfe",
32522
+ zIndex: ["z_var", {
32523
+ "--zIndex": maybeCssVar74(zIndices.popover)
32524
+ }]
32525
+ };
32526
+ var scrimCss = {
32527
+ position: "absolute",
32528
+ inset: "ins_0",
32529
+ backgroundColor: ["bgColor_var", {
32530
+ "--backgroundColor": "var(--b-scrim)"
32531
+ }]
32532
+ };
32533
+ var sheetCss = {
32534
+ ...{
32535
+ position: "relative",
32536
+ display: "df",
32537
+ flexDirection: "fdc",
32538
+ width: "w100",
32539
+ backgroundColor: ["bgColor_var", {
32540
+ "--backgroundColor": "var(--b-surface-raised)"
32541
+ }],
32542
+ color: ["color_var", {
32543
+ "--color": "var(--b-on-surface)"
32544
+ }],
32545
+ boxShadow: "bshModal",
32546
+ outline: "ol_0",
32547
+ bottom: "bot_0px"
32548
+ },
32549
+ ...{
32550
+ borderTopLeftRadius: "btlr_12px",
32551
+ borderTopRightRadius: "btrr_12px",
32552
+ paddingBottom: "pb_env_safe_area_inset_bottom"
32553
+ }
32554
+ };
32555
+
32556
+ // src/inputs/MenuSelectField/internal/MenuPanel.tsx
32557
+ import { trussProps as trussProps152 } from "@homebound/truss/runtime";
32558
+ import { jsx as jsx267, jsxs as jsxs143 } from "react/jsx-runtime";
32559
+ function MenuPanel(props) {
32560
+ const {
32561
+ header,
32562
+ children,
32563
+ variant = "anchored"
32564
+ } = props;
32565
+ const tid = useTestIds(props, "menuPanel");
32566
+ return /* @__PURE__ */ jsxs143("div", { ...trussProps152({
32567
+ ...panelCss,
32568
+ ...variant === "anchored" ? anchoredCss : {}
32569
+ }), ...tid.menuPanel, children: [
32570
+ header && /* @__PURE__ */ jsx267("div", { ...trussProps152({
32571
+ flexShrink: "fs0",
32572
+ borderBottomStyle: "bbs_solid",
32573
+ borderBottomWidth: "bbw_1px",
32574
+ borderColor: ["bc_var", {
32575
+ "--borderColor": "var(--b-surface-separator)"
32576
+ }]
32577
+ }), children: header }),
32578
+ /* @__PURE__ */ jsx267("div", { className: "df fdc fg1 mh0", children })
32579
+ ] });
32580
+ }
32581
+ var panelCss = {
32582
+ display: "df",
32583
+ flexDirection: "fdc",
32584
+ width: "w100",
32585
+ overflow: "oh",
32586
+ color: ["color_var", {
32587
+ "--color": "var(--b-on-surface)"
32588
+ }],
32589
+ maxHeight: "maxh_var_menu_max_height_512px"
32590
+ };
32591
+ var anchoredCss = {
32592
+ backgroundColor: ["bgColor_var", {
32593
+ "--backgroundColor": "var(--b-surface-raised)"
32594
+ }],
32595
+ borderRadius: "br4",
32596
+ boxShadow: "bshBasic"
32597
+ };
32598
+
32599
+ // src/inputs/MenuSelectField/internal/MenuSearchInput.tsx
32600
+ import { trussProps as trussProps153 } from "@homebound/truss/runtime";
32601
+ import { jsx as jsx268, jsxs as jsxs144 } from "react/jsx-runtime";
32602
+ function MenuSearchInput(props) {
32603
+ const {
32604
+ search,
32605
+ inputRef,
32606
+ label,
32607
+ placeholder = "Search"
32608
+ } = props;
32609
+ const tid = useTestIds(props, "menuSearch");
32610
+ return /* @__PURE__ */ jsxs144("label", { className: "df aic g_1 pl2 pr2 h_48px cur_text", children: [
32611
+ /* @__PURE__ */ jsx268("span", { ...trussProps153({
32612
+ display: "df",
32613
+ alignItems: "aic",
32614
+ flexShrink: "fs0",
32615
+ color: ["color_var", {
32616
+ "--color": "var(--b-on-surface-muted)"
32617
+ }]
32618
+ }), children: /* @__PURE__ */ jsx268(Icon, { icon: "search" }) }),
32619
+ /* @__PURE__ */ jsx268("input", { ref: inputRef, type: "text", role: "combobox", "aria-label": label, "aria-autocomplete": "list", "aria-expanded": true, "aria-controls": search.listId, "aria-activedescendant": search.activeDescendant, autoComplete: "off", autoCorrect: "off", spellCheck: false, enterKeyHint: "done", placeholder, value: search.value, onChange: (e) => search.onChange(e.target.value), onKeyDown: search.onKeyDown, ...trussProps153(inputCss), ...tid.search })
32620
+ ] });
32621
+ }
32622
+ var inputCss = {
32623
+ ...{
32624
+ flexGrow: "fg1",
32625
+ minWidth: "mw0",
32626
+ outline: "ol_0",
32627
+ backgroundColor: "bgTransparent",
32628
+ fontWeight: "fw4",
32629
+ fontSize: "fz_14px",
32630
+ lineHeight: "lh_20px",
32631
+ color: ["color_var", {
32632
+ "--color": "var(--b-on-surface)"
32633
+ }]
32634
+ },
32635
+ // iOS zooms the page when a focused input is under 16px.
32636
+ ...{
32637
+ fontSize: "sm_fs_16px"
32638
+ }
32639
+ };
32640
+
32641
+ // src/inputs/MenuSelectField/internal/MenuSelectTrigger.tsx
32642
+ import { mergeProps as mergeProps48 } from "react-aria";
32643
+ import { trussProps as trussProps154, mergeProps as mergeProps_15, maybeCssVar as maybeCssVar75 } from "@homebound/truss/runtime";
32644
+ import { Fragment as Fragment56, jsx as jsx269, jsxs as jsxs145 } from "react/jsx-runtime";
32645
+ function MenuSelectTrigger(props) {
32646
+ const {
32647
+ label,
32648
+ required,
32649
+ errorMsg,
32650
+ helperText,
32651
+ disabled,
32652
+ readOnly,
32653
+ labelStyle: labelStyleProp,
32654
+ inputStylePalette,
32655
+ trigger,
32656
+ triggerRef
32657
+ } = props;
32658
+ const internalProps = props.internalProps ?? {};
32659
+ const {
32660
+ compound = false,
32661
+ forceFocus = false,
32662
+ forceHover = false
32663
+ } = internalProps;
32664
+ const tid = useTestIds(props, defaultTestId(label));
32665
+ const {
32666
+ fieldProps
32667
+ } = usePresentationContext();
32668
+ const labelStyle = labelStyleProp ?? fieldProps?.labelStyle ?? "above";
32669
+ const compact = props.compact ?? fieldProps?.compact ?? false;
32670
+ const borderless = props.borderless ?? fieldProps?.borderless ?? false;
32671
+ const borderOnHover = props.borderOnHover ?? fieldProps?.borderOnHover ?? false;
32672
+ const fullWidth = props.fullWidth ?? fieldProps?.fullWidth ?? false;
32673
+ const visuallyDisabled = props.visuallyDisabled ?? fieldProps?.visuallyDisabled ?? true;
32674
+ const errorInTooltip = props.errorInTooltip ?? fieldProps?.errorInTooltip ?? false;
32675
+ const typeScale = fieldProps?.typeScale ?? "sm";
32676
+ const labelSuffix = useLabelSuffix(required, trigger.isReadOnly);
32677
+ const showFocus = (trigger.isFocusVisible || trigger.isOpen) && !trigger.isDisabled && !trigger.isReadOnly || forceFocus;
32678
+ const showHover = trigger.isHovered && !trigger.isDisabled && !trigger.isReadOnly && !showFocus || forceHover;
32679
+ const showErrorAndHelper = !compound && !trigger.isDisabled && !trigger.isReadOnly;
32680
+ const {
32681
+ proposedValue: proposedText,
32682
+ originalValue: originalText
32683
+ } = trigger.proposalProps;
32684
+ const showProposal = proposedText !== void 0;
32685
+ const originalBelow = originalText && !trigger.isReadOnly ? originalText : void 0;
32686
+ const fieldChrome = getFieldChrome({
32687
+ typeScale,
32688
+ labelStyle,
32689
+ labelLeftFieldWidth: fieldProps?.labelLeftFieldWidth,
32690
+ compact,
32691
+ borderless,
32692
+ borderOnHover,
32693
+ fullWidth,
32694
+ compound,
32695
+ visuallyDisabled,
32696
+ isHovered: trigger.isHovered || forceHover,
32697
+ showProposal,
32698
+ inputStylePalette
32699
+ });
32700
+ const fieldStateCss = {
32701
+ ...fieldChrome.control,
32702
+ ...trigger.isDisabled ? fieldChrome.disabled : {},
32703
+ ...showFocus ? fieldChrome.focus : {},
32704
+ ...showHover ? fieldChrome.hover : {},
32705
+ ...errorMsg && !trigger.isDisabled ? fieldChrome.error : {},
32706
+ ...{
32707
+ textAlign: "tal",
32708
+ outline: "ol_0",
32709
+ appearance: "app_none",
32710
+ font: "fnt_inherit",
32711
+ ...!trigger.isDisabled ? {
32712
+ cursor: "cur_pointer"
32713
+ } : {}
32714
+ }
32715
+ };
32716
+ const supporting = /* @__PURE__ */ jsxs145(Fragment56, { children: [
32717
+ originalBelow && /* @__PURE__ */ jsx269(OriginalValue, { originalValue: originalBelow, ...tid.originalValue }),
32718
+ showErrorAndHelper && errorMsg && !errorInTooltip && /* @__PURE__ */ jsx269(ErrorMessage, { id: trigger.errorId, errorMsg, ...tid.errorMsg }),
32719
+ showErrorAndHelper && helperText && /* @__PURE__ */ jsx269(HelperText, { helperText, ...tid.helperText })
32720
+ ] });
32721
+ const hasSupporting = !!(originalBelow || showErrorAndHelper && (errorMsg || helperText));
32722
+ const valueNode = /* @__PURE__ */ jsxs145(Fragment56, { children: [
32723
+ labelStyle === "inline" && /* @__PURE__ */ jsxs145("span", { id: trigger.labelId, ...trussProps154({
32724
+ fontWeight: "fw4",
32725
+ fontSize: "fz_14px",
32726
+ lineHeight: "lh_20px",
32727
+ whiteSpace: "wsnw",
32728
+ paddingRight: "pr_4px",
32729
+ color: ["color_var", {
32730
+ "--color": maybeCssVar75(trigger.isDisabled && visuallyDisabled ? "currentColor" : "--b-text-label" /* TextLabel */)
32731
+ }]
32732
+ }), children: [
32733
+ label,
32734
+ ":"
32735
+ ] }),
32736
+ /* @__PURE__ */ jsx269("span", { id: trigger.valueId, className: "df aic fg1 mw0 oh", children: trigger.isReadOnly && showProposal ? /* @__PURE__ */ jsx269("span", { className: "fg1 wsnw oh to_ellipsis", children: /* @__PURE__ */ jsx269(ProposedValue, { original: originalText, proposed: proposedText, ...tid.proposedValue }) }) : /* @__PURE__ */ jsxs145(Fragment56, { children: [
32737
+ trigger.selectedLabels.length > 0 && /* @__PURE__ */ jsx269(Tooltip, { title: /* @__PURE__ */ jsx269(SelectedLabels, { labels: trigger.selectedLabels }), children: /* @__PURE__ */ jsx269("span", { className: "df aic fs0 mr1", children: /* @__PURE__ */ jsx269(CountBadge, { count: trigger.selectedLabels.length, ...tid.count }) }) }),
32738
+ /* @__PURE__ */ jsx269("span", { ...trussProps154({
32739
+ ...{
32740
+ flexGrow: "fg1",
32741
+ whiteSpace: "wsnw",
32742
+ overflow: "oh",
32743
+ textOverflow: "to_ellipsis",
32744
+ color: ["color_var", {
32745
+ "--color": maybeCssVar75(trigger.isPlaceholder ? inputPlaceholderColor : void 0)
32746
+ }]
32747
+ },
32748
+ // A placeholder reads as hint text, so it stays at the field's regular weight.
32749
+ ...!trigger.isPlaceholder ? selectedValueCss(labelStyle, trigger.isReadOnly) : {},
32750
+ ...showProposal ? {
32751
+ fontWeight: "fw6",
32752
+ color: ["color_var", {
32753
+ "--color": "var(--b-ai-field-fg)"
32754
+ }]
32755
+ } : {}
32756
+ }), children: trigger.displayText })
32757
+ ] }) }),
32758
+ errorInTooltip && errorMsg && showErrorAndHelper && /* @__PURE__ */ jsx269("span", { className: "df aic fs0 pl1", children: /* @__PURE__ */ jsx269(Icon, { icon: "error", color: "--b-danger" /* Danger */, tooltip: errorMsg }) }),
32759
+ !trigger.isReadOnly && /* @__PURE__ */ jsx269("span", { ...trussProps154({
32760
+ display: "df",
32761
+ alignItems: "aic",
32762
+ flexShrink: "fs0",
32763
+ paddingLeft: "pl1",
32764
+ color: ["color_var", {
32765
+ "--color": maybeCssVar75(trigger.isDisabled ? "--b-field-text-disabled" /* FieldTextDisabled */ : "--b-text-placeholder" /* TextPlaceholder */)
32766
+ }]
32767
+ }), ...tid.toggle, children: /* @__PURE__ */ jsx269(Icon, { icon: trigger.isOpen ? "chevronUp" : "chevronDown" }) })
32768
+ ] });
32769
+ return /* @__PURE__ */ jsxs145(Fragment56, { children: [
32770
+ /* @__PURE__ */ jsxs145("div", { ...trussProps154(fieldChrome.container), children: [
32771
+ label && labelStyle !== "inline" && /* @__PURE__ */ jsx269(Label, { labelProps: {
32772
+ id: trigger.labelId,
32773
+ htmlFor: trigger.isReadOnly ? void 0 : trigger.triggerId,
32774
+ onClick: (event) => {
32775
+ event.preventDefault();
32776
+ if (trigger.isDisabled || trigger.isReadOnly || trigger.isOpen) return;
32777
+ triggerRef.current?.focus();
32778
+ trigger.open();
32779
+ }
32780
+ }, hidden: labelStyle === "hidden", label, inline: labelStyle === "left", suffix: labelSuffix, ...tid.label }),
32781
+ maybeTooltip({
32782
+ title: resolveTooltip(disabled, void 0, readOnly),
32783
+ placement: "top",
32784
+ children: trigger.isReadOnly ? /* @__PURE__ */ jsx269("div", { ...trussProps154(fieldChrome.readOnly), "data-readonly": "true", "data-ai-mode": showProposal ? "true" : void 0, ...tid, children: valueNode }) : /* @__PURE__ */ jsx269("button", { ...mergeProps48(trigger.hoverProps, trigger.focusProps, {
32785
+ id: trigger.triggerId,
32786
+ type: "button",
32787
+ disabled: trigger.isDisabled,
32788
+ "aria-haspopup": "listbox",
32789
+ "aria-expanded": trigger.isOpen,
32790
+ "aria-controls": trigger.listId,
32791
+ "aria-labelledby": `${trigger.labelId} ${trigger.valueId}`,
32792
+ "aria-invalid": errorMsg ? true : void 0,
32793
+ "aria-errormessage": errorMsg ? trigger.errorId : void 0,
32794
+ "data-ai-mode": showProposal ? "true" : void 0,
32795
+ onKeyDown: trigger.onKeyDown,
32796
+ onClick: () => trigger.isOpen ? trigger.close({
32797
+ restoreFocus: true
32798
+ }) : trigger.open(),
32799
+ onFocus: trigger.onFocus,
32800
+ onBlur: trigger.onBlur
32801
+ }), ref: triggerRef, ...mergeProps_15(BorderHoverChild, void 0, fieldStateCss), ...tid, children: valueNode })
32802
+ }),
32803
+ labelStyle !== "left" && supporting
32804
+ ] }),
32805
+ labelStyle === "left" && hasSupporting && /* @__PURE__ */ jsx269("div", { className: "mt_neg1 ml_50", children: supporting })
32806
+ ] });
32807
+ }
32808
+ var inputPlaceholderColor = "#9ca3af";
32809
+ function SelectedLabels({
32810
+ labels
32811
+ }) {
32812
+ return /* @__PURE__ */ jsx269("ul", { className: "mt0 mb0 mr0 ml0 pl2", children: labels.map(({
32813
+ key,
32814
+ label
32815
+ }) => /* @__PURE__ */ jsx269("li", { children: label }, key)) });
32816
+ }
32817
+
32818
+ // src/inputs/MenuSelectField/internal/OptionList.tsx
32819
+ import { getInteractionModality as getInteractionModality2 } from "@react-aria/interactions";
32820
+ import { useEffect as useEffect42, useLayoutEffect as useLayoutEffect23, useRef as useRef83, useState as useState70 } from "react";
32821
+ import { useListBox as useListBox2 } from "react-aria";
32822
+ import { Virtuoso as Virtuoso3 } from "react-virtuoso";
32823
+
32824
+ // src/inputs/MenuSelectField/internal/OptionRow.tsx
32825
+ import { useRef as useRef82 } from "react";
32826
+ import { mergeProps as mergeProps49, useHover as useHover26, useOption as useOption3 } from "react-aria";
32827
+ import { trussProps as trussProps155 } from "@homebound/truss/runtime";
32828
+ import { jsx as jsx270, jsxs as jsxs146 } from "react/jsx-runtime";
32829
+ function SingleOptionRow(props) {
32830
+ return /* @__PURE__ */ jsx270(BaseOptionRow, { ...props, variant: "check" });
32831
+ }
32832
+ function MultiOptionRow(props) {
32833
+ return /* @__PURE__ */ jsx270(BaseOptionRow, { ...props, variant: "checkbox" });
32834
+ }
32835
+ function BaseOptionRow(props) {
32836
+ const {
32837
+ item,
32838
+ state,
32839
+ id,
32840
+ disabledReason,
32841
+ variant
32842
+ } = props;
32843
+ const ref = useRef82(null);
32844
+ const tid = useTestIds(props, "option");
32845
+ const {
32846
+ hoverProps,
32847
+ isHovered
32848
+ } = useHover26({});
32849
+ const {
32850
+ optionProps,
32851
+ isDisabled,
32852
+ isFocused,
32853
+ isSelected
32854
+ } = useOption3({
32855
+ key: item.key,
32856
+ shouldSelectOnPressUp: true,
32857
+ shouldFocusOnHover: false
32858
+ }, state, ref);
32859
+ const highlighted = !isDisabled && (isHovered || isFocused);
32860
+ return maybeTooltip({
32861
+ title: disabledReason,
32862
+ placement: "top",
32863
+ children: /* @__PURE__ */ jsxs146(
32864
+ "div",
32865
+ {
32866
+ ...mergeProps49(optionProps, hoverProps),
32867
+ id,
32868
+ "data-key": item.key,
32869
+ "data-label": item.textValue,
32870
+ ref,
32871
+ ...trussProps155({
32872
+ ...rowCss,
32873
+ ...highlighted ? {
32874
+ backgroundColor: ["bgColor_var", {
32875
+ "--backgroundColor": "var(--b-surface-raised-hover)"
32876
+ }]
32877
+ } : {},
32878
+ ...isDisabled ? {
32879
+ cursor: "cur_not_allowed",
32880
+ color: ["color_var", {
32881
+ "--color": "var(--b-text-disabled)"
32882
+ }]
32883
+ } : {}
32884
+ }),
32885
+ ...tid.option,
32886
+ children: [
32887
+ variant === "checkbox" && /* @__PURE__ */ jsx270(StyledCheckbox, { isSelected, isDisabled }),
32888
+ /* @__PURE__ */ jsx270("span", { className: "wsnw oh to_ellipsis fg1 mw0", children: item.rendered }),
32889
+ variant === "check" && isSelected && /* @__PURE__ */ jsx270("span", { className: "df aic fs0", children: /* @__PURE__ */ jsx270(Icon, { icon: "check", color: isDisabled ? "--b-text-disabled" /* TextDisabled */ : "--b-selection-indicator" /* SelectionIndicator */ }) })
32890
+ ]
32891
+ }
32892
+ )
32893
+ });
32894
+ }
32895
+ var menuRowHeight = 40;
32896
+ var rowCss = {
32897
+ display: "df",
32898
+ alignItems: "aic",
32899
+ gap: "g_1",
32900
+ paddingLeft: "pl2",
32901
+ paddingRight: "pr2",
32902
+ height: ["h_var", {
32903
+ "--height": `${menuRowHeight}px`
32904
+ }],
32905
+ outline: "ol_0",
32906
+ cursor: "cur_pointer",
32907
+ fontWeight: "fw4",
32908
+ fontSize: "fz_14px",
32909
+ lineHeight: "lh_20px",
32910
+ color: ["color_var", {
32911
+ "--color": "var(--b-on-surface)"
32912
+ }]
32913
+ };
32914
+
32915
+ // src/inputs/MenuSelectField/internal/OptionList.tsx
32916
+ import { trussProps as trussProps156 } from "@homebound/truss/runtime";
32917
+ import { Fragment as Fragment57, jsx as jsx271, jsxs as jsxs147 } from "react/jsx-runtime";
32918
+ function OptionList(props) {
32919
+ const {
32920
+ menu,
32921
+ listRef,
32922
+ label,
32923
+ onKeyDown,
32924
+ activeDescendant
32925
+ } = props;
32926
+ const {
32927
+ state,
32928
+ listId: id,
32929
+ disabledReasons,
32930
+ initialIndex,
32931
+ loading,
32932
+ rowVariant
32933
+ } = menu;
32934
+ const tid = useTestIds(props, "optionList");
32935
+ const virtuosoRef = useRef83(null);
32936
+ const {
32937
+ listBoxProps
32938
+ } = useListBox2({
32939
+ id,
32940
+ "aria-label": label,
32941
+ autoFocus: false,
32942
+ shouldUseVirtualFocus: true,
32943
+ shouldFocusOnHover: false,
32944
+ shouldSelectOnPressUp: true,
32945
+ isVirtualized: true
32946
+ }, state, listRef);
32947
+ const items = [...state.collection];
32948
+ const focusedKey = state.selectionManager.focusedKey;
32949
+ useEffect42(() => {
32950
+ if (focusedKey == null || getInteractionModality2() !== "keyboard") return;
32951
+ const index = state.collection.getItem(focusedKey)?.index;
32952
+ if (index !== void 0) virtuosoRef.current?.scrollIntoView({
32953
+ index,
32954
+ behavior: "auto"
32955
+ });
32956
+ }, [focusedKey, state.collection]);
32957
+ const [{
32958
+ initialTop,
32959
+ initialCount
32960
+ }] = useState70(() => ({
32961
+ initialTop: Math.max(0, Math.min(initialIndex, items.length - 1)),
32962
+ initialCount: items.length
32963
+ }));
32964
+ const syncScroll = initialTop + initialRenderCount <= maxSyncRenderCount;
32965
+ useLayoutEffect23(() => {
32966
+ const scroller = listRef.current?.firstElementChild;
32967
+ if (!syncScroll || !scroller) return;
32968
+ const maxTop = Math.max(0, initialCount * menuRowHeight - scroller.clientHeight);
32969
+ setScrollTop(scroller, Math.min(initialTop * menuRowHeight, maxTop));
32970
+ }, [listRef, syncScroll, initialTop, initialCount]);
32971
+ const Row2 = rowVariant === "checkbox" ? MultiOptionRow : SingleOptionRow;
32972
+ const isTest = process.env.NODE_ENV === "test";
32973
+ return /* @__PURE__ */ jsx271("div", { ...listBoxProps, ...onKeyDown ? {
32974
+ onKeyDown,
32975
+ tabIndex: -1,
32976
+ "aria-activedescendant": activeDescendant
32977
+ } : {}, ref: listRef, className: "df fdc fg1 mh0 ol_0", ...tid.listbox, children: items.length === 0 && !loading ? /* @__PURE__ */ jsx271("div", { role: "presentation", ...trussProps156(emptyCss), ...tid.empty, children: "No results" }) : /* @__PURE__ */ jsxs147(Fragment57, { children: [
32978
+ items.length > 0 && /* @__PURE__ */ jsx271(Virtuoso3, { ref: virtuosoRef, style: {
32979
+ height: items.length * menuRowHeight,
32980
+ flexShrink: 1,
32981
+ minHeight: 0,
32982
+ overscrollBehavior: "contain"
32983
+ }, totalCount: items.length, fixedItemHeight: menuRowHeight, computeItemKey: (index) => String(items[index]?.key ?? index), ...isTest ? {
32984
+ initialItemCount: items.length
32985
+ } : syncScroll ? {
32986
+ initialItemCount: Math.min(items.length, initialTop + initialRenderCount)
32987
+ } : {
32988
+ initialTopMostItemIndex: initialTop
32989
+ }, itemContent: (index) => {
32990
+ const item = items[index];
32991
+ if (!item) return null;
32992
+ return /* @__PURE__ */ jsx271(Row2, { item, state, id: optionDomId(id, index), disabledReason: disabledReasons[String(item.key)], ...tid });
32993
+ } }, isTest ? items.length : "virtuoso"),
32994
+ loading && /* @__PURE__ */ jsx271(LoadingDots, {})
32995
+ ] }) });
32996
+ }
32997
+ function optionDomId(listId, index) {
32998
+ return `${listId}-option-${index}`;
32999
+ }
33000
+ function setScrollTop(el, top) {
33001
+ el.scrollTop = top;
33002
+ }
33003
+ var initialRenderCount = 13;
33004
+ var maxSyncRenderCount = 60;
33005
+ var emptyCss = {
33006
+ display: "df",
33007
+ alignItems: "aic",
33008
+ paddingLeft: "pl2",
33009
+ paddingRight: "pr2",
33010
+ height: ["h_var", {
33011
+ "--height": `${menuRowHeight}px`
33012
+ }],
33013
+ fontWeight: "fw4",
33014
+ fontSize: "fz_14px",
33015
+ lineHeight: "lh_20px",
33016
+ color: ["color_var", {
33017
+ "--color": "var(--b-on-surface-muted)"
33018
+ }]
33019
+ };
33020
+
33021
+ // src/inputs/MenuSelectField/internal/useMenuSelectField.tsx
33022
+ import { useId as useId6, useLayoutEffect as useLayoutEffect24, useMemo as useMemo61, useRef as useRef84, useState as useState71 } from "react";
33023
+ import { ListKeyboardDelegate, useFilter as useFilter5, useFocusRing as useFocusRing23, useHover as useHover27 } from "react-aria";
33024
+ import { Item as Item6, useListState } from "react-stately";
33025
+ import { jsx as jsx272 } from "react/jsx-runtime";
33026
+ function useMenuSelectField(props) {
33027
+ const {
33028
+ options: optionsProp,
33029
+ getOptionValue = defaultOptionValue,
33030
+ getOptionLabel = defaultOptionLabel,
33031
+ getOptionMenuLabel,
33032
+ getOptionSearchText,
33033
+ disabledOptions,
33034
+ nothingSelectedText = "",
33035
+ placeholder,
33036
+ disabled,
33037
+ readOnly,
33038
+ onFocus,
33039
+ onBlur,
33040
+ selectionMode,
33041
+ values: propValues,
33042
+ proposedValues,
33043
+ onCommit
33044
+ } = props;
33045
+ const multiple = selectionMode === "multiple";
33046
+ const isDisabled = !!disabled;
33047
+ const isReadOnly = !!readOnly;
33048
+ const fieldId = useId6();
33049
+ const listId = `${fieldId}-listbox`;
33050
+ const triggerId = `${fieldId}-trigger`;
33051
+ const labelId = `${fieldId}-label`;
33052
+ const valueId = `${fieldId}-value`;
33053
+ const errorId = `${fieldId}-error`;
33054
+ const triggerRef = useRef84(null);
33055
+ const searchRef = useRef84(null);
33056
+ const listRef = useRef84(null);
33057
+ const hasFocusRef = useRef84(false);
33058
+ const [isOpen2, setIsOpen] = useState71(false);
33059
+ const [search, setSearch] = useState71("");
33060
+ const [optionsLoading, setOptionsLoading] = useState71(false);
33061
+ const didRequestOptionsRef = useRef84(false);
33062
+ const options = useMemo61(
33063
+ () => initializeOptions(optionsProp, getOptionValue, getOptionLabel, void 0, false),
33064
+ // getOptionValue and getOptionLabel are typically inline lambdas
33065
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
33066
+ [optionsProp]
33067
+ );
33068
+ const { hoverProps, isHovered } = useHover27({});
33069
+ const { focusProps, isFocusVisible } = useFocusRing23();
33070
+ const { contains } = useFilter5({ sensitivity: "base" });
33071
+ const optionsByKey = useMemo61(
33072
+ () => new Map(options.map((o) => [valueToKey(getOptionValue(o)), o])),
33073
+ // getOptionValue is typically an inline lambda
33074
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
33075
+ [options]
33076
+ );
33077
+ const { effectiveValue, proposalProps } = useAiProposal(
33078
+ propValues,
33079
+ proposedValues,
33080
+ (vs) => labelsFor(vs, options, getOptionValue, getOptionLabel).join(", ")
33081
+ );
33082
+ const values = useMemo61(() => effectiveValue ?? [], [effectiveValue]);
33083
+ const selectedKeys = useMemo61(() => new Set(values.map(valueToKey)), [values]);
33084
+ const selectedOptions = useMemo61(
33085
+ () => values.map((v) => optionsByKey.get(valueToKey(v))).filter((o) => o !== void 0),
33086
+ [values, optionsByKey]
33087
+ );
33088
+ const filteredOptions = useMemo61(
33089
+ () => search ? options.filter((o) => matchesSearch(o, search, getOptionLabel, getOptionSearchText, contains)) : options,
33090
+ // getOptionLabel and getOptionSearchText are typically inline lambdas
33091
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
33092
+ [options, search, contains]
33093
+ );
33094
+ const [disabledKeys, disabledReasons] = useMemo61(() => {
33095
+ const tuples = (disabledOptions ?? []).map(disabledOptionToKeyedTuple);
33096
+ return [tuples.map(([k]) => String(k)), Object.fromEntries(tuples.map(([k, r]) => [String(k), r]))];
33097
+ }, [disabledOptions]);
33098
+ function onSelectionChange(keys) {
33099
+ if (keys === "all") return;
33100
+ if (!multiple) {
33101
+ const [key] = [...keys];
33102
+ if (key === void 0) {
33103
+ close({ restoreFocus: true });
33104
+ return;
33105
+ }
33106
+ const opt = optionsByKey.get(String(key));
33107
+ proposalProps.onUserEdit?.();
33108
+ onCommit(opt === void 0 ? [] : [getOptionValue(opt)], opt === void 0 ? [] : [opt]);
33109
+ close({ restoreFocus: true });
33110
+ return;
33111
+ }
33112
+ const next = values.filter((v) => keys.has(valueToKey(v)));
33113
+ for (const k of keys) {
33114
+ const opt = optionsByKey.get(String(k));
33115
+ if (opt !== void 0 && !selectedKeys.has(String(k))) next.push(getOptionValue(opt));
33116
+ }
33117
+ proposalProps.onUserEdit?.();
33118
+ onCommit(
33119
+ next,
33120
+ next.map((v) => optionsByKey.get(valueToKey(v))).filter((o) => o !== void 0)
33121
+ );
33122
+ }
33123
+ const state = useListState({
33124
+ items: filteredOptions,
33125
+ children: (o) => /* @__PURE__ */ jsx272(Item6, { textValue: getOptionLabel(o), children: getOptionMenuLabel ? getOptionMenuLabel(o) : getOptionLabel(o) }, valueToKey(getOptionValue(o))),
33126
+ selectionMode: multiple ? "multiple" : "single",
33127
+ selectedKeys,
33128
+ disabledKeys,
33129
+ onSelectionChange
33130
+ });
33131
+ const { selectionManager } = state;
33132
+ const keyboardDelegate = useMemo61(
33133
+ () => new MenuSelectKeyboardDelegate({
33134
+ collection: state.collection,
33135
+ disabledKeys: state.disabledKeys,
33136
+ ref: listRef
33137
+ }),
33138
+ [state.collection, state.disabledKeys]
33139
+ );
33140
+ function open() {
33141
+ if (isDisabled || isReadOnly) return;
33142
+ setSearch("");
33143
+ setIsOpen(true);
33144
+ if (didRequestOptionsRef.current || Array.isArray(optionsProp)) return;
33145
+ didRequestOptionsRef.current = true;
33146
+ setOptionsLoading(true);
33147
+ void optionsProp.load().finally(() => setOptionsLoading(false));
33148
+ }
33149
+ function close(opts) {
33150
+ setIsOpen(false);
33151
+ setSearch("");
33152
+ if (opts.restoreFocus) {
33153
+ triggerRef.current?.focus({ preventScroll: true });
33154
+ } else if (hasFocusRef.current) {
33155
+ settleBlur();
33156
+ }
33157
+ }
33158
+ function settleBlur() {
33159
+ hasFocusRef.current = false;
33160
+ maybeCall(proposalProps.onUserBlur);
33161
+ maybeCall(onBlur);
33162
+ }
33163
+ const showSearch = options.length > searchOptionLimit;
33164
+ useLayoutEffect24(() => {
33165
+ if (!isOpen2) return;
33166
+ const keyTarget = showSearch ? searchRef.current : listRef.current;
33167
+ keyTarget?.focus({ preventScroll: true });
33168
+ selectionManager.setFocusedKey(null);
33169
+ selectionManager.setFocused(false);
33170
+ }, [isOpen2, showSearch]);
33171
+ function onSearchChange(value) {
33172
+ setSearch(value);
33173
+ selectionManager.setFocusedKey(null);
33174
+ selectionManager.setFocused(false);
33175
+ }
33176
+ function focusKey(key) {
33177
+ if (key == null) return;
33178
+ selectionManager.setFocused(true);
33179
+ selectionManager.setFocusedKey(key);
33180
+ }
33181
+ function onMenuKeyDown(e) {
33182
+ const current2 = selectionManager.focusedKey;
33183
+ switch (e.key) {
33184
+ case "ArrowDown":
33185
+ e.preventDefault();
33186
+ focusKey(
33187
+ current2 == null ? keyboardDelegate.getFirstKey() : keyboardDelegate.getKeyBelow(current2) ?? keyboardDelegate.getFirstKey()
33188
+ );
33189
+ break;
33190
+ case "ArrowUp":
33191
+ e.preventDefault();
33192
+ focusKey(
33193
+ current2 == null ? keyboardDelegate.getLastKey() : keyboardDelegate.getKeyAbove(current2) ?? keyboardDelegate.getLastKey()
33194
+ );
33195
+ break;
33196
+ case "PageDown":
33197
+ e.preventDefault();
33198
+ focusKey(current2 == null ? keyboardDelegate.getFirstKey() : keyboardDelegate.getKeyPageBelow(current2));
33199
+ break;
33200
+ case "PageUp":
33201
+ e.preventDefault();
33202
+ focusKey(current2 == null ? keyboardDelegate.getLastKey() : keyboardDelegate.getKeyPageAbove(current2));
33203
+ break;
33204
+ case "Home":
33205
+ e.preventDefault();
33206
+ focusKey(keyboardDelegate.getFirstKey());
33207
+ break;
33208
+ case "End":
33209
+ e.preventDefault();
33210
+ focusKey(keyboardDelegate.getLastKey());
33211
+ break;
33212
+ case "Enter": {
33213
+ e.preventDefault();
33214
+ const key = selectionManager.focusedKey;
33215
+ if (key != null && !state.disabledKeys.has(key)) selectionManager.select(key);
33216
+ break;
33217
+ }
33218
+ case "Escape":
33219
+ e.preventDefault();
33220
+ e.stopPropagation();
33221
+ close({ restoreFocus: true });
33222
+ break;
33223
+ case "Tab":
33224
+ e.preventDefault();
33225
+ close({ restoreFocus: true });
33226
+ break;
33227
+ default:
33228
+ break;
33229
+ }
33230
+ }
33231
+ function onTriggerKeyDown(e) {
33232
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
33233
+ e.preventDefault();
33234
+ open();
33235
+ }
33236
+ }
33237
+ function onTriggerFocus() {
33238
+ if (hasFocusRef.current) return;
33239
+ hasFocusRef.current = true;
33240
+ maybeCall(onFocus);
33241
+ }
33242
+ function onTriggerBlur() {
33243
+ if (isOpen2) return;
33244
+ settleBlur();
33245
+ }
33246
+ const focusedKey = selectionManager.focusedKey;
33247
+ const focusedIndex = focusedKey != null ? state.collection.getItem(focusedKey)?.index : void 0;
33248
+ const activeDescendant = isOpen2 && focusedIndex !== void 0 ? optionDomId(listId, focusedIndex) : void 0;
33249
+ const initialIndex = Math.max(
33250
+ 0,
33251
+ filteredOptions.findIndex((o) => selectedKeys.has(valueToKey(getOptionValue(o))))
33252
+ );
33253
+ const selectedText = !multiple && selectedOptions[0] !== void 0 ? getOptionLabel(selectedOptions[0]) : "";
33254
+ const displayText = selectedText || (values.length > 0 ? "" : nothingSelectedText || placeholder || "");
33255
+ const isPlaceholder = !selectedText && values.length === 0 && !nothingSelectedText && !!placeholder;
33256
+ const selectedLabels = multiple ? selectedOptions.map((o) => ({ key: valueToKey(getOptionValue(o)), label: getOptionLabel(o) })) : [];
33257
+ const triggerProps = {
33258
+ isDisabled,
33259
+ isReadOnly,
33260
+ isOpen: isOpen2,
33261
+ listId,
33262
+ triggerId,
33263
+ labelId,
33264
+ valueId,
33265
+ errorId,
33266
+ hoverProps,
33267
+ focusProps,
33268
+ isFocusVisible,
33269
+ isHovered,
33270
+ open,
33271
+ close,
33272
+ onKeyDown: onTriggerKeyDown,
33273
+ onFocus: onTriggerFocus,
33274
+ onBlur: onTriggerBlur,
33275
+ displayText,
33276
+ isPlaceholder,
33277
+ selectedLabels,
33278
+ proposalProps
33279
+ };
33280
+ const searchProps = {
33281
+ show: showSearch,
33282
+ value: search,
33283
+ onChange: onSearchChange,
33284
+ listId,
33285
+ activeDescendant,
33286
+ onKeyDown: onMenuKeyDown
33287
+ };
33288
+ const menuProps = {
33289
+ isOpen: isOpen2,
33290
+ close,
33291
+ listId,
33292
+ state,
33293
+ loading: optionsLoading,
33294
+ disabledReasons,
33295
+ initialIndex,
33296
+ rowVariant: multiple ? "checkbox" : "check",
33297
+ onKeyDown: onMenuKeyDown,
33298
+ activeDescendant
33299
+ };
33300
+ return { triggerRef, trigger: triggerProps, searchRef, search: searchProps, listRef, menu: menuProps };
33301
+ }
33302
+ function labelsFor(values, options, getOptionValue, getOptionLabel) {
33303
+ const keys = new Set(values.map(valueToKey));
33304
+ return options.filter((option) => keys.has(valueToKey(getOptionValue(option)))).map(getOptionLabel);
33305
+ }
33306
+ function matchesSearch(option, query, getOptionLabel, getOptionSearchText, contains) {
33307
+ if (contains(getOptionLabel(option), query)) return true;
33308
+ const extra = getOptionSearchText?.(option);
33309
+ const terms = typeof extra === "string" ? [extra] : extra;
33310
+ return terms?.some((term) => contains(term, query)) ?? false;
33311
+ }
33312
+ var searchOptionLimit = 8;
33313
+ var MenuSelectKeyboardDelegate = class _MenuSelectKeyboardDelegate extends ListKeyboardDelegate {
33314
+ /** Rows skipped by Page Up / Page Down. */
33315
+ static pageSize = 10;
33316
+ getKeyPageBelow(key) {
33317
+ return this.stepKeys(key, "below");
33318
+ }
33319
+ getKeyPageAbove(key) {
33320
+ return this.stepKeys(key, "above");
33321
+ }
33322
+ stepKeys(key, direction) {
33323
+ let next = key;
33324
+ for (let index = 0; index < _MenuSelectKeyboardDelegate.pageSize; index += 1) {
33325
+ if (next == null) return next;
33326
+ const candidate = direction === "below" ? this.getKeyBelow(next) : this.getKeyAbove(next);
33327
+ if (candidate == null) return next;
33328
+ next = candidate;
33329
+ }
33330
+ return next;
33331
+ }
33332
+ };
33333
+
33334
+ // src/inputs/MenuSelectField/internal/BaseMenuSelectField.tsx
33335
+ import { Fragment as Fragment58, jsx as jsx273, jsxs as jsxs148 } from "react/jsx-runtime";
33336
+ function BaseMenuSelectField(props) {
33337
+ const {
33338
+ label,
33339
+ searchPlaceholder,
33340
+ selectionMode: _selectionMode,
33341
+ values: _values,
33342
+ proposedValues: _proposedValues,
33343
+ onCommit: _onCommit,
33344
+ ...fieldProps
33345
+ } = props;
33346
+ const { triggerRef, trigger, searchRef, search, listRef, menu } = useMenuSelectField(props);
33347
+ const tid = useTestIds(props, defaultTestId(label));
33348
+ const { sm: isMobile } = useBreakpoint();
33349
+ const panel = /* @__PURE__ */ jsx273(
33350
+ MenuPanel,
33351
+ {
33352
+ variant: isMobile ? "sheet" : "anchored",
33353
+ header: search.show ? /* @__PURE__ */ jsx273(
33354
+ MenuSearchInput,
33355
+ {
33356
+ search,
33357
+ inputRef: searchRef,
33358
+ label: `Search ${label}`,
33359
+ placeholder: searchPlaceholder,
33360
+ ...tid
33361
+ }
33362
+ ) : void 0,
33363
+ ...tid,
33364
+ children: /* @__PURE__ */ jsx273(
33365
+ OptionList,
33366
+ {
33367
+ menu,
33368
+ listRef,
33369
+ label,
33370
+ onKeyDown: search.show ? void 0 : menu.onKeyDown,
33371
+ activeDescendant: search.show ? void 0 : menu.activeDescendant,
33372
+ ...tid
33373
+ }
33374
+ )
33375
+ }
33376
+ );
33377
+ return /* @__PURE__ */ jsxs148(Fragment58, { children: [
33378
+ /* @__PURE__ */ jsx273(MenuSelectTrigger, { ...fieldProps, label, trigger, triggerRef }),
33379
+ isMobile ? /* @__PURE__ */ jsx273(BottomSheet, { isOpen: menu.isOpen, onClose: () => menu.close({ restoreFocus: true }), label, ...tid, children: panel }) : /* @__PURE__ */ jsx273(
33380
+ AnchoredOverlay,
33381
+ {
33382
+ triggerRef,
33383
+ isOpen: menu.isOpen,
33384
+ onClose: () => menu.close({ restoreFocus: false }),
33385
+ ...tid,
33386
+ children: panel
33387
+ }
33388
+ )
33389
+ ] });
33390
+ }
33391
+
33392
+ // src/inputs/MenuSelectField/MenuMultiSelectField.tsx
33393
+ import { jsx as jsx274 } from "react/jsx-runtime";
33394
+ function MenuMultiSelectField(props) {
33395
+ const { onSelect, ...rest } = props;
33396
+ return /* @__PURE__ */ jsx274(BaseMenuSelectField, { ...rest, selectionMode: "multiple", onCommit: onSelect });
33397
+ }
33398
+
33399
+ // src/inputs/MenuSelectField/MenuSelectField.tsx
33400
+ import { useMemo as useMemo62 } from "react";
33401
+ import { jsx as jsx275 } from "react/jsx-runtime";
33402
+ function MenuSelectField(props) {
33403
+ const { value, proposedValue, onSelect, ...rest } = props;
33404
+ const values = useMemo62(() => value === void 0 ? [] : [value], [value]);
33405
+ const proposedValues = useMemo62(() => proposedValue === void 0 ? void 0 : [proposedValue], [proposedValue]);
33406
+ return /* @__PURE__ */ jsx275(
33407
+ BaseMenuSelectField,
33408
+ {
33409
+ ...rest,
33410
+ selectionMode: "single",
33411
+ values,
33412
+ proposedValues,
33413
+ onCommit: (next, opts) => onSelect(next[0], opts[0])
33414
+ }
33415
+ );
33416
+ }
33417
+
32343
33418
  // src/inputs/ToggleButton.tsx
32344
- import { useRef as useRef80, useState as useState70 } from "react";
32345
- import { useFocusRing as useFocusRing23, useHover as useHover26, usePress as usePress3, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden12 } from "react-aria";
33419
+ import { useRef as useRef85, useState as useState72 } from "react";
33420
+ import { useFocusRing as useFocusRing24, useHover as useHover28, usePress as usePress3, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden12 } from "react-aria";
32346
33421
  import { useToggleState as useToggleState2 } from "react-stately";
32347
- import { trussProps as trussProps151 } from "@homebound/truss/runtime";
32348
- import { jsx as jsx265, jsxs as jsxs142 } from "react/jsx-runtime";
33422
+ import { trussProps as trussProps157 } from "@homebound/truss/runtime";
33423
+ import { jsx as jsx276, jsxs as jsxs149 } from "react/jsx-runtime";
32349
33424
  function ToggleButton(props) {
32350
33425
  const {
32351
33426
  selected: isSelected = false,
@@ -32356,7 +33431,7 @@ function ToggleButton(props) {
32356
33431
  __storyState,
32357
33432
  ...otherProps
32358
33433
  } = props;
32359
- const [asyncInProgress, setAsyncInProgress] = useState70(false);
33434
+ const [asyncInProgress, setAsyncInProgress] = useState72(false);
32360
33435
  const isDisabled = !!disabled || asyncInProgress;
32361
33436
  const ariaProps = {
32362
33437
  "aria-label": label,
@@ -32375,8 +33450,8 @@ function ToggleButton(props) {
32375
33450
  return result;
32376
33451
  }
32377
33452
  });
32378
- const labelRef = useRef80(null);
32379
- const ref = useRef80(null);
33453
+ const labelRef = useRef85(null);
33454
+ const ref = useRef85(null);
32380
33455
  const tid = useTestIds(otherProps, label);
32381
33456
  const {
32382
33457
  isPressed: isPressedFromEvents,
@@ -32391,14 +33466,14 @@ function ToggleButton(props) {
32391
33466
  const {
32392
33467
  isFocusVisible: isFocusVisibleFromEvents,
32393
33468
  focusProps
32394
- } = useFocusRing23({
33469
+ } = useFocusRing24({
32395
33470
  ...otherProps,
32396
33471
  within: true
32397
33472
  });
32398
33473
  const {
32399
33474
  hoverProps,
32400
33475
  isHovered: isHoveredFromEvents
32401
- } = useHover26({
33476
+ } = useHover28({
32402
33477
  isDisabled
32403
33478
  });
32404
33479
  const isHovered = __storyState?.hovered ?? isHoveredFromEvents;
@@ -32409,7 +33484,7 @@ function ToggleButton(props) {
32409
33484
  ...focusProps,
32410
33485
  ...hoverProps,
32411
33486
  ...pressProps,
32412
- ...trussProps151({
33487
+ ...trussProps157({
32413
33488
  // Gray500 off-state has no semantic match — keep palette (OnSurfaceMuted is Gray700).
32414
33489
  ...{
32415
33490
  borderRadius: "br4",
@@ -32449,10 +33524,10 @@ function ToggleButton(props) {
32449
33524
  return maybeTooltip({
32450
33525
  title: tooltip,
32451
33526
  placement: "top",
32452
- children: /* @__PURE__ */ jsxs142("label", { ...labelAttrs, children: [
32453
- icon && /* @__PURE__ */ jsx265(Icon, { icon }),
33527
+ children: /* @__PURE__ */ jsxs149("label", { ...labelAttrs, children: [
33528
+ icon && /* @__PURE__ */ jsx276(Icon, { icon }),
32454
33529
  label,
32455
- /* @__PURE__ */ jsx265(VisuallyHidden12, { children: /* @__PURE__ */ jsx265("input", { ref, ...inputProps, ...tid.value }) })
33530
+ /* @__PURE__ */ jsx276(VisuallyHidden12, { children: /* @__PURE__ */ jsx276("input", { ref, ...inputProps, ...tid.value }) })
32456
33531
  ] })
32457
33532
  });
32458
33533
  }
@@ -32592,6 +33667,8 @@ export {
32592
33667
  Loader,
32593
33668
  LoadingSkeleton,
32594
33669
  MaxLines,
33670
+ MenuMultiSelectField,
33671
+ MenuSelectField,
32595
33672
  ModalBanner,
32596
33673
  ModalBody,
32597
33674
  ModalFilterItem,