@uniformdev/mesh-sdk-react 19.158.0 → 19.159.1-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -33,10 +33,10 @@ var src_exports = {};
33
33
  __export(src_exports, {
34
34
  $createVariableNode: () => $createVariableNode,
35
35
  $isVariableNode: () => $isVariableNode,
36
- AddListButton: () => import_design_system53.AddListButton,
37
- Button: () => import_design_system53.Button,
36
+ AddListButton: () => import_design_system63.AddListButton,
37
+ Button: () => import_design_system63.Button,
38
38
  CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
39
- Callout: () => import_design_system53.Callout,
39
+ Callout: () => import_design_system63.Callout,
40
40
  ControlledValuePlugin: () => ControlledValuePlugin,
41
41
  DATE_OPERATORS: () => DATE_OPERATORS,
42
42
  DISCONNECT_VARIABLE_COMMAND: () => DISCONNECT_VARIABLE_COMMAND,
@@ -51,7 +51,7 @@ __export(src_exports, {
51
51
  DateRangeEditor: () => DateRangeEditor,
52
52
  DefaultSearchRow: () => DefaultSearchRow,
53
53
  DefaultSelectedItem: () => DefaultSelectedItem,
54
- DrawerContent: () => import_design_system53.DrawerContent,
54
+ DrawerContent: () => import_design_system63.DrawerContent,
55
55
  EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
56
56
  EntrySearch: () => EntrySearch,
57
57
  FilterButton: () => FilterButton2,
@@ -62,22 +62,22 @@ __export(src_exports, {
62
62
  FilterMenu: () => FilterMenu,
63
63
  FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
64
64
  FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
65
- Heading: () => import_design_system53.Heading,
65
+ Heading: () => import_design_system63.Heading,
66
66
  INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
67
67
  Icons: () => icons_exports,
68
- Input: () => import_design_system53.Input,
69
- InputComboBox: () => import_design_system53.InputComboBox,
70
- InputKeywordSearch: () => import_design_system53.InputKeywordSearch,
71
- InputSelect: () => import_design_system53.InputSelect,
72
- InputToggle: () => import_design_system53.InputToggle,
68
+ Input: () => import_design_system63.Input,
69
+ InputComboBox: () => import_design_system63.InputComboBox,
70
+ InputKeywordSearch: () => import_design_system63.InputKeywordSearch,
71
+ InputSelect: () => import_design_system63.InputSelect,
72
+ InputToggle: () => import_design_system63.InputToggle,
73
73
  InputVariables: () => InputVariables,
74
- Label: () => import_design_system53.Label,
74
+ Label: () => import_design_system63.Label,
75
75
  LinkButton: () => LinkButton,
76
- LoadingIndicator: () => import_design_system53.LoadingIndicator,
77
- LoadingOverlay: () => import_design_system53.LoadingOverlay,
76
+ LoadingIndicator: () => import_design_system63.LoadingIndicator,
77
+ LoadingOverlay: () => import_design_system63.LoadingOverlay,
78
78
  MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
79
- Menu: () => import_design_system53.Menu,
80
- MenuItem: () => import_design_system53.MenuItem,
79
+ Menu: () => import_design_system63.Menu,
80
+ MenuItem: () => import_design_system63.MenuItem,
81
81
  MeshApp: () => MeshApp,
82
82
  NUMBER_OPERATORS: () => NUMBER_OPERATORS,
83
83
  NumberEditor: () => NumberEditor,
@@ -95,22 +95,22 @@ __export(src_exports, {
95
95
  PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
96
96
  ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
97
97
  ParameterConnectionIndicator: () => ParameterConnectionIndicator,
98
- ParameterGroup: () => import_design_system53.ParameterGroup,
99
- ParameterImage: () => import_design_system53.ParameterImage,
100
- ParameterImageInner: () => import_design_system53.ParameterImageInner,
101
- ParameterInput: () => import_design_system53.ParameterInput,
102
- ParameterInputInner: () => import_design_system53.ParameterInputInner,
103
- ParameterLabel: () => import_design_system53.ParameterLabel,
104
- ParameterMenuButton: () => import_design_system53.ParameterMenuButton,
98
+ ParameterGroup: () => import_design_system63.ParameterGroup,
99
+ ParameterImage: () => import_design_system63.ParameterImage,
100
+ ParameterImageInner: () => import_design_system63.ParameterImageInner,
101
+ ParameterInput: () => import_design_system63.ParameterInput,
102
+ ParameterInputInner: () => import_design_system63.ParameterInputInner,
103
+ ParameterLabel: () => import_design_system63.ParameterLabel,
104
+ ParameterMenuButton: () => import_design_system63.ParameterMenuButton,
105
105
  ParameterOrSingleVariable: () => ParameterOrSingleVariable,
106
- ParameterSelect: () => import_design_system53.ParameterSelect,
107
- ParameterSelectInner: () => import_design_system53.ParameterSelectInner,
108
- ParameterShell: () => import_design_system53.ParameterShell,
106
+ ParameterSelect: () => import_design_system63.ParameterSelect,
107
+ ParameterSelectInner: () => import_design_system63.ParameterSelectInner,
108
+ ParameterShell: () => import_design_system63.ParameterShell,
109
109
  ParameterShellContext: () => import_design_system14.ParameterShellContext,
110
- ParameterTextarea: () => import_design_system53.ParameterTextarea,
111
- ParameterTextareaInner: () => import_design_system53.ParameterTextareaInner,
112
- ParameterToggle: () => import_design_system53.ParameterToggle,
113
- ParameterToggleInner: () => import_design_system53.ParameterToggleInner,
110
+ ParameterTextarea: () => import_design_system63.ParameterTextarea,
111
+ ParameterTextareaInner: () => import_design_system63.ParameterTextareaInner,
112
+ ParameterToggle: () => import_design_system63.ParameterToggle,
113
+ ParameterToggleInner: () => import_design_system63.ParameterToggleInner,
114
114
  ParameterVariables: () => ParameterVariables,
115
115
  ProductPreviewList: () => ProductPreviewList,
116
116
  ProductQuery: () => ProductQuery,
@@ -133,8 +133,8 @@ __export(src_exports, {
133
133
  SELECT_OPERATORS: () => SELECT_OPERATORS,
134
134
  SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
135
135
  SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
136
- ScrollableList: () => import_design_system53.ScrollableList,
137
- ScrollableListItem: () => import_design_system53.ScrollableListItem,
136
+ ScrollableList: () => import_design_system63.ScrollableList,
137
+ ScrollableListItem: () => import_design_system63.ScrollableListItem,
138
138
  SearchAndFilter: () => SearchAndFilter,
139
139
  SearchAndFilterContext: () => SearchAndFilterContext,
140
140
  SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
@@ -146,18 +146,19 @@ __export(src_exports, {
146
146
  SortItems: () => SortItems,
147
147
  StatusMultiEditor: () => StatusMultiEditor,
148
148
  StatusSingleEditor: () => StatusSingleEditor,
149
- Switch: () => import_design_system53.Switch,
149
+ Switch: () => import_design_system63.Switch,
150
150
  TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
151
151
  TextEditor: () => TextEditor,
152
152
  TextVariableRenderer: () => TextVariableRenderer,
153
- Textarea: () => import_design_system53.Textarea,
154
- Theme: () => import_design_system53.Theme,
153
+ Textarea: () => import_design_system63.Textarea,
154
+ Theme: () => import_design_system63.Theme,
155
155
  USER_OPERATORS: () => USER_OPERATORS,
156
156
  VariableEditor: () => VariableEditor,
157
157
  VariableNode: () => VariableNode,
158
158
  VariablesList: () => VariablesList,
159
159
  VariablesPlugin: () => VariablesPlugin,
160
160
  VariablesProvider: () => VariablesProvider,
161
+ WORKFLOW_STAGES_OPERATORS: () => WORKFLOW_STAGES_OPERATORS,
161
162
  badgeIcon: () => badgeIcon,
162
163
  bindableFiltersMapper: () => bindableFiltersMapper,
163
164
  convertConnectedDataToVariable: () => convertConnectedDataToVariable,
@@ -246,7 +247,7 @@ __export(src_exports, {
246
247
  useVariableEditor: () => useVariableEditor,
247
248
  useVariables: () => useVariables,
248
249
  useVariablesMenu: () => useVariablesMenu,
249
- utilityColors: () => import_design_system53.utilityColors,
250
+ utilityColors: () => import_design_system63.utilityColors,
250
251
  variableDefaultTextValue: () => variableDefaultTextValue,
251
252
  variablePrefix: () => variablePrefix,
252
253
  variableSuffix: () => variableSuffix,
@@ -7791,304 +7792,194 @@ var MULTI_SELECT_OPERATORS = [
7791
7792
  editorType: "empty"
7792
7793
  }
7793
7794
  ];
7795
+ var WORKFLOW_STAGES_OPERATORS = [
7796
+ {
7797
+ label: "is",
7798
+ value: "eq",
7799
+ editorType: "singleChoice"
7800
+ },
7801
+ {
7802
+ label: "is any of...",
7803
+ value: "in",
7804
+ editorType: "multiChoice"
7805
+ },
7806
+ {
7807
+ label: "is not",
7808
+ value: "neq",
7809
+ editorType: "singleChoice"
7810
+ },
7811
+ {
7812
+ label: "is none of...",
7813
+ value: "nin",
7814
+ editorType: "multiChoice"
7815
+ }
7816
+ ];
7794
7817
 
7795
- // src/components/SearchAndFilter/FilterButton.tsx
7796
- var import_design_system42 = require("@uniformdev/design-system");
7797
-
7798
- // src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
7799
- var import_react76 = require("@emotion/react");
7818
+ // src/components/SearchAndFilter/editors/DateEditor.tsx
7800
7819
  var import_design_system41 = require("@uniformdev/design-system");
7801
- var SearchAndFilterControlsWrapper = (gridColumns) => import_react76.css`
7802
- align-items: stretch;
7803
- display: grid;
7804
- grid-template-columns: ${gridColumns};
7805
- gap: var(--spacing-sm);
7806
- `;
7807
- var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react76.css`
7808
- align-items: stretch;
7809
- display: grid;
7810
- grid-template-columns: ${gridColumns};
7811
- gap: var(--spacing-sm);
7812
- `;
7813
- var ConditionalFilterRow = import_react76.css`
7814
- display: grid;
7815
- grid-template-columns: 35px 1fr;
7816
- gap: var(--spacing-sm);
7817
- margin-left: var(--spacing-base);
7818
-
7819
- ${(0, import_design_system41.cq)("380px")} {
7820
- align-items: center;
7821
-
7822
- &:after {
7823
- content: '';
7824
- display: block;
7825
- height: 1px;
7826
- background: var(--gray-300);
7827
- width: calc(100% - var(--spacing-base));
7828
- margin-left: var(--spacing-base);
7829
- }
7830
- &:last-of-type:after {
7831
- display: none;
7820
+ var import_react76 = require("react");
7821
+ var import_react_use5 = require("react-use");
7822
+ var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
7823
+ var DateEditor = ({
7824
+ onChange,
7825
+ ariaLabel,
7826
+ disabled,
7827
+ value,
7828
+ readOnly,
7829
+ valueTestId
7830
+ }) => {
7831
+ const [innerValue, setInnerValue] = (0, import_react76.useState)(value != null ? value : "");
7832
+ (0, import_react_use5.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
7833
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7834
+ import_design_system41.Input,
7835
+ {
7836
+ type: "date",
7837
+ label: ariaLabel,
7838
+ showLabel: false,
7839
+ onChange: (e) => setInnerValue(e.currentTarget.value),
7840
+ disabled,
7841
+ value: innerValue,
7842
+ readOnly,
7843
+ "data-testid": valueTestId
7832
7844
  }
7833
- }
7845
+ );
7846
+ };
7834
7847
 
7835
- &:nth-of-type(2) {
7836
- margin-left: 0;
7837
- grid-template-columns: 50px 1fr;
7838
- }
7848
+ // src/components/SearchAndFilter/editors/DateRangeEditor.tsx
7849
+ var import_design_system43 = require("@uniformdev/design-system");
7850
+ var import_react77 = require("react");
7851
+ var import_react_use6 = require("react-use");
7839
7852
 
7840
- ${(0, import_design_system41.cq)("580px")} {
7841
- &:after {
7842
- display: none;
7853
+ // src/components/SearchAndFilter/editors/shared/ErrorContainer.tsx
7854
+ var import_design_system42 = require("@uniformdev/design-system");
7855
+ var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
7856
+ var ErrorContainer = ({ errorMessage }) => {
7857
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
7858
+ "div",
7859
+ {
7860
+ css: {
7861
+ gridColumn: "span 6",
7862
+ order: 6
7863
+ },
7864
+ children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system42.FieldMessage, { errorMessage })
7843
7865
  }
7844
- }
7866
+ );
7867
+ };
7845
7868
 
7846
- @media (prefers-reduced-motion: no-preference) {
7847
- animation: ${import_design_system41.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
7848
- }
7849
- `;
7850
- var ConditionalInputRow = import_react76.css`
7851
- display: flex;
7852
- gap: var(--spacing-sm);
7853
- flex-wrap: wrap;
7869
+ // src/components/SearchAndFilter/editors/shared/twoColumnGrid.tsx
7870
+ var twoColumnGrid = {
7871
+ display: "grid",
7872
+ gridTemplateColumns: "1fr 1fr",
7873
+ gap: "var(--spacing-sm);"
7874
+ };
7854
7875
 
7855
- ${(0, import_design_system41.cq)("380px")} {
7856
- & > div:nth-child(-n + 2) {
7857
- width: calc(50% - var(--spacing-sm));
7876
+ // src/components/SearchAndFilter/editors/DateRangeEditor.tsx
7877
+ var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
7878
+ var DateRangeEditor = ({
7879
+ ariaLabel,
7880
+ onChange,
7881
+ disabled,
7882
+ value,
7883
+ readOnly,
7884
+ valueTestId
7885
+ }) => {
7886
+ const [minDateValue, setMinDateValue] = (0, import_react77.useState)(value ? value[0] : "");
7887
+ const [maxDateValue, setMaxDateValue] = (0, import_react77.useState)(value ? value[1] : "");
7888
+ const [error, setError] = (0, import_react77.useState)("");
7889
+ (0, import_react_use6.useDebounce)(
7890
+ () => {
7891
+ if (minDateValue && maxDateValue && !error) {
7892
+ onChange([minDateValue, maxDateValue]);
7893
+ } else {
7894
+ onChange([]);
7895
+ }
7896
+ },
7897
+ 500,
7898
+ [minDateValue, maxDateValue]
7899
+ );
7900
+ (0, import_react77.useEffect)(() => {
7901
+ if (!minDateValue || !maxDateValue) {
7902
+ return;
7858
7903
  }
7859
-
7860
- & > div:nth-child(n + 3) {
7861
- width: calc(100% - 48px);
7904
+ const minDate = new Date(minDateValue);
7905
+ const maxDate = new Date(maxDateValue);
7906
+ if (maxDate < minDate) {
7907
+ setError("The max date cannot be lower than the min date");
7908
+ return;
7862
7909
  }
7863
- }
7864
- ${(0, import_design_system41.cq)("764px")} {
7865
- display: grid;
7866
- grid-template-columns: 200px 160px 1fr 32px;
7867
-
7868
- & > div:nth-child(n) {
7869
- width: auto;
7910
+ if (maxDate && !minDate) {
7911
+ setError("Please enter both a low and high date");
7912
+ return;
7870
7913
  }
7871
- }
7872
- `;
7873
- var SearchInput = import_react76.css`
7874
- max-height: 40px;
7875
- min-height: unset;
7876
- `;
7877
- var BindableKeywordSearchInputStyles = import_react76.css`
7878
- position: relative;
7879
- width: 100%;
7880
-
7881
- & [data-lexical-editor='true'] {
7882
- padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
7883
- font-size: var(--fs-sm);
7884
- border-radius: var(--rounded-full);
7885
- max-height: 40px;
7886
- min-height: unset;
7887
- width: 100%;
7888
- position: relative;
7889
- white-space: nowrap;
7890
- }
7891
- `;
7892
- var ClearSearchButtonContainer = import_react76.css`
7893
- align-items: center;
7894
- display: flex;
7895
- position: absolute;
7896
- inset: 0 var(--spacing-lg) 0 auto;
7897
- `;
7898
- var ClearSearchButtonStyles = import_react76.css`
7899
- background: none;
7900
- border: none;
7901
- padding: 0;
7902
- pointer-events: all;
7903
- `;
7904
- var FilterButton = import_react76.css`
7905
- align-items: center;
7906
- background: var(--white);
7907
- border: 1px solid var(--gray-300);
7908
- border-radius: var(--rounded-full);
7909
- color: var(--typography-base);
7910
- display: flex;
7911
- font-size: var(--fs-sm);
7912
- gap: var(--spacing-sm);
7913
- padding: var(--spacing-sm) var(--spacing-base);
7914
- max-height: 40px;
7915
- transition: color var(--duration-fast) var(--timing-ease-out),
7916
- background-color var(--duration-fast) var(--timing-ease-out),
7917
- border-color var(--duration-fast) var(--timing-ease-out),
7918
- box-shadow var(--duration-fast) var(--timing-ease-out);
7919
-
7920
- svg {
7921
- color: var(--gray-300);
7922
- transition: color var(--duration-fast) var(--timing-ease-out);
7923
- }
7924
-
7925
- &:hover,
7926
- :where([aria-expanded='true']) {
7927
- outline: none;
7928
- background: var(--gray-200);
7929
- border-color: var(--gray-300);
7930
-
7931
- svg {
7932
- color: var(--typography-base);
7914
+ const minDateString = minDate.toDateString();
7915
+ const maxDateString = maxDate.toDateString();
7916
+ if (minDateString === maxDateString || maxDateString === minDateString) {
7917
+ setError("The min and max date cannot be the same");
7918
+ return;
7933
7919
  }
7934
- }
7935
-
7936
- &:disabled {
7937
- opacity: var(--opacity-50);
7938
- }
7939
- `;
7940
- var FilterButtonText = import_react76.css`
7941
- overflow: hidden;
7942
- text-overflow: ellipsis;
7943
- white-space: nowrap;
7944
- max-width: 14ch;
7945
- `;
7946
- var FilterButtonSelected = import_react76.css`
7947
- background: var(--gray-100);
7948
- border-color: var(--gray-300);
7949
-
7950
- svg {
7951
- color: var(--accent-dark);
7952
- }
7953
- `;
7954
- var FilterButtonWithOptions = import_react76.css`
7955
- :where([aria-expanded='true']) {
7956
- background: var(--purple-rain-100);
7957
- border-color: var(--accent-light);
7958
- color: var(--typography-base);
7959
- box-shadow: var(--elevation-100);
7960
-
7961
- svg {
7962
- color: var(--accent-dark);
7920
+ if (minDate > maxDate) {
7921
+ setError("The min date cannot be higher than the max date");
7922
+ return;
7963
7923
  }
7964
- }
7965
- `;
7966
- var SearchIcon = import_react76.css`
7967
- color: var(--icon-color);
7968
- position: absolute;
7969
- inset: 0 var(--spacing-base) 0 auto;
7970
- margin: auto;
7971
- transition: color var(--duration-fast) var(--timing-ease-out);
7972
- `;
7973
- var AddConditionalBtn = import_react76.css`
7974
- align-items: center;
7975
- background: transparent;
7976
- border: none;
7977
- color: var(--primary-action-default);
7978
- display: flex;
7979
- gap: var(--spacing-sm);
7980
- transition: color var(--duration-fast) var(--timing-ease-out);
7981
- padding: 0;
7982
-
7983
- &:hover,
7984
- &:focus {
7985
- color: var(--primary-action-hover);
7986
- }
7987
-
7988
- &:disabled {
7989
- color: var(--gray-400);
7990
- }
7991
- `;
7992
- var Title = import_react76.css`
7993
- color: var(--typography-light);
7994
-
7995
- &:focus {
7996
- outline: none;
7997
- }
7998
- `;
7999
- var ResetConditionsBtn = import_react76.css`
8000
- background: transparent;
8001
- border: none;
8002
- color: var(--action-destructive-default);
8003
- transition: color var(--duration-fast) var(--timing-ease-out);
8004
- padding: 0;
8005
-
8006
- &:hover,
8007
- &:focus {
8008
- color: var(--action-destructive-hover);
8009
- }
8010
- `;
8011
- var IconBtn = import_react76.css`
8012
- background: transparent;
8013
- border: none;
8014
- padding: var(--spacing-sm);
8015
- `;
8016
- var SearchAndFilterOptionsContainer = import_react76.css`
8017
- background: var(--gray-50);
8018
- border: 1px solid var(--gray-300);
8019
- border-radius: var(--rounded-base);
8020
- container-type: inline-size;
8021
- display: flex;
8022
- flex-direction: column;
8023
- gap: var(--spacing-sm);
8024
- padding: var(--spacing-md) 0 var(--spacing-base);
8025
- will-change: height;
8026
- position: relative;
8027
- z-index: 1;
8028
- `;
8029
- var SearchAndFilterOptionsInnerContainer = import_react76.css`
8030
- display: flex;
8031
- flex-direction: column;
8032
- gap: var(--spacing-sm);
8033
- padding-inline: var(--spacing-md);
8034
- `;
8035
- var SearchAndFilterButtonGroup = import_react76.css`
8036
- margin-top: var(--spacing-xs);
8037
- margin-left: calc(56px + var(--spacing-md));
8038
- `;
8039
-
8040
- // src/components/SearchAndFilter/FilterButton.tsx
8041
- var import_jsx_runtime69 = require("@emotion/react/jsx-runtime");
8042
- var FilterButton2 = ({
8043
- text = "Filters",
8044
- icon = "filter-add",
8045
- filterCount,
8046
- hasSelectedValue,
8047
- dataTestId,
8048
- ...props
8049
- }) => {
8050
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
8051
- "button",
8052
- {
8053
- type: "button",
8054
- css: [
8055
- FilterButton,
8056
- hasSelectedValue ? FilterButtonSelected : void 0,
8057
- filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
8058
- ],
8059
- ...props,
8060
- "data-testid": dataTestId,
8061
- children: [
8062
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
8063
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { css: FilterButtonText, children: text }),
8064
- filterCount ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_design_system42.Counter, { count: filterCount, bgColor: "var(--white)" }) : null
8065
- ]
7924
+ if (error) {
7925
+ setError("");
8066
7926
  }
8067
- );
7927
+ if (minDate && maxDate) {
7928
+ setMinDateValue(minDateValue);
7929
+ setMaxDateValue(maxDateValue);
7930
+ } else {
7931
+ setMinDateValue("");
7932
+ setMaxDateValue("");
7933
+ }
7934
+ }, [minDateValue, maxDateValue, setError]);
7935
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
7936
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
7937
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7938
+ import_design_system43.Input,
7939
+ {
7940
+ label: `${ariaLabel}-min-date`,
7941
+ type: "date",
7942
+ showLabel: false,
7943
+ value: minDateValue,
7944
+ onChange: (e) => setMinDateValue(e.currentTarget.value),
7945
+ "aria-invalid": !error ? false : true,
7946
+ disabled,
7947
+ readOnly,
7948
+ "data-testid": "value-low"
7949
+ }
7950
+ ),
7951
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
7952
+ import_design_system43.Input,
7953
+ {
7954
+ label: `${ariaLabel}-max-date`,
7955
+ type: "date",
7956
+ showLabel: false,
7957
+ value: maxDateValue,
7958
+ onChange: (e) => setMaxDateValue(e.currentTarget.value),
7959
+ "aria-invalid": !error ? false : true,
7960
+ disabled,
7961
+ readOnly,
7962
+ "data-testid": "value-high"
7963
+ }
7964
+ )
7965
+ ] }),
7966
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorContainer, { errorMessage: error })
7967
+ ] });
8068
7968
  };
8069
7969
 
8070
- // src/components/SearchAndFilter/FilterControls.tsx
8071
- var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
8072
- var import_design_system45 = require("@uniformdev/design-system");
8073
- var import_lexical11 = require("lexical");
8074
- var import_react79 = require("react");
8075
- var import_react_use6 = require("react-use");
8076
- var import_uuid3 = require("uuid");
8077
-
8078
- // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
7970
+ // src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
8079
7971
  var import_design_system44 = require("@uniformdev/design-system");
8080
7972
  var import_react78 = require("react");
8081
7973
 
8082
- // src/components/SearchAndFilter/FilterEditor.tsx
8083
- var import_design_system43 = require("@uniformdev/design-system");
8084
- var import_react77 = require("react");
8085
- var import_react_use5 = require("react-use");
8086
- var import_jsx_runtime70 = require("@emotion/react/jsx-runtime");
7974
+ // src/components/SearchAndFilter/editors/shared/readOnlyAttributes.tsx
8087
7975
  var readOnlyAttributes = {
8088
7976
  isSearchable: false,
8089
7977
  menuIsOpen: false,
8090
7978
  isClearable: false
8091
7979
  };
7980
+
7981
+ // src/components/SearchAndFilter/editors/FilterMultiChoiceEditor.tsx
7982
+ var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
8092
7983
  var FilterMultiChoiceEditor = ({
8093
7984
  value,
8094
7985
  options,
@@ -8099,20 +7990,24 @@ var FilterMultiChoiceEditor = ({
8099
7990
  }) => {
8100
7991
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
8101
7992
  const isClearable = !readOnly || !disabled;
8102
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8103
- import_design_system43.InputComboBox,
7993
+ const { groupedOptions, selectedOptions } = (0, import_react78.useMemo)(
7994
+ () => (0, import_design_system44.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
7995
+ [options, value]
7996
+ );
7997
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
7998
+ import_design_system44.InputComboBox,
8104
7999
  {
8105
8000
  ...props,
8106
8001
  placeholder: "Type to search...",
8107
- options,
8002
+ options: groupedOptions,
8108
8003
  isMulti: true,
8109
8004
  isClearable,
8110
8005
  isDisabled: disabled,
8111
8006
  onChange: (e) => {
8112
- var _a;
8113
- return props.onChange((_a = e == null ? void 0 : e.map((option) => option.value)) != null ? _a : []);
8007
+ const selectedValues = (0, import_design_system44.getComboBoxSelectedSelectableGroups)(e);
8008
+ return props.onChange([...selectedValues]);
8114
8009
  },
8115
- value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
8010
+ value: selectedOptions,
8116
8011
  "aria-readonly": readOnly,
8117
8012
  styles: {
8118
8013
  menu(base) {
@@ -8126,6 +8021,11 @@ var FilterMultiChoiceEditor = ({
8126
8021
  }
8127
8022
  ) });
8128
8023
  };
8024
+
8025
+ // src/components/SearchAndFilter/editors/FilterSingleChoiceEditor.tsx
8026
+ var import_design_system45 = require("@uniformdev/design-system");
8027
+ var import_react79 = require("react");
8028
+ var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
8129
8029
  var FilterSingleChoiceEditor = ({
8130
8030
  options,
8131
8031
  value,
@@ -8134,91 +8034,30 @@ var FilterSingleChoiceEditor = ({
8134
8034
  onChange,
8135
8035
  valueTestId
8136
8036
  }) => {
8137
- var _a;
8138
8037
  const readOnlyProps = readOnly ? readOnlyAttributes : {};
8139
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8140
- import_design_system43.InputComboBox,
8038
+ const { groupedOptions, selectedOptions } = (0, import_react79.useMemo)(
8039
+ () => (0, import_design_system45.convertComboBoxGroupsToSelectableGroups)({
8040
+ options: options != null ? options : [],
8041
+ selectedItems: new Set(value ? [value] : void 0),
8042
+ selectionMode: "single"
8043
+ }),
8044
+ [options, value]
8045
+ );
8046
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
8047
+ import_design_system45.InputComboBox,
8141
8048
  {
8142
8049
  placeholder: "Type to search...",
8143
- options,
8050
+ options: groupedOptions,
8144
8051
  isClearable: true,
8145
8052
  onChange: (e) => {
8146
- var _a2;
8147
- return onChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
8148
- },
8149
- isDisabled: disabled,
8150
- value: (_a = options == null ? void 0 : options.find((option) => option.value === value)) != null ? _a : null,
8151
- "aria-readonly": readOnly,
8152
- styles: {
8153
- menu(base) {
8154
- return {
8155
- ...base,
8156
- minWidth: "max-content"
8157
- };
8053
+ if (Array.isArray(e == null ? void 0 : e.value)) {
8054
+ return;
8158
8055
  }
8056
+ return onChange(e == null ? void 0 : e.value);
8159
8057
  },
8160
- ...readOnlyProps
8161
- }
8162
- ) });
8163
- };
8164
- var CustomOptions = ({ label, value }) => {
8165
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.StatusBullet, { status: label, message: value });
8166
- };
8167
- var StatusMultiEditor = ({
8168
- options,
8169
- value,
8170
- disabled,
8171
- readOnly,
8172
- onChange,
8173
- valueTestId
8174
- }) => {
8175
- const readOnlyProps = readOnly ? readOnlyAttributes : {};
8176
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8177
- import_design_system43.InputComboBox,
8178
- {
8179
- options,
8180
- isMulti: true,
8181
- onChange: (e) => {
8182
- var _a;
8183
- return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
8184
- },
8185
- formatOptionLabel: CustomOptions,
8186
- "aria-readonly": readOnly,
8187
- value: options == null ? void 0 : options.filter((option) => value == null ? void 0 : value.includes(option.value)),
8188
8058
  isDisabled: disabled,
8189
- styles: {
8190
- menu(base) {
8191
- return {
8192
- ...base,
8193
- minWidth: "max-content"
8194
- };
8195
- }
8196
- },
8197
- ...readOnlyProps
8198
- }
8199
- ) });
8200
- };
8201
- var StatusSingleEditor = ({
8202
- options,
8203
- value,
8204
- disabled,
8205
- readOnly,
8206
- onChange,
8207
- valueTestId
8208
- }) => {
8209
- const readOnlyProps = readOnly ? readOnlyAttributes : {};
8210
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8211
- import_design_system43.InputComboBox,
8212
- {
8213
- options,
8214
- onChange: (e) => {
8215
- var _a;
8216
- return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
8217
- },
8218
- formatOptionLabel: CustomOptions,
8059
+ value: selectedOptions,
8219
8060
  "aria-readonly": readOnly,
8220
- value: options == null ? void 0 : options.find((option) => option.value === value),
8221
- isDisabled: disabled,
8222
8061
  styles: {
8223
8062
  menu(base) {
8224
8063
  return {
@@ -8231,28 +8070,43 @@ var StatusSingleEditor = ({
8231
8070
  }
8232
8071
  ) });
8233
8072
  };
8234
- var TextEditor = ({
8235
- onChange,
8073
+
8074
+ // src/components/SearchAndFilter/editors/NumberEditor.tsx
8075
+ var import_design_system46 = require("@uniformdev/design-system");
8076
+ var import_react80 = require("react");
8077
+ var import_react_use7 = require("react-use");
8078
+ var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
8079
+ var NumberEditor = ({
8236
8080
  ariaLabel,
8081
+ onChange,
8082
+ disabled,
8237
8083
  value,
8238
8084
  readOnly,
8239
8085
  valueTestId
8240
8086
  }) => {
8241
- const [innerValue, setInnerValue] = (0, import_react77.useState)(value != null ? value : "");
8242
- (0, import_react_use5.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
8243
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8244
- import_design_system43.Input,
8087
+ const [innerValue, setInnerValue] = (0, import_react80.useState)(value != null ? value : "");
8088
+ (0, import_react_use7.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
8089
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
8090
+ import_design_system46.Input,
8245
8091
  {
8246
- showLabel: false,
8247
8092
  label: ariaLabel,
8093
+ type: "number",
8094
+ showLabel: false,
8095
+ min: 0,
8248
8096
  onChange: (e) => setInnerValue(e.currentTarget.value),
8249
- placeholder: "Enter phrase to search\u2026",
8097
+ disabled,
8250
8098
  value: innerValue,
8251
8099
  readOnly,
8252
8100
  "data-testid": valueTestId
8253
8101
  }
8254
8102
  );
8255
8103
  };
8104
+
8105
+ // src/components/SearchAndFilter/editors/NumberRangeEditor.tsx
8106
+ var import_design_system47 = require("@uniformdev/design-system");
8107
+ var import_react81 = require("react");
8108
+ var import_react_use8 = require("react-use");
8109
+ var import_jsx_runtime75 = require("@emotion/react/jsx-runtime");
8256
8110
  var NumberRangeEditor = ({
8257
8111
  onChange,
8258
8112
  disabled,
@@ -8261,10 +8115,10 @@ var NumberRangeEditor = ({
8261
8115
  readOnly,
8262
8116
  valueTestId
8263
8117
  }) => {
8264
- const [minValue, setMinValue] = (0, import_react77.useState)("");
8265
- const [maxValue, setMaxValue] = (0, import_react77.useState)("");
8266
- const [error, setError] = (0, import_react77.useState)("");
8267
- (0, import_react_use5.useDebounce)(
8118
+ const [minValue, setMinValue] = (0, import_react81.useState)("");
8119
+ const [maxValue, setMaxValue] = (0, import_react81.useState)("");
8120
+ const [error, setError] = (0, import_react81.useState)("");
8121
+ (0, import_react_use8.useDebounce)(
8268
8122
  () => {
8269
8123
  if (minValue && maxValue && !error) {
8270
8124
  onChange([minValue, maxValue]);
@@ -8275,7 +8129,7 @@ var NumberRangeEditor = ({
8275
8129
  500,
8276
8130
  [minValue, maxValue]
8277
8131
  );
8278
- (0, import_react77.useEffect)(() => {
8132
+ (0, import_react81.useEffect)(() => {
8279
8133
  if (!maxValue && !minValue) {
8280
8134
  return;
8281
8135
  }
@@ -8297,10 +8151,10 @@ var NumberRangeEditor = ({
8297
8151
  setMaxValue(maxValue);
8298
8152
  }
8299
8153
  }, [maxValue, minValue, setError]);
8300
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
8301
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
8302
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8303
- import_design_system43.Input,
8154
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
8155
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
8156
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
8157
+ import_design_system47.Input,
8304
8158
  {
8305
8159
  label: `${ariaLabel}-min`,
8306
8160
  type: "number",
@@ -8315,8 +8169,8 @@ var NumberRangeEditor = ({
8315
8169
  "data-testid": "value-low"
8316
8170
  }
8317
8171
  ),
8318
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8319
- import_design_system43.Input,
8172
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
8173
+ import_design_system47.Input,
8320
8174
  {
8321
8175
  type: "number",
8322
8176
  label: `${ariaLabel}-max`,
@@ -8332,149 +8186,433 @@ var NumberRangeEditor = ({
8332
8186
  }
8333
8187
  )
8334
8188
  ] }),
8335
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorContainer, { errorMessage: error })
8189
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ErrorContainer, { errorMessage: error })
8336
8190
  ] });
8337
8191
  };
8338
- var NumberEditor = ({
8339
- ariaLabel,
8192
+
8193
+ // src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
8194
+ var import_design_system49 = require("@uniformdev/design-system");
8195
+ var import_react82 = require("react");
8196
+
8197
+ // src/components/SearchAndFilter/editors/shared/CustomOptions.tsx
8198
+ var import_design_system48 = require("@uniformdev/design-system");
8199
+ var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
8200
+ var CustomOptions = ({ label, value }) => {
8201
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
8202
+ import_design_system48.StatusBullet,
8203
+ {
8204
+ status: label,
8205
+ message: Array.isArray(value) ? value.join(",") : value
8206
+ }
8207
+ );
8208
+ };
8209
+
8210
+ // src/components/SearchAndFilter/editors/StatusMultiEditor.tsx
8211
+ var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
8212
+ var StatusMultiEditor = ({
8213
+ options,
8214
+ value,
8215
+ disabled,
8216
+ readOnly,
8340
8217
  onChange,
8218
+ valueTestId
8219
+ }) => {
8220
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
8221
+ const { groupedOptions, selectedOptions } = (0, import_react82.useMemo)(
8222
+ () => (0, import_design_system49.convertComboBoxGroupsToSelectableGroups)({ options: options != null ? options : [], selectedItems: new Set(value) }),
8223
+ [options, value]
8224
+ );
8225
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
8226
+ import_design_system49.InputComboBox,
8227
+ {
8228
+ options: groupedOptions != null ? groupedOptions : [],
8229
+ isMulti: true,
8230
+ onChange: (e) => {
8231
+ const selectedValues = (0, import_design_system49.getComboBoxSelectedSelectableGroups)(e);
8232
+ return onChange([...selectedValues]);
8233
+ },
8234
+ formatOptionLabel: CustomOptions,
8235
+ "aria-readonly": readOnly,
8236
+ value: selectedOptions,
8237
+ isDisabled: disabled,
8238
+ styles: {
8239
+ menu(base) {
8240
+ return {
8241
+ ...base,
8242
+ minWidth: "max-content"
8243
+ };
8244
+ }
8245
+ },
8246
+ ...readOnlyProps
8247
+ }
8248
+ ) });
8249
+ };
8250
+
8251
+ // src/components/SearchAndFilter/editors/StatusSingleEditor.tsx
8252
+ var import_design_system50 = require("@uniformdev/design-system");
8253
+ var import_react83 = require("react");
8254
+ var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
8255
+ var StatusSingleEditor = ({
8256
+ options,
8257
+ value,
8341
8258
  disabled,
8259
+ readOnly,
8260
+ onChange,
8261
+ valueTestId
8262
+ }) => {
8263
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
8264
+ const { groupedOptions, selectedOptions } = (0, import_react83.useMemo)(
8265
+ () => (0, import_design_system50.convertComboBoxGroupsToSelectableGroups)({
8266
+ options: options != null ? options : [],
8267
+ selectedItems: new Set(value ? [value] : void 0),
8268
+ selectionMode: "single"
8269
+ }),
8270
+ [options, value]
8271
+ );
8272
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
8273
+ import_design_system50.InputComboBox,
8274
+ {
8275
+ options: groupedOptions,
8276
+ onChange: (e) => {
8277
+ if (Array.isArray(e == null ? void 0 : e.value)) {
8278
+ return;
8279
+ }
8280
+ return onChange(e == null ? void 0 : e.value);
8281
+ },
8282
+ formatOptionLabel: CustomOptions,
8283
+ "aria-readonly": readOnly,
8284
+ value: selectedOptions,
8285
+ isDisabled: disabled,
8286
+ styles: {
8287
+ menu(base) {
8288
+ return {
8289
+ ...base,
8290
+ minWidth: "max-content"
8291
+ };
8292
+ }
8293
+ },
8294
+ ...readOnlyProps
8295
+ }
8296
+ ) });
8297
+ };
8298
+
8299
+ // src/components/SearchAndFilter/editors/TextEditor.tsx
8300
+ var import_design_system51 = require("@uniformdev/design-system");
8301
+ var import_react84 = require("react");
8302
+ var import_react_use9 = require("react-use");
8303
+ var import_jsx_runtime79 = require("@emotion/react/jsx-runtime");
8304
+ var TextEditor = ({
8305
+ onChange,
8306
+ ariaLabel,
8342
8307
  value,
8343
8308
  readOnly,
8344
8309
  valueTestId
8345
8310
  }) => {
8346
- const [innerValue, setInnerValue] = (0, import_react77.useState)(value != null ? value : "");
8347
- (0, import_react_use5.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
8348
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8349
- import_design_system43.Input,
8311
+ const [innerValue, setInnerValue] = (0, import_react84.useState)(value != null ? value : "");
8312
+ (0, import_react_use9.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
8313
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
8314
+ import_design_system51.Input,
8350
8315
  {
8351
- label: ariaLabel,
8352
- type: "number",
8353
8316
  showLabel: false,
8354
- min: 0,
8317
+ label: ariaLabel,
8355
8318
  onChange: (e) => setInnerValue(e.currentTarget.value),
8356
- disabled,
8319
+ placeholder: "Enter phrase to search\u2026",
8357
8320
  value: innerValue,
8358
8321
  readOnly,
8359
8322
  "data-testid": valueTestId
8360
8323
  }
8361
- );
8362
- };
8363
- var DateEditor = ({
8364
- onChange,
8365
- ariaLabel,
8366
- disabled,
8367
- value,
8368
- readOnly,
8369
- valueTestId
8324
+ );
8325
+ };
8326
+
8327
+ // src/components/SearchAndFilter/FilterButton.tsx
8328
+ var import_design_system53 = require("@uniformdev/design-system");
8329
+
8330
+ // src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
8331
+ var import_react85 = require("@emotion/react");
8332
+ var import_design_system52 = require("@uniformdev/design-system");
8333
+ var SearchAndFilterControlsWrapper = (gridColumns) => import_react85.css`
8334
+ align-items: stretch;
8335
+ display: grid;
8336
+ grid-template-columns: ${gridColumns};
8337
+ gap: var(--spacing-sm);
8338
+ `;
8339
+ var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react85.css`
8340
+ align-items: stretch;
8341
+ display: grid;
8342
+ grid-template-columns: ${gridColumns};
8343
+ gap: var(--spacing-sm);
8344
+ `;
8345
+ var ConditionalFilterRow = import_react85.css`
8346
+ align-items: baseline;
8347
+ display: grid;
8348
+ grid-template-columns: 35px 1fr;
8349
+ gap: var(--spacing-sm);
8350
+ margin-left: var(--spacing-base);
8351
+
8352
+ ${(0, import_design_system52.cq)("380px")} {
8353
+ &:after {
8354
+ content: '';
8355
+ display: block;
8356
+ height: 1px;
8357
+ background: var(--gray-300);
8358
+ width: calc(100% - var(--spacing-base));
8359
+ margin-left: var(--spacing-base);
8360
+ }
8361
+ &:last-of-type:after {
8362
+ display: none;
8363
+ }
8364
+ }
8365
+
8366
+ &:nth-of-type(2) {
8367
+ margin-left: 0;
8368
+ grid-template-columns: 50px 1fr;
8369
+ }
8370
+
8371
+ ${(0, import_design_system52.cq)("580px")} {
8372
+ &:after {
8373
+ display: none;
8374
+ }
8375
+ }
8376
+
8377
+ @media (prefers-reduced-motion: no-preference) {
8378
+ animation: ${import_design_system52.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
8379
+ }
8380
+ `;
8381
+ var ConditionalInputRow = import_react85.css`
8382
+ display: flex;
8383
+ gap: var(--spacing-sm);
8384
+ flex-wrap: wrap;
8385
+
8386
+ ${(0, import_design_system52.cq)("380px")} {
8387
+ & > div:nth-child(-n + 2) {
8388
+ width: calc(50% - var(--spacing-sm));
8389
+ }
8390
+
8391
+ & > div:nth-child(n + 3) {
8392
+ width: calc(100% - 48px);
8393
+ }
8394
+ }
8395
+ ${(0, import_design_system52.cq)("764px")} {
8396
+ align-items: flex-start;
8397
+ display: grid;
8398
+ grid-template-columns: 200px 160px 1fr 32px;
8399
+
8400
+ & > div:nth-child(n) {
8401
+ width: auto;
8402
+ }
8403
+ }
8404
+ `;
8405
+ var SearchInput = import_react85.css`
8406
+ max-height: 40px;
8407
+ min-height: unset;
8408
+ `;
8409
+ var BindableKeywordSearchInputStyles = import_react85.css`
8410
+ position: relative;
8411
+ width: 100%;
8412
+
8413
+ & [data-lexical-editor='true'] {
8414
+ padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
8415
+ font-size: var(--fs-sm);
8416
+ border-radius: var(--rounded-full);
8417
+ max-height: 40px;
8418
+ min-height: unset;
8419
+ width: 100%;
8420
+ position: relative;
8421
+ white-space: nowrap;
8422
+ }
8423
+ `;
8424
+ var ClearSearchButtonContainer = import_react85.css`
8425
+ align-items: center;
8426
+ display: flex;
8427
+ position: absolute;
8428
+ inset: 0 var(--spacing-lg) 0 auto;
8429
+ `;
8430
+ var ClearSearchButtonStyles = import_react85.css`
8431
+ background: none;
8432
+ border: none;
8433
+ padding: 0;
8434
+ pointer-events: all;
8435
+ `;
8436
+ var FilterButton = import_react85.css`
8437
+ align-items: center;
8438
+ background: var(--white);
8439
+ border: 1px solid var(--gray-300);
8440
+ border-radius: var(--rounded-full);
8441
+ color: var(--typography-base);
8442
+ display: flex;
8443
+ font-size: var(--fs-sm);
8444
+ gap: var(--spacing-sm);
8445
+ padding: var(--spacing-sm) var(--spacing-base);
8446
+ max-height: 40px;
8447
+ transition: color var(--duration-fast) var(--timing-ease-out),
8448
+ background-color var(--duration-fast) var(--timing-ease-out),
8449
+ border-color var(--duration-fast) var(--timing-ease-out),
8450
+ box-shadow var(--duration-fast) var(--timing-ease-out);
8451
+
8452
+ svg {
8453
+ color: var(--gray-300);
8454
+ transition: color var(--duration-fast) var(--timing-ease-out);
8455
+ }
8456
+
8457
+ &:hover,
8458
+ :where([aria-expanded='true']) {
8459
+ outline: none;
8460
+ background: var(--gray-200);
8461
+ border-color: var(--gray-300);
8462
+
8463
+ svg {
8464
+ color: var(--typography-base);
8465
+ }
8466
+ }
8467
+
8468
+ &:disabled {
8469
+ opacity: var(--opacity-50);
8470
+ }
8471
+ `;
8472
+ var FilterButtonText = import_react85.css`
8473
+ overflow: hidden;
8474
+ text-overflow: ellipsis;
8475
+ white-space: nowrap;
8476
+ max-width: 14ch;
8477
+ `;
8478
+ var FilterButtonSelected = import_react85.css`
8479
+ background: var(--gray-100);
8480
+ border-color: var(--gray-300);
8481
+
8482
+ svg {
8483
+ color: var(--accent-dark);
8484
+ }
8485
+ `;
8486
+ var FilterButtonWithOptions = import_react85.css`
8487
+ :where([aria-expanded='true']) {
8488
+ background: var(--purple-rain-100);
8489
+ border-color: var(--accent-light);
8490
+ color: var(--typography-base);
8491
+ box-shadow: var(--elevation-100);
8492
+
8493
+ svg {
8494
+ color: var(--accent-dark);
8495
+ }
8496
+ }
8497
+ `;
8498
+ var SearchIcon = import_react85.css`
8499
+ color: var(--icon-color);
8500
+ position: absolute;
8501
+ inset: 0 var(--spacing-base) 0 auto;
8502
+ margin: auto;
8503
+ transition: color var(--duration-fast) var(--timing-ease-out);
8504
+ `;
8505
+ var AddConditionalBtn = import_react85.css`
8506
+ align-items: center;
8507
+ background: transparent;
8508
+ border: none;
8509
+ color: var(--primary-action-default);
8510
+ display: flex;
8511
+ gap: var(--spacing-sm);
8512
+ transition: color var(--duration-fast) var(--timing-ease-out);
8513
+ padding: 0;
8514
+
8515
+ &:hover,
8516
+ &:focus {
8517
+ color: var(--primary-action-hover);
8518
+ }
8519
+
8520
+ &:disabled {
8521
+ color: var(--gray-400);
8522
+ }
8523
+ `;
8524
+ var Title = import_react85.css`
8525
+ color: var(--typography-light);
8526
+
8527
+ &:focus {
8528
+ outline: none;
8529
+ }
8530
+ `;
8531
+ var ResetConditionsBtn = import_react85.css`
8532
+ background: transparent;
8533
+ border: none;
8534
+ color: var(--action-destructive-default);
8535
+ transition: color var(--duration-fast) var(--timing-ease-out);
8536
+ padding: 0;
8537
+
8538
+ &:hover,
8539
+ &:focus {
8540
+ color: var(--action-destructive-hover);
8541
+ }
8542
+ `;
8543
+ var IconBtn = import_react85.css`
8544
+ background: transparent;
8545
+ border: none;
8546
+ padding: var(--spacing-sm);
8547
+ `;
8548
+ var SearchAndFilterOptionsContainer = import_react85.css`
8549
+ background: var(--gray-50);
8550
+ border: 1px solid var(--gray-300);
8551
+ border-radius: var(--rounded-base);
8552
+ container-type: inline-size;
8553
+ display: flex;
8554
+ flex-direction: column;
8555
+ gap: var(--spacing-sm);
8556
+ padding: var(--spacing-md) 0 var(--spacing-base);
8557
+ will-change: height;
8558
+ position: relative;
8559
+ z-index: 2;
8560
+ `;
8561
+ var SearchAndFilterOptionsInnerContainer = import_react85.css`
8562
+ display: flex;
8563
+ flex-direction: column;
8564
+ gap: var(--spacing-sm);
8565
+ padding-inline: var(--spacing-md);
8566
+ `;
8567
+ var SearchAndFilterButtonGroup = import_react85.css`
8568
+ margin-top: var(--spacing-xs);
8569
+ margin-left: calc(56px + var(--spacing-md));
8570
+ `;
8571
+
8572
+ // src/components/SearchAndFilter/FilterButton.tsx
8573
+ var import_jsx_runtime80 = require("@emotion/react/jsx-runtime");
8574
+ var FilterButton2 = ({
8575
+ text = "Filters",
8576
+ icon = "filter-add",
8577
+ filterCount,
8578
+ hasSelectedValue,
8579
+ dataTestId,
8580
+ ...props
8370
8581
  }) => {
8371
- const [innerValue, setInnerValue] = (0, import_react77.useState)(value != null ? value : "");
8372
- (0, import_react_use5.useDebounce)(() => onChange(innerValue), 500, [innerValue]);
8373
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8374
- import_design_system43.Input,
8582
+ return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
8583
+ "button",
8375
8584
  {
8376
- type: "date",
8377
- label: ariaLabel,
8378
- showLabel: false,
8379
- onChange: (e) => setInnerValue(e.currentTarget.value),
8380
- disabled,
8381
- value: innerValue,
8382
- readOnly,
8383
- "data-testid": valueTestId
8585
+ type: "button",
8586
+ css: [
8587
+ FilterButton,
8588
+ hasSelectedValue ? FilterButtonSelected : void 0,
8589
+ filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
8590
+ ],
8591
+ ...props,
8592
+ "data-testid": dataTestId,
8593
+ children: [
8594
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system53.Icon, { icon, iconColor: "currentColor", size: "1rem" }),
8595
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { css: FilterButtonText, children: text }),
8596
+ filterCount ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system53.Counter, { count: filterCount, bgColor: "var(--white)" }) : null
8597
+ ]
8384
8598
  }
8385
8599
  );
8386
8600
  };
8387
- var DateRangeEditor = ({
8388
- ariaLabel,
8389
- onChange,
8390
- disabled,
8391
- value,
8392
- readOnly,
8393
- valueTestId
8394
- }) => {
8395
- const [minDateValue, setMinDateValue] = (0, import_react77.useState)(value ? value[0] : "");
8396
- const [maxDateValue, setMaxDateValue] = (0, import_react77.useState)(value ? value[1] : "");
8397
- const [error, setError] = (0, import_react77.useState)("");
8398
- (0, import_react_use5.useDebounce)(
8399
- () => {
8400
- if (minDateValue && maxDateValue && !error) {
8401
- onChange([minDateValue, maxDateValue]);
8402
- } else {
8403
- onChange([]);
8404
- }
8405
- },
8406
- 500,
8407
- [minDateValue, maxDateValue]
8408
- );
8409
- (0, import_react77.useEffect)(() => {
8410
- if (!minDateValue || !maxDateValue) {
8411
- return;
8412
- }
8413
- const minDate = new Date(minDateValue);
8414
- const maxDate = new Date(maxDateValue);
8415
- if (maxDate < minDate) {
8416
- setError("The max date cannot be lower than the min date");
8417
- return;
8418
- }
8419
- if (maxDate && !minDate) {
8420
- setError("Please enter both a low and high date");
8421
- return;
8422
- }
8423
- const minDateString = minDate.toDateString();
8424
- const maxDateString = maxDate.toDateString();
8425
- if (minDateString === maxDateString || maxDateString === minDateString) {
8426
- setError("The min and max date cannot be the same");
8427
- return;
8428
- }
8429
- if (minDate > maxDate) {
8430
- setError("The min date cannot be higher than the max date");
8431
- return;
8432
- }
8433
- if (error) {
8434
- setError("");
8435
- }
8436
- if (minDate && maxDate) {
8437
- setMinDateValue(minDateValue);
8438
- setMaxDateValue(maxDateValue);
8439
- } else {
8440
- setMinDateValue("");
8441
- setMaxDateValue("");
8442
- }
8443
- }, [minDateValue, maxDateValue, setError]);
8444
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
8445
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
8446
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8447
- import_design_system43.Input,
8448
- {
8449
- label: `${ariaLabel}-min-date`,
8450
- type: "date",
8451
- showLabel: false,
8452
- value: minDateValue,
8453
- onChange: (e) => setMinDateValue(e.currentTarget.value),
8454
- "aria-invalid": !error ? false : true,
8455
- disabled,
8456
- readOnly,
8457
- "data-testid": "value-low"
8458
- }
8459
- ),
8460
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8461
- import_design_system43.Input,
8462
- {
8463
- label: `${ariaLabel}-max-date`,
8464
- type: "date",
8465
- showLabel: false,
8466
- value: maxDateValue,
8467
- onChange: (e) => setMaxDateValue(e.currentTarget.value),
8468
- "aria-invalid": !error ? false : true,
8469
- disabled,
8470
- readOnly,
8471
- "data-testid": "value-high"
8472
- }
8473
- )
8474
- ] }),
8475
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorContainer, { errorMessage: error })
8476
- ] });
8477
- };
8601
+
8602
+ // src/components/SearchAndFilter/FilterControls.tsx
8603
+ var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
8604
+ var import_design_system55 = require("@uniformdev/design-system");
8605
+ var import_lexical11 = require("lexical");
8606
+ var import_react87 = require("react");
8607
+ var import_react_use10 = require("react-use");
8608
+ var import_uuid3 = require("uuid");
8609
+
8610
+ // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
8611
+ var import_design_system54 = require("@uniformdev/design-system");
8612
+ var import_react86 = require("react");
8613
+
8614
+ // src/components/SearchAndFilter/FilterEditor.tsx
8615
+ var import_jsx_runtime81 = require("@emotion/react/jsx-runtime");
8478
8616
  var FilterEditorRenderer = ({ editorType, ...props }) => {
8479
8617
  const { filterMapper: contextFilterMapper } = useSearchAndFilter();
8480
8618
  const Editor = contextFilterMapper == null ? void 0 : contextFilterMapper[editorType];
@@ -8484,7 +8622,7 @@ var FilterEditorRenderer = ({ editorType, ...props }) => {
8484
8622
  if (editorType === "empty") {
8485
8623
  return null;
8486
8624
  }
8487
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Editor, { ...props });
8625
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Editor, { ...props });
8488
8626
  };
8489
8627
  var filterMapper = {
8490
8628
  multiChoice: FilterMultiChoiceEditor,
@@ -8501,9 +8639,9 @@ var filterMapper = {
8501
8639
  function withInputVariables(WrappedComponent) {
8502
8640
  const WithInputVariables = (props) => {
8503
8641
  if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
8504
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props });
8642
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
8505
8643
  }
8506
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8644
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
8507
8645
  InputVariables,
8508
8646
  {
8509
8647
  disableInlineMenu: true,
@@ -8511,7 +8649,7 @@ function withInputVariables(WrappedComponent) {
8511
8649
  onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
8512
8650
  value: props.value,
8513
8651
  disabled: props.disabled,
8514
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props })
8652
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
8515
8653
  }
8516
8654
  );
8517
8655
  };
@@ -8521,16 +8659,16 @@ function withInputVariablesForMultiValue(WrappedComponent) {
8521
8659
  const WithInputVariables = (props) => {
8522
8660
  var _a;
8523
8661
  if (!props.bindable || props.disabled || props.readOnly) {
8524
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props });
8662
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props });
8525
8663
  }
8526
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8664
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
8527
8665
  InputVariables,
8528
8666
  {
8529
8667
  disableInlineMenu: true,
8530
8668
  showMenuPosition: "inline-right",
8531
8669
  onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
8532
8670
  value: (_a = props.value) == null ? void 0 : _a[0],
8533
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props })
8671
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(WrappedComponent, { ...props })
8534
8672
  }
8535
8673
  );
8536
8674
  };
@@ -8544,27 +8682,10 @@ var bindableFiltersMapper = {
8544
8682
  text: withInputVariables(TextEditor),
8545
8683
  number: withInputVariables(NumberEditor)
8546
8684
  };
8547
- var ErrorContainer = ({ errorMessage }) => {
8548
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8549
- "div",
8550
- {
8551
- css: {
8552
- gridColumn: "span 6",
8553
- order: 6
8554
- },
8555
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_design_system43.FieldMessage, { errorMessage })
8556
- }
8557
- );
8558
- };
8559
- var twoColumnGrid = {
8560
- display: "grid",
8561
- gridTemplateColumns: "1fr 1fr",
8562
- gap: "var(--spacing-sm);"
8563
- };
8564
8685
 
8565
8686
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
8566
- var import_jsx_runtime71 = require("@emotion/react/jsx-runtime");
8567
- var SearchAndFilterContext = (0, import_react78.createContext)({
8687
+ var import_jsx_runtime82 = require("@emotion/react/jsx-runtime");
8688
+ var SearchAndFilterContext = (0, import_react86.createContext)({
8568
8689
  searchTerm: "",
8569
8690
  setSearchTerm: () => {
8570
8691
  },
@@ -8599,41 +8720,41 @@ var SearchAndFilterProvider = ({
8599
8720
  children,
8600
8721
  allowBindingSearchTerm
8601
8722
  }) => {
8602
- const [searchTerm, setSearchTerm] = (0, import_react78.useState)(defaultSearchTerm);
8603
- const deferredSearchTerm = (0, import_react78.useDeferredValue)(searchTerm);
8604
- const [filterVisibility, setFilterVisibility] = (0, import_react78.useState)(filterVisible);
8605
- const handleSearchTerm = (0, import_react78.useCallback)(
8723
+ const [searchTerm, setSearchTerm] = (0, import_react86.useState)(defaultSearchTerm);
8724
+ const deferredSearchTerm = (0, import_react86.useDeferredValue)(searchTerm);
8725
+ const [filterVisibility, setFilterVisibility] = (0, import_react86.useState)(filterVisible);
8726
+ const handleSearchTerm = (0, import_react86.useCallback)(
8606
8727
  (term) => {
8607
8728
  setSearchTerm(term);
8608
8729
  onSearchChange == null ? void 0 : onSearchChange(term);
8609
8730
  },
8610
8731
  [setSearchTerm, onSearchChange]
8611
8732
  );
8612
- const handleToggleFilterVisibility = (0, import_react78.useCallback)(
8733
+ const handleToggleFilterVisibility = (0, import_react86.useCallback)(
8613
8734
  (visible) => setFilterVisibility(visible),
8614
8735
  [setFilterVisibility]
8615
8736
  );
8616
- const handleAddFilter = (0, import_react78.useCallback)(() => {
8737
+ const handleAddFilter = (0, import_react86.useCallback)(() => {
8617
8738
  onChange([...filters, { field: "", operator: "", value: "" }]);
8618
8739
  }, [filters, onChange]);
8619
- const handleResetFilters = (0, import_react78.useCallback)(() => {
8740
+ const handleResetFilters = (0, import_react86.useCallback)(() => {
8620
8741
  onSearchChange == null ? void 0 : onSearchChange("");
8621
8742
  onChange(resetFilterValues);
8622
8743
  }, [onChange, resetFilterValues, onSearchChange]);
8623
- const handleDeleteFilter = (0, import_react78.useCallback)(
8744
+ const handleDeleteFilter = (0, import_react86.useCallback)(
8624
8745
  (index) => {
8625
8746
  const remainingFilters = filters.filter((_, i) => i !== index);
8626
8747
  onChange(remainingFilters);
8627
8748
  },
8628
8749
  [filters, onChange]
8629
8750
  );
8630
- const validFilterQuery = (0, import_react78.useMemo)(() => {
8751
+ const validFilterQuery = (0, import_react86.useMemo)(() => {
8631
8752
  const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
8632
8753
  if (hasValidFilters) {
8633
8754
  return filters;
8634
8755
  }
8635
8756
  }, [filters]);
8636
- (0, import_react78.useEffect)(() => {
8757
+ (0, import_react86.useEffect)(() => {
8637
8758
  if (filterVisibility) {
8638
8759
  const handleEscKeyFilterClose = (e) => {
8639
8760
  if (e.key === "Escape") {
@@ -8646,7 +8767,7 @@ var SearchAndFilterProvider = ({
8646
8767
  };
8647
8768
  }
8648
8769
  }, [filterVisibility]);
8649
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
8770
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
8650
8771
  SearchAndFilterContext.Provider,
8651
8772
  {
8652
8773
  value: {
@@ -8665,17 +8786,17 @@ var SearchAndFilterProvider = ({
8665
8786
  filterMapper: filterMapper2,
8666
8787
  allowBindingSearchTerm
8667
8788
  },
8668
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_design_system44.VerticalRhythm, { children })
8789
+ children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_design_system54.VerticalRhythm, { children })
8669
8790
  }
8670
8791
  );
8671
8792
  };
8672
8793
  var useSearchAndFilter = () => {
8673
- const value = (0, import_react78.useContext)(SearchAndFilterContext);
8794
+ const value = (0, import_react86.useContext)(SearchAndFilterContext);
8674
8795
  return { ...value };
8675
8796
  };
8676
8797
 
8677
8798
  // src/components/SearchAndFilter/FilterControls.tsx
8678
- var import_jsx_runtime72 = require("@emotion/react/jsx-runtime");
8799
+ var import_jsx_runtime83 = require("@emotion/react/jsx-runtime");
8679
8800
  var FilterControls = ({
8680
8801
  children,
8681
8802
  hideSearchInput
@@ -8688,25 +8809,25 @@ var FilterControls = ({
8688
8809
  searchTerm,
8689
8810
  allowBindingSearchTerm
8690
8811
  } = useSearchAndFilter();
8691
- const editorRef = (0, import_react79.useRef)(null);
8812
+ const editorRef = (0, import_react87.useRef)(null);
8692
8813
  const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
8693
- const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react79.useState)("data-resource-search-term-input");
8694
- const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react79.useState)(searchTerm);
8695
- (0, import_react_use6.useDebounce)(
8814
+ const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react87.useState)("data-resource-search-term-input");
8815
+ const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react87.useState)(searchTerm);
8816
+ (0, import_react_use10.useDebounce)(
8696
8817
  () => {
8697
8818
  setSearchTerm(localeSearchTerm);
8698
8819
  },
8699
8820
  300,
8700
8821
  [localeSearchTerm]
8701
8822
  );
8702
- (0, import_react79.useEffect)(() => {
8823
+ (0, import_react87.useEffect)(() => {
8703
8824
  if (searchTerm === "") {
8704
8825
  setLocaleSearchTerm("");
8705
8826
  setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid3.v4)()}`);
8706
8827
  }
8707
8828
  }, [searchTerm]);
8708
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
8709
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8829
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
8830
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
8710
8831
  FilterButton2,
8711
8832
  {
8712
8833
  "aria-controls": "search-and-filter-options",
@@ -8719,8 +8840,8 @@ var FilterControls = ({
8719
8840
  dataTestId: "filters-button"
8720
8841
  }
8721
8842
  ),
8722
- hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { css: BindableKeywordSearchInputStyles, children: [
8723
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8843
+ hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { css: BindableKeywordSearchInputStyles, children: [
8844
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
8724
8845
  InputVariables,
8725
8846
  {
8726
8847
  label: "",
@@ -8730,8 +8851,8 @@ var FilterControls = ({
8730
8851
  value: localeSearchTerm,
8731
8852
  onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
8732
8853
  disableVariables: !allowBindingSearchTerm,
8733
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8734
- import_design_system45.InputKeywordSearch,
8854
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
8855
+ import_design_system55.InputKeywordSearch,
8735
8856
  {
8736
8857
  placeholder: "Search...",
8737
8858
  onSearchTextChanged: (e) => setLocaleSearchTerm(e),
@@ -8743,7 +8864,7 @@ var FilterControls = ({
8743
8864
  )
8744
8865
  }
8745
8866
  ),
8746
- hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8867
+ hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
8747
8868
  "button",
8748
8869
  {
8749
8870
  css: ClearSearchButtonStyles,
@@ -8757,7 +8878,7 @@ var FilterControls = ({
8757
8878
  },
8758
8879
  type: "button",
8759
8880
  "data-testid": "keyword-search-clear-button",
8760
- children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system45.Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
8881
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_design_system55.Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
8761
8882
  }
8762
8883
  ) }) : null
8763
8884
  ] }),
@@ -8766,22 +8887,22 @@ var FilterControls = ({
8766
8887
  };
8767
8888
 
8768
8889
  // src/components/SearchAndFilter/FilterItem.tsx
8769
- var import_design_system47 = require("@uniformdev/design-system");
8770
- var import_react81 = require("react");
8890
+ var import_design_system57 = require("@uniformdev/design-system");
8891
+ var import_react89 = require("react");
8771
8892
 
8772
8893
  // src/components/SearchAndFilter/FilterMenu.tsx
8773
- var import_design_system46 = require("@uniformdev/design-system");
8774
- var import_react80 = __toESM(require("react"));
8775
- var import_jsx_runtime73 = require("@emotion/react/jsx-runtime");
8894
+ var import_design_system56 = require("@uniformdev/design-system");
8895
+ var import_react88 = __toESM(require("react"));
8896
+ var import_jsx_runtime84 = require("@emotion/react/jsx-runtime");
8776
8897
  var SearchAndFilterOptionsContainer2 = ({
8777
8898
  buttonRow,
8778
8899
  additionalFiltersContainer,
8779
8900
  children
8780
8901
  }) => {
8781
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
8782
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
8783
- buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
8784
- import_design_system46.HorizontalRhythm,
8902
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
8903
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
8904
+ buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
8905
+ import_design_system56.HorizontalRhythm,
8785
8906
  {
8786
8907
  css: SearchAndFilterButtonGroup,
8787
8908
  gap: "sm",
@@ -8790,7 +8911,7 @@ var SearchAndFilterOptionsContainer2 = ({
8790
8911
  children: buttonRow
8791
8912
  }
8792
8913
  ) : null,
8793
- additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { children: additionalFiltersContainer }) : null
8914
+ additionalFiltersContainer ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { children: additionalFiltersContainer }) : null
8794
8915
  ] });
8795
8916
  };
8796
8917
  var FilterMenu = ({
@@ -8803,22 +8924,22 @@ var FilterMenu = ({
8803
8924
  resetButtonText = "reset"
8804
8925
  }) => {
8805
8926
  const { filterVisibility, setFilterVisibility, handleResetFilters, filters } = useSearchAndFilter();
8806
- const innerMenuRef = import_react80.default.useRef(null);
8807
- (0, import_react80.useEffect)(() => {
8927
+ const innerMenuRef = import_react88.default.useRef(null);
8928
+ (0, import_react88.useEffect)(() => {
8808
8929
  var _a;
8809
8930
  if (filterVisibility) {
8810
8931
  (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
8811
8932
  }
8812
8933
  }, [filterVisibility]);
8813
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_design_system46.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
8934
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_design_system56.VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
8814
8935
  SearchAndFilterOptionsContainer2,
8815
8936
  {
8816
8937
  buttonRow: menuControls,
8817
8938
  additionalFiltersContainer,
8818
8939
  children: [
8819
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_design_system46.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
8820
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
8821
- (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
8940
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_design_system56.HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
8941
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
8942
+ (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
8822
8943
  "button",
8823
8944
  {
8824
8945
  type: "button",
@@ -8839,7 +8960,7 @@ var FilterMenu = ({
8839
8960
  };
8840
8961
 
8841
8962
  // src/components/SearchAndFilter/FilterItem.tsx
8842
- var import_jsx_runtime74 = require("@emotion/react/jsx-runtime");
8963
+ var import_jsx_runtime85 = require("@emotion/react/jsx-runtime");
8843
8964
  var FilterItem = ({
8844
8965
  index,
8845
8966
  paramOptions,
@@ -8855,7 +8976,7 @@ var FilterItem = ({
8855
8976
  const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
8856
8977
  const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
8857
8978
  const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
8858
- const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react81.useMemo)(() => {
8979
+ const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = (0, import_react89.useMemo)(() => {
8859
8980
  var _a2;
8860
8981
  const currentSelectedFilter = filterOptions.find((item) => {
8861
8982
  var _a3;
@@ -8882,11 +9003,11 @@ var FilterItem = ({
8882
9003
  menuIsOpen: false,
8883
9004
  isClearable: false
8884
9005
  } : {};
8885
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
8886
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: index === 0 ? "Where" : "and" }),
8887
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { css: ConditionalInputRow, children: [
8888
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
8889
- import_design_system47.InputComboBox,
9006
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
9007
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: index === 0 ? "Where" : "and" }),
9008
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { css: ConditionalInputRow, children: [
9009
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9010
+ import_design_system57.InputComboBox,
8890
9011
  {
8891
9012
  "aria-label": label,
8892
9013
  options: paramOptions,
@@ -8912,8 +9033,8 @@ var FilterItem = ({
8912
9033
  name: `filter-field-${index}`
8913
9034
  }
8914
9035
  ),
8915
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
8916
- import_design_system47.InputComboBox,
9036
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9037
+ import_design_system57.InputComboBox,
8917
9038
  {
8918
9039
  "aria-label": operatorLabel,
8919
9040
  options: operatorOptions,
@@ -8936,7 +9057,7 @@ var FilterItem = ({
8936
9057
  name: `filter-operator-${index}`
8937
9058
  }
8938
9059
  ),
8939
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
9060
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
8940
9061
  FilterEditorRenderer,
8941
9062
  {
8942
9063
  "aria-label": metaDataLabel,
@@ -8950,7 +9071,7 @@ var FilterItem = ({
8950
9071
  valueTestId: "filter-value"
8951
9072
  }
8952
9073
  ),
8953
- readOnly || index === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
9074
+ readOnly || index === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
8954
9075
  "button",
8955
9076
  {
8956
9077
  type: "button",
@@ -8958,7 +9079,7 @@ var FilterItem = ({
8958
9079
  "aria-label": "delete filter",
8959
9080
  css: IconBtn,
8960
9081
  "data-testid": "delete-filter",
8961
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_design_system47.Icon, { icon: "trash", iconColor: "red", size: "1rem" })
9082
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "trash", iconColor: "red", size: "1rem" })
8962
9083
  }
8963
9084
  )
8964
9085
  ] })
@@ -8974,13 +9095,13 @@ var FilterItems = ({
8974
9095
  const next = [...filters];
8975
9096
  next[index] = { ...next[index], [prop]: value };
8976
9097
  if (prop === "operator") {
8977
- if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
9098
+ if (!Array.isArray(value) && ["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
8978
9099
  next[index].value = next[index].value[0];
8979
9100
  }
8980
9101
  if (filters[index].operator === "ndef" || filters[index].operator === "def") {
8981
9102
  next[index].value = "";
8982
9103
  }
8983
- if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
9104
+ if (!Array.isArray(value) && ["between"].includes(value) && Array.isArray(next[index].value) === false) {
8984
9105
  next[index].value = [next[index].value, ""];
8985
9106
  }
8986
9107
  if (value === "def" || value === "true") {
@@ -9000,12 +9121,12 @@ var FilterItems = ({
9000
9121
  }
9001
9122
  setFilters(next);
9002
9123
  };
9003
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
9124
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9004
9125
  FilterMenu,
9005
9126
  {
9006
9127
  id: "search-and-filter-options",
9007
9128
  dataTestId: "search-and-filter-options",
9008
- menuControls: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
9129
+ menuControls: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
9009
9130
  "button",
9010
9131
  {
9011
9132
  type: "button",
@@ -9013,7 +9134,7 @@ var FilterItems = ({
9013
9134
  onClick: handleAddFilter,
9014
9135
  "data-testid": "add-filter",
9015
9136
  children: [
9016
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_design_system47.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
9137
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_design_system57.Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
9017
9138
  addButtonText
9018
9139
  ]
9019
9140
  }
@@ -9027,7 +9148,7 @@ var FilterItems = ({
9027
9148
  })) == null ? void 0 : _a.options) != null ? _b : [];
9028
9149
  const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
9029
9150
  const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
9030
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
9151
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9031
9152
  FilterItem,
9032
9153
  {
9033
9154
  index: i,
@@ -9046,11 +9167,11 @@ var FilterItems = ({
9046
9167
  };
9047
9168
 
9048
9169
  // src/components/SearchAndFilter/SearchAndFilter.tsx
9049
- var import_design_system49 = require("@uniformdev/design-system");
9170
+ var import_design_system59 = require("@uniformdev/design-system");
9050
9171
 
9051
9172
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
9052
- var import_design_system48 = require("@uniformdev/design-system");
9053
- var import_jsx_runtime75 = require("@emotion/react/jsx-runtime");
9173
+ var import_design_system58 = require("@uniformdev/design-system");
9174
+ var import_jsx_runtime86 = require("@emotion/react/jsx-runtime");
9054
9175
  var SearchAndFilterResultContainer = ({
9055
9176
  buttonText,
9056
9177
  clearButtonLabel = "clear",
@@ -9080,31 +9201,40 @@ var SearchAndFilterResultContainer = ({
9080
9201
  handleResetFilters();
9081
9202
  }
9082
9203
  };
9083
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
9084
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_design_system48.HorizontalRhythm, { children: [
9085
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { children: [
9204
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
9205
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_design_system58.HorizontalRhythm, { children: [
9206
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { children: [
9086
9207
  totalResults,
9087
9208
  " results ",
9088
9209
  searchTerm ? `for "${searchTerm}"` : null
9089
9210
  ] }),
9090
- !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9211
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
9091
9212
  ] }),
9092
- totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_design_system48.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9093
- calloutText ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Paragraph, { children: calloutText }) : null,
9094
- hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "tertiaryOutline", size: "xs", onClick: handleClearSearch, children: buttonText != null ? buttonText : "Clear search" })
9213
+ totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_design_system58.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
9214
+ calloutText ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_design_system58.Paragraph, { children: calloutText }) : null,
9215
+ hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9216
+ import_design_system58.Button,
9217
+ {
9218
+ buttonType: "tertiaryOutline",
9219
+ size: "xs",
9220
+ onClick: handleClearSearch,
9221
+ "data-testid": "clear-search",
9222
+ children: buttonText != null ? buttonText : "Clear search"
9223
+ }
9224
+ )
9095
9225
  ] }) : null
9096
9226
  ] });
9097
9227
  };
9098
9228
 
9099
9229
  // src/components/SearchAndFilter/SearchAndFilter.tsx
9100
- var import_jsx_runtime76 = require("@emotion/react/jsx-runtime");
9230
+ var import_jsx_runtime87 = require("@emotion/react/jsx-runtime");
9101
9231
  var SearchAndFilter = ({
9102
9232
  filters,
9103
9233
  filterOptions,
9104
9234
  filterVisible,
9105
9235
  filterControls,
9106
9236
  viewSwitchControls,
9107
- resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SearchAndFilterResultContainer, {}),
9237
+ resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SearchAndFilterResultContainer, {}),
9108
9238
  filterMapper: filterMapper2 = filterMapper,
9109
9239
  additionalFiltersContainer,
9110
9240
  onChange,
@@ -9114,7 +9244,7 @@ var SearchAndFilter = ({
9114
9244
  allowBindingSearchTerm = false,
9115
9245
  resetFilterValues = []
9116
9246
  }) => {
9117
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
9247
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9118
9248
  SearchAndFilterProvider,
9119
9249
  {
9120
9250
  filters,
@@ -9127,18 +9257,18 @@ var SearchAndFilter = ({
9127
9257
  resetFilterValues,
9128
9258
  filterMapper: filterMapper2,
9129
9259
  allowBindingSearchTerm,
9130
- children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_design_system49.VerticalRhythm, { "data-testid": "search-and-filter", children: [
9131
- /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9132
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
9260
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_design_system59.VerticalRhythm, { "data-testid": "search-and-filter", children: [
9261
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9262
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9133
9263
  "div",
9134
9264
  {
9135
9265
  css: SearchAndFilterControlsWrapper(viewSwitchControls ? "auto 1fr 0.05fr" : "auto 1fr"),
9136
- children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9266
+ children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
9137
9267
  }
9138
9268
  ),
9139
9269
  viewSwitchControls
9140
9270
  ] }),
9141
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FilterItems, { additionalFiltersContainer }),
9271
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FilterItems, { additionalFiltersContainer }),
9142
9272
  resultsContainerView
9143
9273
  ] })
9144
9274
  }
@@ -9146,19 +9276,19 @@ var SearchAndFilter = ({
9146
9276
  };
9147
9277
 
9148
9278
  // src/components/SearchAndFilter/SearchOnlyFilter.tsx
9149
- var import_design_system50 = require("@uniformdev/design-system");
9150
- var import_react82 = require("react");
9151
- var import_react_use7 = require("react-use");
9152
- var import_jsx_runtime77 = require("@emotion/react/jsx-runtime");
9153
- var SearchOnlyContext = (0, import_react82.createContext)({
9279
+ var import_design_system60 = require("@uniformdev/design-system");
9280
+ var import_react90 = require("react");
9281
+ var import_react_use11 = require("react-use");
9282
+ var import_jsx_runtime88 = require("@emotion/react/jsx-runtime");
9283
+ var SearchOnlyContext = (0, import_react90.createContext)({
9154
9284
  searchTerm: "",
9155
9285
  setSearchTerm: () => {
9156
9286
  }
9157
9287
  });
9158
9288
  var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9159
9289
  const { searchTerm, setSearchTerm } = useSearchAndFilter();
9160
- const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react82.useState)("");
9161
- (0, import_react_use7.useDebounce)(
9290
+ const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react90.useState)("");
9291
+ (0, import_react_use11.useDebounce)(
9162
9292
  () => {
9163
9293
  setSearchTerm(localeSearchTerm);
9164
9294
  onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
@@ -9166,15 +9296,15 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9166
9296
  300,
9167
9297
  [localeSearchTerm]
9168
9298
  );
9169
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
9299
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9170
9300
  SearchOnlyContext.Provider,
9171
9301
  {
9172
9302
  value: {
9173
9303
  searchTerm,
9174
9304
  setSearchTerm: setLocaleSearchTerm
9175
9305
  },
9176
- children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
9177
- import_design_system50.InputKeywordSearch,
9306
+ children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9307
+ import_design_system60.InputKeywordSearch,
9178
9308
  {
9179
9309
  placeholder: "Search...",
9180
9310
  onSearchTextChanged: (e) => setLocaleSearchTerm(e),
@@ -9188,18 +9318,18 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
9188
9318
  };
9189
9319
 
9190
9320
  // src/components/SearchAndFilter/SortItems.tsx
9191
- var import_design_system52 = require("@uniformdev/design-system");
9321
+ var import_design_system62 = require("@uniformdev/design-system");
9192
9322
 
9193
9323
  // src/components/SearchAndFilter/styles/SortItems.styles.ts
9194
- var import_react83 = require("@emotion/react");
9195
- var import_design_system51 = require("@uniformdev/design-system");
9196
- var ConditionalFilterRow2 = import_react83.css`
9324
+ var import_react91 = require("@emotion/react");
9325
+ var import_design_system61 = require("@uniformdev/design-system");
9326
+ var ConditionalFilterRow2 = import_react91.css`
9197
9327
  display: grid;
9198
9328
  grid-template-columns: 35px 1fr;
9199
9329
  gap: var(--spacing-sm);
9200
9330
  margin-left: var(--spacing-base);
9201
9331
 
9202
- ${(0, import_design_system51.cq)("380px")} {
9332
+ ${(0, import_design_system61.cq)("380px")} {
9203
9333
  align-items: center;
9204
9334
 
9205
9335
  &:after {
@@ -9220,22 +9350,22 @@ var ConditionalFilterRow2 = import_react83.css`
9220
9350
  grid-template-columns: 50px 1fr;
9221
9351
  }
9222
9352
 
9223
- ${(0, import_design_system51.cq)("580px")} {
9353
+ ${(0, import_design_system61.cq)("580px")} {
9224
9354
  &:after {
9225
9355
  display: none;
9226
9356
  }
9227
9357
  }
9228
9358
 
9229
9359
  @media (prefers-reduced-motion: no-preference) {
9230
- animation: ${import_design_system51.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
9360
+ animation: ${import_design_system61.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
9231
9361
  }
9232
9362
  `;
9233
- var ConditionalInputRow2 = import_react83.css`
9363
+ var ConditionalInputRow2 = import_react91.css`
9234
9364
  display: flex;
9235
9365
  gap: var(--spacing-sm);
9236
9366
  flex-wrap: wrap;
9237
9367
 
9238
- ${(0, import_design_system51.cq)("380px")} {
9368
+ ${(0, import_design_system61.cq)("380px")} {
9239
9369
  & > div:nth-child(-n + 2) {
9240
9370
  width: calc(50% - var(--spacing-sm));
9241
9371
  }
@@ -9244,7 +9374,7 @@ var ConditionalInputRow2 = import_react83.css`
9244
9374
  width: calc(100% - 48px);
9245
9375
  }
9246
9376
  }
9247
- ${(0, import_design_system51.cq)("580px")} {
9377
+ ${(0, import_design_system61.cq)("580px")} {
9248
9378
  display: grid;
9249
9379
  grid-template-columns: 200px 160px 1fr 32px;
9250
9380
 
@@ -9253,11 +9383,11 @@ var ConditionalInputRow2 = import_react83.css`
9253
9383
  }
9254
9384
  }
9255
9385
  `;
9256
- var SearchInput2 = import_react83.css`
9386
+ var SearchInput2 = import_react91.css`
9257
9387
  max-height: 40px;
9258
9388
  min-height: unset;
9259
9389
  `;
9260
- var FilterButton3 = import_react83.css`
9390
+ var FilterButton3 = import_react91.css`
9261
9391
  align-items: center;
9262
9392
  background: var(--white);
9263
9393
  border: 1px solid var(--gray-300);
@@ -9293,13 +9423,13 @@ var FilterButton3 = import_react83.css`
9293
9423
  opacity: var(--opacity-50);
9294
9424
  }
9295
9425
  `;
9296
- var FilterButtonText2 = import_react83.css`
9426
+ var FilterButtonText2 = import_react91.css`
9297
9427
  overflow: hidden;
9298
9428
  text-overflow: ellipsis;
9299
9429
  white-space: nowrap;
9300
9430
  max-width: 14ch;
9301
9431
  `;
9302
- var FilterButtonSelected2 = import_react83.css`
9432
+ var FilterButtonSelected2 = import_react91.css`
9303
9433
  background: var(--gray-100);
9304
9434
  border-color: var(--gray-300);
9305
9435
 
@@ -9307,7 +9437,7 @@ var FilterButtonSelected2 = import_react83.css`
9307
9437
  color: var(--accent-dark);
9308
9438
  }
9309
9439
  `;
9310
- var FilterButtonWithOptions2 = import_react83.css`
9440
+ var FilterButtonWithOptions2 = import_react91.css`
9311
9441
  :where([aria-expanded='true']) {
9312
9442
  background: var(--purple-rain-100);
9313
9443
  border-color: var(--accent-light);
@@ -9319,14 +9449,14 @@ var FilterButtonWithOptions2 = import_react83.css`
9319
9449
  }
9320
9450
  }
9321
9451
  `;
9322
- var SearchIcon2 = import_react83.css`
9452
+ var SearchIcon2 = import_react91.css`
9323
9453
  color: var(--icon-color);
9324
9454
  position: absolute;
9325
9455
  inset: 0 var(--spacing-base) 0 auto;
9326
9456
  margin: auto;
9327
9457
  transition: color var(--duration-fast) var(--timing-ease-out);
9328
9458
  `;
9329
- var AddConditionalBtn2 = import_react83.css`
9459
+ var AddConditionalBtn2 = import_react91.css`
9330
9460
  align-items: center;
9331
9461
  background: transparent;
9332
9462
  border: none;
@@ -9345,14 +9475,14 @@ var AddConditionalBtn2 = import_react83.css`
9345
9475
  color: var(--gray-400);
9346
9476
  }
9347
9477
  `;
9348
- var Title2 = import_react83.css`
9478
+ var Title2 = import_react91.css`
9349
9479
  color: var(--typography-light);
9350
9480
 
9351
9481
  &:focus {
9352
9482
  outline: none;
9353
9483
  }
9354
9484
  `;
9355
- var ResetConditionsBtn2 = import_react83.css`
9485
+ var ResetConditionsBtn2 = import_react91.css`
9356
9486
  background: transparent;
9357
9487
  border: none;
9358
9488
  color: var(--action-destructive-default);
@@ -9364,12 +9494,12 @@ var ResetConditionsBtn2 = import_react83.css`
9364
9494
  color: var(--action-destructive-hover);
9365
9495
  }
9366
9496
  `;
9367
- var IconBtn2 = import_react83.css`
9497
+ var IconBtn2 = import_react91.css`
9368
9498
  background: transparent;
9369
9499
  border: none;
9370
9500
  padding: var(--spacing-sm);
9371
9501
  `;
9372
- var SearchAndFilterOptionsContainer3 = import_react83.css`
9502
+ var SearchAndFilterOptionsContainer3 = import_react91.css`
9373
9503
  background: var(--gray-50);
9374
9504
  border: 1px solid var(--gray-300);
9375
9505
  border-radius: var(--rounded-base);
@@ -9382,17 +9512,17 @@ var SearchAndFilterOptionsContainer3 = import_react83.css`
9382
9512
  position: relative;
9383
9513
  z-index: 1;
9384
9514
  `;
9385
- var SearchAndFilterOptionsInnerContainer2 = import_react83.css`
9515
+ var SearchAndFilterOptionsInnerContainer2 = import_react91.css`
9386
9516
  display: flex;
9387
9517
  flex-direction: column;
9388
9518
  gap: var(--spacing-sm);
9389
9519
  padding-inline: var(--spacing-md);
9390
9520
  `;
9391
- var SearchAndFilterButtonGroup2 = import_react83.css`
9521
+ var SearchAndFilterButtonGroup2 = import_react91.css`
9392
9522
  margin-top: var(--spacing-xs);
9393
9523
  margin-left: calc(56px + var(--spacing-md));
9394
9524
  `;
9395
- var SortFilterWrapper = (hiddenLocaleInput) => import_react83.css`
9525
+ var SortFilterWrapper = (hiddenLocaleInput) => import_react91.css`
9396
9526
  align-items: center;
9397
9527
  border-top: 1px solid var(--gray-300);
9398
9528
  display: flex;
@@ -9402,18 +9532,18 @@ var SortFilterWrapper = (hiddenLocaleInput) => import_react83.css`
9402
9532
  position: relative;
9403
9533
  z-index: 0;
9404
9534
 
9405
- ${(0, import_design_system51.cq)("420px")} {
9535
+ ${(0, import_design_system61.cq)("420px")} {
9406
9536
  display: grid;
9407
9537
  grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
9408
9538
  }
9409
9539
  `;
9410
- var SortFilterInputRow = import_react83.css`
9540
+ var SortFilterInputRow = import_react91.css`
9411
9541
  align-items: center;
9412
9542
  display: grid;
9413
9543
  grid-template-columns: 1fr auto;
9414
9544
  gap: var(--spacing-base);
9415
9545
  `;
9416
- var InputVariableWrapper = import_react83.css`
9546
+ var InputVariableWrapper = import_react91.css`
9417
9547
  flex-grow: 1;
9418
9548
 
9419
9549
  // we need to override label styles nested within the input variable
@@ -9424,7 +9554,7 @@ var InputVariableWrapper = import_react83.css`
9424
9554
  `;
9425
9555
 
9426
9556
  // src/components/SearchAndFilter/SortItems.tsx
9427
- var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
9557
+ var import_jsx_runtime89 = require("@emotion/react/jsx-runtime");
9428
9558
  var SortItems = ({
9429
9559
  sortByLabel = "Sort by",
9430
9560
  localeLabel = "Show locale",
@@ -9446,11 +9576,11 @@ var SortItems = ({
9446
9576
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
9447
9577
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
9448
9578
  const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
9449
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9450
- /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_design_system52.VerticalRhythm, { gap: "xs", children: [
9451
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { css: Title2, children: sortByLabel }),
9452
- /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { css: SortFilterInputRow, children: [
9453
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9579
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9580
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_design_system62.VerticalRhythm, { gap: "xs", children: [
9581
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { css: Title2, children: sortByLabel }),
9582
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { css: SortFilterInputRow, children: [
9583
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9454
9584
  InputVariables,
9455
9585
  {
9456
9586
  disableInlineMenu: disableSortBinding,
@@ -9458,8 +9588,8 @@ var SortItems = ({
9458
9588
  value: sortField,
9459
9589
  valueToResetTo: "created_at",
9460
9590
  onChange: (e) => onSortChange(`${e}_${sortDirection}`),
9461
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9462
- import_design_system52.InputComboBox,
9591
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9592
+ import_design_system62.InputComboBox,
9463
9593
  {
9464
9594
  id: "sort-by-field",
9465
9595
  "aria-label": "Sort by",
@@ -9481,7 +9611,7 @@ var SortItems = ({
9481
9611
  )
9482
9612
  }
9483
9613
  ),
9484
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9614
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9485
9615
  InputVariables,
9486
9616
  {
9487
9617
  disableInlineMenu: disableSortBinding,
@@ -9489,8 +9619,8 @@ var SortItems = ({
9489
9619
  valueToResetTo: "DESC",
9490
9620
  showMenuPosition: disableSortBinding ? void 0 : "inline-right",
9491
9621
  onChange: (e) => onSortChange(`${sortField}_${e}`),
9492
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9493
- import_design_system52.SegmentedControl,
9622
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9623
+ import_design_system62.SegmentedControl,
9494
9624
  {
9495
9625
  noCheckmark: true,
9496
9626
  name: "sortBy",
@@ -9521,15 +9651,15 @@ var SortItems = ({
9521
9651
  )
9522
9652
  ] })
9523
9653
  ] }),
9524
- hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_design_system52.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9654
+ hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system62.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9525
9655
  InputVariables,
9526
9656
  {
9527
9657
  label: localeLabelValue,
9528
9658
  value: localeValue,
9529
9659
  showMenuPosition: "inline-right",
9530
9660
  onChange: (e) => onLocaleChange(e != null ? e : ""),
9531
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9532
- import_design_system52.InputSelect,
9661
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
9662
+ import_design_system62.InputSelect,
9533
9663
  {
9534
9664
  name: "localeReturned",
9535
9665
  "aria-label": localeLabelValue,
@@ -9559,19 +9689,19 @@ function createLocationValidator(setValue, validate) {
9559
9689
 
9560
9690
  // src/utils/useContentDataResourceLocaleInfo.ts
9561
9691
  var import_canvas10 = require("@uniformdev/canvas");
9562
- var import_react84 = require("react");
9692
+ var import_react92 = require("react");
9563
9693
  function useContentDataResourceLocaleInfo({
9564
9694
  locale,
9565
9695
  setLocale,
9566
9696
  dynamicInputs
9567
9697
  }) {
9568
9698
  var _a;
9569
- const setLocaleRef = (0, import_react84.useRef)(setLocale);
9699
+ const setLocaleRef = (0, import_react92.useRef)(setLocale);
9570
9700
  setLocaleRef.current = setLocale;
9571
9701
  const { flatVariables } = useVariables();
9572
9702
  const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
9573
9703
  const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
9574
- (0, import_react84.useEffect)(() => {
9704
+ (0, import_react92.useEffect)(() => {
9575
9705
  if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
9576
9706
  setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
9577
9707
  }
@@ -9580,7 +9710,7 @@ function useContentDataResourceLocaleInfo({
9580
9710
  }
9581
9711
 
9582
9712
  // src/index.ts
9583
- var import_design_system53 = require("@uniformdev/design-system");
9713
+ var import_design_system63 = require("@uniformdev/design-system");
9584
9714
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9585
9715
  // Annotate the CommonJS export names for ESM import in node:
9586
9716
  0 && (module.exports = {
@@ -9711,6 +9841,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9711
9841
  VariablesList,
9712
9842
  VariablesPlugin,
9713
9843
  VariablesProvider,
9844
+ WORKFLOW_STAGES_OPERATORS,
9714
9845
  badgeIcon,
9715
9846
  bindableFiltersMapper,
9716
9847
  convertConnectedDataToVariable,