@uniformdev/design-system 19.138.1-alpha.4 → 19.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -20344,6 +20344,11 @@ var TEXTBOX_OPERATORS = [
20344
20344
  value: "match",
20345
20345
  editorType: "text"
20346
20346
  },
20347
+ {
20348
+ label: "starts with...",
20349
+ value: "starts",
20350
+ editorType: "text"
20351
+ },
20347
20352
  {
20348
20353
  label: "is not...",
20349
20354
  value: "neq",
@@ -20366,6 +20371,11 @@ var USER_OPERATORS = [
20366
20371
  value: "match",
20367
20372
  editorType: "text"
20368
20373
  },
20374
+ {
20375
+ label: "starts with...",
20376
+ value: "starts",
20377
+ editorType: "text"
20378
+ },
20369
20379
  {
20370
20380
  label: "is not...",
20371
20381
  value: "neq",
@@ -20420,6 +20430,11 @@ var RICHTEXT_OPERATORS = [
20420
20430
  value: "match",
20421
20431
  editorType: "text"
20422
20432
  },
20433
+ {
20434
+ label: "starts with...",
20435
+ value: "starts",
20436
+ editorType: "text"
20437
+ },
20423
20438
  {
20424
20439
  label: "is not empty",
20425
20440
  value: "def",
@@ -21620,6 +21635,9 @@ var FilterItems = ({
21620
21635
  if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
21621
21636
  next[index].value = next[index].value[0];
21622
21637
  }
21638
+ if (filters[index].operator === "ndef" || filters[index].operator === "def") {
21639
+ next[index].value = "";
21640
+ }
21623
21641
  if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
21624
21642
  next[index].value = [next[index].value, ""];
21625
21643
  }
@@ -21692,7 +21710,8 @@ var SearchAndFilterResultContainer = ({
21692
21710
  clearButtonLabel = "clear",
21693
21711
  calloutTitle: calloutTitle2,
21694
21712
  calloutText,
21695
- onHandleClear
21713
+ onHandleClear,
21714
+ hideClearButton
21696
21715
  }) => {
21697
21716
  const { searchTerm, setSearchTerm, totalResults, setFilters, filters } = useSearchAndFilter();
21698
21717
  const automateCalloutTitle = () => {
@@ -21727,11 +21746,11 @@ var SearchAndFilterResultContainer = ({
21727
21746
  " results ",
21728
21747
  searchTerm ? `for "${searchTerm}"` : null
21729
21748
  ] }),
21730
- !searchTerm ? null : /* @__PURE__ */ jsx125(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
21749
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx125(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
21731
21750
  ] }),
21732
21751
  totalResults === 0 ? /* @__PURE__ */ jsxs85(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
21733
21752
  calloutText ? /* @__PURE__ */ jsx125(Paragraph, { children: calloutText }) : null,
21734
- /* @__PURE__ */ jsx125(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
21753
+ hideClearButton ? null : /* @__PURE__ */ jsx125(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
21735
21754
  ] }) : null
21736
21755
  ] });
21737
21756
  };
package/dist/index.d.mts CHANGED
@@ -23066,7 +23066,7 @@ type Filter = {
23066
23066
  };
23067
23067
 
23068
23068
  /** @deprecated beta - a list of possible operator values that sync with uniform search api */
23069
- type OperatorValue = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'between' | 'ndef' | 'def' | 'match';
23069
+ type OperatorValue = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'between' | 'ndef' | 'def' | 'match' | 'starts';
23070
23070
  type OperatorValueType = {
23071
23071
  value: OperatorValue;
23072
23072
  };
@@ -23412,9 +23412,11 @@ type SearchAndFilterResultContainerProps = {
23412
23412
  calloutText?: string;
23413
23413
  /** The function to handle the clear button */
23414
23414
  onHandleClear?: () => void;
23415
+ /** Sets whether to show or hide both clear search buttons */
23416
+ hideClearButton?: boolean;
23415
23417
  };
23416
23418
  /** @deprecated beta - Search and filter results container */
23417
- declare const SearchAndFilterResultContainer: ({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, }: SearchAndFilterResultContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
23419
+ declare const SearchAndFilterResultContainer: ({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, hideClearButton, }: SearchAndFilterResultContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
23418
23420
 
23419
23421
  declare const SearchOnlyContext: React$1.Context<Pick<SearchAndFilterContextProps, "searchTerm" | "setSearchTerm">>;
23420
23422
  type SearchOnlyProviderProps = Pick<SearchAndFilterProviderProps, 'onSearchChange'> & {
package/dist/index.d.ts CHANGED
@@ -23066,7 +23066,7 @@ type Filter = {
23066
23066
  };
23067
23067
 
23068
23068
  /** @deprecated beta - a list of possible operator values that sync with uniform search api */
23069
- type OperatorValue = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'between' | 'ndef' | 'def' | 'match';
23069
+ type OperatorValue = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'between' | 'ndef' | 'def' | 'match' | 'starts';
23070
23070
  type OperatorValueType = {
23071
23071
  value: OperatorValue;
23072
23072
  };
@@ -23412,9 +23412,11 @@ type SearchAndFilterResultContainerProps = {
23412
23412
  calloutText?: string;
23413
23413
  /** The function to handle the clear button */
23414
23414
  onHandleClear?: () => void;
23415
+ /** Sets whether to show or hide both clear search buttons */
23416
+ hideClearButton?: boolean;
23415
23417
  };
23416
23418
  /** @deprecated beta - Search and filter results container */
23417
- declare const SearchAndFilterResultContainer: ({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, }: SearchAndFilterResultContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
23419
+ declare const SearchAndFilterResultContainer: ({ buttonText, clearButtonLabel, calloutTitle, calloutText, onHandleClear, hideClearButton, }: SearchAndFilterResultContainerProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element | null;
23418
23420
 
23419
23421
  declare const SearchOnlyContext: React$1.Context<Pick<SearchAndFilterContextProps, "searchTerm" | "setSearchTerm">>;
23420
23422
  type SearchOnlyProviderProps = Pick<SearchAndFilterProviderProps, 'onSearchChange'> & {
package/dist/index.js CHANGED
@@ -22189,6 +22189,11 @@ var TEXTBOX_OPERATORS = [
22189
22189
  value: "match",
22190
22190
  editorType: "text"
22191
22191
  },
22192
+ {
22193
+ label: "starts with...",
22194
+ value: "starts",
22195
+ editorType: "text"
22196
+ },
22192
22197
  {
22193
22198
  label: "is not...",
22194
22199
  value: "neq",
@@ -22211,6 +22216,11 @@ var USER_OPERATORS = [
22211
22216
  value: "match",
22212
22217
  editorType: "text"
22213
22218
  },
22219
+ {
22220
+ label: "starts with...",
22221
+ value: "starts",
22222
+ editorType: "text"
22223
+ },
22214
22224
  {
22215
22225
  label: "is not...",
22216
22226
  value: "neq",
@@ -22265,6 +22275,11 @@ var RICHTEXT_OPERATORS = [
22265
22275
  value: "match",
22266
22276
  editorType: "text"
22267
22277
  },
22278
+ {
22279
+ label: "starts with...",
22280
+ value: "starts",
22281
+ editorType: "text"
22282
+ },
22268
22283
  {
22269
22284
  label: "is not empty",
22270
22285
  value: "def",
@@ -23470,6 +23485,9 @@ var FilterItems = ({
23470
23485
  if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
23471
23486
  next[index].value = next[index].value[0];
23472
23487
  }
23488
+ if (filters[index].operator === "ndef" || filters[index].operator === "def") {
23489
+ next[index].value = "";
23490
+ }
23473
23491
  if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
23474
23492
  next[index].value = [next[index].value, ""];
23475
23493
  }
@@ -23546,7 +23564,8 @@ var SearchAndFilterResultContainer = ({
23546
23564
  clearButtonLabel = "clear",
23547
23565
  calloutTitle: calloutTitle2,
23548
23566
  calloutText,
23549
- onHandleClear
23567
+ onHandleClear,
23568
+ hideClearButton
23550
23569
  }) => {
23551
23570
  const { searchTerm, setSearchTerm, totalResults, setFilters, filters } = useSearchAndFilter();
23552
23571
  const automateCalloutTitle = () => {
@@ -23581,11 +23600,11 @@ var SearchAndFilterResultContainer = ({
23581
23600
  " results ",
23582
23601
  searchTerm ? `for "${searchTerm}"` : null
23583
23602
  ] }),
23584
- !searchTerm ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23603
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23585
23604
  ] }),
23586
23605
  totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
23587
23606
  calloutText ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Paragraph, { children: calloutText }) : null,
23588
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
23607
+ hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
23589
23608
  ] }) : null
23590
23609
  ] });
23591
23610
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "19.138.1-alpha.4+7b94dbe2d8",
3
+ "version": "19.139.0",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "@storybook/react": "6.5.16",
25
25
  "@types/react": "18.2.40",
26
26
  "@types/react-dom": "18.2.17",
27
- "@uniformdev/canvas": "^19.138.1-alpha.4+7b94dbe2d8",
28
- "@uniformdev/richtext": "^19.138.1-alpha.4+7b94dbe2d8",
27
+ "@uniformdev/canvas": "^19.139.0",
28
+ "@uniformdev/richtext": "^19.139.0",
29
29
  "autoprefixer": "10.4.16",
30
30
  "hygen": "6.2.11",
31
31
  "postcss": "8.4.38",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "7b94dbe2d80617b83ecd5f317666e75907a1e532"
75
+ "gitHead": "86f2f88868e7f17acf970e1cbf7612650761e961"
76
76
  }