@homebound/beam 4.54.1 → 4.55.1

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.cjs CHANGED
@@ -315,7 +315,6 @@ __export(index_exports, {
315
315
  dateFilter: () => dateFilter,
316
316
  dateFormats: () => dateFormats,
317
317
  dateRangeFilter: () => dateRangeFilter,
318
- defaultDocumentScrollRightPaneWidth: () => defaultDocumentScrollRightPaneWidth,
319
318
  defaultPage: () => defaultPage,
320
319
  defaultRenderFn: () => defaultRenderFn,
321
320
  defaultStyle: () => defaultStyle,
@@ -327,6 +326,7 @@ __export(index_exports, {
327
326
  documentScrollContentWidth: () => documentScrollContentWidth,
328
327
  documentScrollRightPaneContentMinCss: () => documentScrollRightPaneContentMinCss,
329
328
  documentScrollRightPaneHeight: () => documentScrollRightPaneHeight,
329
+ documentScrollRightPaneWidth: () => documentScrollRightPaneWidth,
330
330
  documentScrollRightPaneWidthCss: () => documentScrollRightPaneWidthCss,
331
331
  dragHandleColumn: () => dragHandleColumn,
332
332
  emptyCell: () => emptyCell,
@@ -400,7 +400,6 @@ __export(index_exports, {
400
400
  resetRightPaneStore: () => resetRightPaneStore,
401
401
  resolveTableContentWidth: () => resolveTableContentWidth,
402
402
  resolveTooltip: () => resolveTooltip,
403
- resolveWithRightPaneOptions: () => resolveWithRightPaneOptions,
404
403
  rightPaneContentStore: () => rightPaneContentStore,
405
404
  rightPaneOpenActions: () => rightPaneOpenActions,
406
405
  rightPaneOpenStore: () => rightPaneOpenStore,
@@ -20429,6 +20428,7 @@ function useMenuSelectField(props) {
20429
20428
  getOptionLabel = defaultOptionLabel,
20430
20429
  getOptionMenuLabel,
20431
20430
  getOptionSearchText,
20431
+ autoSort = true,
20432
20432
  onSearch,
20433
20433
  disabledOptions,
20434
20434
  nothingSelectedText = "",
@@ -20471,10 +20471,10 @@ function useMenuSelectField(props) {
20471
20471
  const [optionsLoading, setOptionsLoading] = (0, import_react85.useState)(false);
20472
20472
  const didRequestOptionsRef = (0, import_react85.useRef)(false);
20473
20473
  const options = (0, import_react85.useMemo)(
20474
- () => initializeOptions(optionsProp, getOptionValue, getOptionLabel, void 0, false),
20474
+ () => initializeOptions(optionsProp, getOptionValue, getOptionLabel, void 0, autoSort),
20475
20475
  // getOptionValue and getOptionLabel are typically inline lambdas
20476
20476
  // oxlint-disable-next-line react-hooks/exhaustive-deps
20477
- [optionsProp]
20477
+ [optionsProp, autoSort]
20478
20478
  );
20479
20479
  const { hoverProps, isHovered } = (0, import_react_aria37.useHover)({});
20480
20480
  const { focusProps, isFocusVisible } = (0, import_react_aria37.useFocusRing)();
@@ -22334,11 +22334,12 @@ var import_mobx_react11 = require("mobx-react");
22334
22334
  // src/inputs/MenuSelectField/MenuTreeSelectField.tsx
22335
22335
  var import_jsx_runtime140 = require("react/jsx-runtime");
22336
22336
  function MenuTreeSelectField(props) {
22337
- const { onSelect, selectionDisplay = "all", defaultExpanded = false, ...rest } = props;
22337
+ const { onSelect, selectionDisplay = "all", defaultExpanded = false, autoSort = false, ...rest } = props;
22338
22338
  return /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
22339
22339
  BaseMenuSelectField,
22340
22340
  {
22341
22341
  ...rest,
22342
+ autoSort,
22342
22343
  selectionMode: "multiple",
22343
22344
  tree: { getChildren: getNestedChildren, display: selectionDisplay, defaultExpanded },
22344
22345
  onCommit: (values, opts) => onSelect(treeSelectResponse(values, opts))
@@ -28603,24 +28604,13 @@ function useDocumentScrollRightPaneAnchorRef() {
28603
28604
  }
28604
28605
 
28605
28606
  // src/components/Layout/RightPaneLayout/withRightPane.ts
28606
- var defaultDocumentScrollRightPaneWidth = 450;
28607
+ var documentScrollRightPaneWidth = 448;
28607
28608
  var minDocumentScrollContentWidthPx = 480;
28608
- function resolveWithRightPaneOptions(withRightPane) {
28609
- if (withRightPane === void 0 || withRightPane === false) return void 0;
28610
- if (withRightPane === true) {
28611
- return { width: defaultDocumentScrollRightPaneWidth };
28612
- }
28613
- if (typeof withRightPane === "number") {
28614
- return { width: withRightPane };
28615
- }
28616
- return { width: withRightPane.width ?? defaultDocumentScrollRightPaneWidth };
28617
- }
28618
28609
 
28619
28610
  // src/components/Layout/RightPaneLayout/DocumentScrollOverlayRightPaneLayout.tsx
28620
28611
  var import_jsx_runtime204 = require("react/jsx-runtime");
28621
28612
  function DocumentScrollOverlayRightPaneLayout({
28622
- children,
28623
- paneWidth = defaultDocumentScrollRightPaneWidth
28613
+ children
28624
28614
  }) {
28625
28615
  const nestedInLayout = (0, import_react135.useContext)(NestedRightPaneLayoutContext);
28626
28616
  const {
@@ -28637,7 +28627,7 @@ function DocumentScrollOverlayRightPaneLayout({
28637
28627
  if (nestedInLayout) return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(import_jsx_runtime204.Fragment, { children });
28638
28628
  return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollRightPaneLayoutRoot, { anchorRef, tid, children: sm ? /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(import_jsx_runtime204.Fragment, { children: [
28639
28629
  children,
28640
- /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollRightPane, { paneWidth, mobile: true })
28630
+ /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollRightPane, { paneWidth: documentScrollRightPaneWidth, mobile: true })
28641
28631
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)(import_jsx_runtime204.Fragment, { children: [
28642
28632
  /* @__PURE__ */ (0, import_jsx_runtime204.jsxs)("div", { className: "df aifs wfc mw100", children: [
28643
28633
  /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { className: "w100 mwfc", ...tid.main, children }),
@@ -28650,19 +28640,18 @@ function DocumentScrollOverlayRightPaneLayout({
28650
28640
  transition: "transitionWidth"
28651
28641
  }), ...tid.spacer })
28652
28642
  ] }),
28653
- /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollOverlayRightPaneHost, { anchorRef: anchorRef.ref, spacerRef, paneWidth })
28643
+ /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollOverlayRightPaneHost, { anchorRef: anchorRef.ref, spacerRef })
28654
28644
  ] }) });
28655
28645
  }
28656
28646
  function DocumentScrollOverlayRightPaneHost(props) {
28657
28647
  const {
28658
28648
  anchorRef,
28659
- spacerRef,
28660
- paneWidth
28649
+ spacerRef
28661
28650
  } = props;
28662
28651
  const {
28663
28652
  isRightPaneOpen
28664
28653
  } = useRightPaneOpenState();
28665
- const paneWidthCss = documentScrollRightPaneWidthCss(paneWidth);
28654
+ const paneWidthCss = documentScrollRightPaneWidthCss(documentScrollRightPaneWidth);
28666
28655
  const [keepOverlayChrome, setKeepOverlayChrome] = (0, import_react135.useState)(isRightPaneOpen);
28667
28656
  (0, import_react135.useLayoutEffect)(() => {
28668
28657
  if (isRightPaneOpen) {
@@ -28690,7 +28679,7 @@ function DocumentScrollOverlayRightPaneHost(props) {
28690
28679
  document.documentElement.style.setProperty(beamFloatingRightOffsetVar, "0px");
28691
28680
  };
28692
28681
  }, [anchorRef, keepOverlayChrome, paneWidthCss]);
28693
- return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollRightPane, { paneWidth, mobile: false, anchorRef });
28682
+ return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(DocumentScrollRightPane, { paneWidth: documentScrollRightPaneWidth, mobile: false, anchorRef });
28694
28683
  }
28695
28684
 
28696
28685
  // src/components/Modal/ModalFullBleed.tsx
@@ -28784,7 +28773,7 @@ function DocumentScrollHost(props) {
28784
28773
  testIds,
28785
28774
  children
28786
28775
  } = props;
28787
- const tableBody = rightPane ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(DocumentScrollOverlayRightPaneLayout, { paneWidth: rightPane.width, children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { ...(0, import_runtime134.trussProps)({
28776
+ const tableBody = rightPane ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(DocumentScrollOverlayRightPaneLayout, { children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("div", { ...(0, import_runtime134.trussProps)({
28788
28777
  minWidth: ["mw_var", {
28789
28778
  "--minWidth": (0, import_runtime134.maybeCssVar)(documentScrollRightPaneContentMinCss())
28790
28779
  }]
@@ -29131,7 +29120,6 @@ function GridTableLayoutComponent(props) {
29131
29120
  emptyFallback: layoutEmptyFallback,
29132
29121
  withRightPane
29133
29122
  } = props;
29134
- const rightPane = resolveWithRightPaneOptions(withRightPane);
29135
29123
  const tid = useTestIds(props);
29136
29124
  const host = useGridTableLayoutHost();
29137
29125
  const insetHandled = useContentInsetHandled();
@@ -29229,7 +29217,7 @@ function GridTableLayoutComponent(props) {
29229
29217
  {
29230
29218
  host,
29231
29219
  actions: showTableActions ? tableActionsEl : void 0,
29232
- rightPane,
29220
+ rightPane: withRightPane,
29233
29221
  isVirtualized,
29234
29222
  testIds: tid,
29235
29223
  children: tableBody
@@ -32023,14 +32011,19 @@ var SingleFilter = class extends BaseFilter {
32023
32011
  return resolveOptionSelectedFilterLabel(options, getOptionValue, getOptionLabel, value);
32024
32012
  }
32025
32013
  render(value, setValue, tid, inModal, vertical) {
32026
- const { label, defaultValue, options: maybeOptions, nothingSelectedText, ...props } = this.props;
32014
+ const { label, defaultValue, options: maybeOptions, nothingSelectedText, autoSort, ...props } = this.props;
32027
32015
  const { getOptionValue, getOptionLabel } = optionReaders2(this.props);
32028
32016
  const unsetText = nothingSelectedText ?? "All";
32029
- const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
32017
+ const isStaticList = Array.isArray(maybeOptions);
32018
+ const options = isStaticList ? [
32019
+ allOption,
32020
+ ...initializeOptions(maybeOptions, getOptionValue, getOptionLabel, void 0, autoSort ?? true)
32021
+ ] : maybeOptions;
32030
32022
  return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(
32031
32023
  MenuSelectField,
32032
32024
  {
32033
32025
  ...props,
32026
+ autoSort: isStaticList ? false : autoSort,
32034
32027
  options,
32035
32028
  getOptionValue: (option) => option === allOption ? void 0 : getOptionValue(option),
32036
32029
  getOptionLabel: (option) => option === allOption ? unsetText : getOptionLabel(option),
@@ -33327,7 +33320,6 @@ function CenteredLayout(props) {
33327
33320
  const {
33328
33321
  mdAndUp
33329
33322
  } = useBreakpoint();
33330
- const rightPane = resolveWithRightPaneOptions(withRightPane);
33331
33323
  const shell = /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(ContentInsetProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime257.jsx)("div", { ...(0, import_runtime166.mergeProps)(void 0, {
33332
33324
  // layoutContainer descendants (e.g. ContentHeader) read this to inset sticky horizontal chrome within the shell padding.
33333
33325
  [beamLayoutContentPaddingXVar]: mdAndUp ? pageContentPaddingXValue : smPageContentPaddingXValue,
@@ -33346,8 +33338,8 @@ function CenteredLayout(props) {
33346
33338
  },
33347
33339
  ...pageContentPaddingX
33348
33340
  }), ...tid, children }) });
33349
- if (!rightPane) return shell;
33350
- return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(DocumentScrollOverlayRightPaneLayout, { paneWidth: rightPane.width, children: shell });
33341
+ if (!withRightPane) return shell;
33342
+ return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(DocumentScrollOverlayRightPaneLayout, { children: shell });
33351
33343
  }
33352
33344
  var centeredContentMaxPx = {
33353
33345
  sm: 720,
@@ -33740,7 +33732,6 @@ function FormSectionLayout(props) {
33740
33732
  const {
33741
33733
  sm: isMobile
33742
33734
  } = useBreakpoint();
33743
- const rightPane = resolveWithRightPaneOptions(withRightPane);
33744
33735
  const formSectionLayoutTitleId = "formSectionLayoutTitle";
33745
33736
  const sectionLinks = (sections ?? []).filter((section) => !section.excludeJumpLink).map((section) => {
33746
33737
  const id = defaultTestId(section.title);
@@ -33792,8 +33783,8 @@ function FormSectionLayout(props) {
33792
33783
  }]
33793
33784
  }), ...tid.column, children: form })
33794
33785
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("div", { className: "mb4", children: form });
33795
- if (!rightPane) return body;
33796
- return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(DocumentScrollOverlayRightPaneLayout, { paneWidth: rightPane.width, children: body });
33786
+ if (!withRightPane) return body;
33787
+ return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(DocumentScrollOverlayRightPaneLayout, { children: body });
33797
33788
  }
33798
33789
 
33799
33790
  // src/layouts/PageBanner/usePageBanner.tsx
@@ -35449,7 +35440,6 @@ var togglePressStyles = {
35449
35440
  dateFilter,
35450
35441
  dateFormats,
35451
35442
  dateRangeFilter,
35452
- defaultDocumentScrollRightPaneWidth,
35453
35443
  defaultPage,
35454
35444
  defaultRenderFn,
35455
35445
  defaultStyle,
@@ -35461,6 +35451,7 @@ var togglePressStyles = {
35461
35451
  documentScrollContentWidth,
35462
35452
  documentScrollRightPaneContentMinCss,
35463
35453
  documentScrollRightPaneHeight,
35454
+ documentScrollRightPaneWidth,
35464
35455
  documentScrollRightPaneWidthCss,
35465
35456
  dragHandleColumn,
35466
35457
  emptyCell,
@@ -35534,7 +35525,6 @@ var togglePressStyles = {
35534
35525
  resetRightPaneStore,
35535
35526
  resolveTableContentWidth,
35536
35527
  resolveTooltip,
35537
- resolveWithRightPaneOptions,
35538
35528
  rightPaneContentStore,
35539
35529
  rightPaneOpenActions,
35540
35530
  rightPaneOpenStore,