@uniformdev/design-system 19.133.0 → 19.134.3-alpha.10

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
@@ -11754,7 +11754,6 @@ var activeMenuItem = css25`
11754
11754
  `;
11755
11755
  var menuItem = (textTheme, forceActive) => css25`
11756
11756
  align-items: center;
11757
- border: none;
11758
11757
  border-radius: var(--rounded-base);
11759
11758
  background: none;
11760
11759
  color: ${textTheme === "base" ? "var(--typography-base)" : "var(--brand-secondary-5)"};
@@ -11777,6 +11776,11 @@ var menuItem = (textTheme, forceActive) => css25`
11777
11776
  &[data-active-item] {
11778
11777
  ${typeof forceActive === "undefined" ? activeMenuItem : ""}
11779
11778
  }
11779
+
11780
+ // Remove border from input elements, this fixes UNI-4634
11781
+ &:not(input[type='radio'], input[type='checkbox']) {
11782
+ border: none;
11783
+ }
11780
11784
  `;
11781
11785
  var menuItemWithIcon = css25`
11782
11786
  align-items: center;
@@ -11848,7 +11852,7 @@ function isMenuSeparator(child) {
11848
11852
 
11849
11853
  // src/components/Menu/Menu.styles.ts
11850
11854
  import { css as css26 } from "@emotion/react";
11851
- var menuStyles = css26`
11855
+ var menuStyles = (maxMenuHeight) => css26`
11852
11856
  box-shadow: var(--shadow-base);
11853
11857
  border-radius: var(--rounded-base);
11854
11858
  background: var(--gray-50);
@@ -11858,10 +11862,21 @@ var menuStyles = css26`
11858
11862
  outline: none;
11859
11863
  position: relative;
11860
11864
  z-index: var(--z-50);
11861
-
11862
11865
  &:focus {
11863
11866
  outline: none;
11864
11867
  }
11868
+
11869
+ // resolves uni-2997 for smaller screens not being able to access large menus
11870
+ // the code was removed in https://github.com/uniformdev/platform/commit/0067e6c87aaf29147c656949bbf49d632d3e89dc#diff-84f70b10af4d4ec4f57c535e3c44b04c30ce95ac337ce21db9f1ffd8393a846d
11871
+ // but we need to keep it for the Menu component if the menu is larger than the screen
11872
+ ${maxMenuHeight ? `
11873
+ overflow-x: hidden;
11874
+ overflow-y: auto;
11875
+ height: min(${maxMenuHeight}, var(--popover-available-height));
11876
+ scroll-snap-align: start;
11877
+ scroll-snap-stop: always;
11878
+ ${scrollbarStyles}
11879
+ ` : ""}
11865
11880
  `;
11866
11881
 
11867
11882
  // src/components/Menu/Menu.tsx
@@ -11877,6 +11892,7 @@ var Menu = React8.forwardRef(function Menu2({
11877
11892
  disableAutoSeparatorManagement,
11878
11893
  menuItemsContainerCssClasses,
11879
11894
  testId,
11895
+ maxMenuHeight,
11880
11896
  ...props
11881
11897
  }, ref) {
11882
11898
  const placementOverride = legacyPlacements.includes(placement) ? void 0 : placement;
@@ -11891,7 +11907,7 @@ var Menu = React8.forwardRef(function Menu2({
11891
11907
  shift: menu.parent ? -4 : 0,
11892
11908
  ...props,
11893
11909
  css: [
11894
- menuStyles,
11910
+ menuStyles(maxMenuHeight),
11895
11911
  typeof menuItemsContainerCssClasses === "object" ? menuItemsContainerCssClasses : void 0
11896
11912
  ],
11897
11913
  className: typeof menuItemsContainerCssClasses === "string" ? menuItemsContainerCssClasses : "",
@@ -12141,6 +12157,8 @@ var ButtonWithMenu = ({
12141
12157
  placement,
12142
12158
  size = "lg",
12143
12159
  menuContainerCssClasses,
12160
+ withoutPortal = false,
12161
+ maxMenuHeight,
12144
12162
  ...buttonProps
12145
12163
  }) => {
12146
12164
  const buttonTheme = {
@@ -12199,6 +12217,7 @@ var ButtonWithMenu = ({
12199
12217
  placement,
12200
12218
  menuTrigger: clickableButton,
12201
12219
  menuItemsContainerCssClasses: menuContainerCssClasses,
12220
+ maxMenuHeight,
12202
12221
  children
12203
12222
  }
12204
12223
  )
@@ -12209,6 +12228,8 @@ var ButtonWithMenu = ({
12209
12228
  placement,
12210
12229
  menuTrigger: dropdownButton,
12211
12230
  menuItemsContainerCssClasses: menuContainerCssClasses,
12231
+ portal: withoutPortal,
12232
+ maxMenuHeight,
12212
12233
  children
12213
12234
  }
12214
12235
  ) })
@@ -20457,6 +20478,18 @@ var ConditionalFilterRow = css92`
20457
20478
 
20458
20479
  ${cq("380px")} {
20459
20480
  align-items: center;
20481
+
20482
+ &:after {
20483
+ content: '';
20484
+ display: block;
20485
+ height: 1px;
20486
+ background: var(--gray-300);
20487
+ width: calc(100% - var(--spacing-base));
20488
+ margin-left: var(--spacing-base);
20489
+ }
20490
+ &:last-of-type:after {
20491
+ display: none;
20492
+ }
20460
20493
  }
20461
20494
 
20462
20495
  &:first-of-type {
@@ -20464,6 +20497,12 @@ var ConditionalFilterRow = css92`
20464
20497
  grid-template-columns: 50px 1fr;
20465
20498
  }
20466
20499
 
20500
+ ${cq("580px")} {
20501
+ &:after {
20502
+ display: none;
20503
+ }
20504
+ }
20505
+
20467
20506
  @media (prefers-reduced-motion: no-preference) {
20468
20507
  animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
20469
20508
  }
@@ -20471,23 +20510,29 @@ var ConditionalFilterRow = css92`
20471
20510
  var ConditionalInputRow = css92`
20472
20511
  display: flex;
20473
20512
  gap: var(--spacing-sm);
20474
- flex-direction: column;
20513
+ flex-wrap: wrap;
20475
20514
 
20476
20515
  ${cq("380px")} {
20477
- align-items: center;
20478
- flex-direction: row;
20516
+ & > div:nth-child(-n + 2) {
20517
+ width: calc(50% - var(--spacing-sm));
20518
+ }
20519
+
20520
+ & > div:nth-child(n + 3) {
20521
+ width: calc(100% - 48px);
20522
+ }
20479
20523
  }
20480
20524
  ${cq("580px")} {
20481
20525
  display: grid;
20482
20526
  grid-template-columns: 200px 160px 1fr 32px;
20527
+
20528
+ & > div:nth-child(n) {
20529
+ width: auto;
20530
+ }
20483
20531
  }
20484
20532
  `;
20485
20533
  var SearchInput = css92`
20486
- ${input("nowrap")}
20487
- border-radius: var(--rounded-full);
20488
- padding: var(--spacing-sm) var(--spacing-base);
20489
- font-size: var(--fs-sm);
20490
- padding-right: var(--spacing-2xl);
20534
+ max-height: 40px;
20535
+ min-height: unset;
20491
20536
  `;
20492
20537
  var FilterButton = css92`
20493
20538
  align-items: center;
@@ -20496,8 +20541,10 @@ var FilterButton = css92`
20496
20541
  border-radius: var(--rounded-full);
20497
20542
  color: var(--typography-base);
20498
20543
  display: flex;
20544
+ font-size: var(--fs-sm);
20499
20545
  gap: var(--spacing-sm);
20500
20546
  padding: var(--spacing-sm) var(--spacing-base);
20547
+ max-height: 40px;
20501
20548
  transition: color var(--duration-fast) var(--timing-ease-out),
20502
20549
  background-color var(--duration-fast) var(--timing-ease-out),
20503
20550
  border-color var(--duration-fast) var(--timing-ease-out),
@@ -20642,6 +20689,7 @@ var FilterButton2 = ({
20642
20689
  icon = "filter-add",
20643
20690
  filterCount,
20644
20691
  hasSelectedValue,
20692
+ dataTestId,
20645
20693
  ...props
20646
20694
  }) => {
20647
20695
  return /* @__PURE__ */ jsxs80(
@@ -20654,7 +20702,7 @@ var FilterButton2 = ({
20654
20702
  filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
20655
20703
  ],
20656
20704
  ...props,
20657
- "data-testid": "filters-button",
20705
+ "data-testid": dataTestId,
20658
20706
  children: [
20659
20707
  /* @__PURE__ */ jsx118(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
20660
20708
  /* @__PURE__ */ jsx118("span", { css: FilterButtonText, children: text }),
@@ -20712,6 +20760,7 @@ var SearchAndFilterProvider = ({
20712
20760
  onSearchChange,
20713
20761
  onChange,
20714
20762
  onSortChange,
20763
+ resetFilterValues = [],
20715
20764
  totalResults,
20716
20765
  children
20717
20766
  }) => {
@@ -20741,8 +20790,8 @@ var SearchAndFilterProvider = ({
20741
20790
  onChange([...filters, { field: "", operator: "", value: "" }]);
20742
20791
  }, [filters, onChange]);
20743
20792
  const handleResetFilters = useCallback10(() => {
20744
- onChange([]);
20745
- }, [onChange]);
20793
+ onChange(resetFilterValues);
20794
+ }, [onChange, resetFilterValues]);
20746
20795
  const handleDeleteFilter = useCallback10(
20747
20796
  (index) => {
20748
20797
  const remainingFilters = filters.filter((_, i) => i !== index);
@@ -20859,7 +20908,8 @@ var FilterControls = ({
20859
20908
  "aria-haspopup": "true",
20860
20909
  "aria-expanded": filterVisibility === "filters",
20861
20910
  filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
20862
- onClick: () => handleFilterToggle("filters")
20911
+ onClick: () => handleFilterToggle("filters"),
20912
+ dataTestId: "filters-button"
20863
20913
  }
20864
20914
  ),
20865
20915
  /* @__PURE__ */ jsx120(
@@ -20873,7 +20923,7 @@ var FilterControls = ({
20873
20923
  "aria-expanded": filterVisibility === "sort",
20874
20924
  hasSelectedValue: sortByValue !== "",
20875
20925
  onClick: () => handleFilterToggle("sort"),
20876
- "data-testid": "sort-by-dropdown"
20926
+ dataTestId: "sort-by-button"
20877
20927
  }
20878
20928
  ),
20879
20929
  hideSearchInput ? null : /* @__PURE__ */ jsx120(
@@ -20883,7 +20933,8 @@ var FilterControls = ({
20883
20933
  onSearchTextChanged: (e) => setLocaleSearchTerm(e),
20884
20934
  value: localeSearchTerm,
20885
20935
  compact: true,
20886
- rounded: true
20936
+ rounded: true,
20937
+ css: SearchInput
20887
20938
  }
20888
20939
  ),
20889
20940
  children
@@ -21401,7 +21452,7 @@ var SearchAndFilterOptionsContainer2 = ({
21401
21452
  buttonRow,
21402
21453
  children
21403
21454
  }) => {
21404
- return /* @__PURE__ */ jsxs83("div", { css: SearchAndFilterOptionsContainer, "data-testid": "search-and-filter-options", children: [
21455
+ return /* @__PURE__ */ jsxs83("div", { css: SearchAndFilterOptionsContainer, children: [
21405
21456
  /* @__PURE__ */ jsx123("div", { css: SearchAndFilterOptionsInnerContainer, children }),
21406
21457
  buttonRow ? /* @__PURE__ */ jsx123(
21407
21458
  HorizontalRhythm,
@@ -21415,7 +21466,13 @@ var SearchAndFilterOptionsContainer2 = ({
21415
21466
  ) : null
21416
21467
  ] });
21417
21468
  };
21418
- var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
21469
+ var FilterMenu = ({
21470
+ id,
21471
+ filterTitle = "Show results",
21472
+ menuControls,
21473
+ children,
21474
+ dataTestId
21475
+ }) => {
21419
21476
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
21420
21477
  const innerMenuRef = React24.useRef(null);
21421
21478
  useEffect20(() => {
@@ -21424,7 +21481,7 @@ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children })
21424
21481
  (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
21425
21482
  }
21426
21483
  }, [filterVisibility]);
21427
- return /* @__PURE__ */ jsx123(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, children: filterVisibility ? /* @__PURE__ */ jsxs83(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, children: [
21484
+ return /* @__PURE__ */ jsx123(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs83(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, children: [
21428
21485
  /* @__PURE__ */ jsx123("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
21429
21486
  /* @__PURE__ */ jsx123(
21430
21487
  "button",
@@ -21433,6 +21490,7 @@ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children })
21433
21490
  "aria-label": "close filters",
21434
21491
  css: [CloseBtn],
21435
21492
  onClick: () => setFilterVisibility(void 0),
21493
+ "data-testid": "close-filters",
21436
21494
  children: /* @__PURE__ */ jsx123(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
21437
21495
  }
21438
21496
  ),
@@ -21578,7 +21636,12 @@ var FilterItems = ({
21578
21636
  const next = [...filters];
21579
21637
  next[index] = { ...next[index], [prop]: value };
21580
21638
  if (prop === "operator") {
21581
- next[index].value = "";
21639
+ if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
21640
+ next[index].value = next[index].value[0];
21641
+ }
21642
+ if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
21643
+ next[index].value = [next[index].value, ""];
21644
+ }
21582
21645
  if (value === "def" || value === "true") {
21583
21646
  next[index].value = "true";
21584
21647
  }
@@ -21600,6 +21663,7 @@ var FilterItems = ({
21600
21663
  FilterMenu,
21601
21664
  {
21602
21665
  id: "search-and-filter-options",
21666
+ dataTestId: "search-and-filter-options",
21603
21667
  menuControls: /* @__PURE__ */ jsxs84(Fragment21, { children: [
21604
21668
  /* @__PURE__ */ jsxs84(
21605
21669
  "button",
@@ -21870,7 +21934,7 @@ var SortItems = () => {
21870
21934
  var _a2;
21871
21935
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
21872
21936
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
21873
- return /* @__PURE__ */ jsx126(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsxs86("div", { css: SortFilterInputRow, children: [
21937
+ return /* @__PURE__ */ jsx126(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", dataTestId: "sorting-options", children: /* @__PURE__ */ jsxs86("div", { css: SortFilterInputRow, children: [
21874
21938
  /* @__PURE__ */ jsx126(
21875
21939
  InputComboBox,
21876
21940
  {
@@ -21887,7 +21951,8 @@ var SortItems = () => {
21887
21951
  };
21888
21952
  }
21889
21953
  },
21890
- value: currentSelectedOption
21954
+ value: currentSelectedOption,
21955
+ id: "sort-by-field"
21891
21956
  }
21892
21957
  ),
21893
21958
  /* @__PURE__ */ jsx126(
@@ -21900,7 +21965,8 @@ var SortItems = () => {
21900
21965
  { label: "Descending", value: `DESC` }
21901
21966
  ],
21902
21967
  onChange: (e) => setSortBy(`${sortField}_${e}`),
21903
- value: sortDirection
21968
+ value: sortDirection,
21969
+ "data-testid": "ordering-options"
21904
21970
  }
21905
21971
  )
21906
21972
  ] }) });
@@ -21983,7 +22049,8 @@ var SearchAndFilter = ({
21983
22049
  onChange,
21984
22050
  onSearchChange,
21985
22051
  onSortChange,
21986
- totalResults
22052
+ totalResults,
22053
+ resetFilterValues = []
21987
22054
  }) => {
21988
22055
  return /* @__PURE__ */ jsx129(
21989
22056
  SearchAndFilterProvider,
@@ -21997,6 +22064,7 @@ var SearchAndFilter = ({
21997
22064
  onSearchChange,
21998
22065
  onSortChange,
21999
22066
  totalResults,
22067
+ resetFilterValues,
22000
22068
  children: /* @__PURE__ */ jsxs88(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
22001
22069
  /* @__PURE__ */ jsxs88("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
22002
22070
  /* @__PURE__ */ jsx129(
package/dist/index.d.mts CHANGED
@@ -21103,6 +21103,15 @@ interface ActionButtonsProps {
21103
21103
  size?: ButtonSizeProps;
21104
21104
  /** sets additional Menu component styles */
21105
21105
  menuContainerCssClasses?: SerializedStyles;
21106
+ /** sets whether to use a React portal rendering or not.
21107
+ * @default false
21108
+ */
21109
+ withoutPortal?: boolean;
21110
+ /** (optional) sets the maximum height of the menu
21111
+ * setting a max menu height value will make the menu scrollable if the content exceeds the height
21112
+ * this is not compatible with nested menus that expand to the left or right of the menu
21113
+ */
21114
+ maxMenuHeight?: string;
21106
21115
  }
21107
21116
  /** ButtonWithMenuProps combines the ActionButtonsProps with React HTMLButtonElement attributes */
21108
21117
  type ButtonWithMenuProps = ActionButtonsProps & React$1.ButtonHTMLAttributes<HTMLButtonElement>;
@@ -21128,7 +21137,7 @@ type ButtonWithMenuProps = ActionButtonsProps & React$1.ButtonHTMLAttributes<HTM
21128
21137
  </MenuItem>
21129
21138
  </ButtonWithMenu>
21130
21139
  */
21131
- declare const ButtonWithMenu: ({ onButtonClick, buttonType, buttonText, icon, disabled, children, placement, size, menuContainerCssClasses, ...buttonProps }: ButtonWithMenuProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21140
+ declare const ButtonWithMenu: ({ onButtonClick, buttonType, buttonText, icon, disabled, children, placement, size, menuContainerCssClasses, withoutPortal, maxMenuHeight, ...buttonProps }: ButtonWithMenuProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21132
21141
 
21133
21142
  /**
21134
21143
  * A string in the ISO 8601 date format: YYYY-MM-DD
@@ -22373,6 +22382,11 @@ interface MenuProps extends MenuProps$2 {
22373
22382
  withoutPortal?: boolean;
22374
22383
  /** (optional) sets the test id attribute */
22375
22384
  testId?: string;
22385
+ /** (optional) sets the maximum height of the menu
22386
+ * setting a max menu height value will make the menu scrollable if the content exceeds the height
22387
+ * this is not compatible with nested menus that expand to the left or right of the menu
22388
+ */
22389
+ maxMenuHeight?: string;
22376
22390
  }
22377
22391
  /**
22378
22392
  * Component used for creating clickable menus
@@ -23086,12 +23100,14 @@ type FilterButtonProps = {
23086
23100
  filterCount?: number;
23087
23101
  /** sets the selected styles on the button */
23088
23102
  hasSelectedValue?: boolean;
23103
+ /** sets the data-testid attribute on the button */
23104
+ dataTestId?: string;
23089
23105
  } & HTMLAttributes<HTMLButtonElement>;
23090
23106
  /**
23091
23107
  * @deprecated beta - A filter button component used to display filter menu options
23092
23108
  * @example <FilterButton text="Filters" filterCount={3} />
23093
23109
  */
23094
- declare const FilterButton: ({ text, icon, filterCount, hasSelectedValue, ...props }: FilterButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23110
+ declare const FilterButton: ({ text, icon, filterCount, hasSelectedValue, dataTestId, ...props }: FilterButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23095
23111
 
23096
23112
  /**
23097
23113
  * @deprecated beta - Default filter controls for search and filter
@@ -23153,12 +23169,14 @@ type FiltersProps = {
23153
23169
  menuControls?: React__default.ReactNode;
23154
23170
  /** The children of the filter menu */
23155
23171
  children: React__default.ReactNode;
23172
+ /** Sets the data-test-id attribute for the filter menu */
23173
+ dataTestId?: string;
23156
23174
  };
23157
23175
  /**
23158
23176
  * @deprecated beta - A filter menu component used to display filter options
23159
23177
  * @example <FilterMenu id="search-and-filter-options">Children</FilterMenu>
23160
23178
  * */
23161
- declare const FilterMenu: ({ id, filterTitle, menuControls, children }: FiltersProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23179
+ declare const FilterMenu: ({ id, filterTitle, menuControls, children, dataTestId, }: FiltersProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23162
23180
 
23163
23181
  type SearchAndFilterProviderProps = {
23164
23182
  /** sets the filter values */
@@ -23171,6 +23189,10 @@ type SearchAndFilterProviderProps = {
23171
23189
  onChange: (filters: Filter[]) => void;
23172
23190
  /** function to trigger sort change events */
23173
23191
  onSortChange: (sort: string) => void;
23192
+ /** sets the reset filter values
23193
+ * @default []
23194
+ */
23195
+ resetFilterValues?: Filter[];
23174
23196
  /** sets the list of filter options for each filter row */
23175
23197
  filterOptions: FilterOption[];
23176
23198
  /** sets the list of sort options */
@@ -23201,7 +23223,7 @@ type SearchAndFilterContextProps = {
23201
23223
  /** function that adds a blank set of filter options */
23202
23224
  handleAddFilter: () => void;
23203
23225
  /** function to reset all filter values */
23204
- handleResetFilters: () => void;
23226
+ handleResetFilters: (filters?: Filter[]) => void;
23205
23227
  /** function that deletes a row and it's values visually and from state */
23206
23228
  handleDeleteFilter: (index: number) => void;
23207
23229
  /** sets the initial list of filter options */
@@ -23220,7 +23242,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
23220
23242
  * @deprecated beta - Search and filter provider
23221
23243
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
23222
23244
  * */
23223
- declare const SearchAndFilterProvider: ({ filters, filterOptions, sortOptions, defaultSortByValue, filterMode, onSearchChange, onChange, onSortChange, totalResults, children, }: SearchAndFilterProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23245
+ declare const SearchAndFilterProvider: ({ filters, filterOptions, sortOptions, defaultSortByValue, filterMode, onSearchChange, onChange, onSortChange, resetFilterValues, totalResults, children, }: SearchAndFilterProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23224
23246
  /** @deprecated beta - Search and filter hook
23225
23247
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
23226
23248
  */
@@ -23242,7 +23264,7 @@ declare const useSearchAndFilter: () => {
23242
23264
  /** function that adds a blank set of filter options */
23243
23265
  handleAddFilter: () => void;
23244
23266
  /** function to reset all filter values */
23245
- handleResetFilters: () => void;
23267
+ handleResetFilters: (filters?: Filter[]) => void;
23246
23268
  /** function that deletes a row and it's values visually and from state */
23247
23269
  handleDeleteFilter: (index: number) => void;
23248
23270
  /** sets the initial list of filter options */
@@ -23274,6 +23296,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
23274
23296
  * @default '<SearchAndFilterResultContainer />'
23275
23297
  */
23276
23298
  resultsContainerView?: React$1.ReactNode;
23299
+ /** sets the reset filter values */
23300
+ resetFilterValues?: Filter[];
23277
23301
  /** The children of the search and filter component */
23278
23302
  children?: React$1.ReactNode;
23279
23303
  };
@@ -23281,7 +23305,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
23281
23305
  * @deprecated beta - Search and filter component
23282
23306
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
23283
23307
  * */
23284
- declare const SearchAndFilter: ({ filters, filterOptions, filterMode, sortOptions, defaultSortByValue, filterControls, viewSwitchControls, resultsContainerView, children, onChange, onSearchChange, onSortChange, totalResults, }: SearchAndFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23308
+ declare const SearchAndFilter: ({ filters, filterOptions, filterMode, sortOptions, defaultSortByValue, filterControls, viewSwitchControls, resultsContainerView, children, onChange, onSearchChange, onSortChange, totalResults, resetFilterValues, }: SearchAndFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23285
23309
 
23286
23310
  type SearchAndFilterResultContainerProps = {
23287
23311
  /** The label for the clear button
package/dist/index.d.ts CHANGED
@@ -21103,6 +21103,15 @@ interface ActionButtonsProps {
21103
21103
  size?: ButtonSizeProps;
21104
21104
  /** sets additional Menu component styles */
21105
21105
  menuContainerCssClasses?: SerializedStyles;
21106
+ /** sets whether to use a React portal rendering or not.
21107
+ * @default false
21108
+ */
21109
+ withoutPortal?: boolean;
21110
+ /** (optional) sets the maximum height of the menu
21111
+ * setting a max menu height value will make the menu scrollable if the content exceeds the height
21112
+ * this is not compatible with nested menus that expand to the left or right of the menu
21113
+ */
21114
+ maxMenuHeight?: string;
21106
21115
  }
21107
21116
  /** ButtonWithMenuProps combines the ActionButtonsProps with React HTMLButtonElement attributes */
21108
21117
  type ButtonWithMenuProps = ActionButtonsProps & React$1.ButtonHTMLAttributes<HTMLButtonElement>;
@@ -21128,7 +21137,7 @@ type ButtonWithMenuProps = ActionButtonsProps & React$1.ButtonHTMLAttributes<HTM
21128
21137
  </MenuItem>
21129
21138
  </ButtonWithMenu>
21130
21139
  */
21131
- declare const ButtonWithMenu: ({ onButtonClick, buttonType, buttonText, icon, disabled, children, placement, size, menuContainerCssClasses, ...buttonProps }: ButtonWithMenuProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21140
+ declare const ButtonWithMenu: ({ onButtonClick, buttonType, buttonText, icon, disabled, children, placement, size, menuContainerCssClasses, withoutPortal, maxMenuHeight, ...buttonProps }: ButtonWithMenuProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
21132
21141
 
21133
21142
  /**
21134
21143
  * A string in the ISO 8601 date format: YYYY-MM-DD
@@ -22373,6 +22382,11 @@ interface MenuProps extends MenuProps$2 {
22373
22382
  withoutPortal?: boolean;
22374
22383
  /** (optional) sets the test id attribute */
22375
22384
  testId?: string;
22385
+ /** (optional) sets the maximum height of the menu
22386
+ * setting a max menu height value will make the menu scrollable if the content exceeds the height
22387
+ * this is not compatible with nested menus that expand to the left or right of the menu
22388
+ */
22389
+ maxMenuHeight?: string;
22376
22390
  }
22377
22391
  /**
22378
22392
  * Component used for creating clickable menus
@@ -23086,12 +23100,14 @@ type FilterButtonProps = {
23086
23100
  filterCount?: number;
23087
23101
  /** sets the selected styles on the button */
23088
23102
  hasSelectedValue?: boolean;
23103
+ /** sets the data-testid attribute on the button */
23104
+ dataTestId?: string;
23089
23105
  } & HTMLAttributes<HTMLButtonElement>;
23090
23106
  /**
23091
23107
  * @deprecated beta - A filter button component used to display filter menu options
23092
23108
  * @example <FilterButton text="Filters" filterCount={3} />
23093
23109
  */
23094
- declare const FilterButton: ({ text, icon, filterCount, hasSelectedValue, ...props }: FilterButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23110
+ declare const FilterButton: ({ text, icon, filterCount, hasSelectedValue, dataTestId, ...props }: FilterButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23095
23111
 
23096
23112
  /**
23097
23113
  * @deprecated beta - Default filter controls for search and filter
@@ -23153,12 +23169,14 @@ type FiltersProps = {
23153
23169
  menuControls?: React__default.ReactNode;
23154
23170
  /** The children of the filter menu */
23155
23171
  children: React__default.ReactNode;
23172
+ /** Sets the data-test-id attribute for the filter menu */
23173
+ dataTestId?: string;
23156
23174
  };
23157
23175
  /**
23158
23176
  * @deprecated beta - A filter menu component used to display filter options
23159
23177
  * @example <FilterMenu id="search-and-filter-options">Children</FilterMenu>
23160
23178
  * */
23161
- declare const FilterMenu: ({ id, filterTitle, menuControls, children }: FiltersProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23179
+ declare const FilterMenu: ({ id, filterTitle, menuControls, children, dataTestId, }: FiltersProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23162
23180
 
23163
23181
  type SearchAndFilterProviderProps = {
23164
23182
  /** sets the filter values */
@@ -23171,6 +23189,10 @@ type SearchAndFilterProviderProps = {
23171
23189
  onChange: (filters: Filter[]) => void;
23172
23190
  /** function to trigger sort change events */
23173
23191
  onSortChange: (sort: string) => void;
23192
+ /** sets the reset filter values
23193
+ * @default []
23194
+ */
23195
+ resetFilterValues?: Filter[];
23174
23196
  /** sets the list of filter options for each filter row */
23175
23197
  filterOptions: FilterOption[];
23176
23198
  /** sets the list of sort options */
@@ -23201,7 +23223,7 @@ type SearchAndFilterContextProps = {
23201
23223
  /** function that adds a blank set of filter options */
23202
23224
  handleAddFilter: () => void;
23203
23225
  /** function to reset all filter values */
23204
- handleResetFilters: () => void;
23226
+ handleResetFilters: (filters?: Filter[]) => void;
23205
23227
  /** function that deletes a row and it's values visually and from state */
23206
23228
  handleDeleteFilter: (index: number) => void;
23207
23229
  /** sets the initial list of filter options */
@@ -23220,7 +23242,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
23220
23242
  * @deprecated beta - Search and filter provider
23221
23243
  * @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
23222
23244
  * */
23223
- declare const SearchAndFilterProvider: ({ filters, filterOptions, sortOptions, defaultSortByValue, filterMode, onSearchChange, onChange, onSortChange, totalResults, children, }: SearchAndFilterProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23245
+ declare const SearchAndFilterProvider: ({ filters, filterOptions, sortOptions, defaultSortByValue, filterMode, onSearchChange, onChange, onSortChange, resetFilterValues, totalResults, children, }: SearchAndFilterProviderProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23224
23246
  /** @deprecated beta - Search and filter hook
23225
23247
  * @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
23226
23248
  */
@@ -23242,7 +23264,7 @@ declare const useSearchAndFilter: () => {
23242
23264
  /** function that adds a blank set of filter options */
23243
23265
  handleAddFilter: () => void;
23244
23266
  /** function to reset all filter values */
23245
- handleResetFilters: () => void;
23267
+ handleResetFilters: (filters?: Filter[]) => void;
23246
23268
  /** function that deletes a row and it's values visually and from state */
23247
23269
  handleDeleteFilter: (index: number) => void;
23248
23270
  /** sets the initial list of filter options */
@@ -23274,6 +23296,8 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
23274
23296
  * @default '<SearchAndFilterResultContainer />'
23275
23297
  */
23276
23298
  resultsContainerView?: React$1.ReactNode;
23299
+ /** sets the reset filter values */
23300
+ resetFilterValues?: Filter[];
23277
23301
  /** The children of the search and filter component */
23278
23302
  children?: React$1.ReactNode;
23279
23303
  };
@@ -23281,7 +23305,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
23281
23305
  * @deprecated beta - Search and filter component
23282
23306
  * @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
23283
23307
  * */
23284
- declare const SearchAndFilter: ({ filters, filterOptions, filterMode, sortOptions, defaultSortByValue, filterControls, viewSwitchControls, resultsContainerView, children, onChange, onSearchChange, onSortChange, totalResults, }: SearchAndFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23308
+ declare const SearchAndFilter: ({ filters, filterOptions, filterMode, sortOptions, defaultSortByValue, filterControls, viewSwitchControls, resultsContainerView, children, onChange, onSearchChange, onSortChange, totalResults, resetFilterValues, }: SearchAndFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
23285
23309
 
23286
23310
  type SearchAndFilterResultContainerProps = {
23287
23311
  /** The label for the clear button
package/dist/index.js CHANGED
@@ -13430,7 +13430,6 @@ var activeMenuItem = import_react33.css`
13430
13430
  `;
13431
13431
  var menuItem = (textTheme, forceActive) => import_react33.css`
13432
13432
  align-items: center;
13433
- border: none;
13434
13433
  border-radius: var(--rounded-base);
13435
13434
  background: none;
13436
13435
  color: ${textTheme === "base" ? "var(--typography-base)" : "var(--brand-secondary-5)"};
@@ -13453,6 +13452,11 @@ var menuItem = (textTheme, forceActive) => import_react33.css`
13453
13452
  &[data-active-item] {
13454
13453
  ${typeof forceActive === "undefined" ? activeMenuItem : ""}
13455
13454
  }
13455
+
13456
+ // Remove border from input elements, this fixes UNI-4634
13457
+ &:not(input[type='radio'], input[type='checkbox']) {
13458
+ border: none;
13459
+ }
13456
13460
  `;
13457
13461
  var menuItemWithIcon = import_react33.css`
13458
13462
  align-items: center;
@@ -13525,7 +13529,7 @@ function isMenuSeparator(child) {
13525
13529
  // src/components/Menu/Menu.styles.ts
13526
13530
  init_emotion_jsx_shim();
13527
13531
  var import_react35 = require("@emotion/react");
13528
- var menuStyles = import_react35.css`
13532
+ var menuStyles = (maxMenuHeight) => import_react35.css`
13529
13533
  box-shadow: var(--shadow-base);
13530
13534
  border-radius: var(--rounded-base);
13531
13535
  background: var(--gray-50);
@@ -13535,10 +13539,21 @@ var menuStyles = import_react35.css`
13535
13539
  outline: none;
13536
13540
  position: relative;
13537
13541
  z-index: var(--z-50);
13538
-
13539
13542
  &:focus {
13540
13543
  outline: none;
13541
13544
  }
13545
+
13546
+ // resolves uni-2997 for smaller screens not being able to access large menus
13547
+ // the code was removed in https://github.com/uniformdev/platform/commit/0067e6c87aaf29147c656949bbf49d632d3e89dc#diff-84f70b10af4d4ec4f57c535e3c44b04c30ce95ac337ce21db9f1ffd8393a846d
13548
+ // but we need to keep it for the Menu component if the menu is larger than the screen
13549
+ ${maxMenuHeight ? `
13550
+ overflow-x: hidden;
13551
+ overflow-y: auto;
13552
+ height: min(${maxMenuHeight}, var(--popover-available-height));
13553
+ scroll-snap-align: start;
13554
+ scroll-snap-stop: always;
13555
+ ${scrollbarStyles}
13556
+ ` : ""}
13542
13557
  `;
13543
13558
 
13544
13559
  // src/components/Menu/Menu.tsx
@@ -13554,6 +13569,7 @@ var Menu = React8.forwardRef(function Menu2({
13554
13569
  disableAutoSeparatorManagement,
13555
13570
  menuItemsContainerCssClasses,
13556
13571
  testId,
13572
+ maxMenuHeight,
13557
13573
  ...props
13558
13574
  }, ref) {
13559
13575
  const placementOverride = legacyPlacements.includes(placement) ? void 0 : placement;
@@ -13568,7 +13584,7 @@ var Menu = React8.forwardRef(function Menu2({
13568
13584
  shift: menu.parent ? -4 : 0,
13569
13585
  ...props,
13570
13586
  css: [
13571
- menuStyles,
13587
+ menuStyles(maxMenuHeight),
13572
13588
  typeof menuItemsContainerCssClasses === "object" ? menuItemsContainerCssClasses : void 0
13573
13589
  ],
13574
13590
  className: typeof menuItemsContainerCssClasses === "string" ? menuItemsContainerCssClasses : "",
@@ -13820,6 +13836,8 @@ var ButtonWithMenu = ({
13820
13836
  placement,
13821
13837
  size = "lg",
13822
13838
  menuContainerCssClasses,
13839
+ withoutPortal = false,
13840
+ maxMenuHeight,
13823
13841
  ...buttonProps
13824
13842
  }) => {
13825
13843
  const buttonTheme = {
@@ -13878,6 +13896,7 @@ var ButtonWithMenu = ({
13878
13896
  placement,
13879
13897
  menuTrigger: clickableButton,
13880
13898
  menuItemsContainerCssClasses: menuContainerCssClasses,
13899
+ maxMenuHeight,
13881
13900
  children
13882
13901
  }
13883
13902
  )
@@ -13888,6 +13907,8 @@ var ButtonWithMenu = ({
13888
13907
  placement,
13889
13908
  menuTrigger: dropdownButton,
13890
13909
  menuItemsContainerCssClasses: menuContainerCssClasses,
13910
+ portal: withoutPortal,
13911
+ maxMenuHeight,
13891
13912
  children
13892
13913
  }
13893
13914
  ) })
@@ -22294,6 +22315,18 @@ var ConditionalFilterRow = import_react139.css`
22294
22315
 
22295
22316
  ${cq("380px")} {
22296
22317
  align-items: center;
22318
+
22319
+ &:after {
22320
+ content: '';
22321
+ display: block;
22322
+ height: 1px;
22323
+ background: var(--gray-300);
22324
+ width: calc(100% - var(--spacing-base));
22325
+ margin-left: var(--spacing-base);
22326
+ }
22327
+ &:last-of-type:after {
22328
+ display: none;
22329
+ }
22297
22330
  }
22298
22331
 
22299
22332
  &:first-of-type {
@@ -22301,6 +22334,12 @@ var ConditionalFilterRow = import_react139.css`
22301
22334
  grid-template-columns: 50px 1fr;
22302
22335
  }
22303
22336
 
22337
+ ${cq("580px")} {
22338
+ &:after {
22339
+ display: none;
22340
+ }
22341
+ }
22342
+
22304
22343
  @media (prefers-reduced-motion: no-preference) {
22305
22344
  animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
22306
22345
  }
@@ -22308,23 +22347,29 @@ var ConditionalFilterRow = import_react139.css`
22308
22347
  var ConditionalInputRow = import_react139.css`
22309
22348
  display: flex;
22310
22349
  gap: var(--spacing-sm);
22311
- flex-direction: column;
22350
+ flex-wrap: wrap;
22312
22351
 
22313
22352
  ${cq("380px")} {
22314
- align-items: center;
22315
- flex-direction: row;
22353
+ & > div:nth-child(-n + 2) {
22354
+ width: calc(50% - var(--spacing-sm));
22355
+ }
22356
+
22357
+ & > div:nth-child(n + 3) {
22358
+ width: calc(100% - 48px);
22359
+ }
22316
22360
  }
22317
22361
  ${cq("580px")} {
22318
22362
  display: grid;
22319
22363
  grid-template-columns: 200px 160px 1fr 32px;
22364
+
22365
+ & > div:nth-child(n) {
22366
+ width: auto;
22367
+ }
22320
22368
  }
22321
22369
  `;
22322
22370
  var SearchInput = import_react139.css`
22323
- ${input("nowrap")}
22324
- border-radius: var(--rounded-full);
22325
- padding: var(--spacing-sm) var(--spacing-base);
22326
- font-size: var(--fs-sm);
22327
- padding-right: var(--spacing-2xl);
22371
+ max-height: 40px;
22372
+ min-height: unset;
22328
22373
  `;
22329
22374
  var FilterButton = import_react139.css`
22330
22375
  align-items: center;
@@ -22333,8 +22378,10 @@ var FilterButton = import_react139.css`
22333
22378
  border-radius: var(--rounded-full);
22334
22379
  color: var(--typography-base);
22335
22380
  display: flex;
22381
+ font-size: var(--fs-sm);
22336
22382
  gap: var(--spacing-sm);
22337
22383
  padding: var(--spacing-sm) var(--spacing-base);
22384
+ max-height: 40px;
22338
22385
  transition: color var(--duration-fast) var(--timing-ease-out),
22339
22386
  background-color var(--duration-fast) var(--timing-ease-out),
22340
22387
  border-color var(--duration-fast) var(--timing-ease-out),
@@ -22479,6 +22526,7 @@ var FilterButton2 = ({
22479
22526
  icon = "filter-add",
22480
22527
  filterCount,
22481
22528
  hasSelectedValue,
22529
+ dataTestId,
22482
22530
  ...props
22483
22531
  }) => {
22484
22532
  return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
@@ -22491,7 +22539,7 @@ var FilterButton2 = ({
22491
22539
  filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
22492
22540
  ],
22493
22541
  ...props,
22494
- "data-testid": "filters-button",
22542
+ "data-testid": dataTestId,
22495
22543
  children: [
22496
22544
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
22497
22545
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("span", { css: FilterButtonText, children: text }),
@@ -22543,6 +22591,7 @@ var SearchAndFilterProvider = ({
22543
22591
  onSearchChange,
22544
22592
  onChange,
22545
22593
  onSortChange,
22594
+ resetFilterValues = [],
22546
22595
  totalResults,
22547
22596
  children
22548
22597
  }) => {
@@ -22572,8 +22621,8 @@ var SearchAndFilterProvider = ({
22572
22621
  onChange([...filters, { field: "", operator: "", value: "" }]);
22573
22622
  }, [filters, onChange]);
22574
22623
  const handleResetFilters = (0, import_react140.useCallback)(() => {
22575
- onChange([]);
22576
- }, [onChange]);
22624
+ onChange(resetFilterValues);
22625
+ }, [onChange, resetFilterValues]);
22577
22626
  const handleDeleteFilter = (0, import_react140.useCallback)(
22578
22627
  (index) => {
22579
22628
  const remainingFilters = filters.filter((_, i) => i !== index);
@@ -22690,7 +22739,8 @@ var FilterControls = ({
22690
22739
  "aria-haspopup": "true",
22691
22740
  "aria-expanded": filterVisibility === "filters",
22692
22741
  filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
22693
- onClick: () => handleFilterToggle("filters")
22742
+ onClick: () => handleFilterToggle("filters"),
22743
+ dataTestId: "filters-button"
22694
22744
  }
22695
22745
  ),
22696
22746
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
@@ -22704,7 +22754,7 @@ var FilterControls = ({
22704
22754
  "aria-expanded": filterVisibility === "sort",
22705
22755
  hasSelectedValue: sortByValue !== "",
22706
22756
  onClick: () => handleFilterToggle("sort"),
22707
- "data-testid": "sort-by-dropdown"
22757
+ dataTestId: "sort-by-button"
22708
22758
  }
22709
22759
  ),
22710
22760
  hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
@@ -22714,7 +22764,8 @@ var FilterControls = ({
22714
22764
  onSearchTextChanged: (e) => setLocaleSearchTerm(e),
22715
22765
  value: localeSearchTerm,
22716
22766
  compact: true,
22717
- rounded: true
22767
+ rounded: true,
22768
+ css: SearchInput
22718
22769
  }
22719
22770
  ),
22720
22771
  children
@@ -23239,7 +23290,7 @@ var SearchAndFilterOptionsContainer2 = ({
23239
23290
  buttonRow,
23240
23291
  children
23241
23292
  }) => {
23242
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: SearchAndFilterOptionsContainer, "data-testid": "search-and-filter-options", children: [
23293
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
23243
23294
  /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
23244
23295
  buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23245
23296
  HorizontalRhythm,
@@ -23253,7 +23304,13 @@ var SearchAndFilterOptionsContainer2 = ({
23253
23304
  ) : null
23254
23305
  ] });
23255
23306
  };
23256
- var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
23307
+ var FilterMenu = ({
23308
+ id,
23309
+ filterTitle = "Show results",
23310
+ menuControls,
23311
+ children,
23312
+ dataTestId
23313
+ }) => {
23257
23314
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
23258
23315
  const innerMenuRef = import_react144.default.useRef(null);
23259
23316
  (0, import_react144.useEffect)(() => {
@@ -23262,7 +23319,7 @@ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children })
23262
23319
  (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
23263
23320
  }
23264
23321
  }, [filterVisibility]);
23265
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, children: [
23322
+ 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: [
23266
23323
  /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
23267
23324
  /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23268
23325
  "button",
@@ -23271,6 +23328,7 @@ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children })
23271
23328
  "aria-label": "close filters",
23272
23329
  css: [CloseBtn],
23273
23330
  onClick: () => setFilterVisibility(void 0),
23331
+ "data-testid": "close-filters",
23274
23332
  children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
23275
23333
  }
23276
23334
  ),
@@ -23416,7 +23474,12 @@ var FilterItems = ({
23416
23474
  const next = [...filters];
23417
23475
  next[index] = { ...next[index], [prop]: value };
23418
23476
  if (prop === "operator") {
23419
- next[index].value = "";
23477
+ if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
23478
+ next[index].value = next[index].value[0];
23479
+ }
23480
+ if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
23481
+ next[index].value = [next[index].value, ""];
23482
+ }
23420
23483
  if (value === "def" || value === "true") {
23421
23484
  next[index].value = "true";
23422
23485
  }
@@ -23438,6 +23501,7 @@ var FilterItems = ({
23438
23501
  FilterMenu,
23439
23502
  {
23440
23503
  id: "search-and-filter-options",
23504
+ dataTestId: "search-and-filter-options",
23441
23505
  menuControls: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
23442
23506
  /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
23443
23507
  "button",
@@ -23719,7 +23783,7 @@ var SortItems = () => {
23719
23783
  var _a2;
23720
23784
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
23721
23785
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
23722
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { css: SortFilterInputRow, children: [
23786
+ 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: [
23723
23787
  /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23724
23788
  InputComboBox,
23725
23789
  {
@@ -23736,7 +23800,8 @@ var SortItems = () => {
23736
23800
  };
23737
23801
  }
23738
23802
  },
23739
- value: currentSelectedOption
23803
+ value: currentSelectedOption,
23804
+ id: "sort-by-field"
23740
23805
  }
23741
23806
  ),
23742
23807
  /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
@@ -23749,7 +23814,8 @@ var SortItems = () => {
23749
23814
  { label: "Descending", value: `DESC` }
23750
23815
  ],
23751
23816
  onChange: (e) => setSortBy(`${sortField}_${e}`),
23752
- value: sortDirection
23817
+ value: sortDirection,
23818
+ "data-testid": "ordering-options"
23753
23819
  }
23754
23820
  )
23755
23821
  ] }) });
@@ -23833,7 +23899,8 @@ var SearchAndFilter = ({
23833
23899
  onChange,
23834
23900
  onSearchChange,
23835
23901
  onSortChange,
23836
- totalResults
23902
+ totalResults,
23903
+ resetFilterValues = []
23837
23904
  }) => {
23838
23905
  return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23839
23906
  SearchAndFilterProvider,
@@ -23847,6 +23914,7 @@ var SearchAndFilter = ({
23847
23914
  onSearchChange,
23848
23915
  onSortChange,
23849
23916
  totalResults,
23917
+ resetFilterValues,
23850
23918
  children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
23851
23919
  /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
23852
23920
  /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "19.133.0",
3
+ "version": "19.134.3-alpha.10+ae656e8e4c",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -23,15 +23,15 @@
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.133.0",
27
- "@uniformdev/richtext": "^19.133.0",
26
+ "@uniformdev/canvas": "^19.134.3-alpha.10+ae656e8e4c",
27
+ "@uniformdev/richtext": "^19.134.3-alpha.10+ae656e8e4c",
28
28
  "autoprefixer": "10.4.16",
29
29
  "hygen": "6.2.11",
30
- "postcss": "8.4.32",
30
+ "postcss": "8.4.38",
31
31
  "react": "18.2.0",
32
32
  "react-dom": "18.2.0",
33
33
  "react-select-event": "^5.5.1",
34
- "tsup": "8.0.1"
34
+ "tsup": "8.0.2"
35
35
  },
36
36
  "dependencies": {
37
37
  "@ariakit/react": "^0.3.5",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "405a628b0f592ca13bf65006ef5c92261468c144"
74
+ "gitHead": "ae656e8e4c730dbf960ef43b6c5e9a0b8ba13193"
75
75
  }