@uniformdev/design-system 19.123.1-alpha.9 → 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
  };
@@ -20519,7 +20520,6 @@ var AddConditionalBtn = css92`
20519
20520
  gap: var(--spacing-sm);
20520
20521
  transition: color var(--duration-fast) var(--timing-ease-out);
20521
20522
  padding: 0;
20522
- font-size: var(--fs-sm);
20523
20523
 
20524
20524
  &:hover,
20525
20525
  &:focus {
@@ -20574,7 +20574,7 @@ var SearchAndFilterOptionsContainer = css92`
20574
20574
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
20575
20575
  will-change: height;
20576
20576
  position: relative;
20577
- z-index: 2;
20577
+ z-index: 1;
20578
20578
  `;
20579
20579
  var SearchAndFilterOptionsInnerContainer = css92`
20580
20580
  display: flex;
@@ -20584,6 +20584,11 @@ var SearchAndFilterOptionsInnerContainer = css92`
20584
20584
  var SearchAndFilterButtonGroup = css92`
20585
20585
  margin-top: var(--spacing-base);
20586
20586
  `;
20587
+ var SortFilterInputRow = css92`
20588
+ align-items: center;
20589
+ display: flex;
20590
+ gap: var(--spacing-sm);
20591
+ `;
20587
20592
 
20588
20593
  // src/components/SearchAndFilter/FilterButton.tsx
20589
20594
  import { jsx as jsx117, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
@@ -20616,7 +20621,7 @@ var FilterButton2 = ({
20616
20621
 
20617
20622
  // src/components/SearchAndFilter/FilterControls.tsx
20618
20623
  import { useEffect as useEffect18, useState as useState17 } from "react";
20619
- import { useDebounce as useDebounce2 } from "react-use";
20624
+ import { useDebounce as useDebounce2, useEffectOnce } from "react-use";
20620
20625
 
20621
20626
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
20622
20627
  import {
@@ -20765,7 +20770,9 @@ var FilterControls = ({
20765
20770
  sortByValue,
20766
20771
  filterOptions
20767
20772
  } = useSearchAndFilter();
20773
+ const [initialSortValue, setInitialSortValue] = useState17(sortByValue);
20768
20774
  const [localeSearchTerm, setLocaleSearchTerm] = useState17("");
20775
+ const [userHasChangedSortByValue, setUserHasChangedSortByValue] = useState17(false);
20769
20776
  useDebounce2(
20770
20777
  () => {
20771
20778
  setSearchTerm(localeSearchTerm);
@@ -20779,7 +20786,7 @@ var FilterControls = ({
20779
20786
  }
20780
20787
  }, [searchTerm]);
20781
20788
  const handleFilterToggle = (mode) => {
20782
- if (filterVisibility && ["sort", "filters"].includes(filterVisibility)) {
20789
+ if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
20783
20790
  return setFilterVisibility(void 0);
20784
20791
  }
20785
20792
  return setFilterVisibility(mode);
@@ -20789,7 +20796,15 @@ var FilterControls = ({
20789
20796
  const sortField = sortValue == null ? void 0 : sortValue.join("_");
20790
20797
  const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
20791
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;
20792
- 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]);
20793
20808
  return /* @__PURE__ */ jsxs80(Fragment19, { children: [
20794
20809
  /* @__PURE__ */ jsx119(
20795
20810
  FilterButton2,
@@ -20808,7 +20823,7 @@ var FilterControls = ({
20808
20823
  "aria-controls": "search-and-filter-sortBy",
20809
20824
  "aria-label": "sort by options",
20810
20825
  "aria-haspopup": "true",
20811
- text: sortByValueLabel,
20826
+ text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
20812
20827
  icon: sortByIcon,
20813
20828
  "aria-expanded": filterVisibility === "sort",
20814
20829
  hasSelectedValue: sortByValue !== "",
@@ -20980,6 +20995,14 @@ var FilterMultiChoiceEditor = ({
20980
20995
  },
20981
20996
  value,
20982
20997
  "aria-readonly": readOnly,
20998
+ styles: {
20999
+ menu(base) {
21000
+ return {
21001
+ ...base,
21002
+ minWidth: "max-content"
21003
+ };
21004
+ }
21005
+ },
20983
21006
  ...readOnlyProps
20984
21007
  }
20985
21008
  ) });
@@ -21006,6 +21029,14 @@ var FilterSingleChoiceEditor = ({
21006
21029
  isDisabled,
21007
21030
  value,
21008
21031
  "aria-readonly": readOnly,
21032
+ styles: {
21033
+ menu(base) {
21034
+ return {
21035
+ ...base,
21036
+ minWidth: "max-content"
21037
+ };
21038
+ }
21039
+ },
21009
21040
  ...readOnlyProps
21010
21041
  }
21011
21042
  ) });
@@ -21034,6 +21065,14 @@ var StatusMultiEditor = ({
21034
21065
  formatOptionLabel: CustomOptions,
21035
21066
  value,
21036
21067
  isDisabled,
21068
+ styles: {
21069
+ menu(base) {
21070
+ return {
21071
+ ...base,
21072
+ minWidth: "max-content"
21073
+ };
21074
+ }
21075
+ },
21037
21076
  ...readOnlyProps
21038
21077
  }
21039
21078
  ) });
@@ -21058,6 +21097,14 @@ var StatusSingleEditor = ({
21058
21097
  formatOptionLabel: CustomOptions,
21059
21098
  value,
21060
21099
  isDisabled,
21100
+ styles: {
21101
+ menu(base) {
21102
+ return {
21103
+ ...base,
21104
+ minWidth: "max-content"
21105
+ };
21106
+ }
21107
+ },
21061
21108
  ...readOnlyProps
21062
21109
  }
21063
21110
  ) });
@@ -21323,7 +21370,7 @@ var SearchAndFilterOptionsContainer2 = ({
21323
21370
  ) : null
21324
21371
  ] });
21325
21372
  };
21326
- var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children }) => {
21373
+ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
21327
21374
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
21328
21375
  const innerMenuRef = React24.useRef(null);
21329
21376
  useEffect20(() => {
@@ -21398,7 +21445,7 @@ var FilterItem = ({
21398
21445
  isClearable: false
21399
21446
  } : {};
21400
21447
  return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
21401
- /* @__PURE__ */ jsx123("span", { children: index === 0 ? "where" : "and" }),
21448
+ /* @__PURE__ */ jsx123("span", { children: index === 0 ? "Where" : "and" }),
21402
21449
  /* @__PURE__ */ jsxs83("div", { css: ConditionalInputRow, children: [
21403
21450
  /* @__PURE__ */ jsx123(
21404
21451
  InputComboBox,
@@ -21409,6 +21456,18 @@ var FilterItem = ({
21409
21456
  var _a2;
21410
21457
  onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
21411
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
+ },
21412
21471
  value: selectedFieldValue,
21413
21472
  ...readOnlyProps,
21414
21473
  id: "filter-field"
@@ -21425,6 +21484,14 @@ var FilterItem = ({
21425
21484
  },
21426
21485
  isDisabled: !filters[index].field,
21427
21486
  value: selectedOperatorValue,
21487
+ styles: {
21488
+ menu(base) {
21489
+ return {
21490
+ ...base,
21491
+ minWidth: "max-content"
21492
+ };
21493
+ }
21494
+ },
21428
21495
  ...readOnlyProps,
21429
21496
  id: "filter-operator"
21430
21497
  }
@@ -21442,7 +21509,7 @@ var FilterItem = ({
21442
21509
  valueTestId: "filter-value"
21443
21510
  }
21444
21511
  ),
21445
- /* @__PURE__ */ jsx123(
21512
+ readOnly ? null : /* @__PURE__ */ jsx123(
21446
21513
  "button",
21447
21514
  {
21448
21515
  type: "button",
@@ -21462,6 +21529,7 @@ var FilterItems = ({
21462
21529
  }) => {
21463
21530
  const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
21464
21531
  const handleUpdateFilter = (index, prop, value) => {
21532
+ var _a, _b, _c, _d, _e;
21465
21533
  const next = [...filters];
21466
21534
  next[index] = { ...next[index], [prop]: value };
21467
21535
  if (prop === "operator") {
@@ -21474,7 +21542,11 @@ var FilterItems = ({
21474
21542
  }
21475
21543
  }
21476
21544
  if (prop === "field") {
21477
- 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;
21478
21550
  next[index].value = "";
21479
21551
  }
21480
21552
  setFilters(next);
@@ -21753,7 +21825,7 @@ var SortItems = () => {
21753
21825
  var _a2;
21754
21826
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
21755
21827
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
21756
- 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: [
21757
21829
  /* @__PURE__ */ jsx125(
21758
21830
  InputComboBox,
21759
21831
  {
@@ -21762,6 +21834,14 @@ var SortItems = () => {
21762
21834
  const fieldName = e == null ? void 0 : e.value;
21763
21835
  setSortBy(`${fieldName}_${sortDirection}`);
21764
21836
  },
21837
+ styles: {
21838
+ menu(base) {
21839
+ return {
21840
+ ...base,
21841
+ minWidth: "max-content"
21842
+ };
21843
+ }
21844
+ },
21765
21845
  value: currentSelectedOption
21766
21846
  }
21767
21847
  ),
@@ -21778,7 +21858,7 @@ var SortItems = () => {
21778
21858
  value: sortDirection
21779
21859
  }
21780
21860
  )
21781
- ] }) }) });
21861
+ ] }) });
21782
21862
  };
21783
21863
 
21784
21864
  // src/components/SearchAndFilter/FilterModeView.tsx
package/dist/index.d.mts CHANGED
@@ -23028,6 +23028,8 @@ type FilterOption = {
23028
23028
  valueOptions?: InputOption[];
23029
23029
  /** Set a readonly state on the input */
23030
23030
  readOnly?: boolean;
23031
+ /** Set a disabled state on the input */
23032
+ disabled?: boolean;
23031
23033
  };
23032
23034
  /** @deprecated beta - Filter selected and query value props */
23033
23035
  type Filter = {
package/dist/index.d.ts CHANGED
@@ -23028,6 +23028,8 @@ type FilterOption = {
23028
23028
  valueOptions?: InputOption[];
23029
23029
  /** Set a readonly state on the input */
23030
23030
  readOnly?: boolean;
23031
+ /** Set a disabled state on the input */
23032
+ disabled?: boolean;
23031
23033
  };
23032
23034
  /** @deprecated beta - Filter selected and query value props */
23033
23035
  type Filter = {
package/dist/index.js CHANGED
@@ -4201,7 +4201,7 @@ var import_react22 = require("@emotion/react");
4201
4201
  var PageHeaderSectionContainer = import_react22.css`
4202
4202
  display: flex;
4203
4203
  justify-content: space-between;
4204
- margin-bottom: var(--spacing-lg);
4204
+ margin-bottom: var(--spacing-sm);
4205
4205
  flex-direction: column;
4206
4206
  gap: var(--spacing-sm);
4207
4207
 
@@ -15580,7 +15580,8 @@ function InputComboBox(props) {
15580
15580
  background: "var(--gray-100)",
15581
15581
  "&:hover": {
15582
15582
  borderColor: "var(--gray-300)"
15583
- }
15583
+ },
15584
+ ...state.isFocused ? { borderColor: "var(--gray-300)" } : {}
15584
15585
  },
15585
15586
  ...(_b = (_a2 = props.styles) == null ? void 0 : _a2.control) == null ? void 0 : _b.call(_a2, base, state)
15586
15587
  };
@@ -22351,7 +22352,6 @@ var AddConditionalBtn = import_react138.css`
22351
22352
  gap: var(--spacing-sm);
22352
22353
  transition: color var(--duration-fast) var(--timing-ease-out);
22353
22354
  padding: 0;
22354
- font-size: var(--fs-sm);
22355
22355
 
22356
22356
  &:hover,
22357
22357
  &:focus {
@@ -22406,7 +22406,7 @@ var SearchAndFilterOptionsContainer = import_react138.css`
22406
22406
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
22407
22407
  will-change: height;
22408
22408
  position: relative;
22409
- z-index: 2;
22409
+ z-index: 1;
22410
22410
  `;
22411
22411
  var SearchAndFilterOptionsInnerContainer = import_react138.css`
22412
22412
  display: flex;
@@ -22416,6 +22416,11 @@ var SearchAndFilterOptionsInnerContainer = import_react138.css`
22416
22416
  var SearchAndFilterButtonGroup = import_react138.css`
22417
22417
  margin-top: var(--spacing-base);
22418
22418
  `;
22419
+ var SortFilterInputRow = import_react138.css`
22420
+ align-items: center;
22421
+ display: flex;
22422
+ gap: var(--spacing-sm);
22423
+ `;
22419
22424
 
22420
22425
  // src/components/SearchAndFilter/FilterButton.tsx
22421
22426
  var import_jsx_runtime117 = require("@emotion/react/jsx-runtime");
@@ -22591,7 +22596,9 @@ var FilterControls = ({
22591
22596
  sortByValue,
22592
22597
  filterOptions
22593
22598
  } = useSearchAndFilter();
22599
+ const [initialSortValue, setInitialSortValue] = (0, import_react140.useState)(sortByValue);
22594
22600
  const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react140.useState)("");
22601
+ const [userHasChangedSortByValue, setUserHasChangedSortByValue] = (0, import_react140.useState)(false);
22595
22602
  (0, import_react_use3.useDebounce)(
22596
22603
  () => {
22597
22604
  setSearchTerm(localeSearchTerm);
@@ -22605,7 +22612,7 @@ var FilterControls = ({
22605
22612
  }
22606
22613
  }, [searchTerm]);
22607
22614
  const handleFilterToggle = (mode) => {
22608
- if (filterVisibility && ["sort", "filters"].includes(filterVisibility)) {
22615
+ if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
22609
22616
  return setFilterVisibility(void 0);
22610
22617
  }
22611
22618
  return setFilterVisibility(mode);
@@ -22615,7 +22622,15 @@ var FilterControls = ({
22615
22622
  const sortField = sortValue == null ? void 0 : sortValue.join("_");
22616
22623
  const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
22617
22624
  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;
22618
- const sortByIcon = sortDirection === "ASC" ? "arrow-up" : "arrow-down";
22625
+ const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
22626
+ (0, import_react_use3.useEffectOnce)(() => {
22627
+ setInitialSortValue(sortByValue);
22628
+ });
22629
+ (0, import_react140.useEffect)(() => {
22630
+ if (initialSortValue !== sortByValue) {
22631
+ setUserHasChangedSortByValue(true);
22632
+ }
22633
+ }, [initialSortValue, sortByValue]);
22619
22634
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
22620
22635
  /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
22621
22636
  FilterButton2,
@@ -22634,7 +22649,7 @@ var FilterControls = ({
22634
22649
  "aria-controls": "search-and-filter-sortBy",
22635
22650
  "aria-label": "sort by options",
22636
22651
  "aria-haspopup": "true",
22637
- text: sortByValueLabel,
22652
+ text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
22638
22653
  icon: sortByIcon,
22639
22654
  "aria-expanded": filterVisibility === "sort",
22640
22655
  hasSelectedValue: sortByValue !== "",
@@ -22812,6 +22827,14 @@ var FilterMultiChoiceEditor = ({
22812
22827
  },
22813
22828
  value,
22814
22829
  "aria-readonly": readOnly,
22830
+ styles: {
22831
+ menu(base) {
22832
+ return {
22833
+ ...base,
22834
+ minWidth: "max-content"
22835
+ };
22836
+ }
22837
+ },
22815
22838
  ...readOnlyProps
22816
22839
  }
22817
22840
  ) });
@@ -22838,6 +22861,14 @@ var FilterSingleChoiceEditor = ({
22838
22861
  isDisabled,
22839
22862
  value,
22840
22863
  "aria-readonly": readOnly,
22864
+ styles: {
22865
+ menu(base) {
22866
+ return {
22867
+ ...base,
22868
+ minWidth: "max-content"
22869
+ };
22870
+ }
22871
+ },
22841
22872
  ...readOnlyProps
22842
22873
  }
22843
22874
  ) });
@@ -22866,6 +22897,14 @@ var StatusMultiEditor = ({
22866
22897
  formatOptionLabel: CustomOptions,
22867
22898
  value,
22868
22899
  isDisabled,
22900
+ styles: {
22901
+ menu(base) {
22902
+ return {
22903
+ ...base,
22904
+ minWidth: "max-content"
22905
+ };
22906
+ }
22907
+ },
22869
22908
  ...readOnlyProps
22870
22909
  }
22871
22910
  ) });
@@ -22890,6 +22929,14 @@ var StatusSingleEditor = ({
22890
22929
  formatOptionLabel: CustomOptions,
22891
22930
  value,
22892
22931
  isDisabled,
22932
+ styles: {
22933
+ menu(base) {
22934
+ return {
22935
+ ...base,
22936
+ minWidth: "max-content"
22937
+ };
22938
+ }
22939
+ },
22893
22940
  ...readOnlyProps
22894
22941
  }
22895
22942
  ) });
@@ -23156,7 +23203,7 @@ var SearchAndFilterOptionsContainer2 = ({
23156
23203
  ) : null
23157
23204
  ] });
23158
23205
  };
23159
- var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children }) => {
23206
+ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
23160
23207
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
23161
23208
  const innerMenuRef = import_react143.default.useRef(null);
23162
23209
  (0, import_react143.useEffect)(() => {
@@ -23231,7 +23278,7 @@ var FilterItem = ({
23231
23278
  isClearable: false
23232
23279
  } : {};
23233
23280
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
23234
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: index === 0 ? "where" : "and" }),
23281
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: index === 0 ? "Where" : "and" }),
23235
23282
  /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalInputRow, children: [
23236
23283
  /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23237
23284
  InputComboBox,
@@ -23242,6 +23289,18 @@ var FilterItem = ({
23242
23289
  var _a2;
23243
23290
  onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
23244
23291
  },
23292
+ isOptionDisabled: (option) => {
23293
+ var _a2;
23294
+ return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
23295
+ },
23296
+ styles: {
23297
+ menu(base) {
23298
+ return {
23299
+ ...base,
23300
+ minWidth: "max-content"
23301
+ };
23302
+ }
23303
+ },
23245
23304
  value: selectedFieldValue,
23246
23305
  ...readOnlyProps,
23247
23306
  id: "filter-field"
@@ -23258,6 +23317,14 @@ var FilterItem = ({
23258
23317
  },
23259
23318
  isDisabled: !filters[index].field,
23260
23319
  value: selectedOperatorValue,
23320
+ styles: {
23321
+ menu(base) {
23322
+ return {
23323
+ ...base,
23324
+ minWidth: "max-content"
23325
+ };
23326
+ }
23327
+ },
23261
23328
  ...readOnlyProps,
23262
23329
  id: "filter-operator"
23263
23330
  }
@@ -23275,7 +23342,7 @@ var FilterItem = ({
23275
23342
  valueTestId: "filter-value"
23276
23343
  }
23277
23344
  ),
23278
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23345
+ readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23279
23346
  "button",
23280
23347
  {
23281
23348
  type: "button",
@@ -23295,6 +23362,7 @@ var FilterItems = ({
23295
23362
  }) => {
23296
23363
  const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
23297
23364
  const handleUpdateFilter = (index, prop, value) => {
23365
+ var _a, _b, _c, _d, _e;
23298
23366
  const next = [...filters];
23299
23367
  next[index] = { ...next[index], [prop]: value };
23300
23368
  if (prop === "operator") {
@@ -23307,7 +23375,11 @@ var FilterItems = ({
23307
23375
  }
23308
23376
  }
23309
23377
  if (prop === "field") {
23310
- next[index].operator = "";
23378
+ const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
23379
+ var _a2;
23380
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
23381
+ })) == 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";
23382
+ next[index].operator = firstOperatorInAvailableOperators;
23311
23383
  next[index].value = "";
23312
23384
  }
23313
23385
  setFilters(next);
@@ -23597,7 +23669,7 @@ var SortItems = () => {
23597
23669
  var _a2;
23598
23670
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
23599
23671
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
23600
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { css: ConditionalFilterRow, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: ConditionalInputRow, children: [
23672
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: SortFilterInputRow, children: [
23601
23673
  /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23602
23674
  InputComboBox,
23603
23675
  {
@@ -23606,6 +23678,14 @@ var SortItems = () => {
23606
23678
  const fieldName = e == null ? void 0 : e.value;
23607
23679
  setSortBy(`${fieldName}_${sortDirection}`);
23608
23680
  },
23681
+ styles: {
23682
+ menu(base) {
23683
+ return {
23684
+ ...base,
23685
+ minWidth: "max-content"
23686
+ };
23687
+ }
23688
+ },
23609
23689
  value: currentSelectedOption
23610
23690
  }
23611
23691
  ),
@@ -23622,7 +23702,7 @@ var SortItems = () => {
23622
23702
  value: sortDirection
23623
23703
  }
23624
23704
  )
23625
- ] }) }) });
23705
+ ] }) });
23626
23706
  };
23627
23707
 
23628
23708
  // src/components/SearchAndFilter/FilterModeView.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "19.123.1-alpha.9+0f8fa37358",
3
+ "version": "19.125.2-alpha.3+6bb657551a",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "@storybook/react": "6.5.16",
24
24
  "@types/react": "18.2.40",
25
25
  "@types/react-dom": "18.2.17",
26
- "@uniformdev/canvas": "^19.123.1-alpha.9+0f8fa37358",
27
- "@uniformdev/richtext": "^19.123.1-alpha.9+0f8fa37358",
26
+ "@uniformdev/canvas": "^19.125.2-alpha.3+6bb657551a",
27
+ "@uniformdev/richtext": "^19.125.2-alpha.3+6bb657551a",
28
28
  "autoprefixer": "10.4.16",
29
29
  "hygen": "6.2.11",
30
30
  "postcss": "8.4.32",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "0f8fa37358fa0d8bc2e77e00b09d456c7053ee63"
74
+ "gitHead": "6bb657551ac6e37a7990deace389c581b94176fc"
75
75
  }