@uniformdev/design-system 19.122.1-alpha.0 → 19.125.2-alpha.3

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/esm/index.js CHANGED
@@ -2557,7 +2557,7 @@ import { css as css15 } from "@emotion/react";
2557
2557
  var PageHeaderSectionContainer = css15`
2558
2558
  display: flex;
2559
2559
  justify-content: space-between;
2560
- margin-bottom: var(--spacing-lg);
2560
+ margin-bottom: var(--spacing-sm);
2561
2561
  flex-direction: column;
2562
2562
  gap: var(--spacing-sm);
2563
2563
 
@@ -13845,7 +13845,8 @@ function InputComboBox(props) {
13845
13845
  background: "var(--gray-100)",
13846
13846
  "&:hover": {
13847
13847
  borderColor: "var(--gray-300)"
13848
- }
13848
+ },
13849
+ ...state.isFocused ? { borderColor: "var(--gray-300)" } : {}
13849
13850
  },
13850
13851
  ...(_b = (_a2 = props.styles) == null ? void 0 : _a2.control) == null ? void 0 : _b.call(_a2, base, state)
13851
13852
  };
@@ -17561,6 +17562,16 @@ var toggleInput2 = css79`
17561
17562
  color: var(--white);
17562
17563
  }
17563
17564
 
17565
+ &:indeterminate,
17566
+ &:indeterminate:hover,
17567
+ &:indeterminate:focus {
17568
+ background: var(--accent-dark-active)
17569
+ url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNiIKICBoZWlnaHQ9IjE2IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNCAxMkM0IDExLjQ0NzcgNC40NDc3MiAxMSA1IDExSDE5QzE5LjU1MjMgMTEgMjAgMTEuNDQ3NyAyMCAxMkMyMCAxMi41NTIzIDE5LjU1MjMgMTMgMTkgMTNINUM0LjQ0NzcyIDEzIDQgMTIuNTUyMyA0IDEyWiIKICAgIGZpbGw9IndoaXRlIgogIC8+Cjwvc3ZnPg==')
17570
+ no-repeat center center;
17571
+ border-color: var(--accent-dark-active);
17572
+ color: var(--white);
17573
+ }
17574
+
17564
17575
  &:hover {
17565
17576
  border-color: var(--accent-dark-hover);
17566
17577
  }
@@ -20289,6 +20300,43 @@ var USER_OPERATORS = [
20289
20300
  editorType: "text"
20290
20301
  }
20291
20302
  ];
20303
+ var SYSTEM_DATE_OPERATORS = [
20304
+ {
20305
+ label: "is...",
20306
+ value: "eq",
20307
+ editorType: "date"
20308
+ },
20309
+ {
20310
+ label: "is between...",
20311
+ value: "between",
20312
+ editorType: "dateRange"
20313
+ },
20314
+ {
20315
+ label: "is before...",
20316
+ value: "lt",
20317
+ editorType: "date"
20318
+ },
20319
+ {
20320
+ label: "is after...",
20321
+ value: "gt",
20322
+ editorType: "date"
20323
+ },
20324
+ {
20325
+ label: "is on or before...",
20326
+ value: "lte",
20327
+ editorType: "date"
20328
+ },
20329
+ {
20330
+ label: "is on or after...",
20331
+ value: "gte",
20332
+ editorType: "date"
20333
+ },
20334
+ {
20335
+ label: "is not...",
20336
+ value: "neq",
20337
+ editorType: "date"
20338
+ }
20339
+ ];
20292
20340
  var RICHTEXT_OPERATORS = [
20293
20341
  {
20294
20342
  label: "is empty...",
@@ -20472,7 +20520,6 @@ var AddConditionalBtn = css92`
20472
20520
  gap: var(--spacing-sm);
20473
20521
  transition: color var(--duration-fast) var(--timing-ease-out);
20474
20522
  padding: 0;
20475
- font-size: var(--fs-sm);
20476
20523
 
20477
20524
  &:hover,
20478
20525
  &:focus {
@@ -20527,7 +20574,7 @@ var SearchAndFilterOptionsContainer = css92`
20527
20574
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
20528
20575
  will-change: height;
20529
20576
  position: relative;
20530
- z-index: 2;
20577
+ z-index: 1;
20531
20578
  `;
20532
20579
  var SearchAndFilterOptionsInnerContainer = css92`
20533
20580
  display: flex;
@@ -20537,6 +20584,11 @@ var SearchAndFilterOptionsInnerContainer = css92`
20537
20584
  var SearchAndFilterButtonGroup = css92`
20538
20585
  margin-top: var(--spacing-base);
20539
20586
  `;
20587
+ var SortFilterInputRow = css92`
20588
+ align-items: center;
20589
+ display: flex;
20590
+ gap: var(--spacing-sm);
20591
+ `;
20540
20592
 
20541
20593
  // src/components/SearchAndFilter/FilterButton.tsx
20542
20594
  import { jsx as jsx117, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
@@ -20569,7 +20621,7 @@ var FilterButton2 = ({
20569
20621
 
20570
20622
  // src/components/SearchAndFilter/FilterControls.tsx
20571
20623
  import { useEffect as useEffect18, useState as useState17 } from "react";
20572
- import { useDebounce as useDebounce2 } from "react-use";
20624
+ import { useDebounce as useDebounce2, useEffectOnce } from "react-use";
20573
20625
 
20574
20626
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
20575
20627
  import {
@@ -20718,7 +20770,9 @@ var FilterControls = ({
20718
20770
  sortByValue,
20719
20771
  filterOptions
20720
20772
  } = useSearchAndFilter();
20773
+ const [initialSortValue, setInitialSortValue] = useState17(sortByValue);
20721
20774
  const [localeSearchTerm, setLocaleSearchTerm] = useState17("");
20775
+ const [userHasChangedSortByValue, setUserHasChangedSortByValue] = useState17(false);
20722
20776
  useDebounce2(
20723
20777
  () => {
20724
20778
  setSearchTerm(localeSearchTerm);
@@ -20732,7 +20786,7 @@ var FilterControls = ({
20732
20786
  }
20733
20787
  }, [searchTerm]);
20734
20788
  const handleFilterToggle = (mode) => {
20735
- if (filterVisibility && ["sort", "filters"].includes(filterVisibility)) {
20789
+ if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
20736
20790
  return setFilterVisibility(void 0);
20737
20791
  }
20738
20792
  return setFilterVisibility(mode);
@@ -20742,7 +20796,15 @@ var FilterControls = ({
20742
20796
  const sortField = sortValue == null ? void 0 : sortValue.join("_");
20743
20797
  const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
20744
20798
  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;
20745
- const sortByIcon = sortDirection === "ASC" ? "arrow-up" : "arrow-down";
20799
+ const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
20800
+ useEffectOnce(() => {
20801
+ setInitialSortValue(sortByValue);
20802
+ });
20803
+ useEffect18(() => {
20804
+ if (initialSortValue !== sortByValue) {
20805
+ setUserHasChangedSortByValue(true);
20806
+ }
20807
+ }, [initialSortValue, sortByValue]);
20746
20808
  return /* @__PURE__ */ jsxs80(Fragment19, { children: [
20747
20809
  /* @__PURE__ */ jsx119(
20748
20810
  FilterButton2,
@@ -20761,7 +20823,7 @@ var FilterControls = ({
20761
20823
  "aria-controls": "search-and-filter-sortBy",
20762
20824
  "aria-label": "sort by options",
20763
20825
  "aria-haspopup": "true",
20764
- text: sortByValueLabel,
20826
+ text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
20765
20827
  icon: sortByIcon,
20766
20828
  "aria-expanded": filterVisibility === "sort",
20767
20829
  hasSelectedValue: sortByValue !== "",
@@ -20903,7 +20965,7 @@ var StatusBullet = ({
20903
20965
  };
20904
20966
 
20905
20967
  // src/components/SearchAndFilter/FilterEditor.tsx
20906
- import { jsx as jsx121, jsxs as jsxs81 } from "@emotion/react/jsx-runtime";
20968
+ import { Fragment as Fragment20, jsx as jsx121, jsxs as jsxs81 } from "@emotion/react/jsx-runtime";
20907
20969
  var readOnlyAttributes = {
20908
20970
  isSearchable: false,
20909
20971
  menuIsOpen: false,
@@ -20914,10 +20976,11 @@ var FilterMultiChoiceEditor = ({
20914
20976
  options,
20915
20977
  isDisabled,
20916
20978
  readOnly,
20979
+ valueTestId,
20917
20980
  ...props
20918
20981
  }) => {
20919
20982
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
20920
- return /* @__PURE__ */ jsx121(
20983
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20921
20984
  InputComboBox,
20922
20985
  {
20923
20986
  ...props,
@@ -20932,19 +20995,28 @@ var FilterMultiChoiceEditor = ({
20932
20995
  },
20933
20996
  value,
20934
20997
  "aria-readonly": readOnly,
20998
+ styles: {
20999
+ menu(base) {
21000
+ return {
21001
+ ...base,
21002
+ minWidth: "max-content"
21003
+ };
21004
+ }
21005
+ },
20935
21006
  ...readOnlyProps
20936
21007
  }
20937
- );
21008
+ ) });
20938
21009
  };
20939
21010
  var FilterSingleChoiceEditor = ({
20940
21011
  options,
20941
21012
  value,
20942
21013
  isDisabled,
20943
21014
  readOnly,
20944
- onChange
21015
+ onChange,
21016
+ valueTestId
20945
21017
  }) => {
20946
21018
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
20947
- return /* @__PURE__ */ jsx121(
21019
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20948
21020
  InputComboBox,
20949
21021
  {
20950
21022
  placeholder: "Type to search...",
@@ -20957,9 +21029,17 @@ var FilterSingleChoiceEditor = ({
20957
21029
  isDisabled,
20958
21030
  value,
20959
21031
  "aria-readonly": readOnly,
21032
+ styles: {
21033
+ menu(base) {
21034
+ return {
21035
+ ...base,
21036
+ minWidth: "max-content"
21037
+ };
21038
+ }
21039
+ },
20960
21040
  ...readOnlyProps
20961
21041
  }
20962
- );
21042
+ ) });
20963
21043
  };
20964
21044
  var CustomOptions = ({ label, value }) => {
20965
21045
  return /* @__PURE__ */ jsx121(StatusBullet, { status: label, message: value });
@@ -20969,10 +21049,11 @@ var StatusMultiEditor = ({
20969
21049
  value,
20970
21050
  isDisabled,
20971
21051
  readOnly,
20972
- onChange
21052
+ onChange,
21053
+ valueTestId
20973
21054
  }) => {
20974
21055
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
20975
- return /* @__PURE__ */ jsx121(
21056
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20976
21057
  InputComboBox,
20977
21058
  {
20978
21059
  options,
@@ -20984,19 +21065,28 @@ var StatusMultiEditor = ({
20984
21065
  formatOptionLabel: CustomOptions,
20985
21066
  value,
20986
21067
  isDisabled,
21068
+ styles: {
21069
+ menu(base) {
21070
+ return {
21071
+ ...base,
21072
+ minWidth: "max-content"
21073
+ };
21074
+ }
21075
+ },
20987
21076
  ...readOnlyProps
20988
21077
  }
20989
- );
21078
+ ) });
20990
21079
  };
20991
21080
  var StatusSingleEditor = ({
20992
21081
  options,
20993
21082
  value,
20994
21083
  isDisabled,
20995
21084
  readOnly,
20996
- onChange
21085
+ onChange,
21086
+ valueTestId
20997
21087
  }) => {
20998
21088
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
20999
- return /* @__PURE__ */ jsx121(
21089
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
21000
21090
  InputComboBox,
21001
21091
  {
21002
21092
  options,
@@ -21007,11 +21097,19 @@ var StatusSingleEditor = ({
21007
21097
  formatOptionLabel: CustomOptions,
21008
21098
  value,
21009
21099
  isDisabled,
21100
+ styles: {
21101
+ menu(base) {
21102
+ return {
21103
+ ...base,
21104
+ minWidth: "max-content"
21105
+ };
21106
+ }
21107
+ },
21010
21108
  ...readOnlyProps
21011
21109
  }
21012
- );
21110
+ ) });
21013
21111
  };
21014
- var TextEditor = ({ onChange, ariaLabel, value, readOnly }) => {
21112
+ var TextEditor = ({ onChange, ariaLabel, value, readOnly, valueTestId }) => {
21015
21113
  useDebounce3(() => onChange, 500, [value]);
21016
21114
  return /* @__PURE__ */ jsx121(
21017
21115
  Input,
@@ -21021,11 +21119,19 @@ var TextEditor = ({ onChange, ariaLabel, value, readOnly }) => {
21021
21119
  onChange: (e) => onChange(e.currentTarget.value),
21022
21120
  placeholder: "Enter phrase to search\u2026",
21023
21121
  value,
21024
- readOnly
21122
+ readOnly,
21123
+ "data-testid": valueTestId
21025
21124
  }
21026
21125
  );
21027
21126
  };
21028
- var NumberRangeEditor = ({ onChange, disabled: disabled2, ariaLabel, value, readOnly }) => {
21127
+ var NumberRangeEditor = ({
21128
+ onChange,
21129
+ disabled: disabled2,
21130
+ ariaLabel,
21131
+ value,
21132
+ readOnly,
21133
+ valueTestId
21134
+ }) => {
21029
21135
  const [minValue, setMinValue] = useState18("");
21030
21136
  const [maxValue, setMaxValue] = useState18("");
21031
21137
  const [error, setError] = useState18("");
@@ -21048,41 +21154,50 @@ var NumberRangeEditor = ({ onChange, disabled: disabled2, ariaLabel, value, read
21048
21154
  setError("");
21049
21155
  onChange([minValue, maxValue]);
21050
21156
  }, [maxValue, minValue, setError]);
21051
- return /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, children: [
21052
- /* @__PURE__ */ jsx121(
21053
- Input,
21054
- {
21055
- label: `${ariaLabel}-min`,
21056
- type: "number",
21057
- showLabel: false,
21058
- min: 0,
21059
- placeholder: "Low",
21060
- onChange: (e) => setMinValue(e.currentTarget.value),
21061
- "aria-invalid": !error ? false : true,
21062
- disabled: disabled2,
21063
- value: value ? value[0] : "",
21064
- readOnly
21065
- }
21066
- ),
21067
- /* @__PURE__ */ jsx121(
21068
- Input,
21069
- {
21070
- type: "number",
21071
- label: `${ariaLabel}-max`,
21072
- showLabel: false,
21073
- min: 0,
21074
- placeholder: "High",
21075
- onChange: (e) => setMaxValue(e.currentTarget.value),
21076
- "aria-invalid": !error ? false : true,
21077
- disabled: disabled2,
21078
- value: value ? value[1] : "",
21079
- readOnly
21080
- }
21081
- ),
21157
+ return /* @__PURE__ */ jsxs81(Fragment20, { children: [
21158
+ /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
21159
+ /* @__PURE__ */ jsx121(
21160
+ Input,
21161
+ {
21162
+ label: `${ariaLabel}-min`,
21163
+ type: "number",
21164
+ showLabel: false,
21165
+ min: 0,
21166
+ placeholder: "Low",
21167
+ onChange: (e) => setMinValue(e.currentTarget.value),
21168
+ "aria-invalid": !error ? false : true,
21169
+ disabled: disabled2,
21170
+ value: value ? value[0] : "",
21171
+ readOnly
21172
+ }
21173
+ ),
21174
+ /* @__PURE__ */ jsx121(
21175
+ Input,
21176
+ {
21177
+ type: "number",
21178
+ label: `${ariaLabel}-max`,
21179
+ showLabel: false,
21180
+ min: 0,
21181
+ placeholder: "High",
21182
+ onChange: (e) => setMaxValue(e.currentTarget.value),
21183
+ "aria-invalid": !error ? false : true,
21184
+ disabled: disabled2,
21185
+ value: value ? value[1] : "",
21186
+ readOnly
21187
+ }
21188
+ )
21189
+ ] }),
21082
21190
  /* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
21083
21191
  ] });
21084
21192
  };
21085
- var NumberEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOnly }) => {
21193
+ var NumberEditor = ({
21194
+ ariaLabel,
21195
+ onChange,
21196
+ disabled: disabled2,
21197
+ value,
21198
+ readOnly,
21199
+ valueTestId
21200
+ }) => {
21086
21201
  return /* @__PURE__ */ jsx121(
21087
21202
  Input,
21088
21203
  {
@@ -21093,11 +21208,19 @@ var NumberEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOnly
21093
21208
  onChange: (e) => onChange(e.currentTarget.value),
21094
21209
  disabled: disabled2,
21095
21210
  value,
21096
- readOnly
21211
+ readOnly,
21212
+ "data-testid": valueTestId
21097
21213
  }
21098
21214
  );
21099
21215
  };
21100
- var DateEditor = ({ onChange, ariaLabel, disabled: disabled2, value, readOnly }) => {
21216
+ var DateEditor = ({
21217
+ onChange,
21218
+ ariaLabel,
21219
+ disabled: disabled2,
21220
+ value,
21221
+ readOnly,
21222
+ valueTestId
21223
+ }) => {
21101
21224
  return /* @__PURE__ */ jsx121(
21102
21225
  Input,
21103
21226
  {
@@ -21107,11 +21230,19 @@ var DateEditor = ({ onChange, ariaLabel, disabled: disabled2, value, readOnly })
21107
21230
  onChange: (e) => onChange(e.currentTarget.value),
21108
21231
  disabled: disabled2,
21109
21232
  value,
21110
- readOnly
21233
+ readOnly,
21234
+ "data-testid": valueTestId
21111
21235
  }
21112
21236
  );
21113
21237
  };
21114
- var DateRangeEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOnly }) => {
21238
+ var DateRangeEditor = ({
21239
+ ariaLabel,
21240
+ onChange,
21241
+ disabled: disabled2,
21242
+ value,
21243
+ readOnly,
21244
+ valueTestId
21245
+ }) => {
21115
21246
  const [minDateValue, setMinDateValue] = useState18(value ? value[0] : "");
21116
21247
  const [maxDateValue, setMaxDateValue] = useState18(value ? value[1] : "");
21117
21248
  const [error, setError] = useState18("");
@@ -21146,33 +21277,35 @@ var DateRangeEditor = ({ ariaLabel, onChange, disabled: disabled2, value, readOn
21146
21277
  setError("");
21147
21278
  onChange([minDateValue, maxDateValue]);
21148
21279
  }, [minDateValue, maxDateValue, setError]);
21149
- return /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, children: [
21150
- /* @__PURE__ */ jsx121(
21151
- Input,
21152
- {
21153
- label: `${ariaLabel}-min-date`,
21154
- type: "date",
21155
- showLabel: false,
21156
- value: minDateValue,
21157
- onChange: (e) => setMinDateValue(e.currentTarget.value),
21158
- "aria-invalid": !error ? false : true,
21159
- disabled: disabled2,
21160
- readOnly
21161
- }
21162
- ),
21163
- /* @__PURE__ */ jsx121(
21164
- Input,
21165
- {
21166
- label: `${ariaLabel}-max-date`,
21167
- type: "date",
21168
- showLabel: false,
21169
- value: maxDateValue,
21170
- onChange: (e) => setMaxDateValue(e.currentTarget.value),
21171
- "aria-invalid": !error ? false : true,
21172
- disabled: disabled2,
21173
- readOnly
21174
- }
21175
- ),
21280
+ return /* @__PURE__ */ jsxs81(Fragment20, { children: [
21281
+ /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
21282
+ /* @__PURE__ */ jsx121(
21283
+ Input,
21284
+ {
21285
+ label: `${ariaLabel}-min-date`,
21286
+ type: "date",
21287
+ showLabel: false,
21288
+ value: minDateValue,
21289
+ onChange: (e) => setMinDateValue(e.currentTarget.value),
21290
+ "aria-invalid": !error ? false : true,
21291
+ disabled: disabled2,
21292
+ readOnly
21293
+ }
21294
+ ),
21295
+ /* @__PURE__ */ jsx121(
21296
+ Input,
21297
+ {
21298
+ label: `${ariaLabel}-max-date`,
21299
+ type: "date",
21300
+ showLabel: false,
21301
+ value: maxDateValue,
21302
+ onChange: (e) => setMaxDateValue(e.currentTarget.value),
21303
+ "aria-invalid": !error ? false : true,
21304
+ disabled: disabled2,
21305
+ readOnly
21306
+ }
21307
+ )
21308
+ ] }),
21176
21309
  /* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
21177
21310
  ] });
21178
21311
  };
@@ -21237,7 +21370,7 @@ var SearchAndFilterOptionsContainer2 = ({
21237
21370
  ) : null
21238
21371
  ] });
21239
21372
  };
21240
- var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children }) => {
21373
+ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
21241
21374
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
21242
21375
  const innerMenuRef = React24.useRef(null);
21243
21376
  useEffect20(() => {
@@ -21263,7 +21396,7 @@ var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children })
21263
21396
  };
21264
21397
 
21265
21398
  // src/components/SearchAndFilter/FilterItem.tsx
21266
- import { Fragment as Fragment20, jsx as jsx123, jsxs as jsxs83 } from "@emotion/react/jsx-runtime";
21399
+ import { Fragment as Fragment21, jsx as jsx123, jsxs as jsxs83 } from "@emotion/react/jsx-runtime";
21267
21400
  var FilterItem = ({
21268
21401
  index,
21269
21402
  paramOptions,
@@ -21311,8 +21444,8 @@ var FilterItem = ({
21311
21444
  menuIsOpen: false,
21312
21445
  isClearable: false
21313
21446
  } : {};
21314
- return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, children: [
21315
- /* @__PURE__ */ jsx123("span", { children: index === 0 ? "where" : "and" }),
21447
+ return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
21448
+ /* @__PURE__ */ jsx123("span", { children: index === 0 ? "Where" : "and" }),
21316
21449
  /* @__PURE__ */ jsxs83("div", { css: ConditionalInputRow, children: [
21317
21450
  /* @__PURE__ */ jsx123(
21318
21451
  InputComboBox,
@@ -21323,8 +21456,21 @@ var FilterItem = ({
21323
21456
  var _a2;
21324
21457
  onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
21325
21458
  },
21459
+ isOptionDisabled: (option) => {
21460
+ var _a2;
21461
+ return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
21462
+ },
21463
+ styles: {
21464
+ menu(base) {
21465
+ return {
21466
+ ...base,
21467
+ minWidth: "max-content"
21468
+ };
21469
+ }
21470
+ },
21326
21471
  value: selectedFieldValue,
21327
- ...readOnlyProps
21472
+ ...readOnlyProps,
21473
+ id: "filter-field"
21328
21474
  }
21329
21475
  ),
21330
21476
  /* @__PURE__ */ jsx123(
@@ -21338,7 +21484,16 @@ var FilterItem = ({
21338
21484
  },
21339
21485
  isDisabled: !filters[index].field,
21340
21486
  value: selectedOperatorValue,
21341
- ...readOnlyProps
21487
+ styles: {
21488
+ menu(base) {
21489
+ return {
21490
+ ...base,
21491
+ minWidth: "max-content"
21492
+ };
21493
+ }
21494
+ },
21495
+ ...readOnlyProps,
21496
+ id: "filter-operator"
21342
21497
  }
21343
21498
  ),
21344
21499
  /* @__PURE__ */ jsx123(
@@ -21350,16 +21505,18 @@ var FilterItem = ({
21350
21505
  onChange: (e) => onValueChange(e != null ? e : ""),
21351
21506
  readOnly,
21352
21507
  isDisabled: !filters[index].operator,
21353
- value: selectedMetaValue
21508
+ value: selectedMetaValue,
21509
+ valueTestId: "filter-value"
21354
21510
  }
21355
21511
  ),
21356
- /* @__PURE__ */ jsx123(
21512
+ readOnly ? null : /* @__PURE__ */ jsx123(
21357
21513
  "button",
21358
21514
  {
21359
21515
  type: "button",
21360
21516
  onClick: () => handleDeleteFilter(index),
21361
21517
  "aria-label": "delete filter",
21362
21518
  css: IconBtn,
21519
+ "data-testid": "delete-filter",
21363
21520
  children: /* @__PURE__ */ jsx123(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
21364
21521
  }
21365
21522
  )
@@ -21372,6 +21529,7 @@ var FilterItems = ({
21372
21529
  }) => {
21373
21530
  const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
21374
21531
  const handleUpdateFilter = (index, prop, value) => {
21532
+ var _a, _b, _c, _d, _e;
21375
21533
  const next = [...filters];
21376
21534
  next[index] = { ...next[index], [prop]: value };
21377
21535
  if (prop === "operator") {
@@ -21384,7 +21542,11 @@ var FilterItems = ({
21384
21542
  }
21385
21543
  }
21386
21544
  if (prop === "field") {
21387
- next[index].operator = "";
21545
+ const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
21546
+ var _a2;
21547
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
21548
+ })) == 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";
21549
+ next[index].operator = firstOperatorInAvailableOperators;
21388
21550
  next[index].value = "";
21389
21551
  }
21390
21552
  setFilters(next);
@@ -21393,11 +21555,20 @@ var FilterItems = ({
21393
21555
  FilterMenu,
21394
21556
  {
21395
21557
  id: "search-and-filter-options",
21396
- menuControls: /* @__PURE__ */ jsxs83(Fragment20, { children: [
21397
- /* @__PURE__ */ jsxs83("button", { type: "button", css: AddConditionalBtn, onClick: handleAddFilter, children: [
21398
- /* @__PURE__ */ jsx123(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
21399
- addButtonText
21400
- ] }),
21558
+ menuControls: /* @__PURE__ */ jsxs83(Fragment21, { children: [
21559
+ /* @__PURE__ */ jsxs83(
21560
+ "button",
21561
+ {
21562
+ type: "button",
21563
+ css: AddConditionalBtn,
21564
+ onClick: handleAddFilter,
21565
+ "data-testid": "add-filter",
21566
+ children: [
21567
+ /* @__PURE__ */ jsx123(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
21568
+ addButtonText
21569
+ ]
21570
+ }
21571
+ ),
21401
21572
  (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx123(
21402
21573
  "button",
21403
21574
  {
@@ -21407,6 +21578,7 @@ var FilterItems = ({
21407
21578
  handleResetFilters();
21408
21579
  setFilterVisibility(void 0);
21409
21580
  },
21581
+ "data-testid": "reset-filters",
21410
21582
  children: resetButtonText
21411
21583
  }
21412
21584
  ) : null
@@ -21653,7 +21825,7 @@ var SortItems = () => {
21653
21825
  var _a2;
21654
21826
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
21655
21827
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
21656
- return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsx125("div", { css: ConditionalFilterRow, children: /* @__PURE__ */ jsxs85("div", { css: ConditionalInputRow, children: [
21828
+ return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsxs85("div", { css: SortFilterInputRow, children: [
21657
21829
  /* @__PURE__ */ jsx125(
21658
21830
  InputComboBox,
21659
21831
  {
@@ -21662,6 +21834,14 @@ var SortItems = () => {
21662
21834
  const fieldName = e == null ? void 0 : e.value;
21663
21835
  setSortBy(`${fieldName}_${sortDirection}`);
21664
21836
  },
21837
+ styles: {
21838
+ menu(base) {
21839
+ return {
21840
+ ...base,
21841
+ minWidth: "max-content"
21842
+ };
21843
+ }
21844
+ },
21665
21845
  value: currentSelectedOption
21666
21846
  }
21667
21847
  ),
@@ -21678,7 +21858,7 @@ var SortItems = () => {
21678
21858
  value: sortDirection
21679
21859
  }
21680
21860
  )
21681
- ] }) }) });
21861
+ ] }) });
21682
21862
  };
21683
21863
 
21684
21864
  // src/components/SearchAndFilter/FilterModeView.tsx
@@ -21693,7 +21873,7 @@ var FilterModeView = () => {
21693
21873
  };
21694
21874
 
21695
21875
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
21696
- import { Fragment as Fragment21, jsx as jsx127, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
21876
+ import { Fragment as Fragment22, jsx as jsx127, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
21697
21877
  var SearchAndFilterResultContainer = ({
21698
21878
  buttonText,
21699
21879
  clearButtonLabel = "clear",
@@ -21727,7 +21907,7 @@ var SearchAndFilterResultContainer = ({
21727
21907
  if (totalResults && totalResults > 0) {
21728
21908
  return null;
21729
21909
  }
21730
- return /* @__PURE__ */ jsxs86(Fragment21, { children: [
21910
+ return /* @__PURE__ */ jsxs86(Fragment22, { children: [
21731
21911
  /* @__PURE__ */ jsxs86(HorizontalRhythm, { children: [
21732
21912
  /* @__PURE__ */ jsxs86("span", { children: [
21733
21913
  totalResults,
@@ -21960,14 +22140,14 @@ var SwitchText = css97`
21960
22140
  `;
21961
22141
 
21962
22142
  // src/components/Switch/Switch.tsx
21963
- import { Fragment as Fragment22, jsx as jsx131, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
22143
+ import { Fragment as Fragment23, jsx as jsx131, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
21964
22144
  var Switch = React26.forwardRef(
21965
22145
  ({ label, infoText, toggleText, children, ...inputProps }, ref) => {
21966
22146
  let additionalText = infoText;
21967
22147
  if (infoText && toggleText) {
21968
22148
  additionalText = inputProps.checked ? toggleText : infoText;
21969
22149
  }
21970
- return /* @__PURE__ */ jsxs88(Fragment22, { children: [
22150
+ return /* @__PURE__ */ jsxs88(Fragment23, { children: [
21971
22151
  /* @__PURE__ */ jsxs88("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
21972
22152
  /* @__PURE__ */ jsx131("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
21973
22153
  /* @__PURE__ */ jsx131("span", { css: SwitchInputLabel, children: label })
@@ -22505,6 +22685,7 @@ export {
22505
22685
  RICHTEXT_OPERATORS,
22506
22686
  ResolveIcon,
22507
22687
  RichTextToolbarIcon,
22688
+ SYSTEM_DATE_OPERATORS,
22508
22689
  SYSTEM_FIELD_OPERATORS,
22509
22690
  ScrollableList,
22510
22691
  ScrollableListInputItem,