@innovaccer/design-system 2.21.0 → 2.22.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/css/dist/MaterialSymbolsRounded.woff2 +0 -0
  3. package/css/dist/index.css +101 -15
  4. package/css/dist/index.css.map +1 -1
  5. package/css/gulpfile.js +1 -1
  6. package/css/material-design-icons/iconfont/MaterialSymbolsRounded.woff2 +0 -0
  7. package/css/material-design-icons/iconfont/material-icons.css +9 -15
  8. package/css/src/components/selectionCard.css +91 -0
  9. package/dist/.lib/tsconfig.type.tsbuildinfo +138 -64
  10. package/dist/core/common.type.d.ts +1 -6
  11. package/dist/core/components/atoms/_chip/index.d.ts +2 -2
  12. package/dist/core/components/atoms/button/Button.d.ts +2 -2
  13. package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
  14. package/dist/core/components/atoms/dropdown/Dropdown.d.ts +3 -0
  15. package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
  16. package/dist/core/components/atoms/dropdown/DropdownList.d.ts +8 -0
  17. package/dist/core/components/atoms/dropdown/ErrorTemplate.d.ts +9 -0
  18. package/dist/core/components/atoms/dropdown/option/index.d.ts +2 -2
  19. package/dist/core/components/atoms/icon/Icon.d.ts +0 -7
  20. package/dist/core/components/atoms/input/Input.d.ts +2 -2
  21. package/dist/core/components/atoms/input/actionButton/ActionButton.d.ts +2 -2
  22. package/dist/core/components/atoms/linkButton/LinkButton.d.ts +2 -2
  23. package/dist/core/components/atoms/metaList/Meta.d.ts +2 -2
  24. package/dist/core/components/atoms/metricInput/MetricInput.d.ts +2 -2
  25. package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +15 -15
  26. package/dist/core/components/atoms/selectionCard/SelectionCard.d.ts +23 -0
  27. package/dist/core/components/atoms/selectionCard/hooks/index.d.ts +2 -0
  28. package/dist/core/components/atoms/selectionCard/hooks/useMultiSelect.d.ts +6 -0
  29. package/dist/core/components/atoms/selectionCard/hooks/useSingleSelect.d.ts +6 -0
  30. package/dist/core/components/atoms/selectionCard/index.d.ts +2 -0
  31. package/dist/core/components/molecules/chipInput/ChipInput.d.ts +1 -1
  32. package/dist/core/components/molecules/tabs/Tabs.d.ts +2 -2
  33. package/dist/core/index.d.ts +1 -0
  34. package/dist/core/index.type.d.ts +1 -0
  35. package/dist/core/utils/navigationHelper.d.ts +2 -2
  36. package/dist/index.esm.js +355 -256
  37. package/dist/index.js +263 -181
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.umd.js +1 -1
  40. package/dist/index.umd.js.br +0 -0
  41. package/dist/index.umd.js.gz +0 -0
  42. package/package.json +1 -1
  43. package/css/dist/MaterialSymbolsOutlined.ttf +0 -0
  44. package/css/dist/MaterialSymbolsRounded.ttf +0 -0
  45. package/css/material-design-icons/iconfont/MaterialSymbolsOutlined.ttf +0 -0
  46. package/css/material-design-icons/iconfont/MaterialSymbolsRounded.ttf +0 -0
  47. package/dist/core/components/atoms/icon/utils.d.ts +0 -7
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /**
3
- * Generated on: 1695030042950
3
+ * Generated on: 1695891566322
4
4
  * Package: @innovaccer/design-system
5
- * Version: v2.21.0
5
+ * Version: v2.22.0
6
6
  * License: MIT
7
7
  * Docs: https://innovaccer.github.io/design-system
8
8
  */
@@ -892,8 +892,8 @@
892
892
  disabled = props.disabled,
893
893
  className = props.className;
894
894
  props.tooltip;
895
- var iconVariations = props.iconVariations,
896
- rest = __rest(props, ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip", "iconVariations"]);
895
+ var iconType = props.iconType,
896
+ rest = __rest(props, ["size", "appearance", "iconAlign", "tabIndex", "largeIcon", "type", "children", "icon", "expanded", "selected", "loading", "disabled", "className", "tooltip", "iconType"]);
897
897
 
898
898
  var buttonClass = classNames__default["default"]((_a = {}, _a['Button'] = true, _a['Button--expanded'] = expanded, _a["Button--" + size] = size, _a["Button--" + size + "Square"] = !children, _a["Button--" + appearance] = appearance, _a['Button--selected'] = selected && (appearance === 'basic' || appearance === 'transparent'), _a["Button--iconAlign-" + iconAlign] = children && iconAlign, _a["" + className] = className, _a));
899
899
  var iconClass = classNames__default["default"]((_b = {}, _b['Button-icon'] = true, _b["Button-icon--" + iconAlign] = children && iconAlign, _b));
@@ -916,7 +916,7 @@
916
916
  }, /*#__PURE__*/React__namespace.createElement(Icon, {
917
917
  "data-test": "DesignSystem-Button--Icon",
918
918
  name: icon,
919
- variations: iconVariations,
919
+ type: iconType,
920
920
  size: largeIcon && !children ? sizeMapping$3[size] + 4 : sizeMapping$3[size]
921
921
  })), children && /*#__PURE__*/React__namespace.createElement("span", {
922
922
  className: "Button-text"
@@ -2341,116 +2341,6 @@
2341
2341
  });
2342
2342
  };
2343
2343
 
2344
- var getOpticalSize = function getOpticalSize(size) {
2345
- if (size && size <= 20) {
2346
- return 20;
2347
- } else if (size && size >= 48) {
2348
- return 48;
2349
- }
2350
-
2351
- return size;
2352
- };
2353
-
2354
- var iconVariantMapper = {
2355
- more_horiz: {
2356
- weight: 600,
2357
- opticalSize: 24
2358
- },
2359
- "delete": {
2360
- fill: 0
2361
- },
2362
- radio_button_checked: {
2363
- fill: 0
2364
- },
2365
- radio_button_unchecked: {
2366
- fill: 0
2367
- },
2368
- schedule: {
2369
- fill: 0
2370
- },
2371
- help_outline: {
2372
- fill: 0
2373
- },
2374
- check_circle_outline: {
2375
- fill: 0
2376
- },
2377
- highlight_of: {
2378
- fill: 0
2379
- },
2380
- credit_card: {
2381
- fill: 0
2382
- },
2383
- delete_outline: {
2384
- fill: 0
2385
- },
2386
- bookmark_border: {
2387
- fill: 0
2388
- },
2389
- work_outline: {
2390
- fill: 0
2391
- },
2392
- alarm: {
2393
- fill: 0
2394
- },
2395
- arrow_circle_up: {
2396
- fill: 0
2397
- },
2398
- copyright: {
2399
- fill: 0
2400
- },
2401
- query_builder: {
2402
- fill: 0
2403
- },
2404
- card_membership: {
2405
- fill: 0
2406
- },
2407
- arrow_circle_down: {
2408
- fill: 0
2409
- },
2410
- change_history: {
2411
- fill: 0
2412
- },
2413
- aspect_ratio: {
2414
- fill: 0
2415
- },
2416
- calendar_view_month: {
2417
- fill: 0
2418
- },
2419
- alarm_on: {
2420
- fill: 0
2421
- },
2422
- thumb_down_off_alt: {
2423
- fill: 0
2424
- },
2425
- important_devices: {
2426
- fill: 0
2427
- },
2428
- turned_in_not: {
2429
- fill: 0
2430
- },
2431
- add_circle_outline: {
2432
- fill: 0
2433
- },
2434
- speed: {
2435
- fill: 0
2436
- },
2437
- content_copy: {
2438
- fill: 0
2439
- },
2440
- timelapse: {
2441
- fill: 0
2442
- }
2443
- };
2444
- var getFontVariation = function getFontVariation(iconName, variations, type, size) {
2445
- var defaultVariant = {
2446
- fill: type === 'outlined' ? 0 : 1,
2447
- weight: 400,
2448
- grade: 0,
2449
- opticalSize: getOpticalSize(size)
2450
- };
2451
- return __assign(__assign(__assign({}, defaultVariant), iconVariantMapper[iconName]), variations);
2452
- };
2453
-
2454
2344
  var Icon = function Icon(props) {
2455
2345
  var _a;
2456
2346
 
@@ -2458,8 +2348,7 @@
2458
2348
  className = props.className,
2459
2349
  name = props.name,
2460
2350
  size = props.size,
2461
- children = props.children,
2462
- variations = props.variations;
2351
+ children = props.children;
2463
2352
  var accessibilityProps = useAccessibilityProps(props);
2464
2353
  var baseProps = extractBaseProps(props);
2465
2354
  var mapper = {
@@ -2478,17 +2367,9 @@
2478
2367
 
2479
2368
  var color = appearance && appearance.includes('_') ? getIconAppearance(appearance) : appearance;
2480
2369
  var iconClass = classNames__default["default"]((_a = {}, _a['material-icons'] = true, _a['material-icons-rounded'] = type === 'rounded', _a['material-icons-outlined'] = type === 'outlined', _a['Icon'] = true, _a["Icon--" + color] = appearance, _a["" + className] = className, _a));
2481
-
2482
- var _b = getFontVariation(name, variations, type, size),
2483
- fill = _b.fill,
2484
- grade = _b.grade,
2485
- opticalSize = _b.opticalSize,
2486
- weight = _b.weight;
2487
-
2488
2370
  var styles = {
2489
2371
  fontSize: size + "px",
2490
- width: size + "px",
2491
- 'font-variation-settings': "\"FILL\" " + fill + ", \"wght\" " + weight + ", \"GRAD\" " + grade + ", \"opsz\" " + opticalSize
2372
+ width: size + "px"
2492
2373
  };
2493
2374
 
2494
2375
  if (children && /*#__PURE__*/React__namespace.isValidElement(children)) {
@@ -2562,7 +2443,7 @@
2562
2443
  onClose = props.onClose,
2563
2444
  onClick = props.onClick,
2564
2445
  labelPrefix = props.labelPrefix,
2565
- iconVariations = props.iconVariations;
2446
+ iconType = props.iconType;
2566
2447
  var baseProps = extractBaseProps(props);
2567
2448
 
2568
2449
  var iconClass = function iconClass(align) {
@@ -2620,7 +2501,7 @@
2620
2501
  }), icon && /*#__PURE__*/React__namespace.createElement(Icon, {
2621
2502
  "data-test": "DesignSystem-GenericChip--Icon",
2622
2503
  name: icon,
2623
- variations: iconVariations,
2504
+ type: iconType,
2624
2505
  appearance: iconAppearance('left'),
2625
2506
  className: iconClass('left')
2626
2507
  }), renderLabel(), clearButton && /*#__PURE__*/React__namespace.createElement("div", {
@@ -2652,7 +2533,7 @@
2652
2533
  name = props.name,
2653
2534
  className = props.className,
2654
2535
  labelPrefix = props.labelPrefix,
2655
- iconVariations = props.iconVariations;
2536
+ iconType = props.iconType;
2656
2537
  var baseProps = extractBaseProps(props);
2657
2538
 
2658
2539
  var onCloseHandler = function onCloseHandler() {
@@ -2674,7 +2555,7 @@
2674
2555
  label: label,
2675
2556
  selected: select,
2676
2557
  icon: icon,
2677
- iconVariations: iconVariations,
2558
+ iconType: iconType,
2678
2559
  clearButton: clearbutton,
2679
2560
  disabled: disabled,
2680
2561
  className: chipClass,
@@ -2720,7 +2601,7 @@
2720
2601
  selected = item.selected,
2721
2602
  clearButton = item.clearButton,
2722
2603
  name = item.name,
2723
- iconVariations = item.iconVariations;
2604
+ iconType = item.iconType;
2724
2605
  return /*#__PURE__*/React__namespace.createElement("span", {
2725
2606
  key: ind,
2726
2607
  className: "ChipGroup-item"
@@ -2732,7 +2613,7 @@
2732
2613
  icon: icon,
2733
2614
  disabled: disabled,
2734
2615
  clearButton: clearButton,
2735
- iconVariations: iconVariations,
2616
+ iconType: iconType,
2736
2617
  type: type,
2737
2618
  onClick: function onClick() {
2738
2619
  return onClickHandler(item);
@@ -4154,8 +4035,8 @@
4154
4035
  open = props.open,
4155
4036
  inlineLabel = props.inlineLabel,
4156
4037
  error = props.error,
4157
- iconVariations = props.iconVariations,
4158
- rest = __rest(props, ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error", "iconVariations"]);
4038
+ iconType = props.iconType,
4039
+ rest = __rest(props, ["triggerSize", "placeholder", "menu", "children", "icon", "disabled", "open", "inlineLabel", "error", "iconType"]);
4159
4040
 
4160
4041
  var buttonDisabled = disabled ? 'disabled' : 'default';
4161
4042
  var trimmedPlaceholder = placeholder.trim();
@@ -4180,13 +4061,13 @@
4180
4061
  appearance: buttonDisabled,
4181
4062
  className: "d-flex align-items-center mr-4",
4182
4063
  name: icon,
4183
- variations: iconVariations
4064
+ type: iconType
4184
4065
  }), value && /*#__PURE__*/React__namespace.createElement("span", {
4185
4066
  className: textClass
4186
4067
  }, value)), /*#__PURE__*/React__namespace.createElement(Icon, {
4187
4068
  appearance: buttonDisabled,
4188
4069
  name: iconName,
4189
- variations: iconVariations
4070
+ type: iconType
4190
4071
  }));
4191
4072
  });
4192
4073
  DropdownButton.displayName = 'DropdownButton';
@@ -4313,7 +4194,7 @@
4313
4194
  var label = optionData.label,
4314
4195
  icon = optionData.icon,
4315
4196
  disabled = optionData.disabled,
4316
- iconVariations = optionData.iconVariations;
4197
+ iconType = optionData.iconType;
4317
4198
  var OptionClass = classNames__default["default"]((_a = {}, _a["" + className] = true, _a['Option--icon'] = icon, _a));
4318
4199
  return /*#__PURE__*/React__namespace.createElement("div", {
4319
4200
  className: OptionClass,
@@ -4325,7 +4206,7 @@
4325
4206
  className: "Option-icon mr-4",
4326
4207
  "data-test": dataTest + "--Icon",
4327
4208
  name: icon,
4328
- variations: iconVariations
4209
+ type: iconType
4329
4210
  }), /*#__PURE__*/React__namespace.createElement("div", {
4330
4211
  className: 'Option-label'
4331
4212
  }, /*#__PURE__*/React__namespace.createElement(Text, {
@@ -4618,6 +4499,47 @@
4618
4499
  return null;
4619
4500
  };
4620
4501
 
4502
+ var errorTitle = {
4503
+ FAILED_TO_FETCH: 'Failed to fetch data',
4504
+ NO_RECORDS_FOUND: 'No results found',
4505
+ DEFAULT: 'No record available'
4506
+ };
4507
+ var errorDescription = {
4508
+ FAILED_TO_FETCH: "We couldn't load the data, try reloading.",
4509
+ NO_RECORDS_FOUND: 'Try modifying your search to find what you are looking for.',
4510
+ DEFAULT: 'We have nothing to show you at the moment.'
4511
+ };
4512
+ var ErrorTemplate = function ErrorTemplate(_a) {
4513
+ var dropdownStyle = _a.dropdownStyle,
4514
+ errorType = _a.errorType,
4515
+ updateOptions = _a.updateOptions;
4516
+ return /*#__PURE__*/React__namespace.createElement("div", {
4517
+ className: "Dropdown-wrapper px-7 d-flex",
4518
+ style: dropdownStyle,
4519
+ "data-test": "DesignSystem-Dropdown--wrapper"
4520
+ }, /*#__PURE__*/React__namespace.createElement("div", {
4521
+ className: "d-flex flex-column justify-content-center align-items-center",
4522
+ "data-test": "DesignSystem-Dropdown--errorWrapper"
4523
+ }, /*#__PURE__*/React__namespace.createElement(Text, {
4524
+ className: "mb-3",
4525
+ weight: "strong"
4526
+ }, errorTitle[errorType]), /*#__PURE__*/React__namespace.createElement(Text, {
4527
+ className: "text-align-center mb-6",
4528
+ weight: "medium",
4529
+ size: "small",
4530
+ appearance: "subtle"
4531
+ }, errorDescription[errorType]), errorType === 'FAILED_TO_FETCH' && /*#__PURE__*/React__namespace.createElement(Button, {
4532
+ size: "tiny",
4533
+ largeIcon: true,
4534
+ "aria-label": "reload",
4535
+ icon: "refresh",
4536
+ iconAlign: "left",
4537
+ onClick: function onClick() {
4538
+ return updateOptions();
4539
+ }
4540
+ }, "Reload")));
4541
+ };
4542
+
4621
4543
  var alignmentMapping = {
4622
4544
  right: 'bottom-start',
4623
4545
  left: 'bottom-end'
@@ -4664,7 +4586,11 @@
4664
4586
  className = props.className,
4665
4587
  _m = props.searchPlaceholder,
4666
4588
  searchPlaceholder = _m === void 0 ? 'Search..' : _m,
4667
- scrollIndex = props.scrollIndex;
4589
+ scrollIndex = props.scrollIndex,
4590
+ updateOptions = props.updateOptions,
4591
+ noResultMessage = props.noResultMessage,
4592
+ errorType = props.errorType,
4593
+ loadingOptions = props.loadingOptions;
4668
4594
  var baseProps = extractBaseProps(props);
4669
4595
  var dropdownRef = /*#__PURE__*/React__namespace.createRef();
4670
4596
  var triggerRef = /*#__PURE__*/React__namespace.createRef();
@@ -4690,6 +4616,7 @@
4690
4616
  minHeight && setMinHeight(minHeight);
4691
4617
  };
4692
4618
 
4619
+ var isDropdownListBlank = listOptions.length === 0 && !loadingOptions && selected.length <= 0;
4693
4620
  React__namespace.useEffect(function () {
4694
4621
  var _a;
4695
4622
 
@@ -4732,7 +4659,7 @@
4732
4659
  disabled = props.disabled,
4733
4660
  inlineLabel = props.inlineLabel,
4734
4661
  triggerLabel = props.triggerLabel,
4735
- iconVariations = props.iconVariations;
4662
+ iconType = props.iconType;
4736
4663
  var CustomTrigger = customTrigger ? customTrigger(triggerLabel ? triggerLabel : placeholder) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null);
4737
4664
  var NewCustomTrigger = /*#__PURE__*/React__namespace.cloneElement(CustomTrigger, {
4738
4665
  tabIndex: 0,
@@ -4748,7 +4675,7 @@
4748
4675
  menu: menu,
4749
4676
  error: error,
4750
4677
  ref: dropdownTriggerRef,
4751
- iconVariations: iconVariations
4678
+ iconType: iconType
4752
4679
  }, triggerLabel);
4753
4680
  var dropdownStyle = {
4754
4681
  maxHeight: maxHeight,
@@ -4763,6 +4690,16 @@
4763
4690
  minHeight: minHeight
4764
4691
  };
4765
4692
 
4693
+ var defaultErrorTemplate = function defaultErrorTemplate() {
4694
+ return /*#__PURE__*/React__namespace.createElement(ErrorTemplate, {
4695
+ dropdownStyle: __assign(__assign({}, dropdownStyle), {
4696
+ minHeight: maxHeight
4697
+ }),
4698
+ updateOptions: updateOptions,
4699
+ errorType: errorType
4700
+ });
4701
+ };
4702
+
4766
4703
  var getDropdownSectionClass = function getDropdownSectionClass(showClearButton) {
4767
4704
  var _a;
4768
4705
 
@@ -4969,7 +4906,8 @@
4969
4906
  allItemsSectionLabel = _c === void 0 ? 'All Items' : _c,
4970
4907
  _d = props.loadersCount,
4971
4908
  loadersCount = _d === void 0 ? 10 : _d,
4972
- loadingOptions = props.loadingOptions;
4909
+ _e = props.errorTemplate,
4910
+ errorTemplate = _e === void 0 ? defaultErrorTemplate : _e;
4973
4911
 
4974
4912
  var selectAllPresent = _isSelectAllPresent(searchTerm, remainingOptions, withSelectAll, withCheckbox);
4975
4913
 
@@ -4984,18 +4922,22 @@
4984
4922
  }, renderLoading(loadersCount)));
4985
4923
  }
4986
4924
 
4987
- if (listOptions.length === 0 && !loadingOptions && selected.length <= 0) {
4988
- var _e = props.noResultMessage,
4989
- noResultMessage = _e === void 0 ? 'No result found' : _e;
4990
- return /*#__PURE__*/React__namespace.createElement("div", {
4991
- className: "Dropdown-wrapper",
4992
- style: dropdownStyle,
4993
- "data-test": "DesignSystem-Dropdown--errorWrapper"
4994
- }, /*#__PURE__*/React__namespace.createElement("div", {
4995
- className: 'Option'
4996
- }, /*#__PURE__*/React__namespace.createElement("div", {
4997
- className: 'Option-subinfo'
4998
- }, noResultMessage)));
4925
+ if (isDropdownListBlank) {
4926
+ if (noResultMessage) {
4927
+ return /*#__PURE__*/React__namespace.createElement("div", {
4928
+ className: "Dropdown-wrapper",
4929
+ style: dropdownStyle,
4930
+ "data-test": "DesignSystem-Dropdown--errorWrapper"
4931
+ }, /*#__PURE__*/React__namespace.createElement("div", {
4932
+ className: 'Option'
4933
+ }, /*#__PURE__*/React__namespace.createElement("div", {
4934
+ className: 'Option-subinfo'
4935
+ }, noResultMessage)));
4936
+ } else {
4937
+ return errorTemplate && errorTemplate({
4938
+ errorType: errorType
4939
+ });
4940
+ }
4999
4941
  }
5000
4942
 
5001
4943
  return /*#__PURE__*/React__namespace.createElement("div", {
@@ -5104,6 +5046,7 @@
5104
5046
  }
5105
5047
  };
5106
5048
 
5049
+ var enableSearch = (withSearch || props.async) && (!isDropdownListBlank || errorType === 'NO_RECORDS_FOUND');
5107
5050
  return /*#__PURE__*/React__namespace.createElement("div", __assign({}, baseProps, {
5108
5051
  className: dropdownClass,
5109
5052
  ref: triggerRef,
@@ -5117,7 +5060,7 @@
5117
5060
  position: alignmentMapping[align]
5118
5061
  }, popoverOptions, {
5119
5062
  "data-test": "DesignSystem-Dropdown--Popover"
5120
- }), (withSearch || props.async) && renderSearch(), renderDropdownSection(), showApplyButton && withCheckbox && renderApplyButton()));
5063
+ }), enableSearch && renderSearch(), renderDropdownSection(), showApplyButton && withCheckbox && renderApplyButton()));
5121
5064
  };
5122
5065
 
5123
5066
  DropdownList.displayName = 'DropdownList';
@@ -5195,7 +5138,8 @@
5195
5138
  searchTerm = _a.searchTerm,
5196
5139
  selectAll = _a.selectAll,
5197
5140
  tempSelected = _a.tempSelected,
5198
- previousSelected = _a.previousSelected;
5141
+ previousSelected = _a.previousSelected,
5142
+ errorType = _a.errorType;
5199
5143
  var updatedAsync = async === undefined ? _this.state.async : async;
5200
5144
  var _b = _this.props,
5201
5145
  fetchOptions = _b.fetchOptions,
@@ -5223,6 +5167,7 @@
5223
5167
  var disabledOptions = _this.getDisabledOptions(unSelectedGroup.slice(0, _this.staticLimit));
5224
5168
 
5225
5169
  _this.setState(__assign(__assign({}, _this.state), {
5170
+ errorType: fetchOptions && errorType !== 'NO_RECORDS_FOUND' ? 'FAILED_TO_FETCH' : errorType,
5226
5171
  scrollIndex: res.scrollToIndex || 0,
5227
5172
  optionsLength: optionsLength,
5228
5173
  loading: false,
@@ -5245,7 +5190,8 @@
5245
5190
  _this.setState(__assign(__assign({}, _this.state), {
5246
5191
  loading: true,
5247
5192
  searchInit: true,
5248
- searchTerm: search
5193
+ searchTerm: search,
5194
+ errorType: 'NO_RECORDS_FOUND'
5249
5195
  }));
5250
5196
  };
5251
5197
 
@@ -5493,6 +5439,15 @@
5493
5439
  _this.updateOptions(false);
5494
5440
  });
5495
5441
  });
5442
+
5443
+ _this.reload = function () {
5444
+ _this.setState({
5445
+ loading: true
5446
+ }, function () {
5447
+ _this.updateOptions(false);
5448
+ });
5449
+ };
5450
+
5496
5451
  _this.debounceClear = debounce(250, function () {
5497
5452
  return _this.updateOptions(false);
5498
5453
  });
@@ -5660,7 +5615,8 @@
5660
5615
  previousSelected: selectedGroup,
5661
5616
  selected: _showSelectedItems(async, '', withCheckbox) ? selected : [],
5662
5617
  triggerLabel: _this.updateTriggerLabel(selectedGroup, optionsLength),
5663
- selectAll: getSelectAll$1(selectedGroup, optionsLength, disabledOptions.length)
5618
+ selectAll: getSelectAll$1(selectedGroup, optionsLength, disabledOptions.length),
5619
+ errorType: 'DEFAULT'
5664
5620
  };
5665
5621
  return _this;
5666
5622
  }
@@ -5730,7 +5686,8 @@
5730
5686
  selectAll = _a.selectAll,
5731
5687
  triggerLabel = _a.triggerLabel,
5732
5688
  previousSelected = _a.previousSelected,
5733
- scrollIndex = _a.scrollIndex;
5689
+ scrollIndex = _a.scrollIndex,
5690
+ errorType = _a.errorType;
5734
5691
  var _b = this.props,
5735
5692
  _c = _b.withSelectAll,
5736
5693
  withSelectAll = _c === void 0 ? true : _c,
@@ -5771,7 +5728,9 @@
5771
5728
  onOptionSelect: this.onOptionSelect,
5772
5729
  onSelectAll: this.onSelectAll,
5773
5730
  customTrigger: triggerOptions.customTrigger,
5774
- scrollIndex: scrollIndex
5731
+ scrollIndex: scrollIndex,
5732
+ updateOptions: this.reload,
5733
+ errorType: errorType
5775
5734
  }, rest));
5776
5735
  };
5777
5736
 
@@ -5822,13 +5781,13 @@
5822
5781
  var _a;
5823
5782
 
5824
5783
  var className = props.className,
5825
- iconVariations = props.iconVariations,
5826
- rest = __rest(props, ["className", "iconVariations"]);
5784
+ iconType = props.iconType,
5785
+ rest = __rest(props, ["className", "iconType"]);
5827
5786
 
5828
5787
  var iconClass = classNames__default["default"]((_a = {}, _a['ActionButton'] = true, _a["" + className] = className, _a));
5829
5788
  return /*#__PURE__*/React__namespace.createElement(Icon, __assign({
5830
5789
  className: iconClass,
5831
- variations: iconVariations,
5790
+ type: iconType,
5832
5791
  "data-test": "DesignSystem-Input-ActionButton"
5833
5792
  }, rest));
5834
5793
  };
@@ -5872,8 +5831,8 @@
5872
5831
  autoFocus = props.autoFocus,
5873
5832
  disabled = props.disabled,
5874
5833
  readOnly = props.readOnly,
5875
- iconVariations = props.iconVariations,
5876
- rest = __rest(props, ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly", "iconVariations"]);
5834
+ iconType = props.iconType,
5835
+ rest = __rest(props, ["size", "type", "minWidth", "defaultValue", "name", "placeholder", "value", "icon", "inlineLabel", "required", "error", "info", "onChange", "onClick", "onClear", "onBlur", "onFocus", "onPaste", "actionIcon", "className", "autoFocus", "disabled", "readOnly", "iconType"]);
5877
5836
 
5878
5837
  var ref = React__namespace.useRef(null);
5879
5838
 
@@ -5930,7 +5889,7 @@
5930
5889
  }, /*#__PURE__*/React__namespace.createElement(Icon, {
5931
5890
  name: icon,
5932
5891
  size: sizeMapping$2[size],
5933
- variations: iconVariations
5892
+ type: iconType
5934
5893
  })), /*#__PURE__*/React__namespace.createElement("input", __assign({
5935
5894
  "data-test": "DesignSystem-Input"
5936
5895
  }, baseProps, rest, {
@@ -6022,8 +5981,8 @@
6022
5981
  _h = props.showActionButton,
6023
5982
  showActionButton = _h === void 0 ? true : _h,
6024
5983
  onKeyDown = props.onKeyDown,
6025
- iconVariations = props.iconVariations,
6026
- rest = __rest(props, ["size", "defaultValue", "name", "placeholder", "icon", "prefix", "suffix", "error", "min", "max", "onChange", "onClick", "onBlur", "onFocus", "className", "autoFocus", "disabled", "readOnly", "value", "showActionButton", "onKeyDown", "iconVariations"]);
5984
+ iconType = props.iconType,
5985
+ rest = __rest(props, ["size", "defaultValue", "name", "placeholder", "icon", "prefix", "suffix", "error", "min", "max", "onChange", "onClick", "onBlur", "onFocus", "className", "autoFocus", "disabled", "readOnly", "value", "showActionButton", "onKeyDown", "iconType"]);
6027
5986
 
6028
5987
  var ref = React__namespace.useRef(null);
6029
5988
  var isUncontrolled = valueProp === undefined;
@@ -6120,7 +6079,7 @@
6120
6079
  }, icon && /*#__PURE__*/React__namespace.createElement(Icon, {
6121
6080
  "data-test": "DesignSystem-MetricInput--icon",
6122
6081
  name: icon,
6123
- variations: iconVariations,
6082
+ type: iconType,
6124
6083
  size: sizeMapping$1[size],
6125
6084
  appearance: !value ? 'disabled' : 'subtle',
6126
6085
  className: iconClass
@@ -6862,7 +6821,7 @@
6862
6821
  var label = props.label,
6863
6822
  icon = props.icon,
6864
6823
  size = props.size,
6865
- iconVariations = props.iconVariations;
6824
+ iconType = props.iconType;
6866
6825
  return /*#__PURE__*/React__namespace.createElement("span", {
6867
6826
  "data-test": "DesignSystem-MetaList--Meta",
6868
6827
  className: 'Meta'
@@ -6871,7 +6830,7 @@
6871
6830
  name: icon,
6872
6831
  appearance: "subtle",
6873
6832
  className: 'Meta-icon',
6874
- variations: iconVariations,
6833
+ type: iconType,
6875
6834
  size: size === 'regular' ? 16 : 12
6876
6835
  }), /*#__PURE__*/React__namespace.createElement(Text, {
6877
6836
  size: size,
@@ -6906,7 +6865,7 @@
6906
6865
  var _a = item.label,
6907
6866
  label = _a === void 0 ? '' : _a,
6908
6867
  icon = item.icon,
6909
- iconVariations = item.iconVariations;
6868
+ iconType = item.iconType;
6910
6869
  var rightSeperator = ind !== list.length - 1;
6911
6870
  return /*#__PURE__*/React__namespace.createElement("span", {
6912
6871
  key: ind,
@@ -6915,7 +6874,7 @@
6915
6874
  size: size,
6916
6875
  label: label,
6917
6876
  icon: icon,
6918
- iconVariations: iconVariations
6877
+ iconType: iconType
6919
6878
  }), rightSeperator && /*#__PURE__*/React__namespace.createElement(Icon, {
6920
6879
  "data-test": "DesignSystem-MetaList--rightSeperator",
6921
6880
  name: "fiber_manual_record",
@@ -8965,7 +8924,7 @@
8965
8924
  "data-test": "DesignSystem-VerticalNav--Icon",
8966
8925
  className: expanded ? 'mr-4' : '',
8967
8926
  name: menu.icon,
8968
- variations: menu.iconVariations
8927
+ type: menu.iconType
8969
8928
  }), expanded && /*#__PURE__*/React__namespace.createElement(_MenuLabel, {
8970
8929
  label: menu.label,
8971
8930
  labelColor: itemColor
@@ -9163,7 +9122,7 @@
9163
9122
  return /*#__PURE__*/React__namespace.createElement(Icon, {
9164
9123
  className: "mr-3 HorizontalNav-animate",
9165
9124
  name: menu.icon,
9166
- variations: menu.iconVariations,
9125
+ type: menu.iconType,
9167
9126
  "data-test": "DesignSystem-HorizontalNav--Icon"
9168
9127
  });
9169
9128
  }
@@ -12104,7 +12063,7 @@
12104
12063
  count = _b.count,
12105
12064
  icon = _b.icon,
12106
12065
  disabled = _b.disabled,
12107
- iconVariations = _b.iconVariations;
12066
+ iconType = _b.iconType;
12108
12067
 
12109
12068
  if (count !== undefined) {
12110
12069
  return /*#__PURE__*/React__namespace.createElement(Pills, {
@@ -12122,7 +12081,7 @@
12122
12081
  "data-test": "DesignSystem-Tabs--Icon",
12123
12082
  className: "mr-4 " + iconClass,
12124
12083
  name: icon,
12125
- variations: iconVariations,
12084
+ type: iconType,
12126
12085
  appearance: iconAppearance
12127
12086
  });
12128
12087
  }
@@ -16306,8 +16265,8 @@
16306
16265
  subtle = props.subtle,
16307
16266
  size = props.size,
16308
16267
  iconAlign = props.iconAlign,
16309
- iconVariations = props.iconVariations,
16310
- rest = __rest(props, ["children", "type", "className", "disabled", "tabIndex", "icon", "subtle", "size", "iconAlign", "iconVariations"]);
16268
+ iconType = props.iconType,
16269
+ rest = __rest(props, ["children", "type", "className", "disabled", "tabIndex", "icon", "subtle", "size", "iconAlign", "iconType"]);
16311
16270
 
16312
16271
  var buttonClass = classNames__default["default"]((_a = {}, _a['LinkButton'] = true, _a["LinkButton--" + size] = size, _a['LinkButton--default'] = !subtle, _a['LinkButton--subtle'] = subtle, _a["LinkButton--iconAlign-" + iconAlign] = children && iconAlign, _a["" + className] = className, _a));
16313
16272
  var iconClass = classNames__default["default"]((_b = {}, _b['LinkButton-icon'] = true, _b["LinkButton-icon--" + iconAlign] = children && iconAlign, _b));
@@ -16323,7 +16282,7 @@
16323
16282
  }, /*#__PURE__*/React__namespace.createElement(Icon, {
16324
16283
  "data-test": "DesignSystem-LinkButton--Icon",
16325
16284
  name: icon,
16326
- variations: iconVariations,
16285
+ type: iconType,
16327
16286
  size: size && sizeMapping[size]
16328
16287
  })), children));
16329
16288
  });
@@ -16369,7 +16328,129 @@
16369
16328
  };
16370
16329
  ActionCard.displayName = 'ActionCard';
16371
16330
 
16372
- var version = "2.21.0";
16331
+ var selectedCardValues = new Map();
16332
+ function useMultiSelect() {
16333
+ var _a = React__namespace.useState([]),
16334
+ selectedCardIds = _a[0],
16335
+ setSelectedCardIds = _a[1];
16336
+
16337
+ var isCardSelected = function isCardSelected(id) {
16338
+ return selectedCardIds.includes(id);
16339
+ };
16340
+
16341
+ var updateCardSelection = function updateCardSelection(id, value) {
16342
+ var idList = __spreadArrays(selectedCardIds);
16343
+
16344
+ if (isCardSelected(id)) {
16345
+ idList = selectedCardIds.filter(function (cardKey) {
16346
+ return id !== cardKey;
16347
+ });
16348
+ selectedCardValues["delete"](id);
16349
+ } else {
16350
+ idList.push(id);
16351
+ selectedCardValues.set(id, value);
16352
+ }
16353
+
16354
+ setSelectedCardIds(idList);
16355
+ };
16356
+
16357
+ return {
16358
+ selectedCardIds: selectedCardIds,
16359
+ selectedCardValues: selectedCardValues,
16360
+ isCardSelected: isCardSelected,
16361
+ updateCardSelection: updateCardSelection
16362
+ };
16363
+ }
16364
+
16365
+ function useSingleSelect() {
16366
+ var _a = React__namespace.useState([]),
16367
+ selectedCardIds = _a[0],
16368
+ setSelectedCardIds = _a[1];
16369
+
16370
+ var _b = React__namespace.useState([]),
16371
+ selectedCardValues = _b[0],
16372
+ setSelectedCardValues = _b[1];
16373
+
16374
+ var isCardSelected = function isCardSelected(id) {
16375
+ return selectedCardIds.includes(id);
16376
+ };
16377
+
16378
+ var updateCardSelection = function updateCardSelection(id, value) {
16379
+ var idList = __spreadArrays(selectedCardIds);
16380
+
16381
+ var valueList = __spreadArrays(selectedCardValues);
16382
+
16383
+ if (selectedCardIds.includes(id)) {
16384
+ idList = [];
16385
+ valueList = [];
16386
+ } else {
16387
+ idList = [id];
16388
+ valueList = value ? [value] : [];
16389
+ }
16390
+
16391
+ setSelectedCardIds(idList);
16392
+ setSelectedCardValues(valueList);
16393
+ };
16394
+
16395
+ return {
16396
+ selectedCardIds: selectedCardIds,
16397
+ selectedCardValues: selectedCardValues,
16398
+ isCardSelected: isCardSelected,
16399
+ updateCardSelection: updateCardSelection
16400
+ };
16401
+ }
16402
+
16403
+ var SelectionCard = function SelectionCard(props) {
16404
+ var _a;
16405
+
16406
+ var children = props.children,
16407
+ onClick = props.onClick,
16408
+ disabled = props.disabled,
16409
+ id = props.id,
16410
+ cardValue = props.cardValue,
16411
+ overlayZIndex = props.overlayZIndex,
16412
+ selected = props.selected,
16413
+ className = props.className,
16414
+ rest = __rest(props, ["children", "onClick", "disabled", "id", "cardValue", "overlayZIndex", "selected", "className"]);
16415
+
16416
+ var classes = classNames__default["default"]((_a = {}, _a['Selection-card'] = true, _a['Selection-card--selected'] = selected, _a['Selection-card--disabled'] = disabled && !selected, _a['Selection-card--selected-disabled'] = disabled && selected, _a), className);
16417
+
16418
+ var onClickHandler = function onClickHandler(event) {
16419
+ onClick && onClick(event, id, cardValue);
16420
+ };
16421
+
16422
+ var onKeyDownHandler = function onKeyDownHandler(event) {
16423
+ if (event.key === 'Enter') {
16424
+ onClickHandler(event);
16425
+ }
16426
+ };
16427
+
16428
+ return /*#__PURE__*/React__namespace.createElement("div", __assign({
16429
+ role: "checkbox",
16430
+ "aria-checked": selected,
16431
+ tabIndex: 0,
16432
+ onKeyDown: onKeyDownHandler,
16433
+ onClick: function onClick(event) {
16434
+ return onClickHandler(event);
16435
+ },
16436
+ className: classes,
16437
+ "data-test": "DesignSystem-SelectionCard"
16438
+ }, rest), /*#__PURE__*/React__namespace.createElement("div", {
16439
+ className: "Selection-card-overlay",
16440
+ style: {
16441
+ zIndex: overlayZIndex
16442
+ },
16443
+ "data-test": "DesignSystem-SelectionCard-Overlay"
16444
+ }), children);
16445
+ };
16446
+ SelectionCard.defaultProps = {
16447
+ disabled: false,
16448
+ overlayZIndex: 2
16449
+ };
16450
+ SelectionCard.useMultiSelect = useMultiSelect;
16451
+ SelectionCard.useSingleSelect = useSingleSelect;
16452
+
16453
+ var version = "2.22.0";
16373
16454
 
16374
16455
  exports.ActionCard = ActionCard;
16375
16456
  exports.Avatar = Avatar;
@@ -16445,6 +16526,7 @@
16445
16526
  exports.Radio = Radio;
16446
16527
  exports.RangeSlider = RangeSlider;
16447
16528
  exports.Row = Row;
16529
+ exports.SelectionCard = SelectionCard;
16448
16530
  exports.Sidesheet = Sidesheet;
16449
16531
  exports.Slider = Slider;
16450
16532
  exports.Spinner = Spinner;