@homebound/beam 3.0.5 → 3.1.0-alpha.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.js CHANGED
@@ -4902,7 +4902,7 @@ function Chips(props) {
4902
4902
  // src/components/Table/GridTable.tsx
4903
4903
  import memoizeOne from "memoize-one";
4904
4904
  import { runInAction } from "mobx";
4905
- import React13, { useEffect as useEffect19, useMemo as useMemo24, useRef as useRef38, useState as useState29 } from "react";
4905
+ import React13, { useEffect as useEffect19, useMemo as useMemo24, useRef as useRef39, useState as useState29 } from "react";
4906
4906
  import { Virtuoso as Virtuoso2 } from "react-virtuoso";
4907
4907
 
4908
4908
  // src/components/Layout/ScrollableContent.tsx
@@ -5482,27 +5482,50 @@ function useHover2(props) {
5482
5482
  }
5483
5483
 
5484
5484
  // src/hooks/usePersistedFilter.ts
5485
- import { useEffect as useEffect6, useMemo as useMemo8 } from "react";
5485
+ import { useEffect as useEffect6, useMemo as useMemo8, useRef as useRef6 } from "react";
5486
5486
  import { JsonParam, useQueryParams as useQueryParams2 } from "use-query-params";
5487
5487
  function usePersistedFilter({ storageKey, filterDefs }) {
5488
- const filterKeys = Object.keys(filterDefs);
5488
+ const filterImpls = useMemo8(
5489
+ () => Object.fromEntries(safeEntries(filterDefs).map(([key, def]) => [key, def(key)])),
5490
+ [filterDefs]
5491
+ );
5492
+ const filterKeys = useMemo8(() => Object.keys(filterImpls), [filterImpls]);
5489
5493
  const defaultFilter = useMemo8(
5490
5494
  () => Object.fromEntries(
5491
- safeEntries(filterDefs).filter(([key, def]) => def(key).defaultValue !== void 0).map(([key, def]) => [key, def(key).defaultValue])
5495
+ safeEntries(filterImpls).filter(([, def]) => def.defaultValue !== void 0).map(([key, def]) => [key, def.defaultValue])
5492
5496
  ),
5493
- [filterDefs]
5497
+ [filterImpls]
5494
5498
  );
5495
5499
  const [{ filter: queryParamsFilter }, setQueryParams] = useQueryParams2({ filter: JsonParam });
5496
- const [storedFilter, setStoredFilter] = useSessionStorage(storageKey, queryParamsFilter ?? defaultFilter);
5500
+ const [storedFilter, setStoredFilter] = useSessionStorage(
5501
+ storageKey,
5502
+ dehydrateFilter(filterImpls, defaultFilter) ?? defaultFilter
5503
+ );
5497
5504
  const isQueryParamFilterValid = hasValidFilterKeys(queryParamsFilter, filterKeys);
5498
- const filter = isQueryParamFilterValid ? queryParamsFilter : storedFilter ?? defaultFilter;
5499
- const setFilter = (filter2) => setQueryParams({ filter: filter2 });
5505
+ const serializedQueryParamsFilter = useMemo8(() => JSON.stringify(queryParamsFilter), [queryParamsFilter]);
5506
+ const serializedStoredFilter = useMemo8(() => JSON.stringify(storedFilter), [storedFilter]);
5507
+ const queryParamsFilterSnapshot = useMemo8(
5508
+ () => parseSerializedValue(serializedQueryParamsFilter),
5509
+ [serializedQueryParamsFilter]
5510
+ );
5511
+ const storedFilterSnapshot = useMemo8(() => parseSerializedValue(serializedStoredFilter), [serializedStoredFilter]);
5512
+ const hydratedQueryParamsFilter = useMemo8(
5513
+ () => isQueryParamFilterValid ? hydrateFilter(filterImpls, queryParamsFilterSnapshot) : void 0,
5514
+ [filterImpls, isQueryParamFilterValid, queryParamsFilterSnapshot]
5515
+ );
5516
+ const hydratedStoredFilter = useMemo8(
5517
+ () => hasValidFilterKeys(storedFilterSnapshot, filterKeys) ? hydrateFilter(filterImpls, storedFilterSnapshot) : void 0,
5518
+ [filterImpls, filterKeys, storedFilterSnapshot]
5519
+ );
5520
+ const rawFilter = hydratedQueryParamsFilter ?? hydratedStoredFilter ?? defaultFilter;
5521
+ const filter = useStableValue(rawFilter);
5522
+ const setFilter = (filter2) => setQueryParams({ filter: dehydrateFilter(filterImpls, filter2) });
5500
5523
  useEffect6(
5501
5524
  () => {
5502
5525
  if (queryParamsFilter === void 0) {
5503
5526
  setQueryParams({ filter: storedFilter }, "replaceIn");
5504
5527
  } else if (!isQueryParamFilterValid) {
5505
- setQueryParams({ filter: defaultFilter }, "replaceIn");
5528
+ setQueryParams({ filter: dehydrateFilter(filterImpls, defaultFilter) }, "replaceIn");
5506
5529
  } else if (JSON.stringify(queryParamsFilter) !== JSON.stringify(storedFilter)) {
5507
5530
  setStoredFilter(queryParamsFilter);
5508
5531
  }
@@ -5514,7 +5537,45 @@ function usePersistedFilter({ storageKey, filterDefs }) {
5514
5537
  return { setFilter, filter };
5515
5538
  }
5516
5539
  function hasValidFilterKeys(queryParamsFilter, definedKeys) {
5517
- return queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
5540
+ return !!queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
5541
+ }
5542
+ function hydrateFilter(filterImpls, value) {
5543
+ if (typeof value !== "object" || value === null) return void 0;
5544
+ const hydratedEntries = [];
5545
+ safeEntries(value).forEach(([key, rawValue]) => {
5546
+ const filter = filterImpls[key];
5547
+ if (!filter) return;
5548
+ const hydratedValue = filter.hydrate ? filter.hydrate(rawValue) : rawValue;
5549
+ if (hydratedValue !== void 0) {
5550
+ hydratedEntries.push([key, hydratedValue]);
5551
+ }
5552
+ });
5553
+ return Object.fromEntries(hydratedEntries);
5554
+ }
5555
+ function dehydrateFilter(filterImpls, value) {
5556
+ if (!value) return value;
5557
+ return Object.fromEntries(
5558
+ safeEntries(value).map(([key, rawValue]) => {
5559
+ const filter = filterImpls[key];
5560
+ return [
5561
+ key,
5562
+ filter?.dehydrate ? filter.dehydrate(rawValue) : rawValue
5563
+ ];
5564
+ })
5565
+ );
5566
+ }
5567
+ function parseSerializedValue(value) {
5568
+ return value === void 0 ? void 0 : JSON.parse(value);
5569
+ }
5570
+ function useStableValue(value) {
5571
+ const stableValue = useRef6(value);
5572
+ const stableKey = useRef6(JSON.stringify(value));
5573
+ const nextKey = JSON.stringify(value);
5574
+ if (stableKey.current !== nextKey) {
5575
+ stableValue.current = value;
5576
+ stableKey.current = nextKey;
5577
+ }
5578
+ return stableValue.current;
5518
5579
  }
5519
5580
 
5520
5581
  // src/hooks/useSessionStorage.ts
@@ -5937,7 +5998,7 @@ function CollapseToggle(props) {
5937
5998
  import { useContext as useContext12 } from "react";
5938
5999
 
5939
6000
  // src/inputs/Autocomplete.tsx
5940
- import { useCallback as useCallback10, useRef as useRef23 } from "react";
6001
+ import { useCallback as useCallback10, useRef as useRef24 } from "react";
5941
6002
  import { useComboBox as useComboBox3, useOverlayPosition as useOverlayPosition5 } from "react-aria";
5942
6003
  import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stately";
5943
6004
 
@@ -5945,13 +6006,13 @@ import { Item as Item5, useComboBoxState as useComboBoxState3 } from "react-stat
5945
6006
  import { DayPicker } from "react-day-picker";
5946
6007
 
5947
6008
  // src/components/internal/DatePicker/Day.tsx
5948
- import { useRef as useRef6 } from "react";
6009
+ import { useRef as useRef7 } from "react";
5949
6010
  import { useDayRender } from "react-day-picker";
5950
6011
  import { trussProps as trussProps12, mergeProps as mergeProps3 } from "@homebound/truss/runtime";
5951
6012
  import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
5952
6013
  function Day(props) {
5953
6014
  const tid = useTestIds(props, "datePickerDay");
5954
- const buttonRef = useRef6(null);
6015
+ const buttonRef = useRef7(null);
5955
6016
  const {
5956
6017
  isHidden,
5957
6018
  isButton,
@@ -6132,6 +6193,61 @@ function WeekHeader() {
6132
6193
  ] }, format2(day, "EEEE"))) }) });
6133
6194
  }
6134
6195
 
6196
+ // src/utils/plainDate.ts
6197
+ import { Temporal } from "temporal-polyfill";
6198
+ function plainDateToJsDate(date) {
6199
+ return new Date(date.year, date.month - 1, date.day, 12);
6200
+ }
6201
+ function jsDateToPlainDate(date) {
6202
+ return new Temporal.PlainDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
6203
+ }
6204
+ function dateRangeToJsDateRange(range) {
6205
+ if (!range) return void 0;
6206
+ return {
6207
+ from: range.from ? plainDateToJsDate(range.from) : void 0,
6208
+ to: range.to ? plainDateToJsDate(range.to) : void 0
6209
+ };
6210
+ }
6211
+ function jsDateRangeToDateRange(range) {
6212
+ if (!range) return void 0;
6213
+ return {
6214
+ from: range.from ? jsDateToPlainDate(range.from) : void 0,
6215
+ to: range.to ? jsDateToPlainDate(range.to) : void 0
6216
+ };
6217
+ }
6218
+ function dayMatcherToDayPickerMatcher(matcher) {
6219
+ return (date) => matcher(jsDateToPlainDate(date));
6220
+ }
6221
+ function dayMatchersToDayPickerMatchers(matchers) {
6222
+ if (matchers === void 0) return void 0;
6223
+ return Array.isArray(matchers) ? matchers.map(dayMatcherToDayPickerMatcher) : dayMatcherToDayPickerMatcher(matchers);
6224
+ }
6225
+ function todayPlainDate() {
6226
+ return Temporal.Now.plainDateISO();
6227
+ }
6228
+ function isPlainDate(value) {
6229
+ return value instanceof Temporal.PlainDate;
6230
+ }
6231
+ function parsePersistedPlainDate(value) {
6232
+ if (isPlainDate(value)) return value;
6233
+ if (value instanceof Date && !Number.isNaN(value.getTime())) {
6234
+ return jsDateToPlainDate(value);
6235
+ }
6236
+ if (typeof value !== "string") return void 0;
6237
+ try {
6238
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
6239
+ return Temporal.PlainDate.from(value);
6240
+ }
6241
+ } catch {
6242
+ return void 0;
6243
+ }
6244
+ const date = new Date(value);
6245
+ return Number.isNaN(date.getTime()) ? void 0 : jsDateToPlainDate(date);
6246
+ }
6247
+ function dehydratePlainDate(value) {
6248
+ return value?.toString();
6249
+ }
6250
+
6135
6251
  // src/components/internal/DatePicker/DatePicker.tsx
6136
6252
  import { jsx as jsx19 } from "react/jsx-runtime";
6137
6253
  function DatePicker(props) {
@@ -6151,15 +6267,15 @@ function DatePicker(props) {
6151
6267
  Head: WeekHeader,
6152
6268
  Day
6153
6269
  },
6154
- selected: value ? [value] : [],
6155
- defaultMonth: value ?? /* @__PURE__ */ new Date(),
6270
+ selected: value ? [plainDateToJsDate(value)] : [],
6271
+ defaultMonth: plainDateToJsDate(value ?? todayPlainDate()),
6156
6272
  onDayClick: (day, modifiers) => {
6157
6273
  if (modifiers.disabled) return;
6158
- onSelect(day);
6274
+ onSelect(jsDateToPlainDate(day));
6159
6275
  },
6160
- disabled: disabledDays,
6276
+ disabled: dayMatchersToDayPickerMatchers(disabledDays),
6161
6277
  modifiers: {
6162
- indicatorDot: dottedDays ?? []
6278
+ indicatorDot: dayMatchersToDayPickerMatchers(dottedDays) ?? []
6163
6279
  }
6164
6280
  }
6165
6281
  ) });
@@ -6186,21 +6302,21 @@ function DateRangePicker(props) {
6186
6302
  useYearPicker
6187
6303
  } = props;
6188
6304
  const tid = useTestIds(props, "datePicker");
6189
- return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected: range, components: {
6305
+ return /* @__PURE__ */ jsx21("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ jsx21(DayPicker2, { mode: "range", selected: dateRangeToJsDateRange(range), components: {
6190
6306
  Caption: useYearPicker ? YearSkipHeader : Header,
6191
6307
  Head: WeekHeader,
6192
6308
  Day
6193
- }, defaultMonth: range?.to ?? /* @__PURE__ */ new Date(), onSelect: (selection, day, activeModifiers) => {
6309
+ }, defaultMonth: plainDateToJsDate(range?.to ?? range?.from ?? todayPlainDate()), onSelect: (selection, day, activeModifiers) => {
6194
6310
  if (activeModifiers.disabled) return;
6195
- onSelect(selection);
6196
- }, disabled: disabledDays, modifiers: {
6197
- indicatorDot: dottedDays ?? []
6311
+ onSelect(jsDateRangeToDateRange(selection));
6312
+ }, disabled: dayMatchersToDayPickerMatchers(disabledDays), modifiers: {
6313
+ indicatorDot: dayMatchersToDayPickerMatchers(dottedDays) ?? []
6198
6314
  } }) });
6199
6315
  }
6200
6316
 
6201
6317
  // src/components/internal/Menu.tsx
6202
6318
  import { camelCase } from "change-case";
6203
- import { useEffect as useEffect8, useMemo as useMemo9, useRef as useRef10, useState as useState11 } from "react";
6319
+ import { useEffect as useEffect8, useMemo as useMemo9, useRef as useRef11, useState as useState11 } from "react";
6204
6320
  import { FocusScope, useFilter as useFilter2, useMenu } from "react-aria";
6205
6321
  import { Item, Section, useTreeData, useTreeState } from "react-stately";
6206
6322
 
@@ -6245,7 +6361,7 @@ import { trussProps as trussProps21 } from "@homebound/truss/runtime";
6245
6361
 
6246
6362
  // src/inputs/internal/MenuSearchField.tsx
6247
6363
  import { useTextField } from "@react-aria/textfield";
6248
- import { useRef as useRef9 } from "react";
6364
+ import { useRef as useRef10 } from "react";
6249
6365
 
6250
6366
  // src/inputs/TextFieldBase.tsx
6251
6367
  import { useState as useState10 } from "react";
@@ -6344,7 +6460,7 @@ function InlineLabel({
6344
6460
 
6345
6461
  // src/components/Table/components/Row.tsx
6346
6462
  import { observer } from "mobx-react";
6347
- import React6, { useCallback as useCallback6, useContext as useContext10, useRef as useRef8 } from "react";
6463
+ import React6, { useCallback as useCallback6, useContext as useContext10, useRef as useRef9 } from "react";
6348
6464
  import { mergeProps as mergeProps5 } from "react-aria";
6349
6465
 
6350
6466
  // src/components/Table/components/cell.tsx
@@ -6410,7 +6526,7 @@ var rowClickRenderFn = (as, api, colSpan) => (key, css2, content, row, rowStyle,
6410
6526
  };
6411
6527
 
6412
6528
  // src/components/Table/components/ColumnResizeHandle.tsx
6413
- import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as useRef7, useState as useState9 } from "react";
6529
+ import { useCallback as useCallback5, useContext as useContext8, useEffect as useEffect7, useRef as useRef8, useState as useState9 } from "react";
6414
6530
  import { trussProps as trussProps16 } from "@homebound/truss/runtime";
6415
6531
  import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
6416
6532
  function findScrollableParent(element) {
@@ -6448,13 +6564,13 @@ function ColumnResizeHandle({
6448
6564
  const [guideLineX, setGuideLineX] = useState9(null);
6449
6565
  const [guideLineTop, setGuideLineTop] = useState9(0);
6450
6566
  const [guideLineHeight, setGuideLineHeight] = useState9(0);
6451
- const startXRef = useRef7(0);
6452
- const startWidthRef = useRef7(0);
6453
- const startHandleRightRef = useRef7(0);
6454
- const handleRef = useRef7(null);
6455
- const rafRef = useRef7(null);
6456
- const pendingMouseXRef = useRef7(null);
6457
- const scrollableParentRef = useRef7(null);
6567
+ const startXRef = useRef8(0);
6568
+ const startWidthRef = useRef8(0);
6569
+ const startHandleRightRef = useRef8(0);
6570
+ const handleRef = useRef8(null);
6571
+ const rafRef = useRef8(null);
6572
+ const pendingMouseXRef = useRef8(null);
6573
+ const scrollableParentRef = useRef8(null);
6458
6574
  const tid = useTestIds({}, "columnResizeHandle");
6459
6575
  const handleMouseDown = useCallback5((e) => {
6460
6576
  e.preventDefault();
@@ -7596,7 +7712,7 @@ function RowImpl(props) {
7596
7712
  let foundFirstContentColumn = false;
7597
7713
  let minStickyLeftOffset = 0;
7598
7714
  let expandColumnHidden = false;
7599
- const ref = useRef8(null);
7715
+ const ref = useRef9(null);
7600
7716
  const dragOverCallback = useCallback6((row2, evt) => onDragOver?.(row2, evt), [onDragOver]);
7601
7717
  const onDragOverDebounced = useDebouncedCallback2(dragOverCallback, 100);
7602
7718
  const RowContent = () => /* @__PURE__ */ jsx28(RowTag, { ...mergeProps_12(BorderHoverParent, void 0, rowCss), ...others, "data-gridrow": true, ...getCount(row.id), ref, children: isKeptGroupRow ? /* @__PURE__ */ jsx28(KeptGroupRow, { as, style, columnSizes, row, colSpan: columns.length, isLastBodyRow }) : columns.map((column2, columnIndex) => {
@@ -8234,7 +8350,7 @@ function TextFieldBase(props) {
8234
8350
  maybeTooltip({
8235
8351
  title: tooltip,
8236
8352
  placement: "top",
8237
- children: inputProps.readOnly ? /* @__PURE__ */ jsxs18("div", { ...mergeProps_13(BorderHoverChild, void 0, {
8353
+ children: inputProps.readOnly ? /* @__PURE__ */ jsxs18("div", { ...trussProps20({
8238
8354
  // Use input wrapper to get common styles, but then we need to override some
8239
8355
  ...fieldStyles.inputWrapperReadOnly,
8240
8356
  ...multiline ? {
@@ -8242,7 +8358,7 @@ function TextFieldBase(props) {
8242
8358
  alignItems: "aifs",
8243
8359
  gap: "gap2"
8244
8360
  } : {
8245
- ...wrap === false ? {
8361
+ ...!wrap ? {
8246
8362
  whiteSpace: "wsnw",
8247
8363
  overflow: "oh",
8248
8364
  textOverflow: "to_ellipsis"
@@ -8362,7 +8478,7 @@ var textFieldBaseMultilineTopPadding = 11;
8362
8478
  import { jsx as jsx31 } from "react/jsx-runtime";
8363
8479
  function MenuSearchField(props) {
8364
8480
  const tid = useTestIds(props);
8365
- const inputRef = useRef9(null);
8481
+ const inputRef = useRef10(null);
8366
8482
  const { labelProps, inputProps } = useTextField({ ...props }, inputRef);
8367
8483
  return /* @__PURE__ */ jsx31(
8368
8484
  TextFieldBase,
@@ -8446,7 +8562,7 @@ function Menu(props) {
8446
8562
  keys !== "all" && onChange && onChange([...keys.values()].map((k) => k.toString())[0]);
8447
8563
  }
8448
8564
  });
8449
- const menuRef = useRef10(null);
8565
+ const menuRef = useRef11(null);
8450
8566
  const {
8451
8567
  menuProps
8452
8568
  } = useMenu({
@@ -8488,7 +8604,7 @@ function Menu(props) {
8488
8604
  }
8489
8605
 
8490
8606
  // src/components/internal/MenuItem.tsx
8491
- import { useRef as useRef13 } from "react";
8607
+ import { useRef as useRef14 } from "react";
8492
8608
  import { useHover as useHover7, useMenuItem } from "react-aria";
8493
8609
  import { useHistory } from "react-router";
8494
8610
  import { Link as Link3 } from "react-router-dom";
@@ -8743,12 +8859,12 @@ var pressedOverlayCss = {
8743
8859
  };
8744
8860
 
8745
8861
  // src/components/ButtonModal.tsx
8746
- import { useRef as useRef12 } from "react";
8862
+ import { useRef as useRef13 } from "react";
8747
8863
  import { useMenuTrigger } from "react-aria";
8748
8864
  import { useMenuTriggerState } from "react-stately";
8749
8865
 
8750
8866
  // src/components/internal/OverlayTrigger.tsx
8751
- import { useMemo as useMemo13, useRef as useRef11 } from "react";
8867
+ import { useMemo as useMemo13, useRef as useRef12 } from "react";
8752
8868
  import { useOverlayPosition } from "react-aria";
8753
8869
 
8754
8870
  // src/components/Button.tsx
@@ -9438,7 +9554,7 @@ function OverlayTrigger(props) {
9438
9554
  }
9439
9555
  }
9440
9556
  }), [menuTriggerProps, state]);
9441
- const popoverRef = useRef11(null);
9557
+ const popoverRef = useRef12(null);
9442
9558
  const {
9443
9559
  overlayProps: positionProps
9444
9560
  } = useOverlayPosition({
@@ -9500,7 +9616,7 @@ import { jsx as jsx39 } from "react/jsx-runtime";
9500
9616
  function ButtonModal(props) {
9501
9617
  const { storybookDefaultOpen, trigger, disabled, content, title } = props;
9502
9618
  const state = useMenuTriggerState({ isOpen: storybookDefaultOpen });
9503
- const buttonRef = useRef12(null);
9619
+ const buttonRef = useRef13(null);
9504
9620
  const { menuTriggerProps } = useMenuTrigger({ isDisabled: !!disabled }, state, buttonRef);
9505
9621
  const tid = useTestIds(
9506
9622
  props,
@@ -9584,7 +9700,7 @@ function MenuItemImpl(props) {
9584
9700
  const isDisabled = Boolean(disabled);
9585
9701
  const isSelected = state.selectionManager.selectedKeys.has(label);
9586
9702
  const isFocused = state.selectionManager.focusedKey === item.key;
9587
- const ref = useRef13(null);
9703
+ const ref = useRef14(null);
9588
9704
  const history = useHistory();
9589
9705
  const {
9590
9706
  hoverProps,
@@ -9731,7 +9847,7 @@ function Popover(props) {
9731
9847
  }
9732
9848
 
9733
9849
  // src/inputs/internal/ComboBoxBase.tsx
9734
- import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as useRef22, useState as useState19 } from "react";
9850
+ import { useCallback as useCallback9, useEffect as useEffect14, useMemo as useMemo16, useRef as useRef23, useState as useState19 } from "react";
9735
9851
  import { useButton as useButton7, useComboBox as useComboBox2, useFilter as useFilter4, useOverlayPosition as useOverlayPosition4 } from "react-aria";
9736
9852
  import { Item as Item4, useComboBoxState as useComboBoxState2 } from "react-stately";
9737
9853
  import { trussProps as trussProps39 } from "@homebound/truss/runtime";
@@ -9802,13 +9918,13 @@ function useGrowingTextField({ inputRef, inputWrapRef, value, disabled, maxLines
9802
9918
  }
9803
9919
 
9804
9920
  // src/inputs/TreeSelectField/TreeSelectField.tsx
9805
- import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as useRef21, useState as useState17 } from "react";
9921
+ import React9, { useCallback as useCallback8, useContext as useContext11, useEffect as useEffect13, useMemo as useMemo15, useRef as useRef22, useState as useState17 } from "react";
9806
9922
  import { useButton as useButton6, useComboBox, useFilter as useFilter3, useOverlayPosition as useOverlayPosition3 } from "react-aria";
9807
9923
  import { Item as Item3, useComboBoxState } from "react-stately";
9808
9924
  import { trussProps as trussProps37 } from "@homebound/truss/runtime";
9809
9925
 
9810
9926
  // src/inputs/internal/ListBox.tsx
9811
- import { useEffect as useEffect12, useRef as useRef20, useState as useState16 } from "react";
9927
+ import { useEffect as useEffect12, useRef as useRef21, useState as useState16 } from "react";
9812
9928
  import { useListBox } from "react-aria";
9813
9929
  import { trussProps as trussProps36 } from "@homebound/truss/runtime";
9814
9930
 
@@ -9821,17 +9937,17 @@ import { useListBoxSection, useSeparator as useSeparator2 } from "react-aria";
9821
9937
  import { trussProps as trussProps35 } from "@homebound/truss/runtime";
9822
9938
 
9823
9939
  // src/inputs/internal/Option.tsx
9824
- import { useRef as useRef16 } from "react";
9940
+ import { useRef as useRef17 } from "react";
9825
9941
  import { mergeProps as mergeProps12, useHover as useHover8, useOption } from "react-aria";
9826
9942
 
9827
9943
  // src/inputs/ChipSelectField.tsx
9828
9944
  import { camelCase as camelCase2 } from "change-case";
9829
- import { useEffect as useEffect10, useMemo as useMemo14, useRef as useRef15, useState as useState15 } from "react";
9945
+ import { useEffect as useEffect10, useMemo as useMemo14, useRef as useRef16, useState as useState15 } from "react";
9830
9946
  import { mergeProps as mergeProps11, useButton as useButton5, useFocus as useFocus2, useOverlayPosition as useOverlayPosition2, useSelect } from "react-aria";
9831
9947
  import { Item as Item2, Section as Section2, useListData, useSelectState } from "react-stately";
9832
9948
 
9833
9949
  // src/inputs/ChipTextField.tsx
9834
- import { useEffect as useEffect9, useRef as useRef14, useState as useState14 } from "react";
9950
+ import { useEffect as useEffect9, useRef as useRef15, useState as useState14 } from "react";
9835
9951
  import { useFocus } from "react-aria";
9836
9952
  import { trussProps as trussProps28 } from "@homebound/truss/runtime";
9837
9953
  import { jsx as jsx43 } from "react/jsx-runtime";
@@ -9850,7 +9966,7 @@ function ChipTextField(props) {
9850
9966
  const {
9851
9967
  fieldProps
9852
9968
  } = usePresentationContext();
9853
- const valueRef = useRef14(value);
9969
+ const valueRef = useRef15(value);
9854
9970
  const tid = useTestIds(props, "chipField");
9855
9971
  const [isFocused, setIsFocused] = useState14(false);
9856
9972
  const {
@@ -9871,7 +9987,7 @@ function ChipTextField(props) {
9871
9987
  onBlur: () => maybeCall(onBlur),
9872
9988
  onFocusChange: setIsFocused
9873
9989
  });
9874
- const fieldRef = useRef14(null);
9990
+ const fieldRef = useRef15(null);
9875
9991
  useEffect9(
9876
9992
  () => {
9877
9993
  autoFocus && fieldRef.current?.focus();
@@ -9978,7 +10094,7 @@ function defaultOptionLabel(opt) {
9978
10094
  import { trussProps as trussProps30 } from "@homebound/truss/runtime";
9979
10095
  import { Fragment as Fragment15, jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
9980
10096
  function ChipSelectField(props) {
9981
- const firstRender = useRef15(true);
10097
+ const firstRender = useRef16(true);
9982
10098
  const {
9983
10099
  fieldProps
9984
10100
  } = usePresentationContext();
@@ -10036,10 +10152,10 @@ function ChipSelectField(props) {
10036
10152
  } = useFocus2({
10037
10153
  onFocusChange: setIsClearFocused
10038
10154
  });
10039
- const buttonRef = useRef15(null);
10040
- const popoverRef = useRef15(null);
10041
- const listBoxRef = useRef15(null);
10042
- const wrapperRef = useRef15(null);
10155
+ const buttonRef = useRef16(null);
10156
+ const popoverRef = useRef16(null);
10157
+ const listBoxRef = useRef16(null);
10158
+ const wrapperRef = useRef16(null);
10043
10159
  const listData = useListData({
10044
10160
  initialItems: !onCreateNew ? options : [{
10045
10161
  title: "Options",
@@ -10243,7 +10359,7 @@ function Option(props) {
10243
10359
  scrollToIndex,
10244
10360
  disabledReason
10245
10361
  } = props;
10246
- const ref = useRef16(null);
10362
+ const ref = useRef17(null);
10247
10363
  const {
10248
10364
  hoverProps,
10249
10365
  isHovered
@@ -10322,7 +10438,7 @@ function Option(props) {
10322
10438
 
10323
10439
  // src/inputs/internal/VirtualizedOptions.tsx
10324
10440
  import { getInteractionModality } from "@react-aria/interactions";
10325
- import { useEffect as useEffect11, useRef as useRef19 } from "react";
10441
+ import { useEffect as useEffect11, useRef as useRef20 } from "react";
10326
10442
  import { Virtuoso } from "react-virtuoso";
10327
10443
 
10328
10444
  // src/inputs/internal/LoadingDots.tsx
@@ -10370,11 +10486,11 @@ function LoadingDots({
10370
10486
  }
10371
10487
 
10372
10488
  // src/inputs/TreeSelectField/TreeOption.tsx
10373
- import { useRef as useRef18 } from "react";
10489
+ import { useRef as useRef19 } from "react";
10374
10490
  import { useHover as useHover10, useOption as useOption2 } from "react-aria";
10375
10491
 
10376
10492
  // src/inputs/CheckboxBase.tsx
10377
- import { useRef as useRef17 } from "react";
10493
+ import { useRef as useRef18 } from "react";
10378
10494
  import { mergeProps as mergeProps13, useFocusRing as useFocusRing5, useHover as useHover9, VisuallyHidden as VisuallyHidden3 } from "react-aria";
10379
10495
  import { trussProps as trussProps33 } from "@homebound/truss/runtime";
10380
10496
  import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -10393,7 +10509,7 @@ function CheckboxBase(props) {
10393
10509
  tooltip,
10394
10510
  fullWidth = false
10395
10511
  } = props;
10396
- const ref = useRef17(null);
10512
+ const ref = useRef18(null);
10397
10513
  const {
10398
10514
  isFocusVisible,
10399
10515
  focusProps
@@ -10538,7 +10654,7 @@ function TreeOption(props) {
10538
10654
  const leveledOption = item.value;
10539
10655
  if (!leveledOption) return null;
10540
10656
  const [option, level] = leveledOption;
10541
- const ref = useRef18(null);
10657
+ const ref = useRef19(null);
10542
10658
  const {
10543
10659
  hoverProps,
10544
10660
  isHovered
@@ -10676,7 +10792,7 @@ function VirtualizedOptions(props) {
10676
10792
  isTree,
10677
10793
  allowCollapsing
10678
10794
  } = props;
10679
- const virtuosoRef = useRef19(null);
10795
+ const virtuosoRef = useRef20(null);
10680
10796
  const focusedKey = state.selectionManager.focusedKey;
10681
10797
  const focusedItem = focusedKey != null ? state.collection.getItem(focusedKey) : null;
10682
10798
  const selectedItem = state.selectionManager.selectedKeys.size > 0 ? state.collection.getItem([...state.selectionManager.selectedKeys.values()][0]) : void 0;
@@ -10830,9 +10946,9 @@ function ListBox(props) {
10830
10946
  const isMultiSelect = state.selectionManager.selectionMode === "multiple";
10831
10947
  const firstItem = state.collection.at(0);
10832
10948
  const hasSections = firstItem && firstItem.type === "section";
10833
- const selectedList = useRef20(null);
10834
- const firstRender = useRef20(true);
10835
- const virtuosoListHeight = useRef20(0);
10949
+ const selectedList = useRef21(null);
10950
+ const firstRender = useRef21(true);
10951
+ const virtuosoListHeight = useRef21(0);
10836
10952
  const onListHeightChange = (listHeight) => {
10837
10953
  virtuosoListHeight.current = listHeight;
10838
10954
  const height = (selectedList.current?.offsetHeight || 0) + listHeight;
@@ -11040,7 +11156,7 @@ function TreeSelectFieldBase(props) {
11040
11156
  setFieldState(initTreeFieldState());
11041
11157
  }
11042
11158
  }, [getOptionValue, initTreeFieldState, values]);
11043
- const reactToCollapse = useRef21(false);
11159
+ const reactToCollapse = useRef22(false);
11044
11160
  useEffect13(
11045
11161
  () => {
11046
11162
  if (reactToCollapse.current) {
@@ -11087,7 +11203,7 @@ function TreeSelectFieldBase(props) {
11087
11203
  }));
11088
11204
  }
11089
11205
  }, [collapsedKeys, contains, getOptionLabel, getOptionValue]);
11090
- const firstOpen = useRef21(true);
11206
+ const firstOpen = useRef22(true);
11091
11207
  function onOpenChange(isOpen) {
11092
11208
  if (firstOpen.current && isOpen) {
11093
11209
  maybeInitLoad(options, fieldState, setFieldState);
@@ -11240,12 +11356,12 @@ function TreeSelectFieldBase(props) {
11240
11356
  }));
11241
11357
  }
11242
11358
  }
11243
- const comboBoxRef = useRef21(null);
11244
- const triggerRef = useRef21(null);
11245
- const inputRef = useRef21(null);
11246
- const inputWrapRef = useRef21(null);
11247
- const listBoxRef = useRef21(null);
11248
- const popoverRef = useRef21(null);
11359
+ const comboBoxRef = useRef22(null);
11360
+ const triggerRef = useRef22(null);
11361
+ const inputRef = useRef22(null);
11362
+ const inputWrapRef = useRef22(null);
11363
+ const listBoxRef = useRef22(null);
11364
+ const popoverRef = useRef22(null);
11249
11365
  const {
11250
11366
  buttonProps: triggerProps,
11251
11367
  inputProps,
@@ -11584,7 +11700,7 @@ function ComboBoxBase(props) {
11584
11700
  }));
11585
11701
  }
11586
11702
  }
11587
- const firstOpen = useRef22(true);
11703
+ const firstOpen = useRef23(true);
11588
11704
  function onOpenChange(isOpen) {
11589
11705
  if (firstOpen.current && isOpen) {
11590
11706
  maybeInitLoad();
@@ -11597,12 +11713,12 @@ function ComboBoxBase(props) {
11597
11713
  }));
11598
11714
  }
11599
11715
  }
11600
- const comboBoxRef = useRef22(null);
11601
- const triggerRef = useRef22(null);
11602
- const inputRef = useRef22(null);
11603
- const inputWrapRef = useRef22(null);
11604
- const listBoxRef = useRef22(null);
11605
- const popoverRef = useRef22(null);
11716
+ const comboBoxRef = useRef23(null);
11717
+ const triggerRef = useRef23(null);
11718
+ const inputRef = useRef23(null);
11719
+ const inputWrapRef = useRef23(null);
11720
+ const listBoxRef = useRef23(null);
11721
+ const popoverRef = useRef23(null);
11606
11722
  const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
11607
11723
  const comboBoxChildren = useCallback9((item) => /* @__PURE__ */ jsx56(Item4, { textValue: getOptionLabel(item), children: getOptionMenuLabel(item) }, valueToKey(getOptionValue(item))), [getOptionValue, getOptionLabel, getOptionMenuLabel]);
11608
11724
  const selectedKeys = useMemo16(() => {
@@ -11836,10 +11952,10 @@ function Autocomplete(props) {
11836
11952
  ...others
11837
11953
  };
11838
11954
  const state = useComboBoxState3(comboBoxProps);
11839
- const inputWrapRef = useRef23(null);
11840
- const inputRef = useRef23(null);
11841
- const listBoxRef = useRef23(null);
11842
- const popoverRef = useRef23(null);
11955
+ const inputWrapRef = useRef24(null);
11956
+ const inputRef = useRef24(null);
11957
+ const listBoxRef = useRef24(null);
11958
+ const popoverRef = useRef24(null);
11843
11959
  const { inputProps, listBoxProps, labelProps } = useComboBox3(
11844
11960
  {
11845
11961
  ...comboBoxProps,
@@ -11906,7 +12022,7 @@ function Autocomplete(props) {
11906
12022
  }
11907
12023
 
11908
12024
  // src/inputs/Checkbox.tsx
11909
- import { useRef as useRef24 } from "react";
12025
+ import { useRef as useRef25 } from "react";
11910
12026
  import { useCheckbox } from "react-aria";
11911
12027
  import { useToggleState } from "react-stately";
11912
12028
  import { jsx as jsx58 } from "react/jsx-runtime";
@@ -11916,7 +12032,7 @@ function Checkbox(props) {
11916
12032
  const isIndeterminate = selected === "indeterminate";
11917
12033
  const ariaProps = { isSelected, isDisabled: !!disabled, isIndeterminate, ...otherProps };
11918
12034
  const checkboxProps = { ...ariaProps, "aria-label": label };
11919
- const ref = useRef24(null);
12035
+ const ref = useRef25(null);
11920
12036
  const toggleState = useToggleState(ariaProps);
11921
12037
  const { inputProps } = useCheckbox(checkboxProps, toggleState, ref);
11922
12038
  return /* @__PURE__ */ jsx58(
@@ -11935,7 +12051,7 @@ function Checkbox(props) {
11935
12051
  }
11936
12052
 
11937
12053
  // src/inputs/CheckboxGroup.tsx
11938
- import { useRef as useRef25 } from "react";
12054
+ import { useRef as useRef26 } from "react";
11939
12055
  import { useCheckboxGroup, useCheckboxGroupItem } from "react-aria";
11940
12056
  import { useCheckboxGroupState } from "react-stately";
11941
12057
  import { trussProps as trussProps40 } from "@homebound/truss/runtime";
@@ -12010,7 +12126,7 @@ function CheckboxGroupItem(props) {
12010
12126
  ...ariaProps,
12011
12127
  "aria-label": label
12012
12128
  };
12013
- const ref = useRef25(null);
12129
+ const ref = useRef26(null);
12014
12130
  const {
12015
12131
  inputProps
12016
12132
  } = useCheckboxGroupItem(checkboxProps, groupState, ref);
@@ -12024,7 +12140,7 @@ import { jsx as jsx60 } from "react/jsx-runtime";
12024
12140
  function DateFieldMock(props) {
12025
12141
  const { onChange = () => {
12026
12142
  }, errorMsg, onBlur, onFocus } = props;
12027
- const [value, setValue] = useState20(props.value ? format3(props.value, "MM/dd/yy") : "");
12143
+ const [value, setValue] = useState20(props.value ? format3(plainDateToJsDate(props.value), "MM/dd/yy") : "");
12028
12144
  const tid = useTestIds(props, "date");
12029
12145
  return /* @__PURE__ */ jsx60(
12030
12146
  "input",
@@ -12035,7 +12151,8 @@ function DateFieldMock(props) {
12035
12151
  onChange: (e) => {
12036
12152
  const { value: value2 } = e.target;
12037
12153
  setValue(value2);
12038
- onChange(parse(value2, "MM/dd/yy", /* @__PURE__ */ new Date()));
12154
+ const parsed = parse(value2, "MM/dd/yy", plainDateToJsDate(todayPlainDate()));
12155
+ onChange(Number.isNaN(parsed.getTime()) ? void 0 : jsDateToPlainDate(parsed));
12039
12156
  },
12040
12157
  onBlur: () => maybeCall(onBlur),
12041
12158
  onFocus: () => maybeCall(onFocus),
@@ -12047,13 +12164,13 @@ function DateFieldMock(props) {
12047
12164
  }
12048
12165
 
12049
12166
  // src/inputs/DateFields/DateFieldBase.tsx
12050
- import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef26, useState as useState21 } from "react";
12167
+ import { useCallback as useCallback11, useEffect as useEffect15, useRef as useRef27, useState as useState21 } from "react";
12051
12168
  import { FocusScope as FocusScope3, useButton as useButton8, useOverlayPosition as useOverlayPosition6, useOverlayTrigger, useTextField as useTextField2 } from "react-aria";
12052
- import { isDateRange } from "react-day-picker";
12053
12169
  import { useOverlayTriggerState } from "react-stately";
12054
12170
 
12055
12171
  // src/inputs/DateFields/utils.ts
12056
12172
  import { format as dateFnsFormat, parse as dateFnsParse, isDate } from "date-fns";
12173
+ import { Temporal as Temporal2 } from "temporal-polyfill";
12057
12174
  var dateFormats = {
12058
12175
  short: "MM/dd/yy",
12059
12176
  medium: "EEE, MMM d",
@@ -12064,13 +12181,13 @@ function getDateFormat(format4) {
12064
12181
  }
12065
12182
  function formatDate(date, format4) {
12066
12183
  if (!date) return "";
12067
- return dateFnsFormat(date, format4);
12184
+ return dateFnsFormat(plainDateToJsDate(date), format4);
12068
12185
  }
12069
12186
  function formatDateRange(date, format4) {
12070
12187
  if (!date) return "";
12071
12188
  const { from, to } = date;
12072
- const fromFormatted = from ? dateFnsFormat(from, format4) : "";
12073
- const toFormatted = to ? dateFnsFormat(to, format4) : "";
12189
+ const fromFormatted = from ? dateFnsFormat(plainDateToJsDate(from), format4) : "";
12190
+ const toFormatted = to ? dateFnsFormat(plainDateToJsDate(to), format4) : "";
12074
12191
  return !fromFormatted && !toFormatted ? void 0 : `${fromFormatted} - ${toFormatted}`;
12075
12192
  }
12076
12193
  function parseDate(str, format4) {
@@ -12080,7 +12197,7 @@ function parseDateRange(str, format4) {
12080
12197
  const [from = "", to = ""] = str.split("-");
12081
12198
  const fromDate = parseDateString(from.trim(), format4);
12082
12199
  const toDate = parseDateString(to.trim(), format4);
12083
- if (toDate && fromDate && toDate < fromDate) {
12200
+ if (toDate && fromDate && Temporal2.PlainDate.compare(toDate, fromDate) < 0) {
12084
12201
  return { from: toDate, to: fromDate };
12085
12202
  }
12086
12203
  if (toDate === void 0 && fromDate === void 0) {
@@ -12102,13 +12219,16 @@ function parseDateString(str, format4) {
12102
12219
  if (isNaN(year) || String(year).length > 4 || isNaN(month) || isNaN(day) || day <= 0 || day > 31 || month < 0 || month >= 12) {
12103
12220
  return void 0;
12104
12221
  }
12105
- const parsed = dateFnsParse(str, format4, /* @__PURE__ */ new Date());
12106
- if (!isValidDate(parsed)) {
12222
+ const parsed = dateFnsParse(str, format4, plainDateToJsDate(todayPlainDate()));
12223
+ if (!isValidJsDate(parsed)) {
12107
12224
  return void 0;
12108
12225
  }
12109
- return parsed;
12226
+ return jsDateToPlainDate(parsed);
12110
12227
  }
12111
12228
  function isValidDate(d) {
12229
+ return d !== void 0 && isPlainDate(d);
12230
+ }
12231
+ function isValidJsDate(d) {
12112
12232
  return d !== void 0 && isDate(d) && d.toString() !== "Invalid Date";
12113
12233
  }
12114
12234
 
@@ -12140,11 +12260,11 @@ function DateFieldBase(props) {
12140
12260
  ...others
12141
12261
  } = props;
12142
12262
  const isRangeMode = mode === "range";
12143
- const inputRef = useRef26(null);
12144
- const inputWrapRef = useRef26(null);
12145
- const buttonRef = useRef26(null);
12146
- const overlayRef = useRef26(null);
12147
- const isFocused = useRef26(false);
12263
+ const inputRef = useRef27(null);
12264
+ const inputWrapRef = useRef27(null);
12265
+ const buttonRef = useRef27(null);
12266
+ const overlayRef = useRef27(null);
12267
+ const isFocused = useRef27(false);
12148
12268
  const dateFormat = getDateFormat(format4);
12149
12269
  const [wipValue, setWipValue] = useState21(value);
12150
12270
  const [inputValue, setInputValue] = useState21((isRangeMode ? formatDateRange(props.value, dateFormat) : formatDate(props.value, dateFormat)) ?? "");
@@ -12234,11 +12354,11 @@ function DateFieldBase(props) {
12234
12354
  (d) => {
12235
12355
  setWipValue(d);
12236
12356
  if (d && isParsedDateValid(d)) {
12237
- if (isRangeMode && isDateRange(d)) {
12357
+ if (isRangeMode && isDateRangeValue(d)) {
12238
12358
  props.onChange(d);
12239
12359
  return;
12240
12360
  }
12241
- if (!isRangeMode && !isDateRange(d)) {
12361
+ if (!isRangeMode && !isDateRangeValue(d)) {
12242
12362
  props.onChange(d);
12243
12363
  return;
12244
12364
  }
@@ -12313,7 +12433,10 @@ function DateFieldBase(props) {
12313
12433
  ] });
12314
12434
  }
12315
12435
  function isParsedDateValid(d) {
12316
- return d !== void 0 && (!isDateRange(d) || isDateRange(d) && isValidDate(d.from) && isValidDate(d.to));
12436
+ return d !== void 0 && (!isDateRangeValue(d) || isValidDate(d.from) && isValidDate(d.to));
12437
+ }
12438
+ function isDateRangeValue(value) {
12439
+ return typeof value === "object" && value !== null && ("from" in value || "to" in value);
12317
12440
  }
12318
12441
 
12319
12442
  // src/utils/withTestMock.tsx
@@ -12500,7 +12623,7 @@ function MultiSelectField(props) {
12500
12623
 
12501
12624
  // src/inputs/NumberField.tsx
12502
12625
  import { NumberParser } from "@internationalized/number";
12503
- import { useMemo as useMemo18, useRef as useRef27, useState as useState23 } from "react";
12626
+ import { useMemo as useMemo18, useRef as useRef28, useState as useState23 } from "react";
12504
12627
  import { mergeProps as mergeProps15, useLocale, useNumberField } from "react-aria";
12505
12628
  import { useNumberFieldState } from "react-stately";
12506
12629
  import { jsx as jsx68 } from "react/jsx-runtime";
@@ -12587,11 +12710,11 @@ function NumberField(props) {
12587
12710
  };
12588
12711
  }, [type, numberFormatOptions, defaultFormatOptions, numFractionDigits]);
12589
12712
  const numberParser = useMemo18(() => new NumberParser(locale, formatOptions), [locale, formatOptions]);
12590
- const valueRef = useRef27({
12713
+ const valueRef = useRef28({
12591
12714
  wip: false
12592
12715
  });
12593
- const lastSentRef = useRef27(void 0);
12594
- const focusValueRef = useRef27(void 0);
12716
+ const lastSentRef = useRef28(void 0);
12717
+ const focusValueRef = useRef28(void 0);
12595
12718
  const [, forceRender] = useState23(0);
12596
12719
  const propValue = value === void 0 ? Number.NaN : value / factor;
12597
12720
  if (valueRef.current.wip && !Object.is(valueRef.current.value, propValue)) {
@@ -12639,7 +12762,7 @@ function NumberField(props) {
12639
12762
  ...otherProps
12640
12763
  };
12641
12764
  const state = useNumberFieldState(useProps);
12642
- const inputRef = useRef27(null);
12765
+ const inputRef = useRef28(null);
12643
12766
  const {
12644
12767
  labelProps,
12645
12768
  inputProps,
@@ -12691,7 +12814,7 @@ function formatValue(value, factor, numFractionDigits, numIntegerDigits, positiv
12691
12814
  }
12692
12815
 
12693
12816
  // src/inputs/RadioGroupField.tsx
12694
- import { Fragment as Fragment19, useMemo as useMemo19, useRef as useRef28 } from "react";
12817
+ import { Fragment as Fragment19, useMemo as useMemo19, useRef as useRef29 } from "react";
12695
12818
  import { useFocusRing as useFocusRing6, useHover as useHover12, useRadio, useRadioGroup } from "react-aria";
12696
12819
  import { useRadioGroupState } from "react-stately";
12697
12820
  import { trussProps as trussProps44 } from "@homebound/truss/runtime";
@@ -12767,7 +12890,7 @@ function Radio(props) {
12767
12890
  } = props;
12768
12891
  const labelId = `${parentId}-${value}-label`;
12769
12892
  const descriptionId = `${parentId}-${value}-description`;
12770
- const ref = useRef28(null);
12893
+ const ref = useRef29(null);
12771
12894
  const {
12772
12895
  inputProps,
12773
12896
  isDisabled
@@ -12937,7 +13060,7 @@ var radioDisabled = {
12937
13060
 
12938
13061
  // src/inputs/RichTextField.tsx
12939
13062
  import DOMPurify from "dompurify";
12940
- import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as useRef29, useState as useState25 } from "react";
13063
+ import { createElement, useEffect as useEffect16, useMemo as useMemo20, useRef as useRef30, useState as useState25 } from "react";
12941
13064
 
12942
13065
  // src/inputs/RichTextField.mock.tsx
12943
13066
  import { camelCase as camelCase3 } from "change-case";
@@ -12993,13 +13116,13 @@ function RichTextFieldImpl(props) {
12993
13116
  fullWidth = fieldProps?.fullWidth ?? false
12994
13117
  } = props;
12995
13118
  const [editor, setEditor] = useState25();
12996
- const editorElement = useRef29();
12997
- const currentHtml = useRef29(void 0);
12998
- const onChangeRef = useRef29(onChange);
13119
+ const editorElement = useRef30();
13120
+ const currentHtml = useRef30(void 0);
13121
+ const onChangeRef = useRef30(onChange);
12999
13122
  onChangeRef.current = onChange;
13000
- const onBlurRef = useRef29(onBlur);
13123
+ const onBlurRef = useRef30(onBlur);
13001
13124
  onBlurRef.current = onBlur;
13002
- const onFocusRef = useRef29(onFocus);
13125
+ const onFocusRef = useRef30(onFocus);
13003
13126
  onFocusRef.current = onFocus;
13004
13127
  const id = useMemo20(() => {
13005
13128
  if (readOnly) return;
@@ -13150,7 +13273,7 @@ function SelectField(props) {
13150
13273
  }
13151
13274
 
13152
13275
  // src/inputs/Switch.tsx
13153
- import { useRef as useRef30 } from "react";
13276
+ import { useRef as useRef31 } from "react";
13154
13277
  import { useFocusRing as useFocusRing7, useHover as useHover13, useSwitch, VisuallyHidden as VisuallyHidden5 } from "react-aria";
13155
13278
  import { trussProps as trussProps46 } from "@homebound/truss/runtime";
13156
13279
  import { jsx as jsx73, jsxs as jsxs45 } from "react/jsx-runtime";
@@ -13183,7 +13306,7 @@ function Switch(props) {
13183
13306
  ...otherProps
13184
13307
  };
13185
13308
  const state = toToggleState(isSelected, onChange);
13186
- const ref = useRef30(null);
13309
+ const ref = useRef31(null);
13187
13310
  const {
13188
13311
  inputProps
13189
13312
  } = useSwitch({
@@ -13335,7 +13458,7 @@ function switchCircleSelectedStyles(isCompact) {
13335
13458
  }
13336
13459
 
13337
13460
  // src/inputs/TextAreaField.tsx
13338
- import { useRef as useRef31 } from "react";
13461
+ import { useRef as useRef32 } from "react";
13339
13462
  import { mergeProps as mergeProps16, useTextField as useTextField3 } from "react-aria";
13340
13463
  import { jsx as jsx74 } from "react/jsx-runtime";
13341
13464
  function TextAreaField(props) {
@@ -13353,8 +13476,8 @@ function TextAreaField(props) {
13353
13476
  const isDisabled = !!disabled;
13354
13477
  const isReadOnly = !!readOnly;
13355
13478
  const textFieldProps = { ...otherProps, value, isDisabled, isReadOnly };
13356
- const inputRef = useRef31(null);
13357
- const inputWrapRef = useRef31(null);
13479
+ const inputRef = useRef32(null);
13480
+ const inputWrapRef = useRef32(null);
13358
13481
  useGrowingTextField({ inputRef, inputWrapRef, value, maxLines });
13359
13482
  const { labelProps, inputProps } = useTextField3(
13360
13483
  {
@@ -13392,7 +13515,7 @@ function TextAreaField(props) {
13392
13515
  }
13393
13516
 
13394
13517
  // src/inputs/TextField.tsx
13395
- import { useRef as useRef32 } from "react";
13518
+ import { useRef as useRef33 } from "react";
13396
13519
  import { mergeProps as mergeProps17, useTextField as useTextField4 } from "react-aria";
13397
13520
  import { jsx as jsx75 } from "react/jsx-runtime";
13398
13521
  function TextField(props) {
@@ -13420,7 +13543,7 @@ function TextField(props) {
13420
13543
  validationState: errorMsg ? "invalid" : "valid",
13421
13544
  value
13422
13545
  };
13423
- const inputRef = useRef32(null);
13546
+ const inputRef = useRef33(null);
13424
13547
  const { labelProps, inputProps } = useTextField4(
13425
13548
  {
13426
13549
  ...textFieldProps,
@@ -13456,7 +13579,7 @@ function TextField(props) {
13456
13579
  }
13457
13580
 
13458
13581
  // src/inputs/ToggleButton.tsx
13459
- import { useRef as useRef33, useState as useState26 } from "react";
13582
+ import { useRef as useRef34, useState as useState26 } from "react";
13460
13583
  import { useFocusRing as useFocusRing8, useHover as useHover14, usePress, useSwitch as useSwitch2, VisuallyHidden as VisuallyHidden6 } from "react-aria";
13461
13584
  import { useToggleState as useToggleState3 } from "react-stately";
13462
13585
  import { trussProps as trussProps47 } from "@homebound/truss/runtime";
@@ -13490,8 +13613,8 @@ function ToggleButton(props) {
13490
13613
  return result;
13491
13614
  }
13492
13615
  });
13493
- const labelRef = useRef33(null);
13494
- const ref = useRef33(null);
13616
+ const labelRef = useRef34(null);
13617
+ const ref = useRef34(null);
13495
13618
  const tid = useTestIds(otherProps, label);
13496
13619
  const {
13497
13620
  isPressed: isPressedFromEvents,
@@ -13577,7 +13700,7 @@ var togglePressStyles = {
13577
13700
  };
13578
13701
 
13579
13702
  // src/inputs/ToggleChipGroup.tsx
13580
- import { useRef as useRef34 } from "react";
13703
+ import { useRef as useRef35 } from "react";
13581
13704
  import { useCheckboxGroup as useCheckboxGroup2, useCheckboxGroupItem as useCheckboxGroupItem2, useFocusRing as useFocusRing9, VisuallyHidden as VisuallyHidden7 } from "react-aria";
13582
13705
  import { useCheckboxGroupState as useCheckboxGroupState2 } from "react-stately";
13583
13706
  import { trussProps as trussProps48 } from "@homebound/truss/runtime";
@@ -13650,7 +13773,7 @@ function ToggleChip2(props) {
13650
13773
  } = props;
13651
13774
  const isDisabled = !!disabled;
13652
13775
  const isReadOnly = !!readonly;
13653
- const ref = useRef34(null);
13776
+ const ref = useRef35(null);
13654
13777
  const {
13655
13778
  inputProps
13656
13779
  } = useCheckboxGroupItem2({
@@ -14700,9 +14823,9 @@ function maybeApply(maybeFn) {
14700
14823
  }
14701
14824
 
14702
14825
  // src/components/Table/hooks/useColumnResizeHandlers.ts
14703
- import { useCallback as useCallback12, useRef as useRef35 } from "react";
14826
+ import { useCallback as useCallback12, useRef as useRef36 } from "react";
14704
14827
  function useColumnResizeHandlers(columns, columnSizes, tableWidth, setResizedWidth, setResizedWidths) {
14705
- const hasLockedColumnsRef = useRef35(false);
14828
+ const hasLockedColumnsRef = useRef36(false);
14706
14829
  const distributeAdjustment = useCallback12(
14707
14830
  (rightColumns, totalRightWidth, adjustment) => {
14708
14831
  const updates = {};
@@ -14831,7 +14954,7 @@ function useScrollStorage(tableId, enabled = true) {
14831
14954
 
14832
14955
  // src/components/Table/hooks/useSetupColumnSizes.ts
14833
14956
  import { useResizeObserver } from "@react-aria/utils";
14834
- import { useCallback as useCallback14, useEffect as useEffect18, useRef as useRef36, useState as useState28 } from "react";
14957
+ import { useCallback as useCallback14, useEffect as useEffect18, useRef as useRef37, useState as useState28 } from "react";
14835
14958
 
14836
14959
  // src/components/Table/hooks/useColumnResizing.ts
14837
14960
  import { useCallback as useCallback13, useEffect as useEffect17, useState as useState27 } from "react";
@@ -14890,9 +15013,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
14890
15013
  const { resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths } = useColumnResizing(
14891
15014
  disableColumnResizing ? void 0 : visibleColumnsStorageKey
14892
15015
  );
14893
- const calculateImmediately = useRef36(true);
15016
+ const calculateImmediately = useRef37(true);
14894
15017
  const [tableWidth, setTableWidth] = useState28();
14895
- const prevTableWidthRef = useRef36(tableWidth);
15018
+ const prevTableWidthRef = useRef37(tableWidth);
14896
15019
  const [columnSizes, setColumnSizes] = useState28(
14897
15020
  calcColumnSizes(columns, tableWidth, style.minWidthPx, expandedColumnIds, resizedWidths)
14898
15021
  );
@@ -14959,9 +15082,9 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
14959
15082
  }
14960
15083
 
14961
15084
  // src/hooks/useRenderCount.ts
14962
- import { useCallback as useCallback15, useRef as useRef37 } from "react";
15085
+ import { useCallback as useCallback15, useRef as useRef38 } from "react";
14963
15086
  function useRenderCount() {
14964
- const ref = useRef37(/* @__PURE__ */ new Map());
15087
+ const ref = useRef38(/* @__PURE__ */ new Map());
14965
15088
  const getCount = useCallback15((id) => {
14966
15089
  const count = ref.current.get(id) || 1;
14967
15090
  ref.current.set(id, count + 1);
@@ -15018,10 +15141,10 @@ function GridTable(props) {
15018
15141
  disableColumnResizing = false
15019
15142
  } = props;
15020
15143
  const columnsWithIds = useMemo24(() => assignDefaultColumnIds(_columns), [_columns]);
15021
- const virtuosoRef = useRef38(null);
15022
- const virtuosoRangeRef = useRef38(null);
15023
- const resizeRef = useRef38(null);
15024
- const tableContainerRef = useRef38(null);
15144
+ const virtuosoRef = useRef39(null);
15145
+ const virtuosoRangeRef = useRef39(null);
15146
+ const resizeRef = useRef39(null);
15147
+ const tableContainerRef = useRef39(null);
15025
15148
  const api = useMemo24(
15026
15149
  () => {
15027
15150
  const api2 = props.api ?? new GridTableApiImpl();
@@ -15036,7 +15159,7 @@ function GridTable(props) {
15036
15159
  [props.api]
15037
15160
  );
15038
15161
  const [draggedRow, _setDraggedRow] = useState29(void 0);
15039
- const draggedRowRef = useRef38(draggedRow);
15162
+ const draggedRowRef = useRef39(draggedRow);
15040
15163
  const setDraggedRow = (row) => {
15041
15164
  draggedRowRef.current = row;
15042
15165
  _setDraggedRow(row);
@@ -15882,17 +16005,17 @@ var variantStyles2 = {
15882
16005
  };
15883
16006
 
15884
16007
  // src/components/BeamContext.tsx
15885
- import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as useRef45 } from "react";
16008
+ import { createContext as createContext7, useContext as useContext17, useMemo as useMemo40, useReducer, useRef as useRef46 } from "react";
15886
16009
  import { OverlayProvider } from "react-aria";
15887
16010
 
15888
16011
  // src/components/Modal/Modal.tsx
15889
16012
  import { useResizeObserver as useResizeObserver3 } from "@react-aria/utils";
15890
- import { useCallback as useCallback17, useEffect as useEffect23, useRef as useRef40, useState as useState32 } from "react";
16013
+ import { useCallback as useCallback17, useEffect as useEffect23, useRef as useRef41, useState as useState32 } from "react";
15891
16014
  import { FocusScope as FocusScope4, OverlayContainer as OverlayContainer2, useDialog, useModal as useModal2, useOverlay as useOverlay2, usePreventScroll } from "react-aria";
15892
16015
  import { createPortal as createPortal3 } from "react-dom";
15893
16016
 
15894
16017
  // src/components/Modal/useModal.tsx
15895
- import { useEffect as useEffect22, useMemo as useMemo27, useRef as useRef39 } from "react";
16018
+ import { useEffect as useEffect22, useMemo as useMemo27, useRef as useRef40 } from "react";
15896
16019
 
15897
16020
  // src/components/Modal/ModalContext.tsx
15898
16021
  import { createContext as createContext4, useContext as useContext13, useMemo as useMemo26 } from "react";
@@ -15910,8 +16033,8 @@ function useModalContext() {
15910
16033
  function useModal() {
15911
16034
  const { modalState, modalCanCloseChecks } = useBeamContext();
15912
16035
  const { inModal } = useModalContext();
15913
- const lastCanClose = useRef39();
15914
- const api = useRef39();
16036
+ const lastCanClose = useRef40();
16037
+ const api = useRef40();
15915
16038
  useEffect22(() => {
15916
16039
  return () => {
15917
16040
  modalCanCloseChecks.current = modalCanCloseChecks.current.filter((c) => c !== lastCanClose.current);
@@ -15964,7 +16087,7 @@ function Modal(props) {
15964
16087
  allowClosing = true
15965
16088
  } = props;
15966
16089
  const isFixedHeight = typeof size !== "string";
15967
- const ref = useRef40(null);
16090
+ const ref = useRef41(null);
15968
16091
  const {
15969
16092
  modalBodyDiv,
15970
16093
  modalFooterDiv,
@@ -15995,9 +16118,9 @@ function Modal(props) {
15995
16118
  role: "dialog"
15996
16119
  }, ref);
15997
16120
  const [[width2, height], setSize] = useState32(getSize(size));
15998
- const modalBodyRef = useRef40(null);
15999
- const modalFooterRef = useRef40(null);
16000
- const modalHeaderRef = useRef40(null);
16121
+ const modalBodyRef = useRef41(null);
16122
+ const modalFooterRef = useRef41(null);
16123
+ const modalHeaderRef = useRef41(null);
16001
16124
  const testId = useTestIds({}, testIdPrefix);
16002
16125
  usePreventScroll();
16003
16126
  const {
@@ -16293,7 +16416,7 @@ function useSnackbarContext() {
16293
16416
 
16294
16417
  // src/components/SuperDrawer/SuperDrawer.tsx
16295
16418
  import { AnimatePresence, motion } from "framer-motion";
16296
- import { useEffect as useEffect24, useRef as useRef41 } from "react";
16419
+ import { useEffect as useEffect24, useRef as useRef42 } from "react";
16297
16420
  import { createPortal as createPortal4 } from "react-dom";
16298
16421
 
16299
16422
  // src/components/SuperDrawer/utils.ts
@@ -16315,7 +16438,7 @@ function SuperDrawer() {
16315
16438
  const {
16316
16439
  closeDrawer
16317
16440
  } = useSuperDrawer();
16318
- const headerRef = useRef41(null);
16441
+ const headerRef = useRef42(null);
16319
16442
  const testId = useTestIds({}, "superDrawer");
16320
16443
  const currentContent = contentStack.current[contentStack.current.length - 1]?.opts;
16321
16444
  const {
@@ -16410,7 +16533,7 @@ function SuperDrawer() {
16410
16533
  }
16411
16534
 
16412
16535
  // src/components/Layout/FormPageLayout.tsx
16413
- import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as useRef42, useState as useState39 } from "react";
16536
+ import React16, { createRef, useCallback as useCallback21, useEffect as useEffect25, useMemo as useMemo33, useRef as useRef43, useState as useState39 } from "react";
16414
16537
  import { useButton as useButton9, useFocusRing as useFocusRing11 } from "react-aria";
16415
16538
 
16416
16539
  // src/forms/BoundCheckboxField.tsx
@@ -18078,7 +18201,7 @@ function SectionNavLink(props) {
18078
18201
  });
18079
18202
  }, [sectionRef]);
18080
18203
  const tids = useTestIds(props);
18081
- const buttonRef = useRef42(null);
18204
+ const buttonRef = useRef43(null);
18082
18205
  const {
18083
18206
  buttonProps,
18084
18207
  isPressed
@@ -18228,7 +18351,7 @@ function invertSpacing(value) {
18228
18351
  import React17, { useEffect as useEffect27, useMemo as useMemo38, useState as useState42 } from "react";
18229
18352
 
18230
18353
  // src/components/ButtonMenu.tsx
18231
- import { useRef as useRef43 } from "react";
18354
+ import { useRef as useRef44 } from "react";
18232
18355
  import { useMenuTrigger as useMenuTrigger2 } from "react-aria";
18233
18356
  import { useMenuTriggerState as useMenuTriggerState2 } from "react-stately";
18234
18357
  import { jsx as jsx125 } from "react/jsx-runtime";
@@ -18240,7 +18363,7 @@ function ButtonMenu(props) {
18240
18363
  onChange = props.onChange;
18241
18364
  }
18242
18365
  const state = useMenuTriggerState2({ isOpen: defaultOpen });
18243
- const buttonRef = useRef43(null);
18366
+ const buttonRef = useRef44(null);
18244
18367
  const { menuTriggerProps, menuProps } = useMenuTrigger2({ isDisabled: !!disabled }, state, buttonRef);
18245
18368
  const tid = useTestIds(
18246
18369
  props,
@@ -18347,6 +18470,14 @@ function dateFilter(props) {
18347
18470
  }
18348
18471
  var anyOption = {};
18349
18472
  var DateFilter = class extends BaseFilter {
18473
+ hydrate(value) {
18474
+ if (!isDateFilterValue(value)) return void 0;
18475
+ const hydratedValue = parsePersistedPlainDate(value.value);
18476
+ return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
18477
+ }
18478
+ dehydrate(value) {
18479
+ return value ? { op: value.op, value: dehydratePlainDate(value.value) } : void 0;
18480
+ }
18350
18481
  render(value, setValue, tid, inModal, vertical) {
18351
18482
  const { label, operations, getOperationValue, getOperationLabel } = this.props;
18352
18483
  return /* @__PURE__ */ jsxs65(Fragment28, { children: [
@@ -18366,7 +18497,7 @@ var DateFilter = class extends BaseFilter {
18366
18497
  value: value?.op,
18367
18498
  onSelect: (op) => (
18368
18499
  // default the selected date to today if it doesn't exist in the filter's value
18369
- setValue(op ? { op, value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date() } : void 0)
18500
+ setValue(op ? { op, value: value?.value ?? todayPlainDate() } : void 0)
18370
18501
  ),
18371
18502
  label: inModal ? `${label} date filter operation` : label,
18372
18503
  labelStyle: !inModal && !vertical ? "inline" : inModal || vertical ? "hidden" : "above",
@@ -18378,9 +18509,13 @@ var DateFilter = class extends BaseFilter {
18378
18509
  DateField,
18379
18510
  {
18380
18511
  labelStyle: "inline",
18381
- value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date(),
18512
+ value: value?.value ?? todayPlainDate(),
18382
18513
  label: "Date",
18383
- onChange: (d) => setValue({ ...value, value: d }),
18514
+ onChange: (d) => {
18515
+ if (d && value) {
18516
+ setValue({ ...value, value: d });
18517
+ }
18518
+ },
18384
18519
  disabled: !value,
18385
18520
  ...tid[`${defaultTestId(this.label)}_dateField`]
18386
18521
  }
@@ -18389,6 +18524,9 @@ var DateFilter = class extends BaseFilter {
18389
18524
  ] });
18390
18525
  }
18391
18526
  };
18527
+ function isDateFilterValue(value) {
18528
+ return typeof value === "object" && value !== null && "op" in value && "value" in value;
18529
+ }
18392
18530
 
18393
18531
  // src/components/Filters/DateRangeFilter.tsx
18394
18532
  import { Fragment as Fragment29, jsx as jsx128, jsxs as jsxs66 } from "react/jsx-runtime";
@@ -18396,6 +18534,17 @@ function dateRangeFilter(props) {
18396
18534
  return (key) => new DateRangeFilter(key, props);
18397
18535
  }
18398
18536
  var DateRangeFilter = class extends BaseFilter {
18537
+ hydrate(value) {
18538
+ if (!isDateRangeFilterValue(value)) return void 0;
18539
+ const hydratedValue = hydrateDateRange(value.value);
18540
+ return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
18541
+ }
18542
+ dehydrate(value) {
18543
+ return value ? {
18544
+ op: value.op,
18545
+ value: value.value ? { from: dehydratePlainDate(value.value.from), to: dehydratePlainDate(value.value.to) } : void 0
18546
+ } : void 0;
18547
+ }
18399
18548
  render(value, setValue, tid, inModal, vertical) {
18400
18549
  const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
18401
18550
  return /* @__PURE__ */ jsxs66(Fragment29, { children: [
@@ -18407,8 +18556,17 @@ var DateRangeFilter = class extends BaseFilter {
18407
18556
  isRangeFilterField: true,
18408
18557
  placeholder: placeholderText,
18409
18558
  label: testFieldLabel ?? "Date",
18410
- value: value?.value ? { from: new Date(value.value.from), to: new Date(value.value.to) } : void 0,
18411
- onChange: (d) => d ? setValue({ op: defaultValue?.op, value: d }) : setValue(void 0),
18559
+ value: value?.value,
18560
+ onChange: (d) => {
18561
+ if (!d) {
18562
+ setValue(void 0);
18563
+ return;
18564
+ }
18565
+ const op = value?.op ?? defaultValue?.op;
18566
+ if (op !== void 0) {
18567
+ setValue({ op, value: d });
18568
+ }
18569
+ },
18412
18570
  disabledDays,
18413
18571
  ...tid[`${defaultTestId(this.label)}_dateField`]
18414
18572
  }
@@ -18416,6 +18574,17 @@ var DateRangeFilter = class extends BaseFilter {
18416
18574
  ] });
18417
18575
  }
18418
18576
  };
18577
+ function isDateRangeFilterValue(value) {
18578
+ return typeof value === "object" && value !== null && "op" in value && "value" in value;
18579
+ }
18580
+ function hydrateDateRange(value) {
18581
+ if (typeof value !== "object" || value === null) return void 0;
18582
+ const { from, to } = value;
18583
+ const hydratedFrom = parsePersistedPlainDate(from);
18584
+ const hydratedTo = parsePersistedPlainDate(to);
18585
+ if (hydratedFrom === void 0 && hydratedTo === void 0) return void 0;
18586
+ return { from: hydratedFrom, to: hydratedTo };
18587
+ }
18419
18588
 
18420
18589
  // src/components/Filters/MultiFilter.tsx
18421
18590
  import { jsx as jsx129 } from "react/jsx-runtime";
@@ -18977,7 +19146,7 @@ function toPageNumberSize(page) {
18977
19146
  }
18978
19147
 
18979
19148
  // src/components/Table/components/EditColumnsButton.tsx
18980
- import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as useRef44 } from "react";
19149
+ import { Fragment as Fragment33, useCallback as useCallback22, useMemo as useMemo36, useRef as useRef45 } from "react";
18981
19150
  import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
18982
19151
  import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
18983
19152
  import { jsx as jsx141, jsxs as jsxs72 } from "react/jsx-runtime";
@@ -18992,7 +19161,7 @@ function EditColumnsButton(props) {
18992
19161
  const state = useMenuTriggerState3({
18993
19162
  isOpen: defaultOpen
18994
19163
  });
18995
- const buttonRef = useRef44(null);
19164
+ const buttonRef = useRef45(null);
18996
19165
  const {
18997
19166
  menuTriggerProps
18998
19167
  } = useMenuTrigger3({
@@ -19221,10 +19390,10 @@ function useGridTableLayoutState({
19221
19390
  });
19222
19391
  useEffect27(() => {
19223
19392
  if (page.limit !== persistedPageSize) setPersistedPageSize(page.limit);
19224
- setPage((prev) => ({
19393
+ setPage((prev) => prev.offset === 0 ? prev : {
19225
19394
  ...prev,
19226
19395
  offset: 0
19227
- }));
19396
+ });
19228
19397
  }, [page.limit, persistedPageSize, setPersistedPageSize, filter, searchString]);
19229
19398
  return {
19230
19399
  filter,
@@ -19485,18 +19654,18 @@ var BeamContext = createContext7({
19485
19654
  });
19486
19655
  function BeamProvider({ children, ...presentationProps }) {
19487
19656
  const [, tick] = useReducer((prev) => prev + 1, 0);
19488
- const modalRef = useRef45();
19657
+ const modalRef = useRef46();
19489
19658
  const modalHeaderDiv = useMemo40(() => document.createElement("div"), []);
19490
19659
  const modalBodyDiv = useMemo40(() => {
19491
19660
  const el = document.createElement("div");
19492
19661
  el.style.height = "100%";
19493
19662
  return el;
19494
19663
  }, []);
19495
- const modalCanCloseChecksRef = useRef45([]);
19664
+ const modalCanCloseChecksRef = useRef46([]);
19496
19665
  const modalFooterDiv = useMemo40(() => document.createElement("div"), []);
19497
- const drawerContentStackRef = useRef45([]);
19498
- const drawerCanCloseChecks = useRef45([]);
19499
- const drawerCanCloseDetailsChecks = useRef45([]);
19666
+ const drawerContentStackRef = useRef46([]);
19667
+ const drawerCanCloseChecks = useRef46([]);
19668
+ const drawerCanCloseDetailsChecks = useRef46([]);
19500
19669
  const sdHeaderDiv = useMemo40(() => document.createElement("div"), []);
19501
19670
  const context = useMemo40(() => {
19502
19671
  return {
@@ -19539,14 +19708,14 @@ function useBeamContext() {
19539
19708
  }
19540
19709
 
19541
19710
  // src/components/ButtonDatePicker.tsx
19542
- import { useRef as useRef46 } from "react";
19711
+ import { useRef as useRef47 } from "react";
19543
19712
  import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
19544
19713
  import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
19545
19714
  import { jsx as jsx150 } from "react/jsx-runtime";
19546
19715
  function ButtonDatePicker(props) {
19547
19716
  const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
19548
19717
  const state = useMenuTriggerState4({ isOpen: defaultOpen });
19549
- const buttonRef = useRef46(null);
19718
+ const buttonRef = useRef47(null);
19550
19719
  const {
19551
19720
  menuTriggerProps,
19552
19721
  menuProps: { autoFocus: _af, ...menuProps }
@@ -19569,7 +19738,7 @@ function ButtonDatePicker(props) {
19569
19738
  }
19570
19739
 
19571
19740
  // src/components/ButtonGroup.tsx
19572
- import { useRef as useRef47 } from "react";
19741
+ import { useRef as useRef48 } from "react";
19573
19742
  import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
19574
19743
  import { trussProps as trussProps73 } from "@homebound/truss/runtime";
19575
19744
  import { jsx as jsx151, jsxs as jsxs78 } from "react/jsx-runtime";
@@ -19617,7 +19786,7 @@ function GroupButton(props) {
19617
19786
  isDisabled: !!disabled,
19618
19787
  ...otherProps
19619
19788
  };
19620
- const ref = useRef47(null);
19789
+ const ref = useRef48(null);
19621
19790
  const {
19622
19791
  buttonProps,
19623
19792
  isPressed
@@ -19740,7 +19909,7 @@ import { useHover as useHover16 } from "react-aria";
19740
19909
 
19741
19910
  // src/components/Tag.tsx
19742
19911
  import { useResizeObserver as useResizeObserver4 } from "@react-aria/utils";
19743
- import { useRef as useRef48, useState as useState44 } from "react";
19912
+ import { useRef as useRef49, useState as useState44 } from "react";
19744
19913
  import { trussProps as trussProps74 } from "@homebound/truss/runtime";
19745
19914
  import { jsx as jsx152, jsxs as jsxs79 } from "react/jsx-runtime";
19746
19915
  function Tag(props) {
@@ -19754,7 +19923,7 @@ function Tag(props) {
19754
19923
  const typeStyles2 = getStyles(type);
19755
19924
  const tid = useTestIds(otherProps);
19756
19925
  const [showTooltip, setShowTooltip] = useState44(false);
19757
- const ref = useRef48(null);
19926
+ const ref = useRef49(null);
19758
19927
  useResizeObserver4({
19759
19928
  ref,
19760
19929
  onResize: () => {
@@ -19963,7 +20132,7 @@ function Copy(props) {
19963
20132
 
19964
20133
  // src/components/DnDGrid/DnDGrid.tsx
19965
20134
  import equal2 from "fast-deep-equal";
19966
- import { useCallback as useCallback24, useRef as useRef49 } from "react";
20135
+ import { useCallback as useCallback24, useRef as useRef50 } from "react";
19967
20136
 
19968
20137
  // src/components/DnDGrid/DnDGridContext.tsx
19969
20138
  import { createContext as createContext8, useContext as useContext18 } from "react";
@@ -19986,12 +20155,12 @@ function DnDGrid(props) {
19986
20155
  onReorder,
19987
20156
  activeItemStyles
19988
20157
  } = props;
19989
- const gridEl = useRef49(null);
19990
- const dragEl = useRef49();
19991
- const cloneEl = useRef49();
19992
- const initialOrder = useRef49();
19993
- const reorderViaKeyboard = useRef49(false);
19994
- const transformFrom = useRef49({
20158
+ const gridEl = useRef50(null);
20159
+ const dragEl = useRef50();
20160
+ const cloneEl = useRef50();
20161
+ const initialOrder = useRef50();
20162
+ const reorderViaKeyboard = useRef50(false);
20163
+ const transformFrom = useRef50({
19995
20164
  x: 0,
19996
20165
  y: 0
19997
20166
  });
@@ -20453,14 +20622,14 @@ function HbSpinnerProvider({
20453
20622
 
20454
20623
  // src/components/MaxLines.tsx
20455
20624
  import { useLayoutEffect as useLayoutEffect2, useResizeObserver as useResizeObserver5 } from "@react-aria/utils";
20456
- import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef50, useState as useState45 } from "react";
20625
+ import { useCallback as useCallback25, useEffect as useEffect30, useRef as useRef51, useState as useState45 } from "react";
20457
20626
  import { trussProps as trussProps80 } from "@homebound/truss/runtime";
20458
20627
  import { jsx as jsx160, jsxs as jsxs82 } from "react/jsx-runtime";
20459
20628
  function MaxLines({
20460
20629
  maxLines,
20461
20630
  children
20462
20631
  }) {
20463
- const elRef = useRef50(null);
20632
+ const elRef = useRef51(null);
20464
20633
  const [hasMore, setHasMore] = useState45(false);
20465
20634
  const [expanded, setExpanded] = useState45(false);
20466
20635
  useLayoutEffect2(() => {
@@ -20496,7 +20665,7 @@ function MaxLines({
20496
20665
 
20497
20666
  // src/components/ScrollShadows.tsx
20498
20667
  import { useResizeObserver as useResizeObserver6 } from "@react-aria/utils";
20499
- import { useCallback as useCallback26, useMemo as useMemo47, useRef as useRef51, useState as useState46 } from "react";
20668
+ import { useCallback as useCallback26, useMemo as useMemo47, useRef as useRef52, useState as useState46 } from "react";
20500
20669
  import { trussProps as trussProps81 } from "@homebound/truss/runtime";
20501
20670
  import { jsx as jsx161, jsxs as jsxs83 } from "react/jsx-runtime";
20502
20671
  function ScrollShadows(props) {
@@ -20516,7 +20685,7 @@ function ScrollShadows(props) {
20516
20685
  }
20517
20686
  const [showStartShadow, setShowStartShadow] = useState46(false);
20518
20687
  const [showEndShadow, setShowEndShadow] = useState46(false);
20519
- const scrollRef = useRef51(null);
20688
+ const scrollRef = useRef52(null);
20520
20689
  const [startShadowStyles, endShadowStyles] = useMemo47(() => {
20521
20690
  const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
20522
20691
  const commonStyles = {
@@ -20689,7 +20858,7 @@ function useSnackbar() {
20689
20858
  var snackbarId = 1;
20690
20859
 
20691
20860
  // src/components/Stepper.tsx
20692
- import { useRef as useRef52 } from "react";
20861
+ import { useRef as useRef53 } from "react";
20693
20862
  import { useButton as useButton11, useFocusRing as useFocusRing14, useHover as useHover18 } from "react-aria";
20694
20863
  import { trussProps as trussProps82 } from "@homebound/truss/runtime";
20695
20864
  import { jsx as jsx162, jsxs as jsxs84 } from "react/jsx-runtime";
@@ -20767,7 +20936,7 @@ function StepButton(props) {
20767
20936
  onPress: onClick,
20768
20937
  isDisabled: disabled
20769
20938
  };
20770
- const ref = useRef52(null);
20939
+ const ref = useRef53(null);
20771
20940
  const {
20772
20941
  buttonProps,
20773
20942
  isPressed
@@ -21161,7 +21330,7 @@ function visit(rows, fn) {
21161
21330
 
21162
21331
  // src/components/Tabs.tsx
21163
21332
  import { camelCase as camelCase5 } from "change-case";
21164
- import { useEffect as useEffect32, useMemo as useMemo49, useRef as useRef53, useState as useState47 } from "react";
21333
+ import { useEffect as useEffect32, useMemo as useMemo49, useRef as useRef54, useState as useState47 } from "react";
21165
21334
  import { mergeProps as mergeProps26, useFocusRing as useFocusRing15, useHover as useHover19 } from "react-aria";
21166
21335
  import { matchPath, Route } from "react-router";
21167
21336
  import { Link as Link5, useLocation } from "react-router-dom";
@@ -21220,7 +21389,7 @@ function Tabs(props) {
21220
21389
  } = useFocusRing15();
21221
21390
  const tid = useTestIds(others, "tabs");
21222
21391
  const [active, setActive] = useState47(selected);
21223
- const ref = useRef53(null);
21392
+ const ref = useRef54(null);
21224
21393
  useEffect32(() => setActive(selected), [selected]);
21225
21394
  function onKeyUp(e) {
21226
21395
  if (e.key === "ArrowLeft" || e.key === "ArrowRight") {