@uniformdev/mesh-sdk-react 19.79.1-alpha.13 → 19.79.1-alpha.18

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/LICENSE.txt CHANGED
@@ -1,2 +1,2 @@
1
- © 2023 Uniform Systems, Inc. All Rights Reserved.
1
+ © 2024 Uniform Systems, Inc. All Rights Reserved.
2
2
  See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
package/dist/index.d.mts CHANGED
@@ -903,8 +903,9 @@ type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext
903
903
  onCancel: (context: TEditVariableCancelledContext) => void;
904
904
  context: TEditorContext | undefined;
905
905
  disableAutoFocusOnMount?: boolean;
906
+ showDisplayName?: boolean;
906
907
  };
907
- declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
908
+ declare function VariableEditor({ variable, onSubmit, onCancel, showDisplayName, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
908
909
 
909
910
  type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = React.PropsWithChildren<{
910
911
  /**
@@ -1358,11 +1359,11 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1358
1359
  isMulti?: boolean;
1359
1360
  /** sets disabled state to the interactive element */
1360
1361
  disabled?: boolean;
1361
- };
1362
+ } & React$1.HTMLAttributes<HTMLDivElement>;
1362
1363
  /**
1363
1364
  * @description entry search list item is an opinionated UI component best used for initial retrieved results
1364
1365
  * @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
1365
- declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1366
+ declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, ...props }: ObjectSearchListItemProps & React$1.HTMLAttributes<HTMLDivElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1366
1367
  /**
1367
1368
  * An opinionated loading skeleton component best used with ObjectSearchListItem
1368
1369
  * @example <ObjectSearchListItemLoadingSkeleton />
@@ -1414,6 +1415,8 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1414
1415
  * @default 'Selected'
1415
1416
  */
1416
1417
  resultLabelText?: string;
1418
+ /** sets and override react node replacing the whole HTML block for the result label and counter */
1419
+ resultLabelOverride?: ReactNode;
1417
1420
  /** sets the on remove button click action */
1418
1421
  onRemoveAllSelected?: () => void;
1419
1422
  /** sets the remove button text
@@ -1425,9 +1428,9 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1425
1428
  */
1426
1429
  hideRemoveButton?: boolean;
1427
1430
  /** allows additional buttons to be added to the result title group */
1428
- additionalButtons?: React.ReactNode;
1431
+ additionalButtons?: React__default.ReactNode;
1429
1432
  /** allows placing child components within the result list area */
1430
- renderResultComponent?: (value: TRenderComponent) => React.ReactNode;
1433
+ renderResultComponent?: (value: TRenderComponent) => React__default.ReactNode;
1431
1434
  /** disable or enable drag and drop functionality
1432
1435
  * @default false
1433
1436
  */
@@ -1435,7 +1438,7 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1435
1438
  /** sets the draggable id value */
1436
1439
  multiSelectId?: string;
1437
1440
  /** Rendered when nothing is selected */
1438
- whenNothingSelected?: React.ReactNode;
1441
+ whenNothingSelected?: React__default.ReactNode;
1439
1442
  /**
1440
1443
  * Special case for re-parenting the drag and drop container in case of issues with "position: fixed" and "transform:
1441
1444
  * You can read more about this here https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/reparenting.md
@@ -1449,7 +1452,7 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1449
1452
  * maintain drag and drop functionality
1450
1453
  * @example <ObjectSearchResultList id="my-id" title="title" renderResultComponent={(values) => <CustomComponent {...values} />} />
1451
1454
  */
1452
- declare function ObjectSearchResultList<TRenderComponent extends SelectedItemProps = SelectedItemProps>({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, additionalButtons, renderResultComponent, multiSelectId, disableDnD, getContainerForDnDReparenting, whenNothingSelected, }: ObjectSearchResultListProps<TRenderComponent>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1455
+ declare function ObjectSearchResultList<TRenderComponent extends SelectedItemProps = SelectedItemProps>({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, resultLabelOverride, additionalButtons, renderResultComponent, multiSelectId, disableDnD, getContainerForDnDReparenting, whenNothingSelected, }: ObjectSearchResultListProps<TRenderComponent>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1453
1456
 
1454
1457
  type QueryFilterSearchProps = {
1455
1458
  /** sets the count value */
@@ -1459,12 +1462,18 @@ type QueryFilterSearchProps = {
1459
1462
  /** sets the sortOrder filter value */
1460
1463
  sortOrder: string;
1461
1464
  };
1462
- type QuertFilterSelectionOptionProps = Array<{
1463
- id: string;
1464
- name: string;
1465
+ type QueryFilterSelectionOptionProps = Array<{
1466
+ /** @deprecated please use value instead */
1467
+ id?: string;
1468
+ /** @deprecated please use value or label instead */
1469
+ name?: string;
1470
+ /** contains id or machine values. will be used as value attribute in <option> */
1471
+ value?: string;
1472
+ /** Contains human-readable display name for select options.
1473
+ * Used as value in case value is not present <option> */
1465
1474
  label: string;
1466
1475
  }>;
1467
- type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = QuertFilterSelectionOptionProps> = {
1476
+ type QueryFilterProps<TSelectOptions extends QueryFilterSelectionOptionProps = QueryFilterSelectionOptionProps> = {
1468
1477
  /** sets the query filter title
1469
1478
  * @default 'Configure Query'
1470
1479
  */
@@ -1485,10 +1494,11 @@ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = Q
1485
1494
  * @default 'Count'
1486
1495
  */
1487
1496
  countLabel?: string;
1488
- /** sets the count value or items to show
1497
+ /** sets the count value or items to show. As a string you can pass dynamic variables ${countFromQuery} for example
1489
1498
  * @default 5
1499
+ * @deprecated please use ObjectSearchProviderProps['defaultQuery'] to pass initial count value
1490
1500
  */
1491
- countValue?: number;
1501
+ countValue?: number | string;
1492
1502
  /** sets the sort label text
1493
1503
  * @default 'Sort'
1494
1504
  */
package/dist/index.d.ts CHANGED
@@ -903,8 +903,9 @@ type VariableEditorProps<TEditorContext = unknown, TEditVariableCompletedContext
903
903
  onCancel: (context: TEditVariableCancelledContext) => void;
904
904
  context: TEditorContext | undefined;
905
905
  disableAutoFocusOnMount?: boolean;
906
+ showDisplayName?: boolean;
906
907
  };
907
- declare function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
908
+ declare function VariableEditor({ variable, onSubmit, onCancel, showDisplayName, disableMeshTip, }: VariableEditorProps<any, unknown, EditConnectedDataResponseCancellationContext>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
908
909
 
909
910
  type VariablesProviderProps<TEditVariableContext = unknown, TEditVariableCompletedContext = unknown, TEditVariableCancelledContext = unknown> = React.PropsWithChildren<{
910
911
  /**
@@ -1358,11 +1359,11 @@ type ObjectSearchListItemProps = SelectedItemProps & {
1358
1359
  isMulti?: boolean;
1359
1360
  /** sets disabled state to the interactive element */
1360
1361
  disabled?: boolean;
1361
- };
1362
+ } & React$1.HTMLAttributes<HTMLDivElement>;
1362
1363
  /**
1363
1364
  * @description entry search list item is an opinionated UI component best used for initial retrieved results
1364
1365
  * @example <ObjectSearchListItem id="my-result-item" title="title" popoverData={<p>some data info</p>}><div>example of uncontrolled content</div></ObjectSearchListItem> */
1365
- declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, }: ObjectSearchListItemProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1366
+ declare const ObjectSearchListItem: ({ id, title, contentType, image, imageUrl, popoverData, onSelect, isMulti, disabled, children, ...props }: ObjectSearchListItemProps & React$1.HTMLAttributes<HTMLDivElement>) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1366
1367
  /**
1367
1368
  * An opinionated loading skeleton component best used with ObjectSearchListItem
1368
1369
  * @example <ObjectSearchListItemLoadingSkeleton />
@@ -1414,6 +1415,8 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1414
1415
  * @default 'Selected'
1415
1416
  */
1416
1417
  resultLabelText?: string;
1418
+ /** sets and override react node replacing the whole HTML block for the result label and counter */
1419
+ resultLabelOverride?: ReactNode;
1417
1420
  /** sets the on remove button click action */
1418
1421
  onRemoveAllSelected?: () => void;
1419
1422
  /** sets the remove button text
@@ -1425,9 +1428,9 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1425
1428
  */
1426
1429
  hideRemoveButton?: boolean;
1427
1430
  /** allows additional buttons to be added to the result title group */
1428
- additionalButtons?: React.ReactNode;
1431
+ additionalButtons?: React__default.ReactNode;
1429
1432
  /** allows placing child components within the result list area */
1430
- renderResultComponent?: (value: TRenderComponent) => React.ReactNode;
1433
+ renderResultComponent?: (value: TRenderComponent) => React__default.ReactNode;
1431
1434
  /** disable or enable drag and drop functionality
1432
1435
  * @default false
1433
1436
  */
@@ -1435,7 +1438,7 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1435
1438
  /** sets the draggable id value */
1436
1439
  multiSelectId?: string;
1437
1440
  /** Rendered when nothing is selected */
1438
- whenNothingSelected?: React.ReactNode;
1441
+ whenNothingSelected?: React__default.ReactNode;
1439
1442
  /**
1440
1443
  * Special case for re-parenting the drag and drop container in case of issues with "position: fixed" and "transform:
1441
1444
  * You can read more about this here https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/reparenting.md
@@ -1449,7 +1452,7 @@ type ObjectSearchResultListProps<TRenderComponent extends SelectedItemProps = Se
1449
1452
  * maintain drag and drop functionality
1450
1453
  * @example <ObjectSearchResultList id="my-id" title="title" renderResultComponent={(values) => <CustomComponent {...values} />} />
1451
1454
  */
1452
- declare function ObjectSearchResultList<TRenderComponent extends SelectedItemProps = SelectedItemProps>({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, additionalButtons, renderResultComponent, multiSelectId, disableDnD, getContainerForDnDReparenting, whenNothingSelected, }: ObjectSearchResultListProps<TRenderComponent>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1455
+ declare function ObjectSearchResultList<TRenderComponent extends SelectedItemProps = SelectedItemProps>({ resultLabelText, removeButtonText, onRemoveAllSelected, hideRemoveButton, resultLabelOverride, additionalButtons, renderResultComponent, multiSelectId, disableDnD, getContainerForDnDReparenting, whenNothingSelected, }: ObjectSearchResultListProps<TRenderComponent>): _emotion_react_types_jsx_namespace.EmotionJSX.Element;
1453
1456
 
1454
1457
  type QueryFilterSearchProps = {
1455
1458
  /** sets the count value */
@@ -1459,12 +1462,18 @@ type QueryFilterSearchProps = {
1459
1462
  /** sets the sortOrder filter value */
1460
1463
  sortOrder: string;
1461
1464
  };
1462
- type QuertFilterSelectionOptionProps = Array<{
1463
- id: string;
1464
- name: string;
1465
+ type QueryFilterSelectionOptionProps = Array<{
1466
+ /** @deprecated please use value instead */
1467
+ id?: string;
1468
+ /** @deprecated please use value or label instead */
1469
+ name?: string;
1470
+ /** contains id or machine values. will be used as value attribute in <option> */
1471
+ value?: string;
1472
+ /** Contains human-readable display name for select options.
1473
+ * Used as value in case value is not present <option> */
1465
1474
  label: string;
1466
1475
  }>;
1467
- type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = QuertFilterSelectionOptionProps> = {
1476
+ type QueryFilterProps<TSelectOptions extends QueryFilterSelectionOptionProps = QueryFilterSelectionOptionProps> = {
1468
1477
  /** sets the query filter title
1469
1478
  * @default 'Configure Query'
1470
1479
  */
@@ -1485,10 +1494,11 @@ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = Q
1485
1494
  * @default 'Count'
1486
1495
  */
1487
1496
  countLabel?: string;
1488
- /** sets the count value or items to show
1497
+ /** sets the count value or items to show. As a string you can pass dynamic variables ${countFromQuery} for example
1489
1498
  * @default 5
1499
+ * @deprecated please use ObjectSearchProviderProps['defaultQuery'] to pass initial count value
1490
1500
  */
1491
- countValue?: number;
1501
+ countValue?: number | string;
1492
1502
  /** sets the sort label text
1493
1503
  * @default 'Sort'
1494
1504
  */
package/dist/index.esm.js CHANGED
@@ -3099,9 +3099,10 @@ function VariableEditor({
3099
3099
  variable,
3100
3100
  onSubmit,
3101
3101
  onCancel,
3102
+ showDisplayName,
3102
3103
  disableMeshTip
3103
3104
  }) {
3104
- var _a, _b, _c, _d, _e, _f, _g;
3105
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3105
3106
  const { variables } = useVariables();
3106
3107
  const currentVariable = variables[variable];
3107
3108
  const { register, handleSubmit, formState } = useForm({
@@ -3156,6 +3157,16 @@ function VariableEditor({
3156
3157
  }
3157
3158
  }
3158
3159
  ),
3160
+ showDisplayName ? /* @__PURE__ */ jsx31(
3161
+ Input2,
3162
+ {
3163
+ ...register("displayName"),
3164
+ label: "Display name",
3165
+ autoComplete: "off",
3166
+ caption: "This is the name that will be displayed in the UI. If not provided, the name will be used.",
3167
+ errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3168
+ }
3169
+ ) : null,
3159
3170
  /* @__PURE__ */ jsx31(
3160
3171
  Input2,
3161
3172
  {
@@ -3163,7 +3174,7 @@ function VariableEditor({
3163
3174
  label: "Help Text",
3164
3175
  caption: "Appears when entering a value for this variable.",
3165
3176
  autoComplete: "off",
3166
- errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3177
+ errorMessage: (_g = formState.errors.helpText) == null ? void 0 : _g.message
3167
3178
  }
3168
3179
  ),
3169
3180
  /* @__PURE__ */ jsx31(
@@ -3172,7 +3183,7 @@ function VariableEditor({
3172
3183
  ...register("default"),
3173
3184
  label: "Default Value",
3174
3185
  autoComplete: "off",
3175
- errorMessage: (_g = formState.errors.default) == null ? void 0 : _g.message
3186
+ errorMessage: (_h = formState.errors.default) == null ? void 0 : _h.message
3176
3187
  }
3177
3188
  ),
3178
3189
  /* @__PURE__ */ jsx31(HorizontalRhythm, { justify: "space-between", children: /* @__PURE__ */ jsxs16(HorizontalRhythm, { gap: "sm", children: [
@@ -4065,32 +4076,41 @@ var menuBtn2 = css21`
4065
4076
  transform: translateY(-50%);
4066
4077
  `;
4067
4078
  var input = css21`
4079
+ --input-padding: 12px var(--spacing-base) 12px var(--spacing-sm);
4068
4080
  appearance: none;
4069
4081
  background-color: var(--white);
4070
- border: 1px solid var(--gray-200);
4082
+ border: 1px solid var(--gray-300);
4071
4083
  border-radius: var(--rounded-sm);
4072
4084
  color: var(--gray-700);
4073
- padding-block: var(--spacing-base);
4074
- padding-left: var(--spacing-base);
4075
- padding-right: var(--spacing-lg);
4076
- line-height: 1.75;
4085
+ padding: var(--input-padding);
4086
+ min-height: 50px;
4077
4087
  width: 100%;
4078
4088
  position: relative;
4079
4089
  transition: background var(--duration-fast) var(--timing-ease-out),
4080
4090
  border-color var(--duration-fast) var(--timing-ease-out),
4081
- color var(--duration-fast) var(--timing-ease-out);
4091
+ color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
4092
+
4093
+ &::placeholder {
4094
+ color: var(--gray-400);
4095
+ }
4096
+
4097
+ &:hover {
4098
+ border-color: var(--accent-dark-hover);
4099
+ }
4082
4100
 
4101
+ &[data-focus='true'],
4083
4102
  &:focus,
4084
4103
  &:focus-within {
4085
- border-color: var(--typography-base);
4086
- box-shadow: none;
4104
+ border-color: var(--accent-dark-active);
4105
+ box-shadow: var(--elevation-100);
4087
4106
  outline: none;
4088
4107
  }
4089
4108
 
4109
+ &[data-disabled='true'],
4090
4110
  &:disabled,
4091
4111
  &:disabled::placeholder {
4092
4112
  cursor: not-allowed;
4093
- color: var(--gray-400);
4113
+ color: var(--gray-300);
4094
4114
  border-color: var(--gray-300);
4095
4115
  }
4096
4116
 
@@ -5186,13 +5206,13 @@ function VariablesList() {
5186
5206
  const result = [...sorted || []];
5187
5207
  const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
5188
5208
  result == null ? void 0 : result.splice(res.destination.index, 0, removed);
5189
- const resultAsObj = result.reduce(
5190
- (acc, item, index) => ({
5209
+ const resultAsObj = result.reduce((acc, item, index) => {
5210
+ const { name, ...variableDefinition } = item;
5211
+ return {
5191
5212
  ...acc,
5192
- [item.name]: { type: item.type, default: item.default, order: index }
5193
- }),
5194
- {}
5195
- );
5213
+ [item.name]: { ...variableDefinition, order: index }
5214
+ };
5215
+ }, {});
5196
5216
  dispatch({ type: "reorder", result: resultAsObj });
5197
5217
  return result;
5198
5218
  }
@@ -6375,7 +6395,8 @@ var ObjectSearchListItem = ({
6375
6395
  onSelect,
6376
6396
  isMulti,
6377
6397
  disabled,
6378
- children
6398
+ children,
6399
+ ...props
6379
6400
  }) => {
6380
6401
  const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
6381
6402
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
@@ -6395,6 +6416,7 @@ var ObjectSearchListItem = ({
6395
6416
  role: "listitem",
6396
6417
  css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
6397
6418
  "data-testid": "list-item",
6419
+ ...props,
6398
6420
  children: [
6399
6421
  /* @__PURE__ */ jsxs34(
6400
6422
  "div",
@@ -6515,7 +6537,7 @@ var DefaultResultList = () => {
6515
6537
  };
6516
6538
 
6517
6539
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6518
- import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6540
+ import { DebouncedInputKeywordSearch, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6519
6541
  import { useMemo as useMemo15, useState as useState17 } from "react";
6520
6542
 
6521
6543
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
@@ -6589,14 +6611,14 @@ var ObjectSearchFilter = ({
6589
6611
  }
6590
6612
  ) : null,
6591
6613
  /* @__PURE__ */ jsx62(
6592
- InputKeywordSearch2,
6614
+ DebouncedInputKeywordSearch,
6593
6615
  {
6594
6616
  inputFieldName: searchInputName,
6595
6617
  placeholder: searchInputPlaceholderText,
6596
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6618
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6597
6619
  disabledFieldSubmission: true,
6598
- onClear: () => handleFilterChange({ keyword: "" }),
6599
- value: searchState.keyword
6620
+ defaultValue: searchState.keyword,
6621
+ delay: 300
6600
6622
  }
6601
6623
  )
6602
6624
  ]
@@ -6829,6 +6851,7 @@ function ObjectSearchResultList({
6829
6851
  removeButtonText = "Remove all",
6830
6852
  onRemoveAllSelected,
6831
6853
  hideRemoveButton = false,
6854
+ resultLabelOverride,
6832
6855
  additionalButtons,
6833
6856
  renderResultComponent = (value) => /* @__PURE__ */ jsx66(ObjectSearchResultItem, { ...value }),
6834
6857
  multiSelectId,
@@ -6874,11 +6897,11 @@ function ObjectSearchResultList({
6874
6897
  };
6875
6898
  return /* @__PURE__ */ jsxs40(Fragment13, { children: [
6876
6899
  /* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6877
- /* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6900
+ !resultLabelOverride ? /* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6878
6901
  /* @__PURE__ */ jsx66("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
6879
6902
  " ",
6880
6903
  !selectedListItems.length ? null : /* @__PURE__ */ jsx66(Counter, { count: selectedListItems.length })
6881
- ] }),
6904
+ ] }) : resultLabelOverride,
6882
6905
  /* @__PURE__ */ jsxs40("div", { css: ObjectSearchResultListCounterContainer, children: [
6883
6906
  additionalButtons,
6884
6907
  hideRemoveButton ? null : /* @__PURE__ */ jsx66(
@@ -6920,7 +6943,7 @@ function ObjectSearchResultList({
6920
6943
  }
6921
6944
 
6922
6945
  // src/components/ObjectSearch/QueryFilter.tsx
6923
- import { Input as Input5, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6946
+ import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input5, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6924
6947
  import { useEffect as useEffect16, useState as useState18 } from "react";
6925
6948
  import { jsx as jsx67, jsxs as jsxs41 } from "@emotion/react/jsx-runtime";
6926
6949
  var QueryFilter = ({
@@ -6939,26 +6962,24 @@ var QueryFilter = ({
6939
6962
  sortOrderLabel = "Sort Order",
6940
6963
  sortOrderOptions = [
6941
6964
  {
6942
- name: "Ascending",
6943
- id: "asc",
6965
+ value: "asc",
6944
6966
  label: "Ascending"
6945
6967
  },
6946
6968
  {
6947
- name: "Descending",
6948
- id: "desc",
6969
+ value: "desc",
6949
6970
  label: "Descending"
6950
6971
  }
6951
6972
  ],
6952
6973
  children
6953
6974
  }) => {
6954
- var _a, _b, _c, _d, _e, _f;
6975
+ var _a, _b, _c, _d, _e, _f, _g;
6955
6976
  const { query, onSetQuery } = useObjectSearchContext();
6956
6977
  const [queryState, setQueryState] = useState18({
6957
6978
  contentType: (_a = query.contentType) != null ? _a : "",
6958
- keyword: (_b = query.contentType) != null ? _b : "",
6959
- count: countValue != null ? countValue : 5,
6960
- sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6961
- sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6979
+ keyword: (_b = query.keyword) != null ? _b : "",
6980
+ count: (_c = query.count) != null ? _c : countValue,
6981
+ sortBy: (_d = query.sortBy) != null ? _d : "",
6982
+ sortOrder: (_e = query.sortOrder) != null ? _e : ""
6962
6983
  });
6963
6984
  const handleFilterChange = (value) => {
6964
6985
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6966,7 +6987,7 @@ var QueryFilter = ({
6966
6987
  };
6967
6988
  useEffect16(() => {
6968
6989
  onSetQuery(queryState);
6969
- }, [onSetQuery, queryState]);
6990
+ }, []);
6970
6991
  return /* @__PURE__ */ jsxs41("fieldset", { children: [
6971
6992
  /* @__PURE__ */ jsx67("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
6972
6993
  /* @__PURE__ */ jsx67("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs41(VerticalRhythm3, { children: [
@@ -6974,20 +6995,20 @@ var QueryFilter = ({
6974
6995
  InputVariables,
6975
6996
  {
6976
6997
  label: searchInputLabel,
6977
- value: (_e = queryState.keyword) != null ? _e : "",
6998
+ value: (_f = queryState.keyword) != null ? _f : "",
6978
6999
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6979
7000
  disableInlineMenu: true,
6980
7001
  id: "qf_searchText",
6981
7002
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
6982
- InputKeywordSearch3,
7003
+ DebouncedInputKeywordSearch2,
6983
7004
  {
6984
7005
  id: "qf_searchText",
6985
7006
  inputFieldName: searchInputName,
6986
7007
  placeholder: searchInputPlaceholderText,
6987
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
7008
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6988
7009
  disabledFieldSubmission: true,
6989
- onClear: () => handleFilterChange({ keyword: "" }),
6990
- value: queryState.keyword
7010
+ delay: 300,
7011
+ defaultValue: queryState.keyword
6991
7012
  }
6992
7013
  )
6993
7014
  }
@@ -6998,7 +7019,7 @@ var QueryFilter = ({
6998
7019
  {
6999
7020
  label: contentTypeLabel,
7000
7021
  id: "qf_contentType",
7001
- value: (_f = queryState.contentType) != null ? _f : "",
7022
+ value: (_g = queryState.contentType) != null ? _g : "",
7002
7023
  onChange: (newType) => handleFilterChange({ contentType: newType }),
7003
7024
  disableInlineMenu: true,
7004
7025
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
@@ -7007,13 +7028,8 @@ var QueryFilter = ({
7007
7028
  id: "qf_contentType",
7008
7029
  label: contentTypeLabel,
7009
7030
  showLabel: false,
7010
- options: [
7011
- ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
7012
- ...contentTypeOptions ? contentTypeOptions.map((option) => {
7013
- var _a2;
7014
- return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7015
- }) : []
7016
- ],
7031
+ defaultOption: requireContentType ? void 0 : typeSelectorAllTypesOptionText,
7032
+ options: contentTypeOptions != null ? contentTypeOptions : [],
7017
7033
  onChange: (e) => handleFilterChange({ contentType: e.target.value }),
7018
7034
  value: queryState.contentType
7019
7035
  }
@@ -7028,6 +7044,7 @@ var QueryFilter = ({
7028
7044
  value: queryState.count.toString(10),
7029
7045
  onChange: (newCount) => handleFilterChange({ count: newCount }),
7030
7046
  disableInlineMenu: true,
7047
+ valueToResetTo: "5",
7031
7048
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
7032
7049
  Input5,
7033
7050
  {
@@ -7058,16 +7075,8 @@ var QueryFilter = ({
7058
7075
  label: sortLabel,
7059
7076
  id: "qf_sortBy",
7060
7077
  showLabel: false,
7061
- options: [
7062
- {
7063
- label: "Select a sort",
7064
- id: ""
7065
- },
7066
- ...sortOptions ? sortOptions.map((option) => {
7067
- var _a2;
7068
- return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
7069
- }) : []
7070
- ],
7078
+ defaultOption: "Select a sort",
7079
+ options: sortOptions != null ? sortOptions : [],
7071
7080
  onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
7072
7081
  value: queryState.sortBy
7073
7082
  }
@@ -7088,12 +7097,7 @@ var QueryFilter = ({
7088
7097
  label: sortOrderLabel,
7089
7098
  id: "qf_sortOrder",
7090
7099
  showLabel: false,
7091
- options: [
7092
- ...sortOrderOptions ? sortOrderOptions.map((option) => {
7093
- var _a2;
7094
- return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7095
- }) : []
7096
- ],
7100
+ options: sortOrderOptions != null ? sortOrderOptions : [],
7097
7101
  onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
7098
7102
  value: queryState.sortOrder
7099
7103
  }
@@ -7198,7 +7202,7 @@ import {
7198
7202
  Heading,
7199
7203
  Input as Input6,
7200
7204
  InputComboBox,
7201
- InputKeywordSearch as InputKeywordSearch4,
7205
+ InputKeywordSearch as InputKeywordSearch2,
7202
7206
  InputSelect as InputSelect8,
7203
7207
  InputToggle,
7204
7208
  Label,
@@ -7252,7 +7256,7 @@ export {
7252
7256
  icons_exports as Icons,
7253
7257
  Input6 as Input,
7254
7258
  InputComboBox,
7255
- InputKeywordSearch4 as InputKeywordSearch,
7259
+ InputKeywordSearch2 as InputKeywordSearch,
7256
7260
  InputSelect8 as InputSelect,
7257
7261
  InputToggle,
7258
7262
  InputVariables,
package/dist/index.js CHANGED
@@ -3278,9 +3278,10 @@ function VariableEditor({
3278
3278
  variable,
3279
3279
  onSubmit,
3280
3280
  onCancel,
3281
+ showDisplayName,
3281
3282
  disableMeshTip
3282
3283
  }) {
3283
- var _a, _b, _c, _d, _e, _f, _g;
3284
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3284
3285
  const { variables } = useVariables();
3285
3286
  const currentVariable = variables[variable];
3286
3287
  const { register, handleSubmit, formState } = (0, import_react_hook_form.useForm)({
@@ -3335,6 +3336,16 @@ function VariableEditor({
3335
3336
  }
3336
3337
  }
3337
3338
  ),
3339
+ showDisplayName ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3340
+ import_design_system16.Input,
3341
+ {
3342
+ ...register("displayName"),
3343
+ label: "Display name",
3344
+ autoComplete: "off",
3345
+ caption: "This is the name that will be displayed in the UI. If not provided, the name will be used.",
3346
+ errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3347
+ }
3348
+ ) : null,
3338
3349
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3339
3350
  import_design_system16.Input,
3340
3351
  {
@@ -3342,7 +3353,7 @@ function VariableEditor({
3342
3353
  label: "Help Text",
3343
3354
  caption: "Appears when entering a value for this variable.",
3344
3355
  autoComplete: "off",
3345
- errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3356
+ errorMessage: (_g = formState.errors.helpText) == null ? void 0 : _g.message
3346
3357
  }
3347
3358
  ),
3348
3359
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
@@ -3351,7 +3362,7 @@ function VariableEditor({
3351
3362
  ...register("default"),
3352
3363
  label: "Default Value",
3353
3364
  autoComplete: "off",
3354
- errorMessage: (_g = formState.errors.default) == null ? void 0 : _g.message
3365
+ errorMessage: (_h = formState.errors.default) == null ? void 0 : _h.message
3355
3366
  }
3356
3367
  ),
3357
3368
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_design_system16.HorizontalRhythm, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_design_system16.HorizontalRhythm, { gap: "sm", children: [
@@ -4244,32 +4255,41 @@ var menuBtn2 = import_react42.css`
4244
4255
  transform: translateY(-50%);
4245
4256
  `;
4246
4257
  var input = import_react42.css`
4258
+ --input-padding: 12px var(--spacing-base) 12px var(--spacing-sm);
4247
4259
  appearance: none;
4248
4260
  background-color: var(--white);
4249
- border: 1px solid var(--gray-200);
4261
+ border: 1px solid var(--gray-300);
4250
4262
  border-radius: var(--rounded-sm);
4251
4263
  color: var(--gray-700);
4252
- padding-block: var(--spacing-base);
4253
- padding-left: var(--spacing-base);
4254
- padding-right: var(--spacing-lg);
4255
- line-height: 1.75;
4264
+ padding: var(--input-padding);
4265
+ min-height: 50px;
4256
4266
  width: 100%;
4257
4267
  position: relative;
4258
4268
  transition: background var(--duration-fast) var(--timing-ease-out),
4259
4269
  border-color var(--duration-fast) var(--timing-ease-out),
4260
- color var(--duration-fast) var(--timing-ease-out);
4270
+ color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
4271
+
4272
+ &::placeholder {
4273
+ color: var(--gray-400);
4274
+ }
4275
+
4276
+ &:hover {
4277
+ border-color: var(--accent-dark-hover);
4278
+ }
4261
4279
 
4280
+ &[data-focus='true'],
4262
4281
  &:focus,
4263
4282
  &:focus-within {
4264
- border-color: var(--typography-base);
4265
- box-shadow: none;
4283
+ border-color: var(--accent-dark-active);
4284
+ box-shadow: var(--elevation-100);
4266
4285
  outline: none;
4267
4286
  }
4268
4287
 
4288
+ &[data-disabled='true'],
4269
4289
  &:disabled,
4270
4290
  &:disabled::placeholder {
4271
4291
  cursor: not-allowed;
4272
- color: var(--gray-400);
4292
+ color: var(--gray-300);
4273
4293
  border-color: var(--gray-300);
4274
4294
  }
4275
4295
 
@@ -5343,13 +5363,13 @@ function VariablesList() {
5343
5363
  const result = [...sorted || []];
5344
5364
  const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
5345
5365
  result == null ? void 0 : result.splice(res.destination.index, 0, removed);
5346
- const resultAsObj = result.reduce(
5347
- (acc, item, index) => ({
5366
+ const resultAsObj = result.reduce((acc, item, index) => {
5367
+ const { name, ...variableDefinition } = item;
5368
+ return {
5348
5369
  ...acc,
5349
- [item.name]: { type: item.type, default: item.default, order: index }
5350
- }),
5351
- {}
5352
- );
5370
+ [item.name]: { ...variableDefinition, order: index }
5371
+ };
5372
+ }, {});
5353
5373
  dispatch({ type: "reorder", result: resultAsObj });
5354
5374
  return result;
5355
5375
  }
@@ -6507,7 +6527,8 @@ var ObjectSearchListItem = ({
6507
6527
  onSelect,
6508
6528
  isMulti,
6509
6529
  disabled,
6510
- children
6530
+ children,
6531
+ ...props
6511
6532
  }) => {
6512
6533
  const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
6513
6534
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
@@ -6527,6 +6548,7 @@ var ObjectSearchListItem = ({
6527
6548
  role: "listitem",
6528
6549
  css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
6529
6550
  "data-testid": "list-item",
6551
+ ...props,
6530
6552
  children: [
6531
6553
  /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
6532
6554
  "div",
@@ -6721,14 +6743,14 @@ var ObjectSearchFilter = ({
6721
6743
  }
6722
6744
  ) : null,
6723
6745
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6724
- import_design_system36.InputKeywordSearch,
6746
+ import_design_system36.DebouncedInputKeywordSearch,
6725
6747
  {
6726
6748
  inputFieldName: searchInputName,
6727
6749
  placeholder: searchInputPlaceholderText,
6728
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6750
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6729
6751
  disabledFieldSubmission: true,
6730
- onClear: () => handleFilterChange({ keyword: "" }),
6731
- value: searchState.keyword
6752
+ defaultValue: searchState.keyword,
6753
+ delay: 300
6732
6754
  }
6733
6755
  )
6734
6756
  ]
@@ -6961,6 +6983,7 @@ function ObjectSearchResultList({
6961
6983
  removeButtonText = "Remove all",
6962
6984
  onRemoveAllSelected,
6963
6985
  hideRemoveButton = false,
6986
+ resultLabelOverride,
6964
6987
  additionalButtons,
6965
6988
  renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ObjectSearchResultItem, { ...value }),
6966
6989
  multiSelectId,
@@ -7006,11 +7029,11 @@ function ObjectSearchResultList({
7006
7029
  };
7007
7030
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
7008
7031
  /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "group", css: ObjectSearchResultListContainer, children: [
7009
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
7032
+ !resultLabelOverride ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
7010
7033
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
7011
7034
  " ",
7012
7035
  !selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_design_system39.Counter, { count: selectedListItems.length })
7013
- ] }),
7036
+ ] }) : resultLabelOverride,
7014
7037
  /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
7015
7038
  additionalButtons,
7016
7039
  hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
@@ -7071,26 +7094,24 @@ var QueryFilter = ({
7071
7094
  sortOrderLabel = "Sort Order",
7072
7095
  sortOrderOptions = [
7073
7096
  {
7074
- name: "Ascending",
7075
- id: "asc",
7097
+ value: "asc",
7076
7098
  label: "Ascending"
7077
7099
  },
7078
7100
  {
7079
- name: "Descending",
7080
- id: "desc",
7101
+ value: "desc",
7081
7102
  label: "Descending"
7082
7103
  }
7083
7104
  ],
7084
7105
  children
7085
7106
  }) => {
7086
- var _a, _b, _c, _d, _e, _f;
7107
+ var _a, _b, _c, _d, _e, _f, _g;
7087
7108
  const { query, onSetQuery } = useObjectSearchContext();
7088
7109
  const [queryState, setQueryState] = (0, import_react73.useState)({
7089
7110
  contentType: (_a = query.contentType) != null ? _a : "",
7090
- keyword: (_b = query.contentType) != null ? _b : "",
7091
- count: countValue != null ? countValue : 5,
7092
- sortBy: (_c = sortOptions[0].id) != null ? _c : "",
7093
- sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
7111
+ keyword: (_b = query.keyword) != null ? _b : "",
7112
+ count: (_c = query.count) != null ? _c : countValue,
7113
+ sortBy: (_d = query.sortBy) != null ? _d : "",
7114
+ sortOrder: (_e = query.sortOrder) != null ? _e : ""
7094
7115
  });
7095
7116
  const handleFilterChange = (value) => {
7096
7117
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -7098,7 +7119,7 @@ var QueryFilter = ({
7098
7119
  };
7099
7120
  (0, import_react73.useEffect)(() => {
7100
7121
  onSetQuery(queryState);
7101
- }, [onSetQuery, queryState]);
7122
+ }, []);
7102
7123
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("fieldset", { children: [
7103
7124
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
7104
7125
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_design_system40.VerticalRhythm, { children: [
@@ -7106,20 +7127,20 @@ var QueryFilter = ({
7106
7127
  InputVariables,
7107
7128
  {
7108
7129
  label: searchInputLabel,
7109
- value: (_e = queryState.keyword) != null ? _e : "",
7130
+ value: (_f = queryState.keyword) != null ? _f : "",
7110
7131
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
7111
7132
  disableInlineMenu: true,
7112
7133
  id: "qf_searchText",
7113
7134
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
7114
- import_design_system40.InputKeywordSearch,
7135
+ import_design_system40.DebouncedInputKeywordSearch,
7115
7136
  {
7116
7137
  id: "qf_searchText",
7117
7138
  inputFieldName: searchInputName,
7118
7139
  placeholder: searchInputPlaceholderText,
7119
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
7140
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
7120
7141
  disabledFieldSubmission: true,
7121
- onClear: () => handleFilterChange({ keyword: "" }),
7122
- value: queryState.keyword
7142
+ delay: 300,
7143
+ defaultValue: queryState.keyword
7123
7144
  }
7124
7145
  )
7125
7146
  }
@@ -7130,7 +7151,7 @@ var QueryFilter = ({
7130
7151
  {
7131
7152
  label: contentTypeLabel,
7132
7153
  id: "qf_contentType",
7133
- value: (_f = queryState.contentType) != null ? _f : "",
7154
+ value: (_g = queryState.contentType) != null ? _g : "",
7134
7155
  onChange: (newType) => handleFilterChange({ contentType: newType }),
7135
7156
  disableInlineMenu: true,
7136
7157
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
@@ -7139,13 +7160,8 @@ var QueryFilter = ({
7139
7160
  id: "qf_contentType",
7140
7161
  label: contentTypeLabel,
7141
7162
  showLabel: false,
7142
- options: [
7143
- ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
7144
- ...contentTypeOptions ? contentTypeOptions.map((option) => {
7145
- var _a2;
7146
- return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7147
- }) : []
7148
- ],
7163
+ defaultOption: requireContentType ? void 0 : typeSelectorAllTypesOptionText,
7164
+ options: contentTypeOptions != null ? contentTypeOptions : [],
7149
7165
  onChange: (e) => handleFilterChange({ contentType: e.target.value }),
7150
7166
  value: queryState.contentType
7151
7167
  }
@@ -7160,6 +7176,7 @@ var QueryFilter = ({
7160
7176
  value: queryState.count.toString(10),
7161
7177
  onChange: (newCount) => handleFilterChange({ count: newCount }),
7162
7178
  disableInlineMenu: true,
7179
+ valueToResetTo: "5",
7163
7180
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
7164
7181
  import_design_system40.Input,
7165
7182
  {
@@ -7190,16 +7207,8 @@ var QueryFilter = ({
7190
7207
  label: sortLabel,
7191
7208
  id: "qf_sortBy",
7192
7209
  showLabel: false,
7193
- options: [
7194
- {
7195
- label: "Select a sort",
7196
- id: ""
7197
- },
7198
- ...sortOptions ? sortOptions.map((option) => {
7199
- var _a2;
7200
- return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
7201
- }) : []
7202
- ],
7210
+ defaultOption: "Select a sort",
7211
+ options: sortOptions != null ? sortOptions : [],
7203
7212
  onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
7204
7213
  value: queryState.sortBy
7205
7214
  }
@@ -7220,12 +7229,7 @@ var QueryFilter = ({
7220
7229
  label: sortOrderLabel,
7221
7230
  id: "qf_sortOrder",
7222
7231
  showLabel: false,
7223
- options: [
7224
- ...sortOrderOptions ? sortOrderOptions.map((option) => {
7225
- var _a2;
7226
- return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7227
- }) : []
7228
- ],
7232
+ options: sortOrderOptions != null ? sortOrderOptions : [],
7229
7233
  onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
7230
7234
  value: queryState.sortOrder
7231
7235
  }
package/dist/index.mjs CHANGED
@@ -3099,9 +3099,10 @@ function VariableEditor({
3099
3099
  variable,
3100
3100
  onSubmit,
3101
3101
  onCancel,
3102
+ showDisplayName,
3102
3103
  disableMeshTip
3103
3104
  }) {
3104
- var _a, _b, _c, _d, _e, _f, _g;
3105
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3105
3106
  const { variables } = useVariables();
3106
3107
  const currentVariable = variables[variable];
3107
3108
  const { register, handleSubmit, formState } = useForm({
@@ -3156,6 +3157,16 @@ function VariableEditor({
3156
3157
  }
3157
3158
  }
3158
3159
  ),
3160
+ showDisplayName ? /* @__PURE__ */ jsx31(
3161
+ Input2,
3162
+ {
3163
+ ...register("displayName"),
3164
+ label: "Display name",
3165
+ autoComplete: "off",
3166
+ caption: "This is the name that will be displayed in the UI. If not provided, the name will be used.",
3167
+ errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3168
+ }
3169
+ ) : null,
3159
3170
  /* @__PURE__ */ jsx31(
3160
3171
  Input2,
3161
3172
  {
@@ -3163,7 +3174,7 @@ function VariableEditor({
3163
3174
  label: "Help Text",
3164
3175
  caption: "Appears when entering a value for this variable.",
3165
3176
  autoComplete: "off",
3166
- errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
3177
+ errorMessage: (_g = formState.errors.helpText) == null ? void 0 : _g.message
3167
3178
  }
3168
3179
  ),
3169
3180
  /* @__PURE__ */ jsx31(
@@ -3172,7 +3183,7 @@ function VariableEditor({
3172
3183
  ...register("default"),
3173
3184
  label: "Default Value",
3174
3185
  autoComplete: "off",
3175
- errorMessage: (_g = formState.errors.default) == null ? void 0 : _g.message
3186
+ errorMessage: (_h = formState.errors.default) == null ? void 0 : _h.message
3176
3187
  }
3177
3188
  ),
3178
3189
  /* @__PURE__ */ jsx31(HorizontalRhythm, { justify: "space-between", children: /* @__PURE__ */ jsxs16(HorizontalRhythm, { gap: "sm", children: [
@@ -4065,32 +4076,41 @@ var menuBtn2 = css21`
4065
4076
  transform: translateY(-50%);
4066
4077
  `;
4067
4078
  var input = css21`
4079
+ --input-padding: 12px var(--spacing-base) 12px var(--spacing-sm);
4068
4080
  appearance: none;
4069
4081
  background-color: var(--white);
4070
- border: 1px solid var(--gray-200);
4082
+ border: 1px solid var(--gray-300);
4071
4083
  border-radius: var(--rounded-sm);
4072
4084
  color: var(--gray-700);
4073
- padding-block: var(--spacing-base);
4074
- padding-left: var(--spacing-base);
4075
- padding-right: var(--spacing-lg);
4076
- line-height: 1.75;
4085
+ padding: var(--input-padding);
4086
+ min-height: 50px;
4077
4087
  width: 100%;
4078
4088
  position: relative;
4079
4089
  transition: background var(--duration-fast) var(--timing-ease-out),
4080
4090
  border-color var(--duration-fast) var(--timing-ease-out),
4081
- color var(--duration-fast) var(--timing-ease-out);
4091
+ color var(--duration-fast) var(--timing-ease-out), box-shadow var(--duration-fast) var(--timing-ease-out);
4092
+
4093
+ &::placeholder {
4094
+ color: var(--gray-400);
4095
+ }
4096
+
4097
+ &:hover {
4098
+ border-color: var(--accent-dark-hover);
4099
+ }
4082
4100
 
4101
+ &[data-focus='true'],
4083
4102
  &:focus,
4084
4103
  &:focus-within {
4085
- border-color: var(--typography-base);
4086
- box-shadow: none;
4104
+ border-color: var(--accent-dark-active);
4105
+ box-shadow: var(--elevation-100);
4087
4106
  outline: none;
4088
4107
  }
4089
4108
 
4109
+ &[data-disabled='true'],
4090
4110
  &:disabled,
4091
4111
  &:disabled::placeholder {
4092
4112
  cursor: not-allowed;
4093
- color: var(--gray-400);
4113
+ color: var(--gray-300);
4094
4114
  border-color: var(--gray-300);
4095
4115
  }
4096
4116
 
@@ -5186,13 +5206,13 @@ function VariablesList() {
5186
5206
  const result = [...sorted || []];
5187
5207
  const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
5188
5208
  result == null ? void 0 : result.splice(res.destination.index, 0, removed);
5189
- const resultAsObj = result.reduce(
5190
- (acc, item, index) => ({
5209
+ const resultAsObj = result.reduce((acc, item, index) => {
5210
+ const { name, ...variableDefinition } = item;
5211
+ return {
5191
5212
  ...acc,
5192
- [item.name]: { type: item.type, default: item.default, order: index }
5193
- }),
5194
- {}
5195
- );
5213
+ [item.name]: { ...variableDefinition, order: index }
5214
+ };
5215
+ }, {});
5196
5216
  dispatch({ type: "reorder", result: resultAsObj });
5197
5217
  return result;
5198
5218
  }
@@ -6375,7 +6395,8 @@ var ObjectSearchListItem = ({
6375
6395
  onSelect,
6376
6396
  isMulti,
6377
6397
  disabled,
6378
- children
6398
+ children,
6399
+ ...props
6379
6400
  }) => {
6380
6401
  const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
6381
6402
  const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
@@ -6395,6 +6416,7 @@ var ObjectSearchListItem = ({
6395
6416
  role: "listitem",
6396
6417
  css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
6397
6418
  "data-testid": "list-item",
6419
+ ...props,
6398
6420
  children: [
6399
6421
  /* @__PURE__ */ jsxs34(
6400
6422
  "div",
@@ -6515,7 +6537,7 @@ var DefaultResultList = () => {
6515
6537
  };
6516
6538
 
6517
6539
  // src/components/ObjectSearch/ObjectSearchFilter.tsx
6518
- import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6540
+ import { DebouncedInputKeywordSearch, InputSelect as InputSelect6 } from "@uniformdev/design-system";
6519
6541
  import { useMemo as useMemo15, useState as useState17 } from "react";
6520
6542
 
6521
6543
  // src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
@@ -6589,14 +6611,14 @@ var ObjectSearchFilter = ({
6589
6611
  }
6590
6612
  ) : null,
6591
6613
  /* @__PURE__ */ jsx62(
6592
- InputKeywordSearch2,
6614
+ DebouncedInputKeywordSearch,
6593
6615
  {
6594
6616
  inputFieldName: searchInputName,
6595
6617
  placeholder: searchInputPlaceholderText,
6596
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
6618
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6597
6619
  disabledFieldSubmission: true,
6598
- onClear: () => handleFilterChange({ keyword: "" }),
6599
- value: searchState.keyword
6620
+ defaultValue: searchState.keyword,
6621
+ delay: 300
6600
6622
  }
6601
6623
  )
6602
6624
  ]
@@ -6829,6 +6851,7 @@ function ObjectSearchResultList({
6829
6851
  removeButtonText = "Remove all",
6830
6852
  onRemoveAllSelected,
6831
6853
  hideRemoveButton = false,
6854
+ resultLabelOverride,
6832
6855
  additionalButtons,
6833
6856
  renderResultComponent = (value) => /* @__PURE__ */ jsx66(ObjectSearchResultItem, { ...value }),
6834
6857
  multiSelectId,
@@ -6874,11 +6897,11 @@ function ObjectSearchResultList({
6874
6897
  };
6875
6898
  return /* @__PURE__ */ jsxs40(Fragment13, { children: [
6876
6899
  /* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
6877
- /* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6900
+ !resultLabelOverride ? /* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
6878
6901
  /* @__PURE__ */ jsx66("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
6879
6902
  " ",
6880
6903
  !selectedListItems.length ? null : /* @__PURE__ */ jsx66(Counter, { count: selectedListItems.length })
6881
- ] }),
6904
+ ] }) : resultLabelOverride,
6882
6905
  /* @__PURE__ */ jsxs40("div", { css: ObjectSearchResultListCounterContainer, children: [
6883
6906
  additionalButtons,
6884
6907
  hideRemoveButton ? null : /* @__PURE__ */ jsx66(
@@ -6920,7 +6943,7 @@ function ObjectSearchResultList({
6920
6943
  }
6921
6944
 
6922
6945
  // src/components/ObjectSearch/QueryFilter.tsx
6923
- import { Input as Input5, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6946
+ import { DebouncedInputKeywordSearch as DebouncedInputKeywordSearch2, Input as Input5, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
6924
6947
  import { useEffect as useEffect16, useState as useState18 } from "react";
6925
6948
  import { jsx as jsx67, jsxs as jsxs41 } from "@emotion/react/jsx-runtime";
6926
6949
  var QueryFilter = ({
@@ -6939,26 +6962,24 @@ var QueryFilter = ({
6939
6962
  sortOrderLabel = "Sort Order",
6940
6963
  sortOrderOptions = [
6941
6964
  {
6942
- name: "Ascending",
6943
- id: "asc",
6965
+ value: "asc",
6944
6966
  label: "Ascending"
6945
6967
  },
6946
6968
  {
6947
- name: "Descending",
6948
- id: "desc",
6969
+ value: "desc",
6949
6970
  label: "Descending"
6950
6971
  }
6951
6972
  ],
6952
6973
  children
6953
6974
  }) => {
6954
- var _a, _b, _c, _d, _e, _f;
6975
+ var _a, _b, _c, _d, _e, _f, _g;
6955
6976
  const { query, onSetQuery } = useObjectSearchContext();
6956
6977
  const [queryState, setQueryState] = useState18({
6957
6978
  contentType: (_a = query.contentType) != null ? _a : "",
6958
- keyword: (_b = query.contentType) != null ? _b : "",
6959
- count: countValue != null ? countValue : 5,
6960
- sortBy: (_c = sortOptions[0].id) != null ? _c : "",
6961
- sortOrder: (_d = sortOrderOptions[0].id) != null ? _d : ""
6979
+ keyword: (_b = query.keyword) != null ? _b : "",
6980
+ count: (_c = query.count) != null ? _c : countValue,
6981
+ sortBy: (_d = query.sortBy) != null ? _d : "",
6982
+ sortOrder: (_e = query.sortOrder) != null ? _e : ""
6962
6983
  });
6963
6984
  const handleFilterChange = (value) => {
6964
6985
  setQueryState((prev) => ({ ...prev, ...value }));
@@ -6966,7 +6987,7 @@ var QueryFilter = ({
6966
6987
  };
6967
6988
  useEffect16(() => {
6968
6989
  onSetQuery(queryState);
6969
- }, [onSetQuery, queryState]);
6990
+ }, []);
6970
6991
  return /* @__PURE__ */ jsxs41("fieldset", { children: [
6971
6992
  /* @__PURE__ */ jsx67("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
6972
6993
  /* @__PURE__ */ jsx67("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs41(VerticalRhythm3, { children: [
@@ -6974,20 +6995,20 @@ var QueryFilter = ({
6974
6995
  InputVariables,
6975
6996
  {
6976
6997
  label: searchInputLabel,
6977
- value: (_e = queryState.keyword) != null ? _e : "",
6998
+ value: (_f = queryState.keyword) != null ? _f : "",
6978
6999
  onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
6979
7000
  disableInlineMenu: true,
6980
7001
  id: "qf_searchText",
6981
7002
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
6982
- InputKeywordSearch3,
7003
+ DebouncedInputKeywordSearch2,
6983
7004
  {
6984
7005
  id: "qf_searchText",
6985
7006
  inputFieldName: searchInputName,
6986
7007
  placeholder: searchInputPlaceholderText,
6987
- onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
7008
+ onSearchTextChanged: (keyword) => handleFilterChange({ keyword }),
6988
7009
  disabledFieldSubmission: true,
6989
- onClear: () => handleFilterChange({ keyword: "" }),
6990
- value: queryState.keyword
7010
+ delay: 300,
7011
+ defaultValue: queryState.keyword
6991
7012
  }
6992
7013
  )
6993
7014
  }
@@ -6998,7 +7019,7 @@ var QueryFilter = ({
6998
7019
  {
6999
7020
  label: contentTypeLabel,
7000
7021
  id: "qf_contentType",
7001
- value: (_f = queryState.contentType) != null ? _f : "",
7022
+ value: (_g = queryState.contentType) != null ? _g : "",
7002
7023
  onChange: (newType) => handleFilterChange({ contentType: newType }),
7003
7024
  disableInlineMenu: true,
7004
7025
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
@@ -7007,13 +7028,8 @@ var QueryFilter = ({
7007
7028
  id: "qf_contentType",
7008
7029
  label: contentTypeLabel,
7009
7030
  showLabel: false,
7010
- options: [
7011
- ...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
7012
- ...contentTypeOptions ? contentTypeOptions.map((option) => {
7013
- var _a2;
7014
- return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7015
- }) : []
7016
- ],
7031
+ defaultOption: requireContentType ? void 0 : typeSelectorAllTypesOptionText,
7032
+ options: contentTypeOptions != null ? contentTypeOptions : [],
7017
7033
  onChange: (e) => handleFilterChange({ contentType: e.target.value }),
7018
7034
  value: queryState.contentType
7019
7035
  }
@@ -7028,6 +7044,7 @@ var QueryFilter = ({
7028
7044
  value: queryState.count.toString(10),
7029
7045
  onChange: (newCount) => handleFilterChange({ count: newCount }),
7030
7046
  disableInlineMenu: true,
7047
+ valueToResetTo: "5",
7031
7048
  inputWhenNoVariables: /* @__PURE__ */ jsx67(
7032
7049
  Input5,
7033
7050
  {
@@ -7058,16 +7075,8 @@ var QueryFilter = ({
7058
7075
  label: sortLabel,
7059
7076
  id: "qf_sortBy",
7060
7077
  showLabel: false,
7061
- options: [
7062
- {
7063
- label: "Select a sort",
7064
- id: ""
7065
- },
7066
- ...sortOptions ? sortOptions.map((option) => {
7067
- var _a2;
7068
- return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
7069
- }) : []
7070
- ],
7078
+ defaultOption: "Select a sort",
7079
+ options: sortOptions != null ? sortOptions : [],
7071
7080
  onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
7072
7081
  value: queryState.sortBy
7073
7082
  }
@@ -7088,12 +7097,7 @@ var QueryFilter = ({
7088
7097
  label: sortOrderLabel,
7089
7098
  id: "qf_sortOrder",
7090
7099
  showLabel: false,
7091
- options: [
7092
- ...sortOrderOptions ? sortOrderOptions.map((option) => {
7093
- var _a2;
7094
- return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
7095
- }) : []
7096
- ],
7100
+ options: sortOrderOptions != null ? sortOrderOptions : [],
7097
7101
  onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
7098
7102
  value: queryState.sortOrder
7099
7103
  }
@@ -7198,7 +7202,7 @@ import {
7198
7202
  Heading,
7199
7203
  Input as Input6,
7200
7204
  InputComboBox,
7201
- InputKeywordSearch as InputKeywordSearch4,
7205
+ InputKeywordSearch as InputKeywordSearch2,
7202
7206
  InputSelect as InputSelect8,
7203
7207
  InputToggle,
7204
7208
  Label,
@@ -7252,7 +7256,7 @@ export {
7252
7256
  icons_exports as Icons,
7253
7257
  Input6 as Input,
7254
7258
  InputComboBox,
7255
- InputKeywordSearch4 as InputKeywordSearch,
7259
+ InputKeywordSearch2 as InputKeywordSearch,
7256
7260
  InputSelect8 as InputSelect,
7257
7261
  InputToggle,
7258
7262
  InputVariables,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/mesh-sdk-react",
3
- "version": "19.79.1-alpha.13+608a273da",
3
+ "version": "19.79.1-alpha.18+12234b9350",
4
4
  "description": "Uniform Mesh Framework SDK for React",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -50,9 +50,9 @@
50
50
  "@lexical/selection": "^0.12.0",
51
51
  "@lexical/utils": "^0.12.0",
52
52
  "@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
53
- "@uniformdev/canvas": "19.79.1-alpha.13+608a273da",
54
- "@uniformdev/design-system": "19.79.1-alpha.13+608a273da",
55
- "@uniformdev/mesh-sdk": "19.79.1-alpha.13+608a273da",
53
+ "@uniformdev/canvas": "19.79.1-alpha.18+12234b9350",
54
+ "@uniformdev/design-system": "19.79.1-alpha.18+12234b9350",
55
+ "@uniformdev/mesh-sdk": "19.79.1-alpha.18+12234b9350",
56
56
  "dequal": "^2.0.3",
57
57
  "lexical": "^0.12.0",
58
58
  "mitt": "^3.0.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "608a273da87aa432f17b2c8ce15d747dadab0cd1"
89
+ "gitHead": "12234b9350cfa4209bc7e242701d2dc535ece19e"
90
90
  }