@uniformdev/mesh-sdk-react 19.142.0 → 19.142.1

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_system51.AddListButton,
37
- Button: () => import_design_system51.Button,
36
+ AddListButton: () => import_design_system53.AddListButton,
37
+ Button: () => import_design_system53.Button,
38
38
  CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
39
- Callout: () => import_design_system51.Callout,
39
+ Callout: () => import_design_system53.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_system51.DrawerContent,
54
+ DrawerContent: () => import_design_system53.DrawerContent,
55
55
  EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
56
56
  EntrySearch: () => EntrySearch,
57
57
  FilterButton: () => FilterButton2,
@@ -62,21 +62,21 @@ __export(src_exports, {
62
62
  FilterMenu: () => FilterMenu,
63
63
  FilterMultiChoiceEditor: () => FilterMultiChoiceEditor,
64
64
  FilterSingleChoiceEditor: () => FilterSingleChoiceEditor,
65
- Heading: () => import_design_system51.Heading,
65
+ Heading: () => import_design_system53.Heading,
66
66
  INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
67
67
  Icons: () => icons_exports,
68
- Input: () => import_design_system51.Input,
69
- InputComboBox: () => import_design_system51.InputComboBox,
70
- InputKeywordSearch: () => import_design_system51.InputKeywordSearch,
71
- InputSelect: () => import_design_system51.InputSelect,
72
- InputToggle: () => import_design_system51.InputToggle,
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,
73
73
  InputVariables: () => InputVariables,
74
- Label: () => import_design_system51.Label,
74
+ Label: () => import_design_system53.Label,
75
75
  LinkButton: () => LinkButton,
76
- LoadingIndicator: () => import_design_system51.LoadingIndicator,
77
- LoadingOverlay: () => import_design_system51.LoadingOverlay,
78
- Menu: () => import_design_system51.Menu,
79
- MenuItem: () => import_design_system51.MenuItem,
76
+ LoadingIndicator: () => import_design_system53.LoadingIndicator,
77
+ LoadingOverlay: () => import_design_system53.LoadingOverlay,
78
+ Menu: () => import_design_system53.Menu,
79
+ MenuItem: () => import_design_system53.MenuItem,
80
80
  MeshApp: () => MeshApp,
81
81
  NUMBER_OPERATORS: () => NUMBER_OPERATORS,
82
82
  NumberEditor: () => NumberEditor,
@@ -94,22 +94,22 @@ __export(src_exports, {
94
94
  PUBLISH_STATUS_FIELD_OPERATORS: () => PUBLISH_STATUS_FIELD_OPERATORS,
95
95
  ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
96
96
  ParameterConnectionIndicator: () => ParameterConnectionIndicator,
97
- ParameterGroup: () => import_design_system51.ParameterGroup,
98
- ParameterImage: () => import_design_system51.ParameterImage,
99
- ParameterImageInner: () => import_design_system51.ParameterImageInner,
100
- ParameterInput: () => import_design_system51.ParameterInput,
101
- ParameterInputInner: () => import_design_system51.ParameterInputInner,
102
- ParameterLabel: () => import_design_system51.ParameterLabel,
103
- ParameterMenuButton: () => import_design_system51.ParameterMenuButton,
97
+ ParameterGroup: () => import_design_system53.ParameterGroup,
98
+ ParameterImage: () => import_design_system53.ParameterImage,
99
+ ParameterImageInner: () => import_design_system53.ParameterImageInner,
100
+ ParameterInput: () => import_design_system53.ParameterInput,
101
+ ParameterInputInner: () => import_design_system53.ParameterInputInner,
102
+ ParameterLabel: () => import_design_system53.ParameterLabel,
103
+ ParameterMenuButton: () => import_design_system53.ParameterMenuButton,
104
104
  ParameterOrSingleVariable: () => ParameterOrSingleVariable,
105
- ParameterSelect: () => import_design_system51.ParameterSelect,
106
- ParameterSelectInner: () => import_design_system51.ParameterSelectInner,
107
- ParameterShell: () => import_design_system51.ParameterShell,
105
+ ParameterSelect: () => import_design_system53.ParameterSelect,
106
+ ParameterSelectInner: () => import_design_system53.ParameterSelectInner,
107
+ ParameterShell: () => import_design_system53.ParameterShell,
108
108
  ParameterShellContext: () => import_design_system14.ParameterShellContext,
109
- ParameterTextarea: () => import_design_system51.ParameterTextarea,
110
- ParameterTextareaInner: () => import_design_system51.ParameterTextareaInner,
111
- ParameterToggle: () => import_design_system51.ParameterToggle,
112
- ParameterToggleInner: () => import_design_system51.ParameterToggleInner,
109
+ ParameterTextarea: () => import_design_system53.ParameterTextarea,
110
+ ParameterTextareaInner: () => import_design_system53.ParameterTextareaInner,
111
+ ParameterToggle: () => import_design_system53.ParameterToggle,
112
+ ParameterToggleInner: () => import_design_system53.ParameterToggleInner,
113
113
  ParameterVariables: () => ParameterVariables,
114
114
  ProductPreviewList: () => ProductPreviewList,
115
115
  ProductQuery: () => ProductQuery,
@@ -131,8 +131,8 @@ __export(src_exports, {
131
131
  ResolvableLoadingValue: () => ResolvableLoadingValue,
132
132
  SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
133
133
  SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
134
- ScrollableList: () => import_design_system51.ScrollableList,
135
- ScrollableListItem: () => import_design_system51.ScrollableListItem,
134
+ ScrollableList: () => import_design_system53.ScrollableList,
135
+ ScrollableListItem: () => import_design_system53.ScrollableListItem,
136
136
  SearchAndFilter: () => SearchAndFilter,
137
137
  SearchAndFilterContext: () => SearchAndFilterContext,
138
138
  SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
@@ -141,14 +141,15 @@ __export(src_exports, {
141
141
  SearchOnlyContext: () => SearchOnlyContext,
142
142
  SearchOnlyFilter: () => SearchOnlyFilter,
143
143
  SelectionField: () => SelectionField,
144
+ SortItems: () => SortItems,
144
145
  StatusMultiEditor: () => StatusMultiEditor,
145
146
  StatusSingleEditor: () => StatusSingleEditor,
146
- Switch: () => import_design_system51.Switch,
147
+ Switch: () => import_design_system53.Switch,
147
148
  TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
148
149
  TextEditor: () => TextEditor,
149
150
  TextVariableRenderer: () => TextVariableRenderer,
150
- Textarea: () => import_design_system51.Textarea,
151
- Theme: () => import_design_system51.Theme,
151
+ Textarea: () => import_design_system53.Textarea,
152
+ Theme: () => import_design_system53.Theme,
152
153
  USER_OPERATORS: () => USER_OPERATORS,
153
154
  VariableEditor: () => VariableEditor,
154
155
  VariableNode: () => VariableNode,
@@ -4920,7 +4921,7 @@ var import_lexical9 = require("lexical");
4920
4921
  var import_react50 = require("react");
4921
4922
  var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
4922
4923
  function VariablesComposerInput({
4923
- css: css39,
4924
+ css: css40,
4924
4925
  placeholder,
4925
4926
  ...contentEditableProps
4926
4927
  }) {
@@ -7784,6 +7785,33 @@ var SearchInput = import_react76.css`
7784
7785
  max-height: 40px;
7785
7786
  min-height: unset;
7786
7787
  `;
7788
+ var BindableKeywordSearchInputStyles = import_react76.css`
7789
+ position: relative;
7790
+ width: 100%;
7791
+
7792
+ & [data-lexical-editor='true'] {
7793
+ padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
7794
+ font-size: var(--fs-sm);
7795
+ border-radius: var(--rounded-full);
7796
+ max-height: 40px;
7797
+ min-height: unset;
7798
+ width: 100%;
7799
+ position: relative;
7800
+ white-space: nowrap;
7801
+ }
7802
+ `;
7803
+ var ClearSearchButtonContainer = import_react76.css`
7804
+ align-items: center;
7805
+ display: flex;
7806
+ position: absolute;
7807
+ inset: 0 var(--spacing-lg) 0 auto;
7808
+ `;
7809
+ var ClearSearchButtonStyles = import_react76.css`
7810
+ background: none;
7811
+ border: none;
7812
+ padding: 0;
7813
+ pointer-events: all;
7814
+ `;
7787
7815
  var FilterButton = import_react76.css`
7788
7816
  align-items: center;
7789
7817
  background: var(--white);
@@ -7951,9 +7979,12 @@ var FilterButton2 = ({
7951
7979
  };
7952
7980
 
7953
7981
  // src/components/SearchAndFilter/FilterControls.tsx
7982
+ var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
7954
7983
  var import_design_system45 = require("@uniformdev/design-system");
7984
+ var import_lexical11 = require("lexical");
7955
7985
  var import_react79 = require("react");
7956
7986
  var import_react_use6 = require("react-use");
7987
+ var import_uuid3 = require("uuid");
7957
7988
 
7958
7989
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
7959
7990
  var import_design_system44 = require("@uniformdev/design-system");
@@ -8375,6 +8406,52 @@ var filterMapper = {
8375
8406
  statusSingleChoice: StatusSingleEditor,
8376
8407
  empty: null
8377
8408
  };
8409
+ function withInputVariables(WrappedComponent) {
8410
+ const WithInputVariables = (props) => {
8411
+ if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
8412
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props });
8413
+ }
8414
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8415
+ InputVariables,
8416
+ {
8417
+ disableInlineMenu: true,
8418
+ showMenuPosition: "inline-right",
8419
+ onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
8420
+ value: props.value,
8421
+ disabled: props.disabled,
8422
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props })
8423
+ }
8424
+ );
8425
+ };
8426
+ return WithInputVariables;
8427
+ }
8428
+ function withInputVariablesForMultiValue(WrappedComponent) {
8429
+ const WithInputVariables = (props) => {
8430
+ var _a;
8431
+ if (!props.bindable || props.disabled || props.readOnly) {
8432
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props });
8433
+ }
8434
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8435
+ InputVariables,
8436
+ {
8437
+ disableInlineMenu: true,
8438
+ showMenuPosition: "inline-right",
8439
+ onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
8440
+ value: (_a = props.value) == null ? void 0 : _a[0],
8441
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(WrappedComponent, { ...props })
8442
+ }
8443
+ );
8444
+ };
8445
+ return WithInputVariables;
8446
+ }
8447
+ var bindableFiltersMapper = {
8448
+ ...filterMapper,
8449
+ multiChoice: withInputVariablesForMultiValue(FilterMultiChoiceEditor),
8450
+ singleChoice: withInputVariables(FilterSingleChoiceEditor),
8451
+ date: withInputVariables(DateEditor),
8452
+ text: withInputVariables(TextEditor),
8453
+ number: withInputVariables(NumberEditor)
8454
+ };
8378
8455
  var ErrorContainer = ({ errorMessage }) => {
8379
8456
  return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
8380
8457
  "div",
@@ -8508,17 +8585,21 @@ var FilterControls = ({
8508
8585
  hideSearchInput
8509
8586
  }) => {
8510
8587
  const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm } = useSearchAndFilter();
8511
- const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react79.useState)("");
8588
+ const editorRef = (0, import_react79.useRef)(null);
8589
+ const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
8590
+ const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react79.useState)("data-resource-search-term-input");
8591
+ const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react79.useState)(searchTerm);
8512
8592
  (0, import_react_use6.useDebounce)(
8513
8593
  () => {
8514
8594
  setSearchTerm(localeSearchTerm);
8515
8595
  },
8516
8596
  300,
8517
- [localeSearchTerm, searchTerm]
8597
+ [localeSearchTerm]
8518
8598
  );
8519
8599
  (0, import_react79.useEffect)(() => {
8520
8600
  if (searchTerm === "") {
8521
8601
  setLocaleSearchTerm("");
8602
+ setIdToResetInputVariables(`data-resource-search-term-input-${(0, import_uuid3.v4)()}`);
8522
8603
  }
8523
8604
  }, [searchTerm]);
8524
8605
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
@@ -8535,17 +8616,47 @@ var FilterControls = ({
8535
8616
  dataTestId: "filters-button"
8536
8617
  }
8537
8618
  ),
8538
- hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8539
- import_design_system45.InputKeywordSearch,
8540
- {
8541
- placeholder: "Search...",
8542
- onSearchTextChanged: (e) => setLocaleSearchTerm(e),
8543
- value: localeSearchTerm,
8544
- compact: true,
8545
- rounded: true,
8546
- css: SearchInput
8547
- }
8548
- ),
8619
+ hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { css: BindableKeywordSearchInputStyles, children: [
8620
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8621
+ InputVariables,
8622
+ {
8623
+ label: "",
8624
+ id: idToResetInputVariables,
8625
+ showMenuPosition: "inline-right",
8626
+ editorRef,
8627
+ value: localeSearchTerm,
8628
+ onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
8629
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8630
+ import_design_system45.InputKeywordSearch,
8631
+ {
8632
+ placeholder: "Search...",
8633
+ onSearchTextChanged: (e) => setLocaleSearchTerm(e),
8634
+ value: localeSearchTerm,
8635
+ compact: true,
8636
+ rounded: true,
8637
+ css: SearchInput
8638
+ }
8639
+ )
8640
+ }
8641
+ ),
8642
+ hasVariableInSearchTerm ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { css: ClearSearchButtonContainer, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8643
+ "button",
8644
+ {
8645
+ css: ClearSearchButtonStyles,
8646
+ onClick: () => {
8647
+ setLocaleSearchTerm("");
8648
+ if (editorRef.current) {
8649
+ if (editorRef.current.getRootElement() !== document.activeElement) {
8650
+ editorRef.current.dispatchCommand(import_lexical11.CLEAR_EDITOR_COMMAND, void 0);
8651
+ }
8652
+ }
8653
+ },
8654
+ type: "button",
8655
+ "data-testid": "keyword-search-clear-button",
8656
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_design_system45.Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
8657
+ }
8658
+ ) }) : null
8659
+ ] }),
8549
8660
  children
8550
8661
  ] });
8551
8662
  };
@@ -8975,53 +9086,366 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
8975
9086
  );
8976
9087
  };
8977
9088
 
8978
- // src/components/SearchAndFilter2/filtersMapper.tsx
8979
- var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
8980
- function withInputVariables(WrappedComponent) {
8981
- const WithInputVariables = (props) => {
8982
- if (Array.isArray(props.value) || !props.bindable || props.disabled || props.readOnly) {
8983
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(WrappedComponent, { ...props });
9089
+ // src/components/SearchAndFilter/SortItems.tsx
9090
+ var import_design_system52 = require("@uniformdev/design-system");
9091
+
9092
+ // src/components/SearchAndFilter/styles/SortItems.styles.ts
9093
+ var import_react83 = require("@emotion/react");
9094
+ var import_design_system51 = require("@uniformdev/design-system");
9095
+ var ConditionalFilterRow2 = import_react83.css`
9096
+ display: grid;
9097
+ grid-template-columns: 35px 1fr;
9098
+ gap: var(--spacing-sm);
9099
+ margin-left: var(--spacing-base);
9100
+
9101
+ ${(0, import_design_system51.cq)("380px")} {
9102
+ align-items: center;
9103
+
9104
+ &:after {
9105
+ content: '';
9106
+ display: block;
9107
+ height: 1px;
9108
+ background: var(--gray-300);
9109
+ width: calc(100% - var(--spacing-base));
9110
+ margin-left: var(--spacing-base);
8984
9111
  }
8985
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
8986
- InputVariables,
8987
- {
8988
- disableInlineMenu: true,
8989
- showMenuPosition: "inline-right",
8990
- onChange: (newValue) => props.onChange(newValue != null ? newValue : ""),
8991
- value: props.value,
8992
- disabled: props.disabled,
8993
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(WrappedComponent, { ...props })
8994
- }
8995
- );
8996
- };
8997
- return WithInputVariables;
8998
- }
8999
- function withInputVariablesForMultiValue(WrappedComponent) {
9000
- const WithInputVariables = (props) => {
9001
- var _a;
9002
- if (!props.bindable || props.disabled || props.readOnly) {
9003
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(WrappedComponent, { ...props });
9112
+ &:last-of-type:after {
9113
+ display: none;
9114
+ }
9115
+ }
9116
+
9117
+ &:nth-of-type(2) {
9118
+ margin-left: 0;
9119
+ grid-template-columns: 50px 1fr;
9120
+ }
9121
+
9122
+ ${(0, import_design_system51.cq)("580px")} {
9123
+ &:after {
9124
+ display: none;
9125
+ }
9126
+ }
9127
+
9128
+ @media (prefers-reduced-motion: no-preference) {
9129
+ animation: ${import_design_system51.fadeInLtr} var(--duration-fast) var(--timing-ease-out);
9130
+ }
9131
+ `;
9132
+ var ConditionalInputRow2 = import_react83.css`
9133
+ display: flex;
9134
+ gap: var(--spacing-sm);
9135
+ flex-wrap: wrap;
9136
+
9137
+ ${(0, import_design_system51.cq)("380px")} {
9138
+ & > div:nth-child(-n + 2) {
9139
+ width: calc(50% - var(--spacing-sm));
9140
+ }
9141
+
9142
+ & > div:nth-child(n + 3) {
9143
+ width: calc(100% - 48px);
9144
+ }
9145
+ }
9146
+ ${(0, import_design_system51.cq)("580px")} {
9147
+ display: grid;
9148
+ grid-template-columns: 200px 160px 1fr 32px;
9149
+
9150
+ & > div:nth-child(n) {
9151
+ width: auto;
9004
9152
  }
9005
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9153
+ }
9154
+ `;
9155
+ var SearchInput2 = import_react83.css`
9156
+ max-height: 40px;
9157
+ min-height: unset;
9158
+ `;
9159
+ var FilterButton3 = import_react83.css`
9160
+ align-items: center;
9161
+ background: var(--white);
9162
+ border: 1px solid var(--gray-300);
9163
+ border-radius: var(--rounded-full);
9164
+ color: var(--typography-base);
9165
+ display: flex;
9166
+ font-size: var(--fs-sm);
9167
+ gap: var(--spacing-sm);
9168
+ padding: var(--spacing-sm) var(--spacing-base);
9169
+ max-height: 40px;
9170
+ transition: color var(--duration-fast) var(--timing-ease-out),
9171
+ background-color var(--duration-fast) var(--timing-ease-out),
9172
+ border-color var(--duration-fast) var(--timing-ease-out),
9173
+ box-shadow var(--duration-fast) var(--timing-ease-out);
9174
+
9175
+ svg {
9176
+ color: var(--gray-300);
9177
+ transition: color var(--duration-fast) var(--timing-ease-out);
9178
+ }
9179
+
9180
+ &:hover,
9181
+ :where([aria-expanded='true']) {
9182
+ outline: none;
9183
+ background: var(--gray-200);
9184
+ border-color: var(--gray-300);
9185
+
9186
+ svg {
9187
+ color: var(--typography-base);
9188
+ }
9189
+ }
9190
+
9191
+ &:disabled {
9192
+ opacity: var(--opacity-50);
9193
+ }
9194
+ `;
9195
+ var FilterButtonText2 = import_react83.css`
9196
+ overflow: hidden;
9197
+ text-overflow: ellipsis;
9198
+ white-space: nowrap;
9199
+ max-width: 14ch;
9200
+ `;
9201
+ var FilterButtonSelected2 = import_react83.css`
9202
+ background: var(--gray-100);
9203
+ border-color: var(--gray-300);
9204
+
9205
+ svg {
9206
+ color: var(--accent-dark);
9207
+ }
9208
+ `;
9209
+ var FilterButtonWithOptions2 = import_react83.css`
9210
+ :where([aria-expanded='true']) {
9211
+ background: var(--purple-rain-100);
9212
+ border-color: var(--accent-light);
9213
+ color: var(--typography-base);
9214
+ box-shadow: var(--elevation-100);
9215
+
9216
+ svg {
9217
+ color: var(--accent-dark);
9218
+ }
9219
+ }
9220
+ `;
9221
+ var SearchIcon2 = import_react83.css`
9222
+ color: var(--icon-color);
9223
+ position: absolute;
9224
+ inset: 0 var(--spacing-base) 0 auto;
9225
+ margin: auto;
9226
+ transition: color var(--duration-fast) var(--timing-ease-out);
9227
+ `;
9228
+ var AddConditionalBtn2 = import_react83.css`
9229
+ align-items: center;
9230
+ background: transparent;
9231
+ border: none;
9232
+ color: var(--primary-action-default);
9233
+ display: flex;
9234
+ gap: var(--spacing-sm);
9235
+ transition: color var(--duration-fast) var(--timing-ease-out);
9236
+ padding: 0;
9237
+
9238
+ &:hover,
9239
+ &:focus {
9240
+ color: var(--primary-action-hover);
9241
+ }
9242
+
9243
+ &:disabled {
9244
+ color: var(--gray-400);
9245
+ }
9246
+ `;
9247
+ var Title2 = import_react83.css`
9248
+ color: var(--typography-light);
9249
+
9250
+ &:focus {
9251
+ outline: none;
9252
+ }
9253
+ `;
9254
+ var ResetConditionsBtn2 = import_react83.css`
9255
+ background: transparent;
9256
+ border: none;
9257
+ color: var(--action-destructive-default);
9258
+ transition: color var(--duration-fast) var(--timing-ease-out);
9259
+ padding: 0;
9260
+
9261
+ &:hover,
9262
+ &:focus {
9263
+ color: var(--action-destructive-hover);
9264
+ }
9265
+ `;
9266
+ var IconBtn2 = import_react83.css`
9267
+ background: transparent;
9268
+ border: none;
9269
+ padding: var(--spacing-sm);
9270
+ `;
9271
+ var SearchAndFilterOptionsContainer3 = import_react83.css`
9272
+ background: var(--gray-50);
9273
+ border: 1px solid var(--gray-300);
9274
+ border-radius: var(--rounded-base);
9275
+ container-type: inline-size;
9276
+ display: flex;
9277
+ flex-direction: column;
9278
+ gap: var(--spacing-sm);
9279
+ padding: var(--spacing-md) 0 var(--spacing-base);
9280
+ will-change: height;
9281
+ position: relative;
9282
+ z-index: 1;
9283
+ `;
9284
+ var SearchAndFilterOptionsInnerContainer2 = import_react83.css`
9285
+ display: flex;
9286
+ flex-direction: column;
9287
+ gap: var(--spacing-sm);
9288
+ padding-inline: var(--spacing-md);
9289
+ `;
9290
+ var SearchAndFilterButtonGroup2 = import_react83.css`
9291
+ margin-top: var(--spacing-xs);
9292
+ margin-left: calc(56px + var(--spacing-md));
9293
+ `;
9294
+ var SortFilterWrapper = (hiddenLocaleInput) => import_react83.css`
9295
+ align-items: center;
9296
+ border-top: 1px solid var(--gray-300);
9297
+ display: flex;
9298
+ flex-wrap: wrap;
9299
+ gap: var(--spacing-base);
9300
+ padding: var(--spacing-base) var(--spacing-md) 0;
9301
+ position: relative;
9302
+ z-index: 0;
9303
+
9304
+ ${(0, import_design_system51.cq)("420px")} {
9305
+ display: grid;
9306
+ grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr minmax(140px, 0.25fr)"};
9307
+ }
9308
+ `;
9309
+ var SortFilterInputRow = import_react83.css`
9310
+ align-items: center;
9311
+ display: grid;
9312
+ grid-template-columns: 1fr auto;
9313
+ gap: var(--spacing-base);
9314
+ `;
9315
+ var InputVariableWrapper = import_react83.css`
9316
+ flex-grow: 1;
9317
+
9318
+ // we need to override label styles nested within the input variable
9319
+ // as these are slightly different from the default label styles
9320
+ label > span {
9321
+ color: var(--typography-light);
9322
+ }
9323
+ `;
9324
+
9325
+ // src/components/SearchAndFilter/SortItems.tsx
9326
+ var import_jsx_runtime78 = require("@emotion/react/jsx-runtime");
9327
+ var SortItems = ({
9328
+ sortByLabel = "Sort by",
9329
+ localeLabel = "Show locale",
9330
+ sortOptions,
9331
+ sortByValue,
9332
+ onSortChange,
9333
+ localeValue,
9334
+ localeOptions,
9335
+ onLocaleChange,
9336
+ disableSortBinding
9337
+ }) => {
9338
+ var _a, _b;
9339
+ const hideLocaleOptions = !localeOptions || !onLocaleChange;
9340
+ const values = sortByValue == null ? void 0 : sortByValue.split("_");
9341
+ const sortDirection = values == null ? void 0 : values.pop();
9342
+ const sortField = values == null ? void 0 : values.join("_");
9343
+ const currentSelectedOption = (_b = (_a = sortOptions.find((item) => {
9344
+ var _a2;
9345
+ return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
9346
+ })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
9347
+ const localeLabelValue = sortOptions.length > 1 ? localeLabel : `${localeLabel}s`;
9348
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
9349
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_design_system52.VerticalRhythm, { gap: "xs", children: [
9350
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { css: Title2, children: sortByLabel }),
9351
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { css: SortFilterInputRow, children: [
9352
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9353
+ InputVariables,
9354
+ {
9355
+ disableInlineMenu: disableSortBinding,
9356
+ showMenuPosition: disableSortBinding ? void 0 : "inline-right",
9357
+ value: sortField,
9358
+ valueToResetTo: "created_at",
9359
+ onChange: (e) => onSortChange(`${e}_${sortDirection}`),
9360
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9361
+ import_design_system52.InputComboBox,
9362
+ {
9363
+ id: "sort-by-field",
9364
+ "aria-label": "Sort by",
9365
+ options: sortOptions,
9366
+ onChange: (e) => {
9367
+ const fieldName = e == null ? void 0 : e.value;
9368
+ onSortChange(`${fieldName}_${sortDirection}`);
9369
+ },
9370
+ styles: {
9371
+ menu(base) {
9372
+ return {
9373
+ ...base,
9374
+ minWidth: "max-content"
9375
+ };
9376
+ }
9377
+ },
9378
+ value: currentSelectedOption
9379
+ }
9380
+ )
9381
+ }
9382
+ ),
9383
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9384
+ InputVariables,
9385
+ {
9386
+ disableInlineMenu: disableSortBinding,
9387
+ value: sortDirection,
9388
+ valueToResetTo: "DESC",
9389
+ showMenuPosition: disableSortBinding ? void 0 : "inline-right",
9390
+ onChange: (e) => onSortChange(`${sortField}_${e}`),
9391
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9392
+ import_design_system52.SegmentedControl,
9393
+ {
9394
+ noCheckmark: true,
9395
+ name: "sortBy",
9396
+ hideOptionText: true,
9397
+ iconSize: "1rem",
9398
+ size: "xl",
9399
+ options: [
9400
+ {
9401
+ label: "Ascending",
9402
+ icon: "arrow-up",
9403
+ value: `ASC`,
9404
+ tooltip: "Ascending (e.g. A-Z, oldest to newest)",
9405
+ "data-testid": "sort-ascending"
9406
+ },
9407
+ {
9408
+ label: "Descending",
9409
+ icon: "arrow-down",
9410
+ value: `DESC`,
9411
+ tooltip: "Descending (e.g. Z-A, newest to oldest)",
9412
+ "data-testid": "sort-descending"
9413
+ }
9414
+ ],
9415
+ onChange: (e) => onSortChange(`${sortField}_${e}`),
9416
+ value: sortDirection
9417
+ }
9418
+ )
9419
+ }
9420
+ )
9421
+ ] })
9422
+ ] }),
9423
+ hideLocaleOptions ? null : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_design_system52.VerticalRhythm, { gap: "xs", css: InputVariableWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9006
9424
  InputVariables,
9007
9425
  {
9008
- disableInlineMenu: true,
9426
+ label: localeLabelValue,
9427
+ value: localeValue,
9009
9428
  showMenuPosition: "inline-right",
9010
- onChange: (newValue) => props.onChange(newValue ? [newValue] : []),
9011
- value: (_a = props.value) == null ? void 0 : _a[0],
9012
- inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(WrappedComponent, { ...props })
9429
+ onChange: (e) => onLocaleChange(e != null ? e : ""),
9430
+ inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
9431
+ import_design_system52.InputSelect,
9432
+ {
9433
+ name: "localeReturned",
9434
+ "aria-label": localeLabelValue,
9435
+ label: localeLabelValue,
9436
+ showLabel: false,
9437
+ "data-testid": "context-locale",
9438
+ onChange: (e) => {
9439
+ var _a2;
9440
+ return onLocaleChange((_a2 = e.currentTarget.value) != null ? _a2 : "");
9441
+ },
9442
+ options: localeOptions,
9443
+ value: localeValue
9444
+ }
9445
+ )
9013
9446
  }
9014
- );
9015
- };
9016
- return WithInputVariables;
9017
- }
9018
- var bindableFiltersMapper = {
9019
- ...filterMapper,
9020
- multiChoice: withInputVariablesForMultiValue(FilterMultiChoiceEditor),
9021
- singleChoice: withInputVariables(FilterSingleChoiceEditor),
9022
- date: withInputVariables(DateEditor),
9023
- text: withInputVariables(TextEditor),
9024
- number: withInputVariables(NumberEditor)
9447
+ ) })
9448
+ ] });
9025
9449
  };
9026
9450
 
9027
9451
  // src/utils/createLocationValidator.ts
@@ -9034,19 +9458,19 @@ function createLocationValidator(setValue, validate) {
9034
9458
 
9035
9459
  // src/utils/useContentDataResourceLocaleInfo.ts
9036
9460
  var import_canvas10 = require("@uniformdev/canvas");
9037
- var import_react83 = require("react");
9461
+ var import_react84 = require("react");
9038
9462
  function useContentDataResourceLocaleInfo({
9039
9463
  locale,
9040
9464
  setLocale,
9041
9465
  dynamicInputs
9042
9466
  }) {
9043
9467
  var _a;
9044
- const setLocaleRef = (0, import_react83.useRef)(setLocale);
9468
+ const setLocaleRef = (0, import_react84.useRef)(setLocale);
9045
9469
  setLocaleRef.current = setLocale;
9046
9470
  const { flatVariables } = useVariables();
9047
9471
  const effectiveLocale = locale != null ? locale : dynamicInputs[import_canvas10.LOCALE_DYNAMIC_INPUT_NAME] ? (0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME) : "";
9048
9472
  const boundLocale = (_a = (0, import_canvas10.bindVariables)({ variables: flatVariables, value: effectiveLocale }).result) != null ? _a : effectiveLocale;
9049
- (0, import_react83.useEffect)(() => {
9473
+ (0, import_react84.useEffect)(() => {
9050
9474
  if (locale === void 0 && effectiveLocale && setLocaleRef.current) {
9051
9475
  setLocaleRef.current((0, import_canvas10.createVariableReference)(import_canvas10.LOCALE_DYNAMIC_INPUT_NAME));
9052
9476
  }
@@ -9055,7 +9479,7 @@ function useContentDataResourceLocaleInfo({
9055
9479
  }
9056
9480
 
9057
9481
  // src/index.ts
9058
- var import_design_system51 = require("@uniformdev/design-system");
9482
+ var import_design_system53 = require("@uniformdev/design-system");
9059
9483
  __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9060
9484
  // Annotate the CommonJS export names for ESM import in node:
9061
9485
  0 && (module.exports = {
@@ -9169,6 +9593,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9169
9593
  SearchOnlyContext,
9170
9594
  SearchOnlyFilter,
9171
9595
  SelectionField,
9596
+ SortItems,
9172
9597
  StatusMultiEditor,
9173
9598
  StatusSingleEditor,
9174
9599
  Switch,