@uniformdev/design-system 19.134.3-alpha.28 → 19.136.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1371,8 +1371,6 @@ __export(src_exports, {
1371
1371
  CurrentDrawerContext: () => CurrentDrawerContext,
1372
1372
  DATE_OPERATORS: () => DATE_OPERATORS,
1373
1373
  DashedBox: () => DashedBox,
1374
- DateEditor: () => DateEditor,
1375
- DateRangeEditor: () => DateRangeEditor,
1376
1374
  DateTimePicker: () => DateTimePicker,
1377
1375
  DateTimePickerVariant: () => DateTimePickerVariant,
1378
1376
  DebouncedInputKeywordSearch: () => DebouncedInputKeywordSearch,
@@ -1388,12 +1386,9 @@ __export(src_exports, {
1388
1386
  Fieldset: () => Fieldset,
1389
1387
  FilterButton: () => FilterButton2,
1390
1388
  FilterControls: () => FilterControls,
1391
- FilterEditorRenderer: () => FilterEditorRenderer,
1392
1389
  FilterItem: () => FilterItem,
1393
1390
  FilterItems: () => FilterItems,
1394
1391
  FilterMenu: () => FilterMenu,
1395
- FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
1396
- FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
1397
1392
  Heading: () => Heading,
1398
1393
  HexModalBackground: () => HexModalBackground,
1399
1394
  HorizontalRhythm: () => HorizontalRhythm,
@@ -1440,8 +1435,7 @@ __export(src_exports, {
1440
1435
  ModalDialog: () => ModalDialog,
1441
1436
  MultilineChip: () => MultilineChip,
1442
1437
  NUMBER_OPERATORS: () => NUMBER_OPERATORS,
1443
- NumberEditor: () => NumberEditor,
1444
- NumberRangeEditor: () => NumberRangeEditor,
1438
+ PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
1445
1439
  PageHeaderSection: () => PageHeaderSection,
1446
1440
  Pagination: () => Pagination,
1447
1441
  Paragraph: () => Paragraph,
@@ -1494,8 +1488,6 @@ __export(src_exports, {
1494
1488
  ShortcutRevealer: () => ShortcutRevealer,
1495
1489
  Skeleton: () => Skeleton,
1496
1490
  StatusBullet: () => StatusBullet,
1497
- StatusMultiEditor: () => StatusMultiEditor,
1498
- StatusSingleEditor: () => StatusSingleEditor,
1499
1491
  SuccessMessage: () => SuccessMessage,
1500
1492
  Switch: () => Switch,
1501
1493
  TAKEOVER_STACK_ID: () => TAKEOVER_STACK_ID,
@@ -1512,7 +1504,6 @@ __export(src_exports, {
1512
1504
  TableRow: () => TableRow,
1513
1505
  Tabs: () => Tabs,
1514
1506
  TakeoverDrawerRenderer: () => TakeoverDrawerRenderer,
1515
- TextEditor: () => TextEditor,
1516
1507
  Textarea: () => Textarea,
1517
1508
  Theme: () => Theme,
1518
1509
  Tile: () => Tile2,
@@ -1557,7 +1548,6 @@ __export(src_exports, {
1557
1548
  fadeInRtl: () => fadeInRtl,
1558
1549
  fadeInTop: () => fadeInTop,
1559
1550
  fadeOutBottom: () => fadeOutBottom,
1560
- filterMapper: () => filterMapper,
1561
1551
  fullWidthScreenIcon: () => fullWidthScreenIcon,
1562
1552
  getDrawerAttributes: () => getDrawerAttributes,
1563
1553
  getParentPath: () => getParentPath,
@@ -22299,6 +22289,28 @@ var SYSTEM_FIELD_OPERATORS = [
22299
22289
  editorType: "multiChoice"
22300
22290
  }
22301
22291
  ];
22292
+ var PUBLISH_STATUS_FIELD_OPERATORS = [
22293
+ {
22294
+ label: "is...",
22295
+ value: "eq",
22296
+ editorType: "statusSingleChoice"
22297
+ },
22298
+ {
22299
+ label: "is any of...",
22300
+ value: "in",
22301
+ editorType: "statusMultiChoice"
22302
+ },
22303
+ {
22304
+ label: "is not...",
22305
+ value: "neq",
22306
+ editorType: "statusSingleChoice"
22307
+ },
22308
+ {
22309
+ label: "is none of...",
22310
+ value: "nin",
22311
+ editorType: "statusMultiChoice"
22312
+ }
22313
+ ];
22302
22314
 
22303
22315
  // src/components/SearchAndFilter/FilterButton.tsx
22304
22316
  init_emotion_jsx_shim();
@@ -22341,7 +22353,7 @@ var ConditionalFilterRow = import_react139.css`
22341
22353
  }
22342
22354
  }
22343
22355
 
22344
- &:first-of-type {
22356
+ &:nth-of-type(2) {
22345
22357
  margin-left: 0;
22346
22358
  grid-template-columns: 50px 1fr;
22347
22359
  }
@@ -22495,15 +22507,6 @@ var IconBtn = import_react139.css`
22495
22507
  border: none;
22496
22508
  padding: var(--spacing-sm);
22497
22509
  `;
22498
- var CloseBtn = import_react139.css`
22499
- color: var(--gray-500);
22500
- background: transparent;
22501
- border: none;
22502
- padding: 0;
22503
- position: absolute;
22504
- top: var(--spacing-base);
22505
- right: var(--spacing-base);
22506
- `;
22507
22510
  var SearchAndFilterOptionsContainer = import_react139.css`
22508
22511
  background: var(--gray-50);
22509
22512
  border: 1px solid var(--gray-300);
@@ -22512,7 +22515,7 @@ var SearchAndFilterOptionsContainer = import_react139.css`
22512
22515
  display: flex;
22513
22516
  flex-direction: column;
22514
22517
  gap: var(--spacing-sm);
22515
- padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
22518
+ padding: var(--spacing-md) 0 var(--spacing-base);
22516
22519
  will-change: height;
22517
22520
  position: relative;
22518
22521
  z-index: 1;
@@ -22521,14 +22524,27 @@ var SearchAndFilterOptionsInnerContainer = import_react139.css`
22521
22524
  display: flex;
22522
22525
  flex-direction: column;
22523
22526
  gap: var(--spacing-sm);
22527
+ padding-inline: var(--spacing-md);
22524
22528
  `;
22525
22529
  var SearchAndFilterButtonGroup = import_react139.css`
22526
- margin-top: var(--spacing-base);
22530
+ margin-top: var(--spacing-xs);
22531
+ margin-left: calc(56px + var(--spacing-md));
22532
+ `;
22533
+ var SortFilterWrapper = (hiddenLocaleInput) => import_react139.css`
22534
+ border-top: 1px solid var(--gray-300);
22535
+ align-items: center;
22536
+ display: grid;
22537
+ grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr 200px"};
22538
+ gap: var(--spacing-xl);
22539
+ padding: var(--spacing-base) var(--spacing-md) 0;
22540
+ position: relative;
22541
+ z-index: 0;
22527
22542
  `;
22528
22543
  var SortFilterInputRow = import_react139.css`
22529
22544
  align-items: center;
22530
- display: flex;
22531
- gap: var(--spacing-sm);
22545
+ display: grid;
22546
+ grid-template-columns: 1fr auto;
22547
+ gap: var(--spacing-base);
22532
22548
  `;
22533
22549
 
22534
22550
  // src/components/SearchAndFilter/FilterButton.tsx
@@ -22563,25 +22579,216 @@ var FilterButton2 = ({
22563
22579
 
22564
22580
  // src/components/SearchAndFilter/FilterControls.tsx
22565
22581
  init_emotion_jsx_shim();
22566
- var import_react143 = require("react");
22567
- var import_react_use4 = require("react-use");
22582
+ var import_react141 = require("react");
22583
+ var import_react_use3 = require("react-use");
22568
22584
 
22569
22585
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
22570
22586
  init_emotion_jsx_shim();
22571
- var import_react142 = require("react");
22587
+ var import_react140 = require("react");
22588
+ var import_jsx_runtime119 = require("@emotion/react/jsx-runtime");
22589
+ var SearchAndFilterContext = (0, import_react140.createContext)({
22590
+ searchTerm: "",
22591
+ setSearchTerm: () => {
22592
+ },
22593
+ filterVisibility: void 0,
22594
+ setFilterVisibility: () => {
22595
+ },
22596
+ filters: [],
22597
+ setFilters: () => {
22598
+ },
22599
+ handleAddFilter: () => {
22600
+ },
22601
+ handleResetFilters: () => {
22602
+ },
22603
+ handleDeleteFilter: () => {
22604
+ },
22605
+ handleLocaleChange: () => {
22606
+ },
22607
+ setSortBy: () => {
22608
+ },
22609
+ sortByValue: "",
22610
+ filterOptions: [],
22611
+ sortOptions: [],
22612
+ validFilterQuery: [],
22613
+ totalResults: 0,
22614
+ localeOptions: [],
22615
+ localeValue: ""
22616
+ });
22617
+ var SearchAndFilterProvider = ({
22618
+ filters,
22619
+ filterOptions,
22620
+ sortOptions,
22621
+ defaultSortByValue,
22622
+ defaultLocale = "",
22623
+ localeOptions,
22624
+ onLocaleChange,
22625
+ filterVisible = false,
22626
+ onSearchChange,
22627
+ onChange,
22628
+ onSortChange,
22629
+ resetFilterValues = [{ field: "", operator: "", value: "" }],
22630
+ totalResults,
22631
+ children
22632
+ }) => {
22633
+ const [searchTerm, setSearchTerm] = (0, import_react140.useState)("");
22634
+ const deferredSearchTerm = (0, import_react140.useDeferredValue)(searchTerm);
22635
+ const [filterVisibility, setFilterVisibility] = (0, import_react140.useState)(filterVisible);
22636
+ const [sortByValue, setSortByValue] = (0, import_react140.useState)(defaultSortByValue);
22637
+ const [localeValue, setLocale] = (0, import_react140.useState)(defaultLocale);
22638
+ const handleSearchTerm = (0, import_react140.useCallback)(
22639
+ (term) => {
22640
+ setSearchTerm(term);
22641
+ onSearchChange == null ? void 0 : onSearchChange(term);
22642
+ },
22643
+ [setSearchTerm, onSearchChange]
22644
+ );
22645
+ const handleLocaleChange = (0, import_react140.useCallback)(
22646
+ (locale) => {
22647
+ setLocale(locale);
22648
+ onLocaleChange == null ? void 0 : onLocaleChange(locale);
22649
+ },
22650
+ [onLocaleChange]
22651
+ );
22652
+ const handleOnSortChange = (0, import_react140.useCallback)(
22653
+ (sort) => {
22654
+ setSortByValue(sort);
22655
+ onSortChange(sort);
22656
+ },
22657
+ [onSortChange]
22658
+ );
22659
+ const handleToggleFilterVisibilty = (0, import_react140.useCallback)(
22660
+ (visible) => setFilterVisibility(visible),
22661
+ [setFilterVisibility]
22662
+ );
22663
+ const handleAddFilter = (0, import_react140.useCallback)(() => {
22664
+ onChange([...filters, { field: "", operator: "", value: "" }]);
22665
+ }, [filters, onChange]);
22666
+ const handleResetFilters = (0, import_react140.useCallback)(() => {
22667
+ onChange(resetFilterValues);
22668
+ }, [onChange, resetFilterValues]);
22669
+ const handleDeleteFilter = (0, import_react140.useCallback)(
22670
+ (index) => {
22671
+ const remainingFilters = filters.filter((_, i) => i !== index);
22672
+ onChange(remainingFilters);
22673
+ },
22674
+ [filters, onChange]
22675
+ );
22676
+ const validFilterQuery = (0, import_react140.useMemo)(() => {
22677
+ const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
22678
+ if (hasValidFilters) {
22679
+ return filters;
22680
+ }
22681
+ }, [filters]);
22682
+ (0, import_react140.useEffect)(() => {
22683
+ if (filterVisibility) {
22684
+ const handleEscKeyFilterClose = (e) => {
22685
+ if (e.key === "Escape") {
22686
+ setFilterVisibility(false);
22687
+ }
22688
+ };
22689
+ document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
22690
+ return () => {
22691
+ document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
22692
+ };
22693
+ }
22694
+ }, [filterVisibility]);
22695
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
22696
+ SearchAndFilterContext.Provider,
22697
+ {
22698
+ value: {
22699
+ searchTerm: deferredSearchTerm,
22700
+ setSearchTerm: (e) => handleSearchTerm(e),
22701
+ setSortBy: (e) => handleOnSortChange(e),
22702
+ sortByValue,
22703
+ filterVisibility,
22704
+ setFilterVisibility: (e) => handleToggleFilterVisibilty(e),
22705
+ filters,
22706
+ setFilters: (e) => onChange(e),
22707
+ handleAddFilter,
22708
+ handleResetFilters,
22709
+ handleDeleteFilter,
22710
+ filterOptions,
22711
+ sortOptions,
22712
+ validFilterQuery,
22713
+ totalResults,
22714
+ localeOptions,
22715
+ localeValue,
22716
+ handleLocaleChange
22717
+ },
22718
+ children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(VerticalRhythm, { children })
22719
+ }
22720
+ );
22721
+ };
22722
+ var useSearchAndFilter = () => {
22723
+ const value = (0, import_react140.useContext)(SearchAndFilterContext);
22724
+ return { ...value };
22725
+ };
22726
+
22727
+ // src/components/SearchAndFilter/FilterControls.tsx
22728
+ var import_jsx_runtime120 = require("@emotion/react/jsx-runtime");
22729
+ var FilterControls = ({
22730
+ children,
22731
+ hideSearchInput
22732
+ }) => {
22733
+ const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm } = useSearchAndFilter();
22734
+ const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react141.useState)("");
22735
+ (0, import_react_use3.useDebounce)(
22736
+ () => {
22737
+ setSearchTerm(localeSearchTerm);
22738
+ },
22739
+ 300,
22740
+ [localeSearchTerm, searchTerm]
22741
+ );
22742
+ (0, import_react141.useEffect)(() => {
22743
+ if (searchTerm === "") {
22744
+ setLocaleSearchTerm("");
22745
+ }
22746
+ }, [searchTerm]);
22747
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
22748
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
22749
+ FilterButton2,
22750
+ {
22751
+ "aria-controls": "search-and-filter-options",
22752
+ "aria-label": "filter options",
22753
+ "aria-haspopup": "true",
22754
+ text: "Filter/Sort",
22755
+ "aria-expanded": filterVisibility === true,
22756
+ filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
22757
+ onClick: () => setFilterVisibility(!filterVisibility),
22758
+ dataTestId: "filters-button"
22759
+ }
22760
+ ),
22761
+ hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
22762
+ InputKeywordSearch,
22763
+ {
22764
+ placeholder: "Search...",
22765
+ onSearchTextChanged: (e) => setLocaleSearchTerm(e),
22766
+ value: localeSearchTerm,
22767
+ compact: true,
22768
+ rounded: true,
22769
+ css: SearchInput
22770
+ }
22771
+ ),
22772
+ children
22773
+ ] });
22774
+ };
22775
+
22776
+ // src/components/SearchAndFilter/FilterItem.tsx
22777
+ init_emotion_jsx_shim();
22778
+ var import_react148 = require("react");
22572
22779
 
22573
22780
  // src/components/SearchAndFilter/FilterEditor.tsx
22574
22781
  init_emotion_jsx_shim();
22575
- var import_react141 = require("react");
22576
- var import_react_use3 = require("react-use");
22782
+ var import_react143 = require("react");
22783
+ var import_react_use4 = require("react-use");
22577
22784
 
22578
22785
  // src/components/Validation/StatusBullet.tsx
22579
22786
  init_emotion_jsx_shim();
22580
22787
 
22581
22788
  // src/components/Validation/StatusBullet.styles.ts
22582
22789
  init_emotion_jsx_shim();
22583
- var import_react140 = require("@emotion/react");
22584
- var StatusBulletContainer = import_react140.css`
22790
+ var import_react142 = require("@emotion/react");
22791
+ var StatusBulletContainer = import_react142.css`
22585
22792
  align-items: center;
22586
22793
  align-self: center;
22587
22794
  color: var(--gray-500);
@@ -22598,33 +22805,33 @@ var StatusBulletContainer = import_react140.css`
22598
22805
  display: block;
22599
22806
  }
22600
22807
  `;
22601
- var StatusBulletBase = import_react140.css`
22808
+ var StatusBulletBase = import_react142.css`
22602
22809
  font-size: var(--fs-sm);
22603
22810
  &:before {
22604
22811
  width: var(--fs-xs);
22605
22812
  height: var(--fs-xs);
22606
22813
  }
22607
22814
  `;
22608
- var StatusBulletSmall = import_react140.css`
22815
+ var StatusBulletSmall = import_react142.css`
22609
22816
  font-size: var(--fs-xs);
22610
22817
  &:before {
22611
22818
  width: var(--fs-xxs);
22612
22819
  height: var(--fs-xxs);
22613
22820
  }
22614
22821
  `;
22615
- var StatusDraft = import_react140.css`
22822
+ var StatusDraft = import_react142.css`
22616
22823
  &:before {
22617
22824
  background: var(--white);
22618
22825
  box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
22619
22826
  }
22620
22827
  `;
22621
- var StatusModified = import_react140.css`
22828
+ var StatusModified = import_react142.css`
22622
22829
  &:before {
22623
22830
  background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
22624
22831
  box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
22625
22832
  }
22626
22833
  `;
22627
- var StatusError = import_react140.css`
22834
+ var StatusError = import_react142.css`
22628
22835
  color: var(--error);
22629
22836
  &:before {
22630
22837
  /* TODO: replace this with an svg icon */
@@ -22637,29 +22844,29 @@ var StatusError = import_react140.css`
22637
22844
  );
22638
22845
  }
22639
22846
  `;
22640
- var StatusPublished = import_react140.css`
22847
+ var StatusPublished = import_react142.css`
22641
22848
  &:before {
22642
22849
  background: var(--primary-action-default);
22643
22850
  }
22644
22851
  `;
22645
- var StatusOrphan = import_react140.css`
22852
+ var StatusOrphan = import_react142.css`
22646
22853
  &:before {
22647
22854
  background: var(--brand-secondary-5);
22648
22855
  }
22649
22856
  `;
22650
- var StatusUnknown = import_react140.css`
22857
+ var StatusUnknown = import_react142.css`
22651
22858
  &:before {
22652
22859
  background: var(--gray-800);
22653
22860
  }
22654
22861
  `;
22655
- var StatusDeleted = import_react140.css`
22862
+ var StatusDeleted = import_react142.css`
22656
22863
  &:before {
22657
22864
  background: var(--error);
22658
22865
  }
22659
22866
  `;
22660
22867
 
22661
22868
  // src/components/Validation/StatusBullet.tsx
22662
- var import_jsx_runtime119 = require("@emotion/react/jsx-runtime");
22869
+ var import_jsx_runtime121 = require("@emotion/react/jsx-runtime");
22663
22870
  var StatusBullet = ({
22664
22871
  status,
22665
22872
  hideText = false,
@@ -22679,7 +22886,7 @@ var StatusBullet = ({
22679
22886
  Deleted: StatusDeleted
22680
22887
  };
22681
22888
  const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
22682
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
22889
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
22683
22890
  "span",
22684
22891
  {
22685
22892
  role: "status",
@@ -22692,7 +22899,7 @@ var StatusBullet = ({
22692
22899
  };
22693
22900
 
22694
22901
  // src/components/SearchAndFilter/FilterEditor.tsx
22695
- var import_jsx_runtime120 = require("@emotion/react/jsx-runtime");
22902
+ var import_jsx_runtime122 = require("@emotion/react/jsx-runtime");
22696
22903
  var readOnlyAttributes = {
22697
22904
  isSearchable: false,
22698
22905
  menuIsOpen: false,
@@ -22701,13 +22908,13 @@ var readOnlyAttributes = {
22701
22908
  var FilterMultiChoiceEditor = ({
22702
22909
  value,
22703
22910
  options,
22704
- disabled: disabled2,
22911
+ isDisabled,
22705
22912
  readOnly,
22706
22913
  valueTestId,
22707
22914
  ...props
22708
22915
  }) => {
22709
22916
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
22710
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
22917
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22711
22918
  InputComboBox,
22712
22919
  {
22713
22920
  ...props,
@@ -22715,12 +22922,12 @@ var FilterMultiChoiceEditor = ({
22715
22922
  options,
22716
22923
  isMulti: true,
22717
22924
  isClearable: true,
22718
- isDisabled: disabled2,
22925
+ isDisabled,
22719
22926
  onChange: (e) => {
22720
22927
  var _a;
22721
- return props.onChange((_a = e == null ? void 0 : e.map((option) => option.value)) != null ? _a : []);
22928
+ return props.onChange((_a = e.map((item) => item.value)) != null ? _a : []);
22722
22929
  },
22723
- value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
22930
+ value,
22724
22931
  "aria-readonly": readOnly,
22725
22932
  styles: {
22726
22933
  menu(base) {
@@ -22737,13 +22944,13 @@ var FilterMultiChoiceEditor = ({
22737
22944
  var FilterSingleChoiceEditor = ({
22738
22945
  options,
22739
22946
  value,
22740
- disabled: disabled2,
22947
+ isDisabled,
22741
22948
  readOnly,
22742
22949
  onChange,
22743
22950
  valueTestId
22744
22951
  }) => {
22745
22952
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
22746
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
22953
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22747
22954
  InputComboBox,
22748
22955
  {
22749
22956
  placeholder: "Type to search...",
@@ -22753,8 +22960,8 @@ var FilterSingleChoiceEditor = ({
22753
22960
  var _a;
22754
22961
  return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
22755
22962
  },
22756
- isDisabled: disabled2,
22757
- value: options == null ? void 0 : options.find((option) => option.value === value),
22963
+ isDisabled,
22964
+ value,
22758
22965
  "aria-readonly": readOnly,
22759
22966
  styles: {
22760
22967
  menu(base) {
@@ -22769,18 +22976,18 @@ var FilterSingleChoiceEditor = ({
22769
22976
  ) });
22770
22977
  };
22771
22978
  var CustomOptions = ({ label, value }) => {
22772
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(StatusBullet, { status: label, message: value });
22979
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(StatusBullet, { status: label, message: value });
22773
22980
  };
22774
22981
  var StatusMultiEditor = ({
22775
22982
  options,
22776
22983
  value,
22777
- disabled: disabled2,
22984
+ isDisabled,
22778
22985
  readOnly,
22779
22986
  onChange,
22780
22987
  valueTestId
22781
22988
  }) => {
22782
22989
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
22783
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
22990
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22784
22991
  InputComboBox,
22785
22992
  {
22786
22993
  options,
@@ -22790,8 +22997,9 @@ var StatusMultiEditor = ({
22790
22997
  return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
22791
22998
  },
22792
22999
  formatOptionLabel: CustomOptions,
22793
- value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
22794
- isDisabled: disabled2,
23000
+ value,
23001
+ isDisabled,
23002
+ "aria-readonly": readOnly,
22795
23003
  styles: {
22796
23004
  menu(base) {
22797
23005
  return {
@@ -22807,13 +23015,13 @@ var StatusMultiEditor = ({
22807
23015
  var StatusSingleEditor = ({
22808
23016
  options,
22809
23017
  value,
22810
- disabled: disabled2,
23018
+ isDisabled,
22811
23019
  readOnly,
22812
23020
  onChange,
22813
23021
  valueTestId
22814
23022
  }) => {
22815
23023
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
22816
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23024
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22817
23025
  InputComboBox,
22818
23026
  {
22819
23027
  options,
@@ -22822,8 +23030,9 @@ var StatusSingleEditor = ({
22822
23030
  return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
22823
23031
  },
22824
23032
  formatOptionLabel: CustomOptions,
22825
- value: options == null ? void 0 : options.find((option) => option.value === value),
22826
- isDisabled: disabled2,
23033
+ value,
23034
+ isDisabled,
23035
+ "aria-readonly": readOnly,
22827
23036
  styles: {
22828
23037
  menu(base) {
22829
23038
  return {
@@ -22836,15 +23045,9 @@ var StatusSingleEditor = ({
22836
23045
  }
22837
23046
  ) });
22838
23047
  };
22839
- var TextEditor = ({
22840
- onChange,
22841
- ariaLabel,
22842
- value,
22843
- readOnly,
22844
- valueTestId
22845
- }) => {
22846
- (0, import_react_use3.useDebounce)(() => onChange, 500, [value]);
22847
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23048
+ var TextEditor = ({ onChange, ariaLabel, value, readOnly, valueTestId }) => {
23049
+ (0, import_react_use4.useDebounce)(() => onChange, 500, [value]);
23050
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22848
23051
  Input,
22849
23052
  {
22850
23053
  showLabel: false,
@@ -22865,10 +23068,10 @@ var NumberRangeEditor = ({
22865
23068
  readOnly,
22866
23069
  valueTestId
22867
23070
  }) => {
22868
- const [minValue, setMinValue] = (0, import_react141.useState)("");
22869
- const [maxValue, setMaxValue] = (0, import_react141.useState)("");
22870
- const [error, setError] = (0, import_react141.useState)("");
22871
- (0, import_react141.useEffect)(() => {
23071
+ const [minValue, setMinValue] = (0, import_react143.useState)("");
23072
+ const [maxValue, setMaxValue] = (0, import_react143.useState)("");
23073
+ const [error, setError] = (0, import_react143.useState)("");
23074
+ (0, import_react143.useEffect)(() => {
22872
23075
  if (!maxValue && !minValue) {
22873
23076
  return;
22874
23077
  }
@@ -22887,9 +23090,9 @@ var NumberRangeEditor = ({
22887
23090
  setError("");
22888
23091
  onChange([minValue, maxValue]);
22889
23092
  }, [maxValue, minValue, setError]);
22890
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
22891
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
22892
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23093
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
23094
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
23095
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22893
23096
  Input,
22894
23097
  {
22895
23098
  label: `${ariaLabel}-min`,
@@ -22904,7 +23107,7 @@ var NumberRangeEditor = ({
22904
23107
  readOnly
22905
23108
  }
22906
23109
  ),
22907
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23110
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22908
23111
  Input,
22909
23112
  {
22910
23113
  type: "number",
@@ -22920,7 +23123,7 @@ var NumberRangeEditor = ({
22920
23123
  }
22921
23124
  )
22922
23125
  ] }),
22923
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(ErrorContainer, { errorMessage: error })
23126
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ErrorContainer, { errorMessage: error })
22924
23127
  ] });
22925
23128
  };
22926
23129
  var NumberEditor = ({
@@ -22931,7 +23134,7 @@ var NumberEditor = ({
22931
23134
  readOnly,
22932
23135
  valueTestId
22933
23136
  }) => {
22934
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23137
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22935
23138
  Input,
22936
23139
  {
22937
23140
  label: ariaLabel,
@@ -22954,7 +23157,7 @@ var DateEditor = ({
22954
23157
  readOnly,
22955
23158
  valueTestId
22956
23159
  }) => {
22957
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23160
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22958
23161
  Input,
22959
23162
  {
22960
23163
  type: "date",
@@ -22976,10 +23179,10 @@ var DateRangeEditor = ({
22976
23179
  readOnly,
22977
23180
  valueTestId
22978
23181
  }) => {
22979
- const [minDateValue, setMinDateValue] = (0, import_react141.useState)(value ? value[0] : "");
22980
- const [maxDateValue, setMaxDateValue] = (0, import_react141.useState)(value ? value[1] : "");
22981
- const [error, setError] = (0, import_react141.useState)("");
22982
- (0, import_react141.useEffect)(() => {
23182
+ const [minDateValue, setMinDateValue] = (0, import_react143.useState)(value ? value[0] : "");
23183
+ const [maxDateValue, setMaxDateValue] = (0, import_react143.useState)(value ? value[1] : "");
23184
+ const [error, setError] = (0, import_react143.useState)("");
23185
+ (0, import_react143.useEffect)(() => {
22983
23186
  if (!minDateValue || !maxDateValue) {
22984
23187
  return;
22985
23188
  }
@@ -23010,9 +23213,9 @@ var DateRangeEditor = ({
23010
23213
  setError("");
23011
23214
  onChange([minDateValue, maxDateValue]);
23012
23215
  }, [minDateValue, maxDateValue, setError]);
23013
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
23014
- /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
23015
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23216
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
23217
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
23218
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23016
23219
  Input,
23017
23220
  {
23018
23221
  label: `${ariaLabel}-min-date`,
@@ -23025,7 +23228,7 @@ var DateRangeEditor = ({
23025
23228
  readOnly
23026
23229
  }
23027
23230
  ),
23028
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23231
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23029
23232
  Input,
23030
23233
  {
23031
23234
  label: `${ariaLabel}-max-date`,
@@ -23039,19 +23242,18 @@ var DateRangeEditor = ({
23039
23242
  }
23040
23243
  )
23041
23244
  ] }),
23042
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(ErrorContainer, { errorMessage: error })
23245
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ErrorContainer, { errorMessage: error })
23043
23246
  ] });
23044
23247
  };
23045
23248
  var FilterEditorRenderer = ({ editorType, ...props }) => {
23046
- const { filterMapper: contextFilterMapper } = useSearchAndFilter();
23047
- const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
23249
+ const Editor = filterMapper[editorType];
23048
23250
  if (!Editor) {
23049
23251
  return null;
23050
23252
  }
23051
23253
  if (editorType === "empty") {
23052
23254
  return null;
23053
23255
  }
23054
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Editor, { ...props });
23256
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Editor, { ...props, disabled: props.isDisabled });
23055
23257
  };
23056
23258
  var filterMapper = {
23057
23259
  multiChoice: FilterMultiChoiceEditor,
@@ -23066,14 +23268,14 @@ var filterMapper = {
23066
23268
  empty: null
23067
23269
  };
23068
23270
  var ErrorContainer = ({ errorMessage }) => {
23069
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
23271
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23070
23272
  "div",
23071
23273
  {
23072
23274
  css: {
23073
23275
  gridColumn: "span 6",
23074
23276
  order: 6
23075
23277
  },
23076
- children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(FieldMessage, { errorMessage })
23278
+ children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(FieldMessage, { errorMessage })
23077
23279
  }
23078
23280
  );
23079
23281
  };
@@ -23083,235 +23285,13 @@ var twoColumnGrid = {
23083
23285
  gap: "var(--spacing-sm);"
23084
23286
  };
23085
23287
 
23086
- // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
23087
- var import_jsx_runtime121 = require("@emotion/react/jsx-runtime");
23088
- var SearchAndFilterContext = (0, import_react142.createContext)({
23089
- searchTerm: "",
23090
- setSearchTerm: () => {
23091
- },
23092
- filterVisibility: void 0,
23093
- setFilterVisibility: () => {
23094
- },
23095
- filters: [],
23096
- setFilters: () => {
23097
- },
23098
- handleAddFilter: () => {
23099
- },
23100
- handleResetFilters: () => {
23101
- },
23102
- handleDeleteFilter: () => {
23103
- },
23104
- setSortBy: () => {
23105
- },
23106
- sortByValue: "",
23107
- filterOptions: [],
23108
- sortOptions: [],
23109
- validFilterQuery: [],
23110
- filterMapper: {},
23111
- totalResults: 0
23112
- });
23113
- var SearchAndFilterProvider = ({
23114
- filters,
23115
- filterOptions,
23116
- sortOptions,
23117
- defaultSortByValue,
23118
- filterMode: filterMode3 = void 0,
23119
- onSearchChange,
23120
- onChange,
23121
- onSortChange,
23122
- resetFilterValues = [],
23123
- totalResults,
23124
- filterMapper: filterMapper2 = filterMapper,
23125
- children
23126
- }) => {
23127
- const [searchTerm, setSearchTerm] = (0, import_react142.useState)("");
23128
- const deferredSearchTerm = (0, import_react142.useDeferredValue)(searchTerm);
23129
- const [filterVisibility, setFilterVisibility] = (0, import_react142.useState)(filterMode3);
23130
- const [sortByValue, setSortByValue] = (0, import_react142.useState)(defaultSortByValue);
23131
- const handleSearchTerm = (0, import_react142.useCallback)(
23132
- (term) => {
23133
- setSearchTerm(term);
23134
- onSearchChange == null ? void 0 : onSearchChange(term);
23135
- },
23136
- [setSearchTerm, onSearchChange]
23137
- );
23138
- const handleOnSortChange = (0, import_react142.useCallback)(
23139
- (sort) => {
23140
- setSortByValue(sort);
23141
- onSortChange(sort);
23142
- },
23143
- [onSortChange]
23144
- );
23145
- const handleToggleFilterVisibilty = (0, import_react142.useCallback)(
23146
- (mode) => setFilterVisibility(mode),
23147
- [setFilterVisibility]
23148
- );
23149
- const handleAddFilter = (0, import_react142.useCallback)(() => {
23150
- onChange([...filters, { field: "", operator: "", value: "" }]);
23151
- }, [filters, onChange]);
23152
- const handleResetFilters = (0, import_react142.useCallback)(() => {
23153
- onChange(resetFilterValues);
23154
- }, [onChange, resetFilterValues]);
23155
- const handleDeleteFilter = (0, import_react142.useCallback)(
23156
- (index) => {
23157
- const remainingFilters = filters.filter((_, i) => i !== index);
23158
- onChange(remainingFilters);
23159
- },
23160
- [filters, onChange]
23161
- );
23162
- const validFilterQuery = (0, import_react142.useMemo)(() => {
23163
- const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
23164
- if (hasValidFilters) {
23165
- return filters;
23166
- }
23167
- }, [filters]);
23168
- (0, import_react142.useEffect)(() => {
23169
- if (filterVisibility) {
23170
- const handleEscKeyFilterClose = (e) => {
23171
- if (e.key === "Escape") {
23172
- setFilterVisibility(void 0);
23173
- }
23174
- };
23175
- document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
23176
- return () => {
23177
- document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
23178
- };
23179
- }
23180
- }, [filterVisibility]);
23181
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
23182
- SearchAndFilterContext.Provider,
23183
- {
23184
- value: {
23185
- searchTerm: deferredSearchTerm,
23186
- setSearchTerm: (e) => handleSearchTerm(e),
23187
- setSortBy: (e) => handleOnSortChange(e),
23188
- sortByValue,
23189
- filterVisibility,
23190
- setFilterVisibility: (e) => handleToggleFilterVisibilty(e),
23191
- filters,
23192
- setFilters: (e) => onChange(e),
23193
- handleAddFilter,
23194
- handleResetFilters,
23195
- handleDeleteFilter,
23196
- filterOptions,
23197
- sortOptions,
23198
- validFilterQuery,
23199
- totalResults,
23200
- filterMapper: filterMapper2
23201
- },
23202
- children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(VerticalRhythm, { children })
23203
- }
23204
- );
23205
- };
23206
- var useSearchAndFilter = () => {
23207
- const value = (0, import_react142.useContext)(SearchAndFilterContext);
23208
- return { ...value };
23209
- };
23210
-
23211
- // src/components/SearchAndFilter/FilterControls.tsx
23212
- var import_jsx_runtime122 = require("@emotion/react/jsx-runtime");
23213
- var FilterControls = ({
23214
- children,
23215
- defaultSortByValue,
23216
- hideSearchInput
23217
- }) => {
23218
- var _a, _b, _c;
23219
- const {
23220
- setFilterVisibility,
23221
- filterVisibility,
23222
- setSearchTerm,
23223
- validFilterQuery,
23224
- searchTerm,
23225
- sortByValue,
23226
- filterOptions
23227
- } = useSearchAndFilter();
23228
- const [initialSortValue, setInitialSortValue] = (0, import_react143.useState)(sortByValue);
23229
- const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react143.useState)("");
23230
- const [userHasChangedSortByValue, setUserHasChangedSortByValue] = (0, import_react143.useState)(false);
23231
- (0, import_react_use4.useDebounce)(
23232
- () => {
23233
- setSearchTerm(localeSearchTerm);
23234
- },
23235
- 300,
23236
- [localeSearchTerm, searchTerm]
23237
- );
23238
- (0, import_react143.useEffect)(() => {
23239
- if (searchTerm === "") {
23240
- setLocaleSearchTerm("");
23241
- }
23242
- }, [searchTerm]);
23243
- const handleFilterToggle = (mode) => {
23244
- if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
23245
- return setFilterVisibility(void 0);
23246
- }
23247
- return setFilterVisibility(mode);
23248
- };
23249
- const sortValue = (sortByValue != null ? sortByValue : defaultSortByValue).split("_");
23250
- const sortDirection = sortValue == null ? void 0 : sortValue.pop();
23251
- const sortField = sortValue == null ? void 0 : sortValue.join("_");
23252
- const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
23253
- const sortByValueLabel = (_c = (_b = (_a = filterOptions == null ? void 0 : filterOptions.find((op) => op.value === sortOn)) == null ? void 0 : _a.options) == null ? void 0 : _b.find((f) => f.value === sortField)) == null ? void 0 : _c.label;
23254
- const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
23255
- (0, import_react_use4.useEffectOnce)(() => {
23256
- setInitialSortValue(sortByValue);
23257
- });
23258
- (0, import_react143.useEffect)(() => {
23259
- if (initialSortValue !== sortByValue) {
23260
- setUserHasChangedSortByValue(true);
23261
- }
23262
- }, [initialSortValue, sortByValue]);
23263
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
23264
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23265
- FilterButton2,
23266
- {
23267
- "aria-controls": "search-and-filter-options",
23268
- "aria-label": "filter options",
23269
- "aria-haspopup": "true",
23270
- "aria-expanded": filterVisibility === "filters",
23271
- filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
23272
- onClick: () => handleFilterToggle("filters"),
23273
- dataTestId: "filters-button"
23274
- }
23275
- ),
23276
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23277
- FilterButton2,
23278
- {
23279
- "aria-controls": "search-and-filter-sortBy",
23280
- "aria-label": "sort by options",
23281
- "aria-haspopup": "true",
23282
- text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
23283
- icon: sortByIcon,
23284
- "aria-expanded": filterVisibility === "sort",
23285
- hasSelectedValue: sortByValue !== "",
23286
- onClick: () => handleFilterToggle("sort"),
23287
- dataTestId: "sort-by-button"
23288
- }
23289
- ),
23290
- hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
23291
- InputKeywordSearch,
23292
- {
23293
- placeholder: "Search...",
23294
- onSearchTextChanged: (e) => setLocaleSearchTerm(e),
23295
- value: localeSearchTerm,
23296
- compact: true,
23297
- rounded: true,
23298
- css: SearchInput
23299
- }
23300
- ),
23301
- children
23302
- ] });
23303
- };
23304
-
23305
- // src/components/SearchAndFilter/FilterItem.tsx
23306
- init_emotion_jsx_shim();
23307
- var import_react145 = require("react");
23308
-
23309
23288
  // src/components/SearchAndFilter/FilterMenu.tsx
23310
23289
  init_emotion_jsx_shim();
23311
23290
  var import_react144 = __toESM(require("react"));
23312
23291
  var import_jsx_runtime123 = require("@emotion/react/jsx-runtime");
23313
23292
  var SearchAndFilterOptionsContainer2 = ({
23314
23293
  buttonRow,
23294
+ sortControls,
23315
23295
  children
23316
23296
  }) => {
23317
23297
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
@@ -23325,17 +23305,20 @@ var SearchAndFilterOptionsContainer2 = ({
23325
23305
  justify: "space-between",
23326
23306
  children: buttonRow
23327
23307
  }
23328
- ) : null
23308
+ ) : null,
23309
+ sortControls ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { children: sortControls }) : null
23329
23310
  ] });
23330
23311
  };
23331
23312
  var FilterMenu = ({
23332
23313
  id,
23333
23314
  filterTitle = "Show results",
23334
23315
  menuControls,
23316
+ sortControls,
23335
23317
  children,
23336
- dataTestId
23318
+ dataTestId,
23319
+ resetButtonText = "reset"
23337
23320
  }) => {
23338
- const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
23321
+ const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
23339
23322
  const innerMenuRef = import_react144.default.useRef(null);
23340
23323
  (0, import_react144.useEffect)(() => {
23341
23324
  var _a;
@@ -23343,258 +23326,40 @@ var FilterMenu = ({
23343
23326
  (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
23344
23327
  }
23345
23328
  }, [filterVisibility]);
23346
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, children: [
23347
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
23348
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23349
- "button",
23350
- {
23351
- type: "button",
23352
- "aria-label": "close filters",
23353
- css: [CloseBtn],
23354
- onClick: () => setFilterVisibility(void 0),
23355
- "data-testid": "close-filters",
23356
- children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
23357
- }
23358
- ),
23359
- children
23360
- ] }) : null });
23361
- };
23362
-
23363
- // src/components/SearchAndFilter/FilterItem.tsx
23364
- var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
23365
- var FilterItem = ({
23366
- index,
23367
- paramOptions,
23368
- operatorOptions,
23369
- valueOptions,
23370
- onParamChange,
23371
- onOperatorChange,
23372
- onValueChange
23373
- }) => {
23374
- var _a, _b;
23375
- const { filters, handleDeleteFilter, filterOptions } = useSearchAndFilter();
23376
- const label = filters[index].field !== "" ? filters[index].field : "unknown filter field";
23377
- const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
23378
- const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
23379
- const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
23380
- const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react145.useMemo)(() => {
23381
- var _a2;
23382
- const currentSelectedFilter = filterOptions.find((item) => {
23383
- var _a3;
23384
- return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
23385
- });
23386
- const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
23387
- return filters[index].field === item.value;
23388
- });
23389
- const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
23390
- const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
23391
- return filters[index].operator === item.value;
23392
- });
23393
- return {
23394
- selectedFieldValue: selectedFieldValue2,
23395
- selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
23396
- selectedMetaValue: filters[index].value,
23397
- readOnly: isCurrentFieldReadOnly,
23398
- bindable: selectedFieldValue2 == null ? void 0 : selectedFieldValue2.bindable
23399
- };
23400
- }, [filters, filterOptions, index, operatorOptions]);
23401
- const readOnlyProps = readOnly ? {
23402
- "aria-readonly": true,
23403
- isSearchable: false,
23404
- menuIsOpen: false,
23405
- isClearable: false
23406
- } : {};
23407
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
23408
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { children: index === 0 ? "Where" : "and" }),
23409
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("div", { css: ConditionalInputRow, children: [
23410
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23411
- InputComboBox,
23412
- {
23413
- "aria-label": label,
23414
- options: paramOptions,
23415
- onChange: (e) => {
23416
- var _a2;
23417
- onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
23418
- },
23419
- isOptionDisabled: (option) => {
23420
- var _a2;
23421
- return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
23422
- },
23423
- styles: {
23424
- menu(base) {
23425
- return {
23426
- ...base,
23427
- minWidth: "max-content"
23428
- };
23429
- }
23430
- },
23431
- value: selectedFieldValue,
23432
- ...readOnlyProps,
23433
- id: "filter-field"
23434
- }
23435
- ),
23436
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23437
- InputComboBox,
23438
- {
23439
- "aria-label": operatorLabel,
23440
- options: operatorOptions,
23441
- onChange: (e) => {
23442
- var _a2;
23443
- return onOperatorChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
23444
- },
23445
- isDisabled: !filters[index].field,
23446
- value: selectedOperatorValue,
23447
- styles: {
23448
- menu(base) {
23449
- return {
23450
- ...base,
23451
- minWidth: "max-content"
23452
- };
23453
- }
23454
- },
23455
- ...readOnlyProps,
23456
- id: "filter-operator"
23457
- }
23458
- ),
23459
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23460
- FilterEditorRenderer,
23461
- {
23462
- "aria-label": metaDataLabel,
23463
- editorType: metaDataPossibleOptions,
23464
- options: valueOptions,
23465
- onChange: (e) => onValueChange(e != null ? e : ""),
23466
- readOnly,
23467
- bindable,
23468
- disabled: !filters[index].operator,
23469
- value: selectedMetaValue,
23470
- valueTestId: "filter-value"
23471
- }
23472
- ),
23473
- readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23329
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, sortControls, children: [
23330
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
23331
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
23332
+ (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23474
23333
  "button",
23475
23334
  {
23476
23335
  type: "button",
23477
- onClick: () => handleDeleteFilter(index),
23478
- "aria-label": "delete filter",
23479
- css: IconBtn,
23480
- "data-testid": "delete-filter",
23481
- children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
23482
- }
23483
- )
23484
- ] })
23485
- ] });
23486
- };
23487
- var FilterItems = ({
23488
- addButtonText = "add condition",
23489
- resetButtonText = "reset filters"
23490
- }) => {
23491
- const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
23492
- const handleUpdateFilter = (index, prop, value) => {
23493
- var _a, _b, _c, _d, _e;
23494
- const next = [...filters];
23495
- next[index] = { ...next[index], [prop]: value };
23496
- if (prop === "operator") {
23497
- if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
23498
- next[index].value = next[index].value[0];
23499
- }
23500
- if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
23501
- next[index].value = [next[index].value, ""];
23502
- }
23503
- if (value === "def" || value === "true") {
23504
- next[index].value = "true";
23505
- }
23506
- if (value === "ndef" || value === "false") {
23507
- next[index].value = "false";
23508
- }
23509
- }
23510
- if (prop === "field") {
23511
- const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
23512
- var _a2;
23513
- return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
23514
- })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((op) => op.value === next[index].field)) == null ? void 0 : _c.operatorOptions) == null ? void 0 : _d[0].value) != null ? _e : "eq";
23515
- next[index].operator = firstOperatorInAvailableOperators;
23516
- next[index].value = "";
23517
- }
23518
- setFilters(next);
23519
- };
23520
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23521
- FilterMenu,
23522
- {
23523
- id: "search-and-filter-options",
23524
- dataTestId: "search-and-filter-options",
23525
- menuControls: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
23526
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
23527
- "button",
23528
- {
23529
- type: "button",
23530
- css: AddConditionalBtn,
23531
- onClick: handleAddFilter,
23532
- "data-testid": "add-filter",
23533
- children: [
23534
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
23535
- addButtonText
23536
- ]
23537
- }
23538
- ),
23539
- (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23540
- "button",
23541
- {
23542
- type: "button",
23543
- css: ResetConditionsBtn,
23544
- onClick: () => {
23545
- handleResetFilters();
23546
- setFilterVisibility(void 0);
23547
- },
23548
- "data-testid": "reset-filters",
23549
- children: resetButtonText
23550
- }
23551
- ) : null
23552
- ] }),
23553
- children: filters.map((item, i) => {
23554
- var _a, _b, _c, _d, _e, _f;
23555
- const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
23556
- var _a2;
23557
- return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
23558
- })) == null ? void 0 : _a.options) != null ? _b : [];
23559
- const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
23560
- const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
23561
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23562
- FilterItem,
23563
- {
23564
- index: i,
23565
- paramOptions: filterOptions,
23566
- onParamChange: (e) => handleUpdateFilter(i, "field", e),
23567
- operatorOptions: possibleOperators,
23568
- onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
23569
- onValueChange: (e) => handleUpdateFilter(i, "value", e),
23570
- valueOptions: possibleValueOptions
23336
+ css: ResetConditionsBtn,
23337
+ onClick: () => {
23338
+ handleResetFilters();
23339
+ setFilterVisibility(false);
23571
23340
  },
23572
- i
23573
- );
23574
- })
23575
- }
23576
- );
23341
+ "data-testid": "reset-filters",
23342
+ children: resetButtonText
23343
+ }
23344
+ ) : null
23345
+ ] }),
23346
+ children
23347
+ ] }) : null });
23577
23348
  };
23578
23349
 
23579
- // src/components/SearchAndFilter/SearchAndFilter.tsx
23580
- init_emotion_jsx_shim();
23581
-
23582
- // src/components/SearchAndFilter/FilterModeView.tsx
23583
- init_emotion_jsx_shim();
23584
-
23585
23350
  // src/components/SearchAndFilter/SortItems.tsx
23586
23351
  init_emotion_jsx_shim();
23587
23352
 
23588
23353
  // src/components/SegmentedControl/SegmentedControl.tsx
23589
23354
  init_emotion_jsx_shim();
23590
- var import_react147 = require("@emotion/react");
23355
+ var import_react146 = require("@emotion/react");
23591
23356
  var import_CgCheck5 = require("@react-icons/all-files/cg/CgCheck");
23592
- var import_react148 = require("react");
23357
+ var import_react147 = require("react");
23593
23358
 
23594
23359
  // src/components/SegmentedControl/SegmentedControl.styles.ts
23595
23360
  init_emotion_jsx_shim();
23596
- var import_react146 = require("@emotion/react");
23597
- var segmentedControlStyles = import_react146.css`
23361
+ var import_react145 = require("@emotion/react");
23362
+ var segmentedControlStyles = import_react145.css`
23598
23363
  --segmented-control-rounded-value: var(--rounded-base);
23599
23364
  --segmented-control-border-width: 1px;
23600
23365
  --segmented-control-selected-color: var(--brand-secondary-3);
@@ -23613,14 +23378,14 @@ var segmentedControlStyles = import_react146.css`
23613
23378
  border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
23614
23379
  font-size: var(--fs-xs);
23615
23380
  `;
23616
- var segmentedControlVerticalStyles = import_react146.css`
23381
+ var segmentedControlVerticalStyles = import_react145.css`
23617
23382
  flex-direction: column;
23618
23383
  --segmented-control-first-border-radius: var(--segmented-control-rounded-value)
23619
23384
  var(--segmented-control-rounded-value) 0 0;
23620
23385
  --segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
23621
23386
  var(--segmented-control-rounded-value);
23622
23387
  `;
23623
- var segmentedControlItemStyles = import_react146.css`
23388
+ var segmentedControlItemStyles = import_react145.css`
23624
23389
  &:first-of-type label {
23625
23390
  border-radius: var(--segmented-control-first-border-radius);
23626
23391
  }
@@ -23628,10 +23393,10 @@ var segmentedControlItemStyles = import_react146.css`
23628
23393
  border-radius: var(--segmented-control-last-border-radius);
23629
23394
  }
23630
23395
  `;
23631
- var segmentedControlInputStyles = import_react146.css`
23396
+ var segmentedControlInputStyles = import_react145.css`
23632
23397
  ${accessibleHidden}
23633
23398
  `;
23634
- var segmentedControlLabelStyles = (checked, disabled2) => import_react146.css`
23399
+ var segmentedControlLabelStyles = (checked, disabled2) => import_react145.css`
23635
23400
  position: relative;
23636
23401
  display: flex;
23637
23402
  align-items: center;
@@ -23698,23 +23463,23 @@ var segmentedControlLabelStyles = (checked, disabled2) => import_react146.css`
23698
23463
  `}
23699
23464
  }
23700
23465
  `;
23701
- var segmentedControlLabelIconOnlyStyles = import_react146.css`
23466
+ var segmentedControlLabelIconOnlyStyles = import_react145.css`
23702
23467
  padding-inline: 0.5em;
23703
23468
  `;
23704
- var segmentedControlLabelCheckStyles = import_react146.css`
23469
+ var segmentedControlLabelCheckStyles = import_react145.css`
23705
23470
  opacity: 0.5;
23706
23471
  `;
23707
- var segmentedControlLabelContentStyles = import_react146.css`
23472
+ var segmentedControlLabelContentStyles = import_react145.css`
23708
23473
  display: flex;
23709
23474
  align-items: center;
23710
23475
  justify-content: center;
23711
23476
  gap: var(--spacing-sm);
23712
23477
  height: 100%;
23713
23478
  `;
23714
- var segmentedControlLabelTextStyles = import_react146.css``;
23479
+ var segmentedControlLabelTextStyles = import_react145.css``;
23715
23480
 
23716
23481
  // src/components/SegmentedControl/SegmentedControl.tsx
23717
- var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
23482
+ var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
23718
23483
  var SegmentedControl = ({
23719
23484
  name,
23720
23485
  options,
@@ -23724,9 +23489,11 @@ var SegmentedControl = ({
23724
23489
  disabled: disabled2 = false,
23725
23490
  orientation = "horizontal",
23726
23491
  size = "md",
23492
+ hideOptionText = false,
23493
+ iconSize = "1.5em",
23727
23494
  ...props
23728
23495
  }) => {
23729
- const onOptionChange = (0, import_react148.useCallback)(
23496
+ const onOptionChange = (0, import_react147.useCallback)(
23730
23497
  (event) => {
23731
23498
  if (event.target.checked) {
23732
23499
  onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
@@ -23734,18 +23501,19 @@ var SegmentedControl = ({
23734
23501
  },
23735
23502
  [options, onChange]
23736
23503
  );
23737
- const sizeStyles = (0, import_react148.useMemo)(() => {
23504
+ const sizeStyles = (0, import_react147.useMemo)(() => {
23738
23505
  const map = {
23739
- sm: (0, import_react147.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
23740
- md: (0, import_react147.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
23741
- lg: (0, import_react147.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" })
23506
+ sm: (0, import_react146.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
23507
+ md: (0, import_react146.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
23508
+ lg: (0, import_react146.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" }),
23509
+ xl: (0, import_react146.css)({ height: "calc(48px - 2px)", fontSize: "var(--fs-base)" })
23742
23510
  };
23743
23511
  return map[size];
23744
23512
  }, [size]);
23745
- const isIconOnly = (0, import_react148.useMemo)(() => {
23513
+ const isIconOnly = (0, import_react147.useMemo)(() => {
23746
23514
  return options.every((option) => option && option.icon && !option.label);
23747
23515
  }, [options]);
23748
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23516
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23749
23517
  "div",
23750
23518
  {
23751
23519
  css: [segmentedControlStyles, orientation === "vertical" ? segmentedControlVerticalStyles : void 0],
@@ -23758,45 +23526,53 @@ var SegmentedControl = ({
23758
23526
  }
23759
23527
  const text = option.label ? option.label : option.icon ? null : String(option.value);
23760
23528
  const isDisabled = disabled2 || option.disabled;
23761
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { css: segmentedControlItemStyles, "data-testid": "container-segmented-control", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
23762
- "label",
23529
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23530
+ "div",
23763
23531
  {
23764
- css: [
23765
- segmentedControlLabelStyles(option.value === value, isDisabled),
23766
- sizeStyles,
23767
- isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
23768
- ],
23769
- children: [
23770
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23771
- "input",
23772
- {
23773
- css: segmentedControlInputStyles,
23774
- type: "radio",
23775
- name,
23776
- value: index,
23777
- checked: option.value === value,
23778
- onChange: onOptionChange,
23779
- disabled: isDisabled
23780
- }
23781
- ),
23782
- option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
23783
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
23784
- !option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { icon: option.icon, size: "1.5em", iconColor: "currentColor" }),
23785
- !text ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
23786
- ] })
23787
- ]
23532
+ css: segmentedControlItemStyles,
23533
+ "data-testid": option["data-testid"] ? option["data-testid"] : "container-segmented-control",
23534
+ children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
23535
+ "label",
23536
+ {
23537
+ css: [
23538
+ segmentedControlLabelStyles(option.value === value, isDisabled),
23539
+ sizeStyles,
23540
+ isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
23541
+ ],
23542
+ children: [
23543
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23544
+ "input",
23545
+ {
23546
+ css: segmentedControlInputStyles,
23547
+ type: "radio",
23548
+ name,
23549
+ value: index,
23550
+ checked: option.value === value,
23551
+ onChange: onOptionChange,
23552
+ disabled: isDisabled
23553
+ }
23554
+ ),
23555
+ option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
23556
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
23557
+ !option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { icon: option.icon, size: iconSize, iconColor: "currentColor" }),
23558
+ !text || hideOptionText ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
23559
+ ] })
23560
+ ]
23561
+ }
23562
+ )
23788
23563
  }
23789
- ) }) }, JSON.stringify(option.value));
23564
+ ) }, JSON.stringify(option.value));
23790
23565
  })
23791
23566
  }
23792
23567
  );
23793
23568
  };
23794
23569
 
23795
23570
  // src/components/SearchAndFilter/SortItems.tsx
23796
- var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
23797
- var SortItems = () => {
23571
+ var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
23572
+ var SortItems = ({ sortByLabel = "Sort by", localeLabel = "Locale returned" }) => {
23798
23573
  var _a, _b;
23799
- const { sortOptions, setSortBy, sortByValue } = useSearchAndFilter();
23574
+ const { sortOptions, setSortBy, sortByValue, localeValue, localeOptions, handleLocaleChange } = useSearchAndFilter();
23575
+ const hideLocaleOptions = !localeOptions;
23800
23576
  const values = sortByValue.split("_");
23801
23577
  const sortDirection = values.pop();
23802
23578
  const sortField = values.join("_");
@@ -23804,58 +23580,294 @@ var SortItems = () => {
23804
23580
  var _a2;
23805
23581
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
23806
23582
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
23807
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", dataTestId: "sorting-options", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { css: SortFilterInputRow, children: [
23808
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23809
- InputComboBox,
23810
- {
23811
- options: sortOptions,
23812
- onChange: (e) => {
23813
- const fieldName = e == null ? void 0 : e.value;
23814
- setSortBy(`${fieldName}_${sortDirection}`);
23815
- },
23816
- styles: {
23817
- menu(base) {
23818
- return {
23819
- ...base,
23820
- minWidth: "max-content"
23821
- };
23583
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
23584
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(VerticalRhythm, { gap: "xs", children: [
23585
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { css: Title, children: sortByLabel }),
23586
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: SortFilterInputRow, children: [
23587
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23588
+ InputComboBox,
23589
+ {
23590
+ id: "sort-by-field",
23591
+ "aria-label": "Sort by",
23592
+ options: sortOptions,
23593
+ onChange: (e) => {
23594
+ const fieldName = e == null ? void 0 : e.value;
23595
+ setSortBy(`${fieldName}_${sortDirection}`);
23596
+ },
23597
+ styles: {
23598
+ menu(base) {
23599
+ return {
23600
+ ...base,
23601
+ minWidth: "max-content"
23602
+ };
23603
+ }
23604
+ },
23605
+ value: currentSelectedOption
23822
23606
  }
23823
- },
23824
- value: currentSelectedOption,
23825
- id: "sort-by-field"
23826
- }
23827
- ),
23828
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23829
- SegmentedControl,
23830
- {
23831
- noCheckmark: true,
23832
- name: "sortBy",
23833
- options: [
23834
- { label: "Ascending", value: `ASC` },
23835
- { label: "Descending", value: `DESC` }
23836
- ],
23837
- onChange: (e) => setSortBy(`${sortField}_${e}`),
23838
- value: sortDirection,
23839
- "data-testid": "ordering-options"
23840
- }
23841
- )
23842
- ] }) });
23607
+ ),
23608
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23609
+ SegmentedControl,
23610
+ {
23611
+ noCheckmark: true,
23612
+ name: "sortBy",
23613
+ hideOptionText: true,
23614
+ iconSize: "1rem",
23615
+ size: "xl",
23616
+ options: [
23617
+ {
23618
+ label: "Ascending",
23619
+ icon: "arrow-up",
23620
+ value: `ASC`,
23621
+ tooltip: "Ascending (e.g. A-Z, newest to oldest)",
23622
+ "data-testid": "sort-ascending"
23623
+ },
23624
+ {
23625
+ label: "Descending",
23626
+ icon: "arrow-down",
23627
+ value: `DESC`,
23628
+ tooltip: "Descending (e.g. Z-A, oldest to newest)",
23629
+ "data-testid": "sort-descending"
23630
+ }
23631
+ ],
23632
+ onChange: (e) => setSortBy(`${sortField}_${e}`),
23633
+ value: sortDirection
23634
+ }
23635
+ )
23636
+ ] })
23637
+ ] }),
23638
+ hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(VerticalRhythm, { gap: "xs", children: [
23639
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { css: Title, children: localeLabel }),
23640
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23641
+ InputSelect,
23642
+ {
23643
+ name: "localeReturned",
23644
+ "aria-label": "Locale returned",
23645
+ label: "Locale returned",
23646
+ showLabel: false,
23647
+ "data-testid": "context-locale",
23648
+ onChange: (e) => {
23649
+ var _a2;
23650
+ return handleLocaleChange((_a2 = e.currentTarget.value) != null ? _a2 : "");
23651
+ },
23652
+ options: localeOptions,
23653
+ value: localeValue
23654
+ }
23655
+ )
23656
+ ] })
23657
+ ] });
23843
23658
  };
23844
23659
 
23845
- // src/components/SearchAndFilter/FilterModeView.tsx
23846
- var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
23847
- var FilterModeView = () => {
23848
- const { filterVisibility } = useSearchAndFilter();
23849
- const modeView = {
23850
- filters: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(FilterItems, {}),
23851
- sort: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(SortItems, {})
23660
+ // src/components/SearchAndFilter/FilterItem.tsx
23661
+ var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
23662
+ var FilterItem = ({
23663
+ index,
23664
+ paramOptions,
23665
+ operatorOptions,
23666
+ valueOptions,
23667
+ onParamChange,
23668
+ onOperatorChange,
23669
+ onValueChange
23670
+ }) => {
23671
+ var _a, _b;
23672
+ const { filters, handleDeleteFilter, filterOptions } = useSearchAndFilter();
23673
+ const label = filters[index].field !== "" ? filters[index].field : "unknown filter field";
23674
+ const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
23675
+ const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
23676
+ const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
23677
+ const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly } = (0, import_react148.useMemo)(() => {
23678
+ var _a2;
23679
+ const currentSelectedFilter = filterOptions.find((item) => {
23680
+ var _a3;
23681
+ return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
23682
+ });
23683
+ const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
23684
+ return filters[index].field === item.value;
23685
+ });
23686
+ const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
23687
+ const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
23688
+ return filters[index].operator === item.value;
23689
+ });
23690
+ const selectedMetaValue2 = valueOptions.filter((item) => {
23691
+ if (Array.isArray(filters[index].value) && item.value) {
23692
+ return filters[index].value.includes(item.value);
23693
+ }
23694
+ return filters[index].value === item.value;
23695
+ });
23696
+ return {
23697
+ selectedFieldValue: selectedFieldValue2,
23698
+ selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
23699
+ selectedMetaValue: selectedMetaValue2.length > 0 ? selectedMetaValue2 : filters[index].value,
23700
+ readOnly: isCurrentFieldReadOnly
23701
+ };
23702
+ }, [filters, filterOptions, index, operatorOptions, valueOptions]);
23703
+ const readOnlyProps = readOnly ? {
23704
+ "aria-readonly": true,
23705
+ isSearchable: false,
23706
+ menuIsOpen: false,
23707
+ isClearable: false
23708
+ } : {};
23709
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
23710
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: index === 0 ? "Where" : "and" }),
23711
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { css: ConditionalInputRow, children: [
23712
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23713
+ InputComboBox,
23714
+ {
23715
+ "aria-label": label,
23716
+ options: paramOptions,
23717
+ onChange: (e) => {
23718
+ var _a2;
23719
+ onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
23720
+ },
23721
+ isOptionDisabled: (option) => {
23722
+ var _a2;
23723
+ return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
23724
+ },
23725
+ styles: {
23726
+ menu(base) {
23727
+ return {
23728
+ ...base,
23729
+ minWidth: "max-content"
23730
+ };
23731
+ }
23732
+ },
23733
+ value: selectedFieldValue,
23734
+ ...readOnlyProps,
23735
+ id: "filter-field",
23736
+ name: `filter-field-${index}`
23737
+ }
23738
+ ),
23739
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23740
+ InputComboBox,
23741
+ {
23742
+ "aria-label": operatorLabel,
23743
+ options: operatorOptions,
23744
+ onChange: (e) => {
23745
+ var _a2;
23746
+ return onOperatorChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
23747
+ },
23748
+ isDisabled: !filters[index].field,
23749
+ value: selectedOperatorValue,
23750
+ styles: {
23751
+ menu(base) {
23752
+ return {
23753
+ ...base,
23754
+ minWidth: "max-content"
23755
+ };
23756
+ }
23757
+ },
23758
+ ...readOnlyProps,
23759
+ id: "filter-operator",
23760
+ name: `filter-operator-${index}`
23761
+ }
23762
+ ),
23763
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23764
+ FilterEditorRenderer,
23765
+ {
23766
+ "aria-label": metaDataLabel,
23767
+ editorType: metaDataPossibleOptions,
23768
+ options: valueOptions,
23769
+ onChange: (e) => onValueChange(e != null ? e : ""),
23770
+ readOnly,
23771
+ isDisabled: !filters[index].operator,
23772
+ value: selectedMetaValue,
23773
+ valueTestId: "filter-value"
23774
+ }
23775
+ ),
23776
+ readOnly || index === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23777
+ "button",
23778
+ {
23779
+ type: "button",
23780
+ onClick: () => handleDeleteFilter(index),
23781
+ "aria-label": "delete filter",
23782
+ css: IconBtn,
23783
+ "data-testid": "delete-filter",
23784
+ children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
23785
+ }
23786
+ )
23787
+ ] })
23788
+ ] });
23789
+ };
23790
+ var FilterItems = ({ addButtonText = "add condition" }) => {
23791
+ const { filterOptions, filters, setFilters, handleAddFilter } = useSearchAndFilter();
23792
+ const handleUpdateFilter = (index, prop, value) => {
23793
+ var _a, _b, _c, _d, _e;
23794
+ const next = [...filters];
23795
+ next[index] = { ...next[index], [prop]: value };
23796
+ if (prop === "operator") {
23797
+ if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
23798
+ next[index].value = next[index].value[0];
23799
+ }
23800
+ if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
23801
+ next[index].value = [next[index].value, ""];
23802
+ }
23803
+ if (value === "def" || value === "true") {
23804
+ next[index].value = "true";
23805
+ }
23806
+ if (value === "ndef" || value === "false") {
23807
+ next[index].value = "false";
23808
+ }
23809
+ }
23810
+ if (prop === "field") {
23811
+ const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
23812
+ var _a2;
23813
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
23814
+ })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((op) => op.value === next[index].field)) == null ? void 0 : _c.operatorOptions) == null ? void 0 : _d[0].value) != null ? _e : "eq";
23815
+ next[index].operator = firstOperatorInAvailableOperators;
23816
+ next[index].value = "";
23817
+ }
23818
+ setFilters(next);
23852
23819
  };
23853
- return filterVisibility ? modeView[filterVisibility] : null;
23820
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23821
+ FilterMenu,
23822
+ {
23823
+ id: "search-and-filter-options",
23824
+ dataTestId: "search-and-filter-options",
23825
+ menuControls: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
23826
+ "button",
23827
+ {
23828
+ type: "button",
23829
+ css: AddConditionalBtn,
23830
+ onClick: handleAddFilter,
23831
+ "data-testid": "add-filter",
23832
+ children: [
23833
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
23834
+ addButtonText
23835
+ ]
23836
+ }
23837
+ ),
23838
+ sortControls: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(SortItems, {}),
23839
+ children: filters.map((item, i) => {
23840
+ var _a, _b, _c, _d, _e, _f;
23841
+ const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
23842
+ var _a2;
23843
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
23844
+ })) == null ? void 0 : _a.options) != null ? _b : [];
23845
+ const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
23846
+ const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
23847
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23848
+ FilterItem,
23849
+ {
23850
+ index: i,
23851
+ paramOptions: filterOptions,
23852
+ onParamChange: (e) => handleUpdateFilter(i, "field", e),
23853
+ operatorOptions: possibleOperators,
23854
+ onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
23855
+ onValueChange: (e) => handleUpdateFilter(i, "value", e),
23856
+ valueOptions: possibleValueOptions
23857
+ },
23858
+ i
23859
+ );
23860
+ })
23861
+ }
23862
+ );
23854
23863
  };
23855
23864
 
23865
+ // src/components/SearchAndFilter/SearchAndFilter.tsx
23866
+ init_emotion_jsx_shim();
23867
+
23856
23868
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
23857
23869
  init_emotion_jsx_shim();
23858
- var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
23870
+ var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
23859
23871
  var SearchAndFilterResultContainer = ({
23860
23872
  buttonText,
23861
23873
  clearButtonLabel = "clear",
@@ -23889,47 +23901,49 @@ var SearchAndFilterResultContainer = ({
23889
23901
  if (totalResults && totalResults > 0) {
23890
23902
  return null;
23891
23903
  }
23892
- return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
23893
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(HorizontalRhythm, { children: [
23894
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("span", { children: [
23904
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
23905
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(HorizontalRhythm, { children: [
23906
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { children: [
23895
23907
  totalResults,
23896
23908
  " results ",
23897
23909
  searchTerm ? `for "${searchTerm}"` : null
23898
23910
  ] }),
23899
- !searchTerm ? null : /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23911
+ !searchTerm ? null : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23900
23912
  ] }),
23901
- totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
23902
- calloutText ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Paragraph, { children: calloutText }) : null,
23903
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
23913
+ totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
23914
+ calloutText ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Paragraph, { children: calloutText }) : null,
23915
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
23904
23916
  ] }) : null
23905
23917
  ] });
23906
23918
  };
23907
23919
 
23908
23920
  // src/components/SearchAndFilter/SearchAndFilter.tsx
23909
- var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
23921
+ var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
23910
23922
  var SearchAndFilter = ({
23911
23923
  filters,
23912
23924
  filterOptions,
23913
- filterMode: filterMode3,
23925
+ filterVisible,
23914
23926
  sortOptions,
23915
23927
  defaultSortByValue,
23916
23928
  filterControls,
23917
23929
  viewSwitchControls,
23918
- resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SearchAndFilterResultContainer, {}),
23919
- children = /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(FilterModeView, {}),
23920
- filterMapper: filterMapper2 = filterMapper,
23930
+ resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(SearchAndFilterResultContainer, {}),
23931
+ children = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterItems, {}),
23921
23932
  onChange,
23922
23933
  onSearchChange,
23923
23934
  onSortChange,
23935
+ onLocaleChange,
23924
23936
  totalResults,
23925
- resetFilterValues = []
23937
+ resetFilterValues = [],
23938
+ defaultLocale,
23939
+ localeOptions
23926
23940
  }) => {
23927
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23941
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
23928
23942
  SearchAndFilterProvider,
23929
23943
  {
23930
23944
  filters,
23931
23945
  filterOptions,
23932
- filterMode: filterMode3,
23946
+ filterVisible,
23933
23947
  defaultSortByValue,
23934
23948
  sortOptions,
23935
23949
  onChange,
@@ -23937,16 +23951,18 @@ var SearchAndFilter = ({
23937
23951
  onSortChange,
23938
23952
  totalResults,
23939
23953
  resetFilterValues,
23940
- filterMapper: filterMapper2,
23941
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
23942
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
23943
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23954
+ defaultLocale,
23955
+ localeOptions,
23956
+ onLocaleChange,
23957
+ children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
23958
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
23959
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
23944
23960
  "div",
23945
23961
  {
23946
23962
  css: SearchAndFilterControlsWrapper(
23947
- viewSwitchControls ? "auto auto 1fr 0.5fr" : "auto auto 1fr"
23963
+ viewSwitchControls ? "auto 1fr 0.05fr" : "auto auto 1fr"
23948
23964
  ),
23949
- children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(FilterControls, { hideSearchInput: !onSearchChange, defaultSortByValue }) : filterControls
23965
+ children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
23950
23966
  }
23951
23967
  ),
23952
23968
  viewSwitchControls
@@ -23962,7 +23978,7 @@ var SearchAndFilter = ({
23962
23978
  init_emotion_jsx_shim();
23963
23979
  var import_react149 = require("react");
23964
23980
  var import_react_use5 = require("react-use");
23965
- var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
23981
+ var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
23966
23982
  var SearchOnlyContext = (0, import_react149.createContext)({
23967
23983
  searchTerm: "",
23968
23984
  setSearchTerm: () => {
@@ -23979,14 +23995,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
23979
23995
  300,
23980
23996
  [localeSearchTerm]
23981
23997
  );
23982
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
23998
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23983
23999
  SearchOnlyContext.Provider,
23984
24000
  {
23985
24001
  value: {
23986
24002
  searchTerm,
23987
24003
  setSearchTerm: setLocaleSearchTerm
23988
24004
  },
23989
- children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
24005
+ children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23990
24006
  InputKeywordSearch,
23991
24007
  {
23992
24008
  placeholder: "Search...",
@@ -24016,7 +24032,7 @@ var skeletonStyles = import_react150.css`
24016
24032
  `;
24017
24033
 
24018
24034
  // src/components/Skeleton/Skeleton.tsx
24019
- var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
24035
+ var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
24020
24036
  var Skeleton = ({
24021
24037
  width = "100%",
24022
24038
  height = "1.25rem",
@@ -24024,7 +24040,7 @@ var Skeleton = ({
24024
24040
  circle = false,
24025
24041
  children,
24026
24042
  ...otherProps
24027
- }) => /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
24043
+ }) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
24028
24044
  "div",
24029
24045
  {
24030
24046
  css: [
@@ -24133,19 +24149,19 @@ var SwitchText = import_react151.css`
24133
24149
  `;
24134
24150
 
24135
24151
  // src/components/Switch/Switch.tsx
24136
- var import_jsx_runtime132 = require("@emotion/react/jsx-runtime");
24152
+ var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
24137
24153
  var Switch = React26.forwardRef(
24138
24154
  ({ label, infoText, toggleText, children, ...inputProps }, ref) => {
24139
24155
  let additionalText = infoText;
24140
24156
  if (infoText && toggleText) {
24141
24157
  additionalText = inputProps.checked ? toggleText : infoText;
24142
24158
  }
24143
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_jsx_runtime132.Fragment, { children: [
24144
- /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
24145
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
24146
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { css: SwitchInputLabel, children: label })
24159
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
24160
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
24161
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
24162
+ /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { css: SwitchInputLabel, children: label })
24147
24163
  ] }),
24148
- additionalText ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { css: SwitchText, children: additionalText }) : null,
24164
+ additionalText ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { css: SwitchText, children: additionalText }) : null,
24149
24165
  children
24150
24166
  ] });
24151
24167
  }
@@ -24184,40 +24200,40 @@ var tableCellHead = import_react152.css`
24184
24200
  `;
24185
24201
 
24186
24202
  // src/components/Table/Table.tsx
24187
- var import_jsx_runtime133 = require("@emotion/react/jsx-runtime");
24203
+ var import_jsx_runtime132 = require("@emotion/react/jsx-runtime");
24188
24204
  var Table = React27.forwardRef(
24189
24205
  ({ children, cellPadding, ...otherProps }, ref) => {
24190
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
24206
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
24191
24207
  }
24192
24208
  );
24193
24209
  var TableHead = React27.forwardRef(
24194
24210
  ({ children, ...otherProps }, ref) => {
24195
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
24211
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
24196
24212
  }
24197
24213
  );
24198
24214
  var TableBody = React27.forwardRef(
24199
24215
  ({ children, ...otherProps }, ref) => {
24200
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("tbody", { ref, ...otherProps, children });
24216
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tbody", { ref, ...otherProps, children });
24201
24217
  }
24202
24218
  );
24203
24219
  var TableFoot = React27.forwardRef(
24204
24220
  ({ children, ...otherProps }, ref) => {
24205
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("tfoot", { ref, ...otherProps, children });
24221
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tfoot", { ref, ...otherProps, children });
24206
24222
  }
24207
24223
  );
24208
24224
  var TableRow = React27.forwardRef(
24209
24225
  ({ children, ...otherProps }, ref) => {
24210
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
24226
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
24211
24227
  }
24212
24228
  );
24213
24229
  var TableCellHead = React27.forwardRef(
24214
24230
  ({ children, ...otherProps }, ref) => {
24215
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
24231
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
24216
24232
  }
24217
24233
  );
24218
24234
  var TableCellData = React27.forwardRef(
24219
24235
  ({ children, ...otherProps }, ref) => {
24220
- return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("td", { ref, ...otherProps, children });
24236
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("td", { ref, ...otherProps, children });
24221
24237
  }
24222
24238
  );
24223
24239
 
@@ -24253,7 +24269,7 @@ var tabButtonGroupStyles = import_react153.css`
24253
24269
  `;
24254
24270
 
24255
24271
  // src/components/Tabs/Tabs.tsx
24256
- var import_jsx_runtime134 = require("@emotion/react/jsx-runtime");
24272
+ var import_jsx_runtime133 = require("@emotion/react/jsx-runtime");
24257
24273
  var useCurrentTab = () => {
24258
24274
  const context = (0, import_react154.useTabStore)();
24259
24275
  if (!context) {
@@ -24291,23 +24307,23 @@ var Tabs = ({
24291
24307
  tab.setSelectedId(selected);
24292
24308
  }
24293
24309
  }, [selected, tab]);
24294
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react154.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
24310
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react154.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
24295
24311
  };
24296
24312
  var TabButtonGroup = ({ children, ...props }) => {
24297
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react154.TabList, { ...props, css: tabButtonGroupStyles, children });
24313
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react154.TabList, { ...props, css: tabButtonGroupStyles, children });
24298
24314
  };
24299
24315
  var TabButton = ({
24300
24316
  children,
24301
24317
  id,
24302
24318
  ...props
24303
24319
  }) => {
24304
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react154.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
24320
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react154.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
24305
24321
  };
24306
24322
  var TabContent = ({
24307
24323
  children,
24308
24324
  ...props
24309
24325
  }) => {
24310
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_react154.TabPanel, { ...props, children });
24326
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react154.TabPanel, { ...props, children });
24311
24327
  };
24312
24328
 
24313
24329
  // src/components/Toast/Toast.tsx
@@ -24540,9 +24556,9 @@ var toastContainerStyles = import_react156.css`
24540
24556
  `;
24541
24557
 
24542
24558
  // src/components/Toast/Toast.tsx
24543
- var import_jsx_runtime135 = require("@emotion/react/jsx-runtime");
24559
+ var import_jsx_runtime134 = require("@emotion/react/jsx-runtime");
24544
24560
  var ToastContainer = ({ limit = 4 }) => {
24545
- return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
24561
+ return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
24546
24562
  import_react_toastify.ToastContainer,
24547
24563
  {
24548
24564
  css: toastContainerStyles,
@@ -24581,8 +24597,6 @@ var ToastContainer = ({ limit = 4 }) => {
24581
24597
  CurrentDrawerContext,
24582
24598
  DATE_OPERATORS,
24583
24599
  DashedBox,
24584
- DateEditor,
24585
- DateRangeEditor,
24586
24600
  DateTimePicker,
24587
24601
  DateTimePickerVariant,
24588
24602
  DebouncedInputKeywordSearch,
@@ -24598,12 +24612,9 @@ var ToastContainer = ({ limit = 4 }) => {
24598
24612
  Fieldset,
24599
24613
  FilterButton,
24600
24614
  FilterControls,
24601
- FilterEditorRenderer,
24602
24615
  FilterItem,
24603
24616
  FilterItems,
24604
24617
  FilterMenu,
24605
- FilterMultiChoiceEditor,
24606
- FilterSingleChoiceEditor,
24607
24618
  Heading,
24608
24619
  HexModalBackground,
24609
24620
  HorizontalRhythm,
@@ -24650,8 +24661,7 @@ var ToastContainer = ({ limit = 4 }) => {
24650
24661
  ModalDialog,
24651
24662
  MultilineChip,
24652
24663
  NUMBER_OPERATORS,
24653
- NumberEditor,
24654
- NumberRangeEditor,
24664
+ PUBLISH_STATUS_FIELD_OPERATORS,
24655
24665
  PageHeaderSection,
24656
24666
  Pagination,
24657
24667
  Paragraph,
@@ -24704,8 +24714,6 @@ var ToastContainer = ({ limit = 4 }) => {
24704
24714
  ShortcutRevealer,
24705
24715
  Skeleton,
24706
24716
  StatusBullet,
24707
- StatusMultiEditor,
24708
- StatusSingleEditor,
24709
24717
  SuccessMessage,
24710
24718
  Switch,
24711
24719
  TAKEOVER_STACK_ID,
@@ -24722,7 +24730,6 @@ var ToastContainer = ({ limit = 4 }) => {
24722
24730
  TableRow,
24723
24731
  Tabs,
24724
24732
  TakeoverDrawerRenderer,
24725
- TextEditor,
24726
24733
  Textarea,
24727
24734
  Theme,
24728
24735
  Tile,
@@ -24767,7 +24774,6 @@ var ToastContainer = ({ limit = 4 }) => {
24767
24774
  fadeInRtl,
24768
24775
  fadeInTop,
24769
24776
  fadeOutBottom,
24770
- filterMapper,
24771
24777
  fullWidthScreenIcon,
24772
24778
  getDrawerAttributes,
24773
24779
  getParentPath,