@homebound/beam 3.2.0 → 3.3.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.cjs CHANGED
@@ -219,6 +219,7 @@ __export(index_exports, {
219
219
  filterTestIdPrefix: () => filterTestIdPrefix,
220
220
  formatDate: () => formatDate,
221
221
  formatDateRange: () => formatDateRange,
222
+ formatPlainDate: () => formatPlainDate,
222
223
  formatValue: () => formatValue,
223
224
  generateColumnId: () => generateColumnId,
224
225
  getAlignment: () => getAlignment,
@@ -5890,24 +5891,47 @@ function useHover2(props) {
5890
5891
  var import_react16 = require("react");
5891
5892
  var import_use_query_params2 = require("use-query-params");
5892
5893
  function usePersistedFilter({ storageKey, filterDefs }) {
5893
- const filterKeys = Object.keys(filterDefs);
5894
+ const filterImpls = (0, import_react16.useMemo)(
5895
+ () => Object.fromEntries(safeEntries(filterDefs).map(([key, def]) => [key, def(key)])),
5896
+ [filterDefs]
5897
+ );
5898
+ const filterKeys = (0, import_react16.useMemo)(() => Object.keys(filterImpls), [filterImpls]);
5894
5899
  const defaultFilter = (0, import_react16.useMemo)(
5895
5900
  () => Object.fromEntries(
5896
- safeEntries(filterDefs).filter(([key, def]) => def(key).defaultValue !== void 0).map(([key, def]) => [key, def(key).defaultValue])
5901
+ safeEntries(filterImpls).filter(([, def]) => def.defaultValue !== void 0).map(([key, def]) => [key, def.defaultValue])
5897
5902
  ),
5898
- [filterDefs]
5903
+ [filterImpls]
5899
5904
  );
5900
5905
  const [{ filter: queryParamsFilter }, setQueryParams] = (0, import_use_query_params2.useQueryParams)({ filter: import_use_query_params2.JsonParam });
5901
- const [storedFilter, setStoredFilter] = useSessionStorage(storageKey, queryParamsFilter ?? defaultFilter);
5906
+ const [storedFilter, setStoredFilter] = useSessionStorage(
5907
+ storageKey,
5908
+ dehydrateFilter(filterImpls, defaultFilter) ?? defaultFilter
5909
+ );
5902
5910
  const isQueryParamFilterValid = hasValidFilterKeys(queryParamsFilter, filterKeys);
5903
- const filter = isQueryParamFilterValid ? queryParamsFilter : storedFilter ?? defaultFilter;
5904
- const setFilter = (filter2) => setQueryParams({ filter: filter2 });
5911
+ const serializedQueryParamsFilter = (0, import_react16.useMemo)(() => JSON.stringify(queryParamsFilter), [queryParamsFilter]);
5912
+ const serializedStoredFilter = (0, import_react16.useMemo)(() => JSON.stringify(storedFilter), [storedFilter]);
5913
+ const queryParamsFilterSnapshot = (0, import_react16.useMemo)(
5914
+ () => parseSerializedValue(serializedQueryParamsFilter),
5915
+ [serializedQueryParamsFilter]
5916
+ );
5917
+ const storedFilterSnapshot = (0, import_react16.useMemo)(() => parseSerializedValue(serializedStoredFilter), [serializedStoredFilter]);
5918
+ const hydratedQueryParamsFilter = (0, import_react16.useMemo)(
5919
+ () => isQueryParamFilterValid ? hydrateFilter(filterImpls, queryParamsFilterSnapshot) : void 0,
5920
+ [filterImpls, isQueryParamFilterValid, queryParamsFilterSnapshot]
5921
+ );
5922
+ const hydratedStoredFilter = (0, import_react16.useMemo)(
5923
+ () => hasValidFilterKeys(storedFilterSnapshot, filterKeys) ? hydrateFilter(filterImpls, storedFilterSnapshot) : void 0,
5924
+ [filterImpls, filterKeys, storedFilterSnapshot]
5925
+ );
5926
+ const rawFilter = hydratedQueryParamsFilter ?? hydratedStoredFilter ?? defaultFilter;
5927
+ const filter = useStableValue(rawFilter);
5928
+ const setFilter = (filter2) => setQueryParams({ filter: dehydrateFilter(filterImpls, filter2) });
5905
5929
  (0, import_react16.useEffect)(
5906
5930
  () => {
5907
5931
  if (queryParamsFilter === void 0) {
5908
5932
  setQueryParams({ filter: storedFilter }, "replaceIn");
5909
5933
  } else if (!isQueryParamFilterValid) {
5910
- setQueryParams({ filter: defaultFilter }, "replaceIn");
5934
+ setQueryParams({ filter: dehydrateFilter(filterImpls, defaultFilter) }, "replaceIn");
5911
5935
  } else if (JSON.stringify(queryParamsFilter) !== JSON.stringify(storedFilter)) {
5912
5936
  setStoredFilter(queryParamsFilter);
5913
5937
  }
@@ -5919,7 +5943,46 @@ function usePersistedFilter({ storageKey, filterDefs }) {
5919
5943
  return { setFilter, filter };
5920
5944
  }
5921
5945
  function hasValidFilterKeys(queryParamsFilter, definedKeys) {
5922
- return queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
5946
+ return !!queryParamsFilter && safeKeys(queryParamsFilter).every((key) => definedKeys.includes(key));
5947
+ }
5948
+ function hydrateFilter(filterImpls, value) {
5949
+ if (typeof value !== "object" || value === null) return void 0;
5950
+ const hydratedEntries = [];
5951
+ safeEntries(value).forEach(([key, rawValue]) => {
5952
+ const filter = filterImpls[key];
5953
+ if (!filter) return;
5954
+ const hydratedValue = filter.hydrate ? filter.hydrate(rawValue) : rawValue;
5955
+ if (hydratedValue !== void 0) {
5956
+ hydratedEntries.push([key, hydratedValue]);
5957
+ }
5958
+ });
5959
+ return Object.fromEntries(hydratedEntries);
5960
+ }
5961
+ function dehydrateFilter(filterImpls, value) {
5962
+ if (!value) return value;
5963
+ return Object.fromEntries(
5964
+ safeEntries(value).map(([key, rawValue]) => {
5965
+ const filter = filterImpls[key];
5966
+ return [
5967
+ key,
5968
+ // Let each filter own serialization so persisted state stays stable for non-plain JSON values like PlainDate.
5969
+ filter?.dehydrate ? filter.dehydrate(rawValue) : rawValue
5970
+ ];
5971
+ })
5972
+ );
5973
+ }
5974
+ function parseSerializedValue(value) {
5975
+ return value === void 0 ? void 0 : JSON.parse(value);
5976
+ }
5977
+ function useStableValue(value) {
5978
+ const stableValue = (0, import_react16.useRef)(value);
5979
+ const stableKey = (0, import_react16.useRef)(JSON.stringify(value));
5980
+ const nextKey = JSON.stringify(value);
5981
+ if (stableKey.current !== nextKey) {
5982
+ stableValue.current = value;
5983
+ stableKey.current = nextKey;
5984
+ }
5985
+ return stableValue.current;
5923
5986
  }
5924
5987
 
5925
5988
  // src/hooks/useSessionStorage.ts
@@ -6349,6 +6412,107 @@ var import_react_stately7 = require("react-stately");
6349
6412
  // src/components/internal/DatePicker/DatePicker.tsx
6350
6413
  var import_react_day_picker3 = require("react-day-picker");
6351
6414
 
6415
+ // src/utils/plainDate.ts
6416
+ var import_temporal_polyfill = require("temporal-polyfill");
6417
+ function jsDateToPlainDate(date) {
6418
+ return new import_temporal_polyfill.Temporal.PlainDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
6419
+ }
6420
+ function formatPlainDate(date, format) {
6421
+ switch (format) {
6422
+ case "shortDate":
6423
+ return date.toLocaleString("en-US", { month: "2-digit", day: "2-digit", year: "2-digit" });
6424
+ case "date":
6425
+ return date.toLocaleString("en-US", { month: "2-digit", day: "2-digit", year: "numeric" });
6426
+ case "shortWeekdayMonthDay":
6427
+ return date.toLocaleString("en-US", { weekday: "short", month: "short", day: "numeric" });
6428
+ case "longWeekdayMonthDayYear":
6429
+ return `${date.toLocaleString("en-US", { weekday: "long" })} ${date.toLocaleString("en-US", { month: "long" })} ${date.day}, ${formatYear(date.year)}`;
6430
+ case "monthYear":
6431
+ return date.toLocaleString("en-US", { month: "long", year: "numeric" });
6432
+ case "shortMonth":
6433
+ return date.toLocaleString("en-US", { month: "short" });
6434
+ case "year":
6435
+ return formatYear(date.year);
6436
+ case "weekdayInitial":
6437
+ return date.toLocaleString("en-US", { weekday: "narrow" });
6438
+ case "weekday":
6439
+ return date.toLocaleString("en-US", { weekday: "long" });
6440
+ default:
6441
+ throw new Error(`Unsupported date format: ${format}`);
6442
+ }
6443
+ }
6444
+ function todayPlainDate() {
6445
+ return import_temporal_polyfill.Temporal.Now.plainDateISO();
6446
+ }
6447
+ function isPlainDate(value) {
6448
+ return value instanceof import_temporal_polyfill.Temporal.PlainDate;
6449
+ }
6450
+ function parsePersistedPlainDate(value) {
6451
+ if (isPlainDate(value)) return value;
6452
+ if (value instanceof Date && !Number.isNaN(value.getTime())) {
6453
+ return jsDateToPlainDate(value);
6454
+ }
6455
+ if (typeof value !== "string") return void 0;
6456
+ try {
6457
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
6458
+ return import_temporal_polyfill.Temporal.PlainDate.from(value);
6459
+ }
6460
+ } catch {
6461
+ return void 0;
6462
+ }
6463
+ const date = new Date(value);
6464
+ return Number.isNaN(date.getTime()) ? void 0 : jsDateToPlainDate(date);
6465
+ }
6466
+ function dehydratePlainDate(value) {
6467
+ return value?.toString();
6468
+ }
6469
+ function padNumber(value, length) {
6470
+ return Math.abs(value).toString().padStart(length, "0");
6471
+ }
6472
+ function formatYear(year) {
6473
+ return `${year < 0 ? "-" : ""}${padNumber(year, 4)}`;
6474
+ }
6475
+
6476
+ // src/components/internal/DatePicker/dates.ts
6477
+ function plainDateToJsDate(date) {
6478
+ return new Date(date.year, date.month - 1, date.day, 12);
6479
+ }
6480
+ function dateRangeToJsDateRange(range) {
6481
+ if (!range) return void 0;
6482
+ return {
6483
+ from: range.from ? plainDateToJsDate(range.from) : void 0,
6484
+ to: range.to ? plainDateToJsDate(range.to) : void 0
6485
+ };
6486
+ }
6487
+ function jsDateRangeToDateRange(range) {
6488
+ if (!range) return void 0;
6489
+ return {
6490
+ from: range.from ? jsDateToPlainDate(range.from) : void 0,
6491
+ to: range.to ? jsDateToPlainDate(range.to) : void 0
6492
+ };
6493
+ }
6494
+ function dateMatcherToDayPickerMatcher(matcher) {
6495
+ if (typeof matcher === "function") {
6496
+ return function dayPickerMatcher(date) {
6497
+ return matcher(jsDateToPlainDate(date));
6498
+ };
6499
+ }
6500
+ if (Array.isArray(matcher)) {
6501
+ return matcher.map(plainDateToJsDate);
6502
+ }
6503
+ if (isPlainDate(matcher)) {
6504
+ return plainDateToJsDate(matcher);
6505
+ }
6506
+ return {
6507
+ from: matcher.from ? plainDateToJsDate(matcher.from) : void 0,
6508
+ to: matcher.to ? plainDateToJsDate(matcher.to) : void 0
6509
+ };
6510
+ }
6511
+ function dateMatchersToDayPickerMatchers(matchers) {
6512
+ if (matchers === void 0) return void 0;
6513
+ return Array.isArray(matchers) ? matchers.map(dateMatcherToDayPickerMatcher) : dateMatcherToDayPickerMatcher(matchers);
6514
+ }
6515
+
6352
6516
  // src/components/internal/DatePicker/Day.tsx
6353
6517
  var import_react21 = require("react");
6354
6518
  var import_react_day_picker = require("react-day-picker");
@@ -6490,11 +6654,12 @@ function Header(props) {
6490
6654
  const {
6491
6655
  displayMonth
6492
6656
  } = props;
6657
+ const displayMonthDate = jsDateToPlainDate(displayMonth);
6493
6658
  const {
6494
6659
  goToMonth
6495
6660
  } = (0, import_react_day_picker2.useNavigation)();
6496
6661
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "df jcsb aic ml_12px mr_2px h_32px", children: [
6497
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: (0, import_date_fns.format)(displayMonth, "MMMM yyyy") }),
6662
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "monthYear") }),
6498
6663
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6499
6664
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth((0, import_date_fns.addMonths)(displayMonth, -1)) }),
6500
6665
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth((0, import_date_fns.addMonths)(displayMonth, 1)) })
@@ -6505,36 +6670,41 @@ function YearSkipHeader(props) {
6505
6670
  const {
6506
6671
  displayMonth
6507
6672
  } = props;
6673
+ const displayMonthDate = jsDateToPlainDate(displayMonth);
6508
6674
  const {
6509
6675
  goToMonth
6510
6676
  } = (0, import_react_day_picker2.useNavigation)();
6511
6677
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "df jcsb aic ml_12px mr_12px h_32px", children: [
6512
6678
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "df fdr jcsb", children: [
6513
6679
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth((0, import_date_fns.addMonths)(displayMonth, -1)) }),
6514
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: (0, import_date_fns.format)(displayMonth, "MMM") }),
6680
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "shortMonth") }),
6515
6681
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth((0, import_date_fns.addMonths)(displayMonth, 1)) })
6516
6682
  ] }),
6517
6683
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "df fdr jcsb", children: [
6518
6684
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronLeft", onClick: () => goToMonth((0, import_date_fns.addYears)(displayMonth, -1)) }),
6519
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: (0, import_date_fns.format)(displayMonth, "yyyy") }),
6685
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { className: "fw4 fz_16px lh_24px", children: formatPlainDate(displayMonthDate, "year") }),
6520
6686
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconButton, { color: "rgba(100, 100, 100, 1)" /* Gray700 */, icon: "chevronRight", onClick: () => goToMonth((0, import_date_fns.addYears)(displayMonth, 1)) })
6521
6687
  ] })
6522
6688
  ] });
6523
6689
  }
6524
6690
 
6525
6691
  // src/components/internal/DatePicker/WeekHeader.tsx
6526
- var import_date_fns2 = require("date-fns");
6527
6692
  var import_jsx_runtime18 = require("react/jsx-runtime");
6528
6693
  function WeekHeader() {
6529
- const start = (0, import_date_fns2.startOfWeek)(/* @__PURE__ */ new Date());
6694
+ const today = todayPlainDate();
6695
+ const start = today.subtract({
6696
+ days: today.dayOfWeek % 7
6697
+ });
6530
6698
  const days = [];
6531
6699
  for (let i = 0; i < 7; i++) {
6532
- days.push((0, import_date_fns2.addDays)(start, i));
6700
+ days.push(start.add({
6701
+ days: i
6702
+ }));
6533
6703
  }
6534
6704
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("thead", { className: "rdp-head", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("tr", { className: "rdp-head_row", children: days.map((day) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("th", { scope: "col", className: "pt1 pb_12px pr1 pl1 fw4 fz_12px lh_16px gray400", children: [
6535
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", children: (0, import_date_fns2.format)(day, "EEEEE") }),
6536
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rdp-vhidden", children: (0, import_date_fns2.format)(day, "EEEE") })
6537
- ] }, (0, import_date_fns2.format)(day, "EEEE"))) }) });
6705
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", children: formatPlainDate(day, "weekdayInitial") }),
6706
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rdp-vhidden", children: formatPlainDate(day, "weekday") })
6707
+ ] }, formatPlainDate(day, "weekday"))) }) });
6538
6708
  }
6539
6709
 
6540
6710
  // src/components/internal/DatePicker/DatePicker.tsx
@@ -6556,15 +6726,15 @@ function DatePicker(props) {
6556
6726
  Head: WeekHeader,
6557
6727
  Day
6558
6728
  },
6559
- selected: value ? [value] : [],
6560
- defaultMonth: value ?? /* @__PURE__ */ new Date(),
6729
+ selected: value ? [plainDateToJsDate(value)] : [],
6730
+ defaultMonth: plainDateToJsDate(value ?? todayPlainDate()),
6561
6731
  onDayClick: (day, modifiers) => {
6562
6732
  if (modifiers.disabled) return;
6563
- onSelect(day);
6733
+ onSelect(jsDateToPlainDate(day));
6564
6734
  },
6565
- disabled: disabledDays,
6735
+ disabled: dateMatchersToDayPickerMatchers(disabledDays),
6566
6736
  modifiers: {
6567
- indicatorDot: dottedDays ?? []
6737
+ indicatorDot: dateMatchersToDayPickerMatchers(dottedDays) ?? []
6568
6738
  }
6569
6739
  }
6570
6740
  ) });
@@ -6591,15 +6761,15 @@ function DateRangePicker(props) {
6591
6761
  useYearPicker
6592
6762
  } = props;
6593
6763
  const tid = useTestIds(props, "datePicker");
6594
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_day_picker4.DayPicker, { mode: "range", selected: range, components: {
6764
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "dib bgWhite fw4 fz_12px lh_16px", ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_day_picker4.DayPicker, { mode: "range", selected: dateRangeToJsDateRange(range), components: {
6595
6765
  Caption: useYearPicker ? YearSkipHeader : Header,
6596
6766
  Head: WeekHeader,
6597
6767
  Day
6598
- }, defaultMonth: range?.to ?? /* @__PURE__ */ new Date(), onSelect: (selection, day, activeModifiers) => {
6768
+ }, defaultMonth: plainDateToJsDate(range?.to ?? range?.from ?? todayPlainDate()), onSelect: (selection, day, activeModifiers) => {
6599
6769
  if (activeModifiers.disabled) return;
6600
- onSelect(selection);
6601
- }, disabled: disabledDays, modifiers: {
6602
- indicatorDot: dottedDays ?? []
6770
+ onSelect(jsDateRangeToDateRange(selection));
6771
+ }, disabled: dateMatchersToDayPickerMatchers(disabledDays), modifiers: {
6772
+ indicatorDot: dateMatchersToDayPickerMatchers(dottedDays) ?? []
6603
6773
  } }) });
6604
6774
  }
6605
6775
 
@@ -7752,6 +7922,7 @@ var RowState = class {
7752
7922
  };
7753
7923
 
7754
7924
  // src/components/Table/utils/sortRows.ts
7925
+ var import_temporal_polyfill2 = require("temporal-polyfill");
7755
7926
  function sortRows(columns, rows, sortState, caseSensitive) {
7756
7927
  const fn = sortFn(columns, sortState, caseSensitive);
7757
7928
  const sorted = [...rows].sort(fn);
@@ -7816,7 +7987,7 @@ function sortValue(value, caseSensitive) {
7816
7987
  if (maybeFn instanceof Function) {
7817
7988
  maybeFn = maybeFn();
7818
7989
  }
7819
- return typeof maybeFn === "string" && !caseSensitive ? maybeFn.toLowerCase() : maybeFn;
7990
+ return normalizeSortValue(maybeFn, caseSensitive);
7820
7991
  }
7821
7992
  function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, maybeContent) {
7822
7993
  if (process.env.NODE_ENV !== "production" && !isHeader && sortOn === "client" && column2.clientSideSort !== false) {
@@ -7831,7 +8002,24 @@ function ensureClientSideSortValueIsSortable(sortOn, isHeader, column2, idx, may
7831
8002
  }
7832
8003
  function canClientSideSort(value) {
7833
8004
  const t = typeof value;
7834
- return value === null || t === "undefined" || t === "number" || t === "string" || t === "boolean" || value instanceof Date;
8005
+ return value === null || t === "undefined" || t === "number" || t === "string" || t === "bigint" || t === "boolean" || value instanceof Date || isPlainDate2(value) || isZonedDateTime(value);
8006
+ }
8007
+ function normalizeSortValue(value, caseSensitive) {
8008
+ if (isPlainDate2(value)) {
8009
+ return value.toString();
8010
+ } else if (isZonedDateTime(value)) {
8011
+ return value.epochNanoseconds;
8012
+ } else if (typeof value === "string" && !caseSensitive) {
8013
+ return value.toLowerCase();
8014
+ } else {
8015
+ return value;
8016
+ }
8017
+ }
8018
+ function isPlainDate2(value) {
8019
+ return value instanceof import_temporal_polyfill2.Temporal.PlainDate;
8020
+ }
8021
+ function isZonedDateTime(value) {
8022
+ return value instanceof import_temporal_polyfill2.Temporal.ZonedDateTime;
7835
8023
  }
7836
8024
 
7837
8025
  // src/components/Table/components/Row.tsx
@@ -12464,69 +12652,37 @@ function CheckboxGroupItem(props) {
12464
12652
  }
12465
12653
 
12466
12654
  // src/inputs/DateFields/DateField.mock.tsx
12467
- var import_date_fns3 = require("date-fns");
12468
12655
  var import_react50 = require("react");
12469
- var import_jsx_runtime60 = require("react/jsx-runtime");
12470
- function DateFieldMock(props) {
12471
- const { onChange = () => {
12472
- }, errorMsg, onBlur, onFocus } = props;
12473
- const [value, setValue] = (0, import_react50.useState)(props.value ? (0, import_date_fns3.format)(props.value, "MM/dd/yy") : "");
12474
- const tid = useTestIds(props, "date");
12475
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12476
- "input",
12477
- {
12478
- ...tid,
12479
- "data-error": !!errorMsg,
12480
- value,
12481
- onChange: (e) => {
12482
- const { value: value2 } = e.target;
12483
- setValue(value2);
12484
- onChange((0, import_date_fns3.parse)(value2, "MM/dd/yy", /* @__PURE__ */ new Date()));
12485
- },
12486
- onBlur: () => maybeCall(onBlur),
12487
- onFocus: () => maybeCall(onFocus),
12488
- disabled: !!props.disabled,
12489
- readOnly: !!props.readOnly,
12490
- "data-disabled-days": JSON.stringify(props.disabledDays)
12491
- }
12492
- );
12493
- }
12494
-
12495
- // src/inputs/DateFields/DateFieldBase.tsx
12496
- var import_react51 = require("react");
12497
- var import_react_aria31 = require("react-aria");
12498
- var import_react_day_picker5 = require("react-day-picker");
12499
- var import_react_stately10 = require("react-stately");
12500
12656
 
12501
12657
  // src/inputs/DateFields/utils.ts
12502
- var import_date_fns4 = require("date-fns");
12658
+ var import_temporal_polyfill3 = require("temporal-polyfill");
12503
12659
  var dateFormats = {
12504
- short: "MM/dd/yy",
12505
- medium: "EEE, MMM d",
12506
- long: "EEEE LLLL d, uuuu"
12660
+ short: "shortDate",
12661
+ medium: "shortWeekdayMonthDay",
12662
+ long: "longWeekdayMonthDayYear"
12507
12663
  };
12508
- function getDateFormat(format4) {
12509
- return format4 ? dateFormats[format4] : dateFormats.short;
12664
+ function getDateFormat(format) {
12665
+ return format ? dateFormats[format] : dateFormats.short;
12510
12666
  }
12511
- function formatDate(date, format4) {
12667
+ function formatDate(date, format) {
12512
12668
  if (!date) return "";
12513
- return (0, import_date_fns4.format)(date, format4);
12669
+ return formatPlainDate(date, format);
12514
12670
  }
12515
- function formatDateRange(date, format4) {
12671
+ function formatDateRange(date, format) {
12516
12672
  if (!date) return "";
12517
12673
  const { from, to } = date;
12518
- const fromFormatted = from ? (0, import_date_fns4.format)(from, format4) : "";
12519
- const toFormatted = to ? (0, import_date_fns4.format)(to, format4) : "";
12674
+ const fromFormatted = from ? formatPlainDate(from, format) : "";
12675
+ const toFormatted = to ? formatPlainDate(to, format) : "";
12520
12676
  return !fromFormatted && !toFormatted ? void 0 : `${fromFormatted} - ${toFormatted}`;
12521
12677
  }
12522
- function parseDate(str, format4) {
12523
- return parseDateString(str, format4);
12678
+ function parseDate(str, format) {
12679
+ return parseDateString(str, format);
12524
12680
  }
12525
- function parseDateRange(str, format4) {
12681
+ function parseDateRange(str, format) {
12526
12682
  const [from = "", to = ""] = str.split("-");
12527
- const fromDate = parseDateString(from.trim(), format4);
12528
- const toDate = parseDateString(to.trim(), format4);
12529
- if (toDate && fromDate && toDate < fromDate) {
12683
+ const fromDate = parseDateString(from.trim(), format);
12684
+ const toDate = parseDateString(to.trim(), format);
12685
+ if (toDate && fromDate && import_temporal_polyfill3.Temporal.PlainDate.compare(toDate, fromDate) < 0) {
12530
12686
  return { from: toDate, to: fromDate };
12531
12687
  }
12532
12688
  if (toDate === void 0 && fromDate === void 0) {
@@ -12534,31 +12690,81 @@ function parseDateRange(str, format4) {
12534
12690
  }
12535
12691
  return { from: fromDate, to: toDate };
12536
12692
  }
12537
- function parseDateString(str, format4) {
12693
+ function parseDateString(str, format) {
12694
+ if (format !== dateFormats.short && format !== "date") {
12695
+ return void 0;
12696
+ }
12538
12697
  const split = str.split("/");
12539
12698
  if (split.length !== 3) {
12540
12699
  return void 0;
12541
12700
  }
12542
- if (split[2].length !== 2) {
12701
+ const yearLength = format === dateFormats.short ? 2 : 4;
12702
+ if (split[2].length !== yearLength) {
12543
12703
  return void 0;
12544
12704
  }
12545
- const month = parseInt(split[0], 10) - 1;
12705
+ const month = parseInt(split[0], 10);
12546
12706
  const day = parseInt(split[1], 10);
12547
12707
  const year = parseInt(split[2], 10);
12548
- if (isNaN(year) || String(year).length > 4 || isNaN(month) || isNaN(day) || day <= 0 || day > 31 || month < 0 || month >= 12) {
12708
+ if (Number.isNaN(year) || Number.isNaN(month) || Number.isNaN(day) || day <= 0 || day > 31 || month <= 0 || month > 12) {
12549
12709
  return void 0;
12550
12710
  }
12551
- const parsed = (0, import_date_fns4.parse)(str, format4, /* @__PURE__ */ new Date());
12552
- if (!isValidDate(parsed)) {
12711
+ try {
12712
+ return import_temporal_polyfill3.Temporal.PlainDate.from({
12713
+ year: yearLength === 2 ? normalizeTwoDigitYear(year, todayPlainDate().year) : year,
12714
+ month,
12715
+ day
12716
+ });
12717
+ } catch {
12553
12718
  return void 0;
12554
12719
  }
12555
- return parsed;
12556
12720
  }
12557
12721
  function isValidDate(d) {
12558
- return d !== void 0 && (0, import_date_fns4.isDate)(d) && d.toString() !== "Invalid Date";
12722
+ return d !== void 0 && isPlainDate(d);
12723
+ }
12724
+ function normalizeTwoDigitYear(twoDigitYear, currentYear) {
12725
+ const isCommonEra = currentYear > 0;
12726
+ const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
12727
+ if (absCurrentYear <= 50) {
12728
+ return isCommonEra ? twoDigitYear || 100 : 1 - (twoDigitYear || 100);
12729
+ }
12730
+ const rangeEnd = absCurrentYear + 50;
12731
+ const rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
12732
+ const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
12733
+ const normalizedYear = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
12734
+ return isCommonEra ? normalizedYear : 1 - normalizedYear;
12735
+ }
12736
+
12737
+ // src/inputs/DateFields/DateField.mock.tsx
12738
+ var import_jsx_runtime60 = require("react/jsx-runtime");
12739
+ function DateFieldMock(props) {
12740
+ const { onChange = () => {
12741
+ }, errorMsg, onBlur, onFocus } = props;
12742
+ const [value, setValue] = (0, import_react50.useState)(formatDate(props.value, dateFormats.short));
12743
+ const tid = useTestIds(props, "date");
12744
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
12745
+ "input",
12746
+ {
12747
+ ...tid,
12748
+ "data-error": !!errorMsg,
12749
+ value,
12750
+ onChange: (e) => {
12751
+ const { value: value2 } = e.target;
12752
+ setValue(value2);
12753
+ onChange(parseDate(value2, dateFormats.short));
12754
+ },
12755
+ onBlur: () => maybeCall(onBlur),
12756
+ onFocus: () => maybeCall(onFocus),
12757
+ disabled: !!props.disabled,
12758
+ readOnly: !!props.readOnly,
12759
+ "data-disabled-days": JSON.stringify(props.disabledDays)
12760
+ }
12761
+ );
12559
12762
  }
12560
12763
 
12561
12764
  // src/inputs/DateFields/DateFieldBase.tsx
12765
+ var import_react51 = require("react");
12766
+ var import_react_aria31 = require("react-aria");
12767
+ var import_react_stately10 = require("react-stately");
12562
12768
  var import_runtime43 = require("@homebound/truss/runtime");
12563
12769
  var import_jsx_runtime61 = require("react/jsx-runtime");
12564
12770
  function DateFieldBase(props) {
@@ -12574,7 +12780,7 @@ function DateFieldBase(props) {
12574
12780
  errorMsg,
12575
12781
  helperText,
12576
12782
  readOnly,
12577
- format: format4 = "short",
12783
+ format = "short",
12578
12784
  iconLeft = false,
12579
12785
  hideCalendarIcon = false,
12580
12786
  disabledDays,
@@ -12591,7 +12797,7 @@ function DateFieldBase(props) {
12591
12797
  const buttonRef = (0, import_react51.useRef)(null);
12592
12798
  const overlayRef = (0, import_react51.useRef)(null);
12593
12799
  const isFocused = (0, import_react51.useRef)(false);
12594
- const dateFormat = getDateFormat(format4);
12800
+ const dateFormat = getDateFormat(format);
12595
12801
  const [wipValue, setWipValue] = (0, import_react51.useState)(value);
12596
12802
  const [inputValue, setInputValue] = (0, import_react51.useState)((isRangeMode ? formatDateRange(props.value, dateFormat) : formatDate(props.value, dateFormat)) ?? "");
12597
12803
  const tid = useTestIds(props, defaultTestId(label));
@@ -12680,16 +12886,20 @@ function DateFieldBase(props) {
12680
12886
  (d) => {
12681
12887
  setWipValue(d);
12682
12888
  if (d && isParsedDateValid(d)) {
12683
- if (isRangeMode && (0, import_react_day_picker5.isDateRange)(d)) {
12889
+ if (isRangeMode && isDateRangeValue(d)) {
12684
12890
  props.onChange(d);
12685
12891
  return;
12686
12892
  }
12687
- if (!isRangeMode && !(0, import_react_day_picker5.isDateRange)(d)) {
12893
+ if (!isRangeMode && !isDateRangeValue(d)) {
12688
12894
  props.onChange(d);
12689
12895
  return;
12690
12896
  }
12691
12897
  } else {
12692
- props.onChange(void 0);
12898
+ if (isRangeMode) {
12899
+ props.onChange(void 0);
12900
+ } else {
12901
+ props.onChange(void 0);
12902
+ }
12693
12903
  return;
12694
12904
  }
12695
12905
  },
@@ -12697,7 +12907,7 @@ function DateFieldBase(props) {
12697
12907
  // eslint-disable-next-line react-hooks/exhaustive-deps
12698
12908
  [isRangeMode, props.onChange]
12699
12909
  );
12700
- const inputSize = !isRangeMode ? format4 === "short" ? 8 : format4 === "medium" ? 10 : void 0 : void 0;
12910
+ const inputSize = !isRangeMode ? format === "short" ? 8 : format === "medium" ? 10 : void 0 : void 0;
12701
12911
  const clearButton = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, { children: inputValue !== "" && !state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(IconButton, { icon: "xCircle", color: "rgba(100, 100, 100, 1)" /* Gray700 */, onClick: () => {
12702
12912
  setInputValue("");
12703
12913
  onChange(void 0);
@@ -12759,7 +12969,10 @@ function DateFieldBase(props) {
12759
12969
  ] });
12760
12970
  }
12761
12971
  function isParsedDateValid(d) {
12762
- return d !== void 0 && (!(0, import_react_day_picker5.isDateRange)(d) || (0, import_react_day_picker5.isDateRange)(d) && isValidDate(d.from) && isValidDate(d.to));
12972
+ return d !== void 0 && (!isDateRangeValue(d) || isValidDate(d.from) && isValidDate(d.to));
12973
+ }
12974
+ function isDateRangeValue(value) {
12975
+ return typeof value === "object" && value !== null && ("from" in value || "to" in value);
12763
12976
  }
12764
12977
 
12765
12978
  // src/utils/withTestMock.tsx
@@ -15276,7 +15489,7 @@ function useScrollStorage(tableId, enabled = true) {
15276
15489
  }
15277
15490
 
15278
15491
  // src/components/Table/hooks/useSetupColumnSizes.ts
15279
- var import_utils66 = require("@react-aria/utils");
15492
+ var import_utils67 = require("@react-aria/utils");
15280
15493
  var import_react70 = require("react");
15281
15494
 
15282
15495
  // src/components/Table/hooks/useColumnResizing.ts
@@ -15400,7 +15613,7 @@ function useSetupColumnSizes(style, columns, resizeRef, expandedColumnIds, visib
15400
15613
  // eslint-disable-next-line react-hooks/exhaustive-deps
15401
15614
  [tableWidth, setTableAndColumnWidths, setTableAndColumnWidthsDebounced]
15402
15615
  );
15403
- (0, import_utils66.useResizeObserver)({ ref: resizeRef, onResize });
15616
+ (0, import_utils67.useResizeObserver)({ ref: resizeRef, onResize });
15404
15617
  return { columnSizes, tableWidth, resizedWidths, setResizedWidth, setResizedWidths, resetColumnWidths };
15405
15618
  }
15406
15619
 
@@ -15993,7 +16206,7 @@ function ToggleChips(props) {
15993
16206
  }
15994
16207
 
15995
16208
  // src/components/Accordion.tsx
15996
- var import_utils69 = require("@react-aria/utils");
16209
+ var import_utils70 = require("@react-aria/utils");
15997
16210
  var import_react73 = require("react");
15998
16211
  var import_react_aria40 = require("react-aria");
15999
16212
  var import_runtime54 = require("@homebound/truss/runtime");
@@ -16019,7 +16232,7 @@ function Accordion(props) {
16019
16232
  xss
16020
16233
  } = props;
16021
16234
  const tid = useTestIds(props, "accordion");
16022
- const id = (0, import_utils69.useId)();
16235
+ const id = (0, import_utils70.useId)();
16023
16236
  const [expanded, setExpanded] = (0, import_react73.useState)(defaultExpanded && !disabled);
16024
16237
  const {
16025
16238
  isFocusVisible,
@@ -16041,7 +16254,7 @@ function Accordion(props) {
16041
16254
  setContentHeight(`${contentEl.scrollHeight}px`);
16042
16255
  }
16043
16256
  }, [expanded, contentEl, setContentHeight]);
16044
- (0, import_utils69.useResizeObserver)({
16257
+ (0, import_utils70.useResizeObserver)({
16045
16258
  ref: contentRef,
16046
16259
  onResize
16047
16260
  });
@@ -16332,7 +16545,7 @@ var import_react102 = require("react");
16332
16545
  var import_react_aria46 = require("react-aria");
16333
16546
 
16334
16547
  // src/components/Modal/Modal.tsx
16335
- var import_utils73 = require("@react-aria/utils");
16548
+ var import_utils74 = require("@react-aria/utils");
16336
16549
  var import_react78 = require("react");
16337
16550
  var import_react_aria41 = require("react-aria");
16338
16551
  var import_react_dom3 = require("react-dom");
@@ -16455,7 +16668,7 @@ function Modal(props) {
16455
16668
  };
16456
16669
  }
16457
16670
  const [hasScroll, setHasScroll] = (0, import_react78.useState)(forceScrolling ?? false);
16458
- (0, import_utils73.useResizeObserver)({
16671
+ (0, import_utils74.useResizeObserver)({
16459
16672
  ref: modalBodyRef,
16460
16673
  onResize: (0, import_react78.useCallback)(
16461
16674
  () => {
@@ -18095,7 +18308,7 @@ function FormHeading(props) {
18095
18308
  FormHeading.isFormHeading = true;
18096
18309
 
18097
18310
  // src/forms/StaticField.tsx
18098
- var import_utils101 = require("@react-aria/utils");
18311
+ var import_utils102 = require("@react-aria/utils");
18099
18312
  var import_runtime65 = require("@homebound/truss/runtime");
18100
18313
  var import_jsx_runtime118 = require("react/jsx-runtime");
18101
18314
  function StaticField(props) {
@@ -18109,7 +18322,7 @@ function StaticField(props) {
18109
18322
  children
18110
18323
  } = props;
18111
18324
  const tid = useTestIds(props, typeof label === "string" ? defaultTestId(label) : "staticField");
18112
- const id = (0, import_utils101.useId)();
18325
+ const id = (0, import_utils102.useId)();
18113
18326
  return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { ...(0, import_runtime65.trussProps)({
18114
18327
  ...labelStyle === "left" ? {
18115
18328
  display: "df",
@@ -18793,8 +19006,16 @@ function dateFilter(props) {
18793
19006
  }
18794
19007
  var anyOption = {};
18795
19008
  var DateFilter = class extends BaseFilter {
19009
+ hydrate(value) {
19010
+ if (!isDateFilterValue(value)) return void 0;
19011
+ const hydratedValue = parsePersistedPlainDate(value.value);
19012
+ return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
19013
+ }
19014
+ dehydrate(value) {
19015
+ return value ? { op: value.op, value: dehydratePlainDate(value.value) } : void 0;
19016
+ }
18796
19017
  render(value, setValue, tid, inModal, vertical) {
18797
- const { label, operations, getOperationValue, getOperationLabel } = this.props;
19018
+ const { label, operations, getOperationValue, getOperationLabel, defaultValue } = this.props;
18798
19019
  return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
18799
19020
  vertical && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Label, { label }),
18800
19021
  /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(CompoundField, { children: [
@@ -18811,8 +19032,8 @@ var DateFilter = class extends BaseFilter {
18811
19032
  getOptionLabel: (o) => o === anyOption ? "Any" : getOperationLabel(o),
18812
19033
  value: value?.op,
18813
19034
  onSelect: (op) => (
18814
- // default the selected date to today if it doesn't exist in the filter's value
18815
- setValue(op ? { op, value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date() } : void 0)
19035
+ // default the selected date to the filter's default date or today if it doesn't exist in the filter's value
19036
+ setValue(op ? { op, value: value?.value ?? defaultValue?.value ?? todayPlainDate() } : void 0)
18816
19037
  ),
18817
19038
  label: inModal ? `${label} date filter operation` : label,
18818
19039
  labelStyle: !inModal && !vertical ? "inline" : inModal || vertical ? "hidden" : "above",
@@ -18824,9 +19045,13 @@ var DateFilter = class extends BaseFilter {
18824
19045
  DateField,
18825
19046
  {
18826
19047
  labelStyle: "inline",
18827
- value: value?.value ? new Date(value.value) : /* @__PURE__ */ new Date(),
19048
+ value: value?.value ?? defaultValue?.value ?? todayPlainDate(),
18828
19049
  label: "Date",
18829
- onChange: (d) => setValue({ ...value, value: d }),
19050
+ onChange: (d) => {
19051
+ if (d && value) {
19052
+ setValue({ ...value, value: d });
19053
+ }
19054
+ },
18830
19055
  disabled: !value,
18831
19056
  ...tid[`${defaultTestId(this.label)}_dateField`]
18832
19057
  }
@@ -18835,6 +19060,9 @@ var DateFilter = class extends BaseFilter {
18835
19060
  ] });
18836
19061
  }
18837
19062
  };
19063
+ function isDateFilterValue(value) {
19064
+ return typeof value === "object" && value !== null && "op" in value && "value" in value;
19065
+ }
18838
19066
 
18839
19067
  // src/components/Filters/DateRangeFilter.tsx
18840
19068
  var import_jsx_runtime128 = require("react/jsx-runtime");
@@ -18842,6 +19070,17 @@ function dateRangeFilter(props) {
18842
19070
  return (key) => new DateRangeFilter(key, props);
18843
19071
  }
18844
19072
  var DateRangeFilter = class extends BaseFilter {
19073
+ hydrate(value) {
19074
+ if (!isDateRangeFilterValue(value)) return void 0;
19075
+ const hydratedValue = hydrateDateRange(value.value);
19076
+ return hydratedValue ? { op: value.op, value: hydratedValue } : void 0;
19077
+ }
19078
+ dehydrate(value) {
19079
+ return value ? {
19080
+ op: value.op,
19081
+ value: value.value ? { from: dehydratePlainDate(value.value.from), to: dehydratePlainDate(value.value.to) } : void 0
19082
+ } : void 0;
19083
+ }
18845
19084
  render(value, setValue, tid, inModal, vertical) {
18846
19085
  const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
18847
19086
  return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
@@ -18853,8 +19092,17 @@ var DateRangeFilter = class extends BaseFilter {
18853
19092
  isRangeFilterField: true,
18854
19093
  placeholder: placeholderText,
18855
19094
  label: testFieldLabel ?? "Date",
18856
- value: value?.value ? { from: new Date(value.value.from), to: new Date(value.value.to) } : void 0,
18857
- onChange: (d) => d ? setValue({ op: defaultValue?.op, value: d }) : setValue(void 0),
19095
+ value: value?.value,
19096
+ onChange: (d) => {
19097
+ if (!d) {
19098
+ setValue(void 0);
19099
+ return;
19100
+ }
19101
+ const op = value?.op ?? defaultValue?.op;
19102
+ if (op !== void 0) {
19103
+ setValue({ op, value: d });
19104
+ }
19105
+ },
18858
19106
  disabledDays,
18859
19107
  ...tid[`${defaultTestId(this.label)}_dateField`]
18860
19108
  }
@@ -18862,6 +19110,17 @@ var DateRangeFilter = class extends BaseFilter {
18862
19110
  ] });
18863
19111
  }
18864
19112
  };
19113
+ function isDateRangeFilterValue(value) {
19114
+ return typeof value === "object" && value !== null && "op" in value && "value" in value;
19115
+ }
19116
+ function hydrateDateRange(value) {
19117
+ if (typeof value !== "object" || value === null) return void 0;
19118
+ const { from, to } = value;
19119
+ const hydratedFrom = parsePersistedPlainDate(from);
19120
+ const hydratedTo = parsePersistedPlainDate(to);
19121
+ if (hydratedFrom === void 0 && hydratedTo === void 0) return void 0;
19122
+ return { from: hydratedFrom, to: hydratedTo };
19123
+ }
18865
19124
 
18866
19125
  // src/components/Filters/MultiFilter.tsx
18867
19126
  var import_jsx_runtime129 = require("react/jsx-runtime");
@@ -19667,10 +19926,10 @@ function useGridTableLayoutState({
19667
19926
  });
19668
19927
  (0, import_react99.useEffect)(() => {
19669
19928
  if (page.limit !== persistedPageSize) setPersistedPageSize(page.limit);
19670
- setPage((prev) => ({
19929
+ setPage((prev) => prev.offset === 0 ? prev : {
19671
19930
  ...prev,
19672
19931
  offset: 0
19673
- }));
19932
+ });
19674
19933
  }, [page.limit, persistedPageSize, setPersistedPageSize, filter, searchString]);
19675
19934
  return {
19676
19935
  filter,
@@ -20185,7 +20444,7 @@ var import_react106 = require("react");
20185
20444
  var import_react_aria49 = require("react-aria");
20186
20445
 
20187
20446
  // src/components/Tag.tsx
20188
- var import_utils118 = require("@react-aria/utils");
20447
+ var import_utils119 = require("@react-aria/utils");
20189
20448
  var import_react105 = require("react");
20190
20449
  var import_runtime78 = require("@homebound/truss/runtime");
20191
20450
  var import_jsx_runtime152 = require("react/jsx-runtime");
@@ -20201,7 +20460,7 @@ function Tag(props) {
20201
20460
  const tid = useTestIds(otherProps);
20202
20461
  const [showTooltip, setShowTooltip] = (0, import_react105.useState)(false);
20203
20462
  const ref = (0, import_react105.useRef)(null);
20204
- (0, import_utils118.useResizeObserver)({
20463
+ (0, import_utils119.useResizeObserver)({
20205
20464
  ref,
20206
20465
  onResize: () => {
20207
20466
  if (ref.current) {
@@ -20898,7 +21157,7 @@ function HbSpinnerProvider({
20898
21157
  }
20899
21158
 
20900
21159
  // src/components/MaxLines.tsx
20901
- var import_utils126 = require("@react-aria/utils");
21160
+ var import_utils127 = require("@react-aria/utils");
20902
21161
  var import_react115 = require("react");
20903
21162
  var import_runtime85 = require("@homebound/truss/runtime");
20904
21163
  var import_jsx_runtime160 = require("react/jsx-runtime");
@@ -20909,7 +21168,7 @@ function MaxLines({
20909
21168
  const elRef = (0, import_react115.useRef)(null);
20910
21169
  const [hasMore, setHasMore] = (0, import_react115.useState)(false);
20911
21170
  const [expanded, setExpanded] = (0, import_react115.useState)(false);
20912
- (0, import_utils126.useLayoutEffect)(() => {
21171
+ (0, import_utils127.useLayoutEffect)(() => {
20913
21172
  if (!elRef.current) return;
20914
21173
  setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
20915
21174
  }, []);
@@ -20920,7 +21179,7 @@ function MaxLines({
20920
21179
  if (!elRef.current) return;
20921
21180
  !expanded && setHasMore(elRef.current.scrollHeight > elRef.current.clientHeight);
20922
21181
  }, [expanded]);
20923
- (0, import_utils126.useResizeObserver)({
21182
+ (0, import_utils127.useResizeObserver)({
20924
21183
  ref: elRef,
20925
21184
  onResize
20926
21185
  });
@@ -20941,7 +21200,7 @@ function MaxLines({
20941
21200
  }
20942
21201
 
20943
21202
  // src/components/ScrollShadows.tsx
20944
- var import_utils127 = require("@react-aria/utils");
21203
+ var import_utils128 = require("@react-aria/utils");
20945
21204
  var import_react116 = require("react");
20946
21205
  var import_runtime86 = require("@homebound/truss/runtime");
20947
21206
  var import_jsx_runtime161 = require("react/jsx-runtime");
@@ -21028,7 +21287,7 @@ function ScrollShadows(props) {
21028
21287
  setShowEndShadow(start + boxSize < end);
21029
21288
  }, [horizontal]);
21030
21289
  const onResize = (0, import_react116.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), [updateScrollProps]);
21031
- (0, import_utils127.useResizeObserver)({
21290
+ (0, import_utils128.useResizeObserver)({
21032
21291
  ref: scrollRef,
21033
21292
  onResize
21034
21293
  });
@@ -22065,6 +22324,7 @@ function useToast() {
22065
22324
  filterTestIdPrefix,
22066
22325
  formatDate,
22067
22326
  formatDateRange,
22327
+ formatPlainDate,
22068
22328
  formatValue,
22069
22329
  generateColumnId,
22070
22330
  getAlignment,