@qualtrics/ui-react 2.49.0 → 2.49.1-alpha.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 (37) hide show
  1. package/dist/__shared/cjs/{index-96632417.js → index-65fe6015.js} +71 -77
  2. package/dist/components/Button/Button2.js +9 -13
  3. package/dist/components/ColorPicker/Palette.js +33 -39
  4. package/dist/components/Combobox/Combobox.js +1 -1
  5. package/dist/components/ConfigPane/ConfigPane.js +5 -6
  6. package/dist/components/Dropdown/Dropdown.js +1 -1
  7. package/dist/components/Dropdown/DropdownButton.js +1 -1
  8. package/dist/components/NewMenu/BaseMenu.js +3 -3
  9. package/dist/components/Tabs/TabContextProvider.js +0 -2
  10. package/dist/components/Tooltip/Tooltip.js +2 -2
  11. package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +1 -1
  12. package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +1 -1
  13. package/dist/components/deprecated_Tabs/Tabs.js +2 -2
  14. package/dist/icons/index.d.ts +0 -2
  15. package/dist/index.d.ts +8 -4
  16. package/dist/index.js +1 -1
  17. package/dist/next/AdvancedTable/AdvancedTable.js +8 -6
  18. package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
  19. package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +6 -1
  20. package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +15 -6
  21. package/dist/next/AdvancedTable/AdvancedTableDnDContext.js +32 -0
  22. package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +9 -11
  23. package/dist/next/AdvancedTable/AdvancedTableRow.js +6 -1
  24. package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +12 -3
  25. package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +30 -138
  26. package/dist/next/AdvancedTable/useDragAndDropConfig.js +191 -0
  27. package/dist/next/Drawer/Drawer.js +1 -1
  28. package/dist/next/Menu/Hooks/usePaneSearch.js +12 -7
  29. package/dist/next/PhoneNumberInput/PhoneNumberInput.js +1 -0
  30. package/dist/next/index.d.ts +14 -12
  31. package/dist/next/index.js +263 -126
  32. package/dist/utils/Text/Text.js +1 -1
  33. package/dist/utils/Translation/containsComponentOrElement.js +6 -3
  34. package/dist/utils/Translation/useTranslation.js +5 -1
  35. package/icons/package.json +9 -9
  36. package/next/package.json +9 -9
  37. package/package.json +40 -40
@@ -261,13 +261,16 @@ function insertPlaceholders(message, placeholders) {
261
261
  }
262
262
 
263
263
  function isClassComponent(component) {
264
- return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
264
+ return typeof component === 'function' &&
265
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
266
+ // @ts-expect-error
267
+ !!component.prototype.isReactComponent;
265
268
  }
266
269
  function isFunctionComponent(component) {
267
- return !!(typeof component === 'function' && String(component).includes('return React.createElement'));
270
+ return typeof component === 'function' && String(component).includes('return React.createElement');
268
271
  }
269
272
  function isReactComponent(component) {
270
- return !!(isClassComponent(component) || isFunctionComponent(component));
273
+ return isClassComponent(component) || isFunctionComponent(component);
271
274
  }
272
275
 
273
276
  /**
@@ -305,7 +308,11 @@ const useTranslation = () => {
305
308
  const fallbackText = fallbackLocalizedText[key];
306
309
  if (!translatedText && !HAS_ERROR_BEEN_LOGGED_FOR_KEY.has(key)) {
307
310
  HAS_ERROR_BEEN_LOGGED_FOR_KEY.add(key);
308
- fallbackText ? console.warn(NO_LOCALIZED_TEXT_FOR_KEY(key)) : console.warn(NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY(key));
311
+ if (fallbackText) {
312
+ console.warn(NO_LOCALIZED_TEXT_FOR_KEY(key));
313
+ } else {
314
+ console.warn(NO_LOCALIZED_OR_FALLBACK_TEXT_FOR_KEY(key));
315
+ }
309
316
  }
310
317
  const text = translatedText || fallbackText;
311
318
  if (text && placeholders) {
@@ -1569,7 +1576,7 @@ const conditionalA11yHelpersWrapper = function (Children) {
1569
1576
  };
1570
1577
 
1571
1578
  const Tooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
1572
- var _children$ref;
1579
+ var _ref2;
1573
1580
  let {
1574
1581
  content,
1575
1582
  unstable_contentKey: contentKey,
@@ -1750,7 +1757,7 @@ const Tooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
1750
1757
  open: isInDOM,
1751
1758
  placement: placement,
1752
1759
  anchor: /*#__PURE__*/React__default["default"].cloneElement(children, {
1753
- ref: mergeRefs(anchorRef, (_children$ref = children.ref) !== null && _children$ref !== void 0 ? _children$ref : null)
1760
+ ref: mergeRefs(anchorRef, (_ref2 = children.ref) !== null && _ref2 !== void 0 ? _ref2 : null)
1754
1761
  }),
1755
1762
  popper: /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({}, rest, {
1756
1763
  id: flyoutContainerId,
@@ -1850,7 +1857,7 @@ const Text = /*#__PURE__*/React.forwardRef((_ref, ref) => {
1850
1857
  lightTheme: lightTheme,
1851
1858
  delayMs: delayMs,
1852
1859
  "aria-hidden": true
1853
- }, willClone ? ( /*#__PURE__*/React__default["default"].cloneElement(children, {
1860
+ }, willClone ? (/*#__PURE__*/React__default["default"].cloneElement(children, {
1854
1861
  className: classNames__default["default"](className, children.props.className),
1855
1862
  ref: mergeRefs(children.ref, ref, internalRef)
1856
1863
  })) : /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
@@ -2314,19 +2321,15 @@ const Button = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
2314
2321
  onClick === null || onClick === void 0 || onClick(e);
2315
2322
  };
2316
2323
  const keyDownHandler = disabled ? undefined : onKeyDown;
2317
- return (
2318
- /*#__PURE__*/
2319
- /* eslint-disable react/button-has-type */
2320
- React__default["default"].createElement("button", _extends__default["default"]({}, rest, {
2321
- "aria-disabled": ariaDisabled !== null && ariaDisabled !== void 0 ? ariaDisabled : disabled,
2322
- type: type,
2323
- className: classes,
2324
- ref: ref,
2325
- onClick: clickHandler,
2326
- onKeyDown: keyDownHandler
2327
- }), children)
2328
- /* eslint-disable react/button-has-type */
2329
- );
2324
+ return /*#__PURE__*/ /* eslint-disable react/button-has-type */React__default["default"].createElement("button", _extends__default["default"]({}, rest, {
2325
+ "aria-disabled": ariaDisabled !== null && ariaDisabled !== void 0 ? ariaDisabled : disabled,
2326
+ type: type,
2327
+ className: classes,
2328
+ ref: ref,
2329
+ onClick: clickHandler,
2330
+ onKeyDown: keyDownHandler
2331
+ }), children)
2332
+ /* eslint-disable react/button-has-type */;
2330
2333
  });
2331
2334
 
2332
2335
  var css_248z$B = "._tQiqT{display:inline-flex;align-items:stretch}._tQiqT._OY-cS{width:100%}._tQiqT ._WD-uo{margin:0;min-width:0}._tQiqT ._WD-uo:focus{z-index:20}._tQiqT ._WD-uo:hover{z-index:10}._tQiqT ._WD-uo._bNopj{border:none}._tQiqT ._WD-uo._OY-cS{display:inline-flex;width:auto;flex-grow:1}._tQiqT ._WD-uo:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._tQiqT ._WD-uo:first-child._bNopj{border-right:1px solid #fff}._tQiqT ._WD-uo:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._tQiqT ._WD-uo:not(:last-child):not(:first-child)._bNopj{border-left:1px solid #fff;border-right:1px solid #fff}._tQiqT ._WD-uo:last-child{margin:0;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._tQiqT ._WD-uo:last-child._bNopj{border-left:1px solid #fff}._tQiqT ._WD-uo:only-child{margin:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px}";
@@ -3518,45 +3521,39 @@ function Palette(_ref2) {
3518
3521
  break;
3519
3522
  }
3520
3523
  }
3521
- return (
3522
- /*#__PURE__*/
3523
- /* eslint-disable jsx-a11y/no-static-element-interactions */
3524
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
3525
- /* eslint-disable jsx-a11y/interactive-supports-focus */
3526
- React__default["default"].createElement("div", {
3527
- role: "grid",
3528
- "aria-label": paletteAriaLabel,
3529
- className: classNames__default["default"](styles$r.palette, {
3530
- [styles$r.removeUpperMargin]: removeUpperMargin
3531
- }),
3532
- onKeyDown: handleKeyDown,
3533
- "data-testid": getSubDataTestId(dataTestId, 'palette')
3534
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3535
- id: swatchDescriptionId,
3536
- className: styles$r.hidden
3537
- }, swatchAriaDesc), paletteRows.map((row, rowIndex) =>
3538
- /*#__PURE__*/
3539
- /* eslint-disable react/no-array-index-key */
3540
- React__default["default"].createElement("div", {
3541
- role: "row",
3542
- key: rowIndex
3543
- }, row.map((color, index) => {
3544
- const cellIndex = rowIndex * rowLength + index;
3545
- return /*#__PURE__*/React__default["default"].createElement(Swatch$1, {
3546
- key: color.hex,
3547
- color: color,
3548
- onColorSwatchClick: onColorSwatchClick,
3549
- focusedSwatchIndex: focusedSwatchIndex,
3550
- setFocusedSwatchIndex: setFocusedSwatchIndex,
3551
- cellIndex: cellIndex,
3552
- "aria-describedby": swatchDescriptionId,
3553
- ref: swatch => {
3554
- swatchRefs.current[cellIndex] = swatch;
3555
- },
3556
- dataTestId: dataTestId
3557
- });
3558
- }))))
3559
- );
3524
+ return /*#__PURE__*/ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable jsx-a11y/interactive-supports-focus */React__default["default"].createElement("div", {
3525
+ role: "grid",
3526
+ "aria-label": paletteAriaLabel,
3527
+ className: classNames__default["default"](styles$r.palette, {
3528
+ [styles$r.removeUpperMargin]: removeUpperMargin
3529
+ }),
3530
+ onKeyDown: handleKeyDown,
3531
+ "data-testid": getSubDataTestId(dataTestId, 'palette')
3532
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
3533
+ id: swatchDescriptionId,
3534
+ className: styles$r.hidden
3535
+ }, swatchAriaDesc), paletteRows.map((row, rowIndex) =>
3536
+ /*#__PURE__*/
3537
+ /* eslint-disable react/no-array-index-key */
3538
+ React__default["default"].createElement("div", {
3539
+ role: "row",
3540
+ key: rowIndex
3541
+ }, row.map((color, index) => {
3542
+ const cellIndex = rowIndex * rowLength + index;
3543
+ return /*#__PURE__*/React__default["default"].createElement(Swatch$1, {
3544
+ key: color.hex,
3545
+ color: color,
3546
+ onColorSwatchClick: onColorSwatchClick,
3547
+ focusedSwatchIndex: focusedSwatchIndex,
3548
+ setFocusedSwatchIndex: setFocusedSwatchIndex,
3549
+ cellIndex: cellIndex,
3550
+ "aria-describedby": swatchDescriptionId,
3551
+ ref: swatch => {
3552
+ swatchRefs.current[cellIndex] = swatch;
3553
+ },
3554
+ dataTestId: dataTestId
3555
+ });
3556
+ }))));
3560
3557
  }
3561
3558
 
3562
3559
  function RGBInput(_ref) {
@@ -4358,7 +4355,7 @@ const Combobox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
4358
4355
 
4359
4356
  // Gets the <ComboboxInput> and <ComboboxList> components from the children
4360
4357
  React__default["default"].Children.forEach(children, child => {
4361
- if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
4358
+ if (/*#__PURE__*/React__default["default"].isValidElement(child)) {
4362
4359
  if ((child === null || child === void 0 ? void 0 : child.type) === ComboboxInput) {
4363
4360
  comboboxInput = child;
4364
4361
  } else if ((child === null || child === void 0 ? void 0 : child.type) === ComboboxList) {
@@ -4880,15 +4877,15 @@ const ConfigPane = _ref2 => {
4880
4877
  const [isOpen, setIsOpen] = useControllableState(true, onIsOpenChange, externalIsOpen);
4881
4878
  const [isPinned, setIsPinned] = useControllableState(true, onIsPinnedChange, externalIsPinned);
4882
4879
  const panelId = useId(id);
4883
- useDidUpdate(() => {
4884
- setIsTransitioning(true);
4885
- }, [isOpen]);
4886
4880
  const {
4887
4881
  translate
4888
4882
  } = useTranslation();
4889
4883
  const pinPanelLabel = translate('configPane.pinPanel');
4890
4884
  const unpinPanelLabel = translate('configPane.unpinPanel');
4891
- const toggleOpen = () => setIsOpen(currentIsOpen => !currentIsOpen);
4885
+ const toggleOpen = () => {
4886
+ setIsTransitioning(true);
4887
+ setIsOpen(currentIsOpen => !currentIsOpen);
4888
+ };
4892
4889
  const [isContainerHoveredRef, isContainerHovered] = useIsHovered();
4893
4890
  return /*#__PURE__*/React__default["default"].createElement("div", {
4894
4891
  className: classNames__default["default"](styles$p.paneContainer, {
@@ -4935,7 +4932,7 @@ const ConfigPane = _ref2 => {
4935
4932
  "data-testid": getSubDataTestId(dataTestId, DATA_TESTID_SUFFIXES$2.BODY)
4936
4933
  }, children)))), !hideOpenButton &&
4937
4934
  /*#__PURE__*/
4938
- /*
4935
+ /*
4939
4936
  the following element is clickable but doesn't need an accessible role since it is
4940
4937
  purely a visual convenience for opening the panel. Keyboard users can use the
4941
4938
  expand/collapse button to achieve the same functionality
@@ -5082,7 +5079,7 @@ const DropdownButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
5082
5079
  onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
5083
5080
  onKeyDownButton(e);
5084
5081
  };
5085
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, children ? ( /*#__PURE__*/React__default["default"].cloneElement(children, {
5082
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, children ? (/*#__PURE__*/React__default["default"].cloneElement(children, {
5086
5083
  ref: mergeRefs(ref, children === null || children === void 0 ? void 0 : children.ref, buttonRef, dropdownButtonRef),
5087
5084
  disabled: disabled || dropdownAriaDisabled,
5088
5085
  'aria-disabled': dropdownAriaDisabled,
@@ -5716,7 +5713,7 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
5716
5713
  const [searchValue, setSearchValue] = useControllableState('', onSearchValueChange, externalSearchValue);
5717
5714
  const [searchHeight, setSearchHeight] = React.useState();
5718
5715
  React__default["default"].Children.forEach(children, child => {
5719
- if ( /*#__PURE__*/React__default["default"].isValidElement(child)) {
5716
+ if (/*#__PURE__*/React__default["default"].isValidElement(child)) {
5720
5717
  switch (child === null || child === void 0 ? void 0 : child.type) {
5721
5718
  case DropdownButton:
5722
5719
  dropdownButton = child;
@@ -7919,7 +7916,7 @@ const BaseMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
7919
7916
  const ariaLabelledBy = (_externalAnchor$props3 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props4 = externalAnchor.props) === null || _externalAnchor$props4 === void 0 ? void 0 : _externalAnchor$props4['aria-labelledby']) !== null && _externalAnchor$props3 !== void 0 ? _externalAnchor$props3 : externalAriaLabelledBy ? "".concat(externalAriaLabelledBy, " ").concat(anchorId) : undefined;
7920
7917
  const ariaLabel = (_externalAnchor$props5 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props6 = externalAnchor.props) === null || _externalAnchor$props6 === void 0 ? void 0 : _externalAnchor$props6['aria-label']) !== null && _externalAnchor$props5 !== void 0 ? _externalAnchor$props5 : externalAriaLabel && typeof menuAnchorLabel === 'string' ? "".concat(externalAriaLabel, " ").concat(menuAnchorLabel) : externalAriaLabel;
7921
7918
  const ariaExpanded = (externalAnchor === null || externalAnchor === void 0 ? void 0 : externalAnchor.props['aria-expanded']) !== undefined ? externalAnchor.props['aria-expanded'] : isOpen ? true : undefined;
7922
- const actualAnchor = externalAnchor !== undefined ? ( /*#__PURE__*/React__default["default"].cloneElement(externalAnchor, {
7919
+ const actualAnchor = externalAnchor !== undefined ? (/*#__PURE__*/React__default["default"].cloneElement(externalAnchor, {
7923
7920
  ref: mergeRefs(ref, anchorRef, externalAnchor.ref),
7924
7921
  tabIndex: (_externalAnchor$props7 = externalAnchor.props.tabIndex) !== null && _externalAnchor$props7 !== void 0 ? _externalAnchor$props7 : 0,
7925
7922
  role: (_externalAnchor$props8 = externalAnchor.props.role) !== null && _externalAnchor$props8 !== void 0 ? _externalAnchor$props8 : 'button',
@@ -7973,7 +7970,7 @@ const BaseMenu = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
7973
7970
  const popperIsOpen = !disabled && isOpen;
7974
7971
  if (!listItems.length) {
7975
7972
  noResults = true;
7976
- listItems.push( /*#__PURE__*/React__default["default"].createElement("div", {
7973
+ listItems.push(/*#__PURE__*/React__default["default"].createElement("div", {
7977
7974
  key: "no-list-items",
7978
7975
  className: classNames__default["default"](menuStyles.menuItem, menuStyles.noMenuItems),
7979
7976
  role: "menuitem"
@@ -8106,7 +8103,7 @@ function getDescendent(children, value) {
8106
8103
  }
8107
8104
  function getLabel(menuOptionNode) {
8108
8105
  var _menuOptionNode$props;
8109
- if ( /*#__PURE__*/React.isValidElement(menuOptionNode)) return getLabel(menuOptionNode === null || menuOptionNode === void 0 || (_menuOptionNode$props = menuOptionNode.props) === null || _menuOptionNode$props === void 0 ? void 0 : _menuOptionNode$props.children);
8106
+ if (/*#__PURE__*/React.isValidElement(menuOptionNode)) return getLabel(menuOptionNode === null || menuOptionNode === void 0 || (_menuOptionNode$props = menuOptionNode.props) === null || _menuOptionNode$props === void 0 ? void 0 : _menuOptionNode$props.children);
8110
8107
  return menuOptionNode;
8111
8108
  }
8112
8109
  function union(arr1, arr2) {
@@ -10895,8 +10892,6 @@ const {
10895
10892
  Provider: TabCtxProvider,
10896
10893
  useContext: useTabContext$1
10897
10894
  } = createContextUtilities();
10898
- // For now the provider props are identical to the contents of the context.
10899
-
10900
10895
  const TabContextProvider$1 = _ref => {
10901
10896
  let {
10902
10897
  activeTab,
@@ -12076,7 +12071,7 @@ const NumberStepperIncrement = /*#__PURE__*/React__default["default"].forwardRef
12076
12071
  } = useNumberStepperContext();
12077
12072
 
12078
12073
  // Indicates if the button is disabled
12079
- const isDisabled = inputValue >= max || isExternallyDisabled;
12074
+ const isDisabled = Number(inputValue) >= max || isExternallyDisabled;
12080
12075
 
12081
12076
  /**
12082
12077
  * Calls `onClick` if it is defined.
@@ -12135,7 +12130,7 @@ const NumberStepperDecrement = /*#__PURE__*/React__default["default"].forwardRef
12135
12130
  } = useNumberStepperContext();
12136
12131
 
12137
12132
  // Indicates if the button is disabled
12138
- const isDisabled = inputValue <= min || isExternallyDisabled;
12133
+ const isDisabled = Number(inputValue) <= min || isExternallyDisabled;
12139
12134
 
12140
12135
  /**
12141
12136
  * Calls `onClick` if it is defined.
@@ -12420,7 +12415,7 @@ const Tabs = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
12420
12415
  active,
12421
12416
  tabIndex: active ? tabIndexOfActiveTab : -1
12422
12417
  };
12423
- tabs.push( /*#__PURE__*/React__default["default"].createElement(TabContextProvider, {
12418
+ tabs.push(/*#__PURE__*/React__default["default"].createElement(TabContextProvider, {
12424
12419
  key: key,
12425
12420
  value: context
12426
12421
  }, /*#__PURE__*/React__default["default"].cloneElement(child, {
@@ -12456,7 +12451,7 @@ const Tabs = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
12456
12451
  const panelClasses = classNames__default["default"](styles$1.panel, {
12457
12452
  [styles$1.inactive]: !isActive
12458
12453
  });
12459
- panels.push( /*#__PURE__*/React__default["default"].createElement("div", {
12454
+ panels.push(/*#__PURE__*/React__default["default"].createElement("div", {
12460
12455
  key: key,
12461
12456
  role: "tabpanel",
12462
12457
  "aria-labelledby": (_child$props$id2 = child.props.id) !== null && _child$props$id2 !== void 0 ? _child$props$id2 : tabIdPrefix + key,
@@ -13107,7 +13102,6 @@ exports.Translate = Translate;
13107
13102
  exports.UIProvider = UIProvider;
13108
13103
  exports.VIRTUOSO_PROPS = VIRTUOSO_PROPS;
13109
13104
  exports.buttonStyles = buttonStyles;
13110
- exports.canUseDOM = canUseDOM;
13111
13105
  exports.concatIds = concatIds;
13112
13106
  exports.conditionalA11yHelpersWrapper = conditionalA11yHelpersWrapper;
13113
13107
  exports.createContextUtilities = createContextUtilities;
@@ -33,19 +33,15 @@ const Button = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
33
33
  onClick === null || onClick === void 0 || onClick(e);
34
34
  };
35
35
  const keyDownHandler = disabled ? undefined : onKeyDown;
36
- return (
37
- /*#__PURE__*/
38
- /* eslint-disable react/button-has-type */
39
- React__default.createElement("button", _extends({}, rest, {
40
- "aria-disabled": ariaDisabled !== null && ariaDisabled !== void 0 ? ariaDisabled : disabled,
41
- type: type,
42
- className: classes,
43
- ref: ref,
44
- onClick: clickHandler,
45
- onKeyDown: keyDownHandler
46
- }), children)
47
- /* eslint-disable react/button-has-type */
48
- );
36
+ return /*#__PURE__*/ /* eslint-disable react/button-has-type */React__default.createElement("button", _extends({}, rest, {
37
+ "aria-disabled": ariaDisabled !== null && ariaDisabled !== void 0 ? ariaDisabled : disabled,
38
+ type: type,
39
+ className: classes,
40
+ ref: ref,
41
+ onClick: clickHandler,
42
+ onKeyDown: keyDownHandler
43
+ }), children)
44
+ /* eslint-disable react/button-has-type */;
49
45
  });
50
46
 
51
47
  export { Button };
@@ -93,45 +93,39 @@ function Palette(_ref2) {
93
93
  break;
94
94
  }
95
95
  }
96
- return (
97
- /*#__PURE__*/
98
- /* eslint-disable jsx-a11y/no-static-element-interactions */
99
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
100
- /* eslint-disable jsx-a11y/interactive-supports-focus */
101
- React__default.createElement("div", {
102
- role: "grid",
103
- "aria-label": paletteAriaLabel,
104
- className: classNames(styles.palette, {
105
- [styles.removeUpperMargin]: removeUpperMargin
106
- }),
107
- onKeyDown: handleKeyDown,
108
- "data-testid": getSubDataTestId(dataTestId, 'palette')
109
- }, /*#__PURE__*/React__default.createElement("div", {
110
- id: swatchDescriptionId,
111
- className: styles.hidden
112
- }, swatchAriaDesc), paletteRows.map((row, rowIndex) =>
113
- /*#__PURE__*/
114
- /* eslint-disable react/no-array-index-key */
115
- React__default.createElement("div", {
116
- role: "row",
117
- key: rowIndex
118
- }, row.map((color, index) => {
119
- const cellIndex = rowIndex * rowLength + index;
120
- return /*#__PURE__*/React__default.createElement(Swatch, {
121
- key: color.hex,
122
- color: color,
123
- onColorSwatchClick: onColorSwatchClick,
124
- focusedSwatchIndex: focusedSwatchIndex,
125
- setFocusedSwatchIndex: setFocusedSwatchIndex,
126
- cellIndex: cellIndex,
127
- "aria-describedby": swatchDescriptionId,
128
- ref: swatch => {
129
- swatchRefs.current[cellIndex] = swatch;
130
- },
131
- dataTestId: dataTestId
132
- });
133
- }))))
134
- );
96
+ return /*#__PURE__*/ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */ /* eslint-disable jsx-a11y/interactive-supports-focus */React__default.createElement("div", {
97
+ role: "grid",
98
+ "aria-label": paletteAriaLabel,
99
+ className: classNames(styles.palette, {
100
+ [styles.removeUpperMargin]: removeUpperMargin
101
+ }),
102
+ onKeyDown: handleKeyDown,
103
+ "data-testid": getSubDataTestId(dataTestId, 'palette')
104
+ }, /*#__PURE__*/React__default.createElement("div", {
105
+ id: swatchDescriptionId,
106
+ className: styles.hidden
107
+ }, swatchAriaDesc), paletteRows.map((row, rowIndex) =>
108
+ /*#__PURE__*/
109
+ /* eslint-disable react/no-array-index-key */
110
+ React__default.createElement("div", {
111
+ role: "row",
112
+ key: rowIndex
113
+ }, row.map((color, index) => {
114
+ const cellIndex = rowIndex * rowLength + index;
115
+ return /*#__PURE__*/React__default.createElement(Swatch, {
116
+ key: color.hex,
117
+ color: color,
118
+ onColorSwatchClick: onColorSwatchClick,
119
+ focusedSwatchIndex: focusedSwatchIndex,
120
+ setFocusedSwatchIndex: setFocusedSwatchIndex,
121
+ cellIndex: cellIndex,
122
+ "aria-describedby": swatchDescriptionId,
123
+ ref: swatch => {
124
+ swatchRefs.current[cellIndex] = swatch;
125
+ },
126
+ dataTestId: dataTestId
127
+ });
128
+ }))));
135
129
  }
136
130
 
137
131
  export { Palette as default };
@@ -70,7 +70,7 @@ const Combobox = /*#__PURE__*/forwardRef((_ref, ref) => {
70
70
 
71
71
  // Gets the <ComboboxInput> and <ComboboxList> components from the children
72
72
  React__default.Children.forEach(children, child => {
73
- if ( /*#__PURE__*/React__default.isValidElement(child)) {
73
+ if (/*#__PURE__*/React__default.isValidElement(child)) {
74
74
  if ((child === null || child === void 0 ? void 0 : child.type) === ComboboxInput) {
75
75
  comboboxInput = child;
76
76
  } else if ((child === null || child === void 0 ? void 0 : child.type) === ComboboxList) {
@@ -14,7 +14,6 @@ import ChevronLeftIcon from '../../icons/components/ChevronLeftIcon.js';
14
14
  import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
15
15
  import useControllableState from '../../hooks/useControllableState/useControllableState.js';
16
16
  import useId from '../../hooks/useId/useId.js';
17
- import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
18
17
  import useIsHovered from '../../hooks/useIsHovered/useIsHovered.js';
19
18
  import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
20
19
  import IconButton from '../IconButton/IconButton.js';
@@ -94,15 +93,15 @@ const ConfigPane = _ref2 => {
94
93
  const [isOpen, setIsOpen] = useControllableState(true, onIsOpenChange, externalIsOpen);
95
94
  const [isPinned, setIsPinned] = useControllableState(true, onIsPinnedChange, externalIsPinned);
96
95
  const panelId = useId(id);
97
- useDidUpdate(() => {
98
- setIsTransitioning(true);
99
- }, [isOpen]);
100
96
  const {
101
97
  translate
102
98
  } = useTranslation();
103
99
  const pinPanelLabel = translate('configPane.pinPanel');
104
100
  const unpinPanelLabel = translate('configPane.unpinPanel');
105
- const toggleOpen = () => setIsOpen(currentIsOpen => !currentIsOpen);
101
+ const toggleOpen = () => {
102
+ setIsTransitioning(true);
103
+ setIsOpen(currentIsOpen => !currentIsOpen);
104
+ };
106
105
  const [isContainerHoveredRef, isContainerHovered] = useIsHovered();
107
106
  return /*#__PURE__*/React__default.createElement("div", {
108
107
  className: classNames(styles.paneContainer, {
@@ -149,7 +148,7 @@ const ConfigPane = _ref2 => {
149
148
  "data-testid": getSubDataTestId(dataTestId, DATA_TESTID_SUFFIXES.BODY)
150
149
  }, children)))), !hideOpenButton &&
151
150
  /*#__PURE__*/
152
- /*
151
+ /*
153
152
  the following element is clickable but doesn't need an accessible role since it is
154
153
  purely a visual convenience for opening the panel. Keyboard users can use the
155
154
  expand/collapse button to achieve the same functionality
@@ -69,7 +69,7 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
69
69
  const [searchValue, setSearchValue] = useControllableState('', onSearchValueChange, externalSearchValue);
70
70
  const [searchHeight, setSearchHeight] = useState();
71
71
  React__default.Children.forEach(children, child => {
72
- if ( /*#__PURE__*/React__default.isValidElement(child)) {
72
+ if (/*#__PURE__*/React__default.isValidElement(child)) {
73
73
  switch (child === null || child === void 0 ? void 0 : child.type) {
74
74
  case DropdownButton:
75
75
  dropdownButton = child;
@@ -113,7 +113,7 @@ const DropdownButton = /*#__PURE__*/forwardRef((_ref, ref) => {
113
113
  onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
114
114
  onKeyDownButton(e);
115
115
  };
116
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children ? ( /*#__PURE__*/React__default.cloneElement(children, {
116
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, children ? (/*#__PURE__*/React__default.cloneElement(children, {
117
117
  ref: mergeRefs(ref, children === null || children === void 0 ? void 0 : children.ref, buttonRef, dropdownButtonRef),
118
118
  disabled: disabled || dropdownAriaDisabled,
119
119
  'aria-disabled': dropdownAriaDisabled,
@@ -231,7 +231,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
231
231
  const ariaLabelledBy = (_externalAnchor$props3 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props4 = externalAnchor.props) === null || _externalAnchor$props4 === void 0 ? void 0 : _externalAnchor$props4['aria-labelledby']) !== null && _externalAnchor$props3 !== void 0 ? _externalAnchor$props3 : externalAriaLabelledBy ? "".concat(externalAriaLabelledBy, " ").concat(anchorId) : undefined;
232
232
  const ariaLabel = (_externalAnchor$props5 = externalAnchor === null || externalAnchor === void 0 || (_externalAnchor$props6 = externalAnchor.props) === null || _externalAnchor$props6 === void 0 ? void 0 : _externalAnchor$props6['aria-label']) !== null && _externalAnchor$props5 !== void 0 ? _externalAnchor$props5 : externalAriaLabel && typeof menuAnchorLabel === 'string' ? "".concat(externalAriaLabel, " ").concat(menuAnchorLabel) : externalAriaLabel;
233
233
  const ariaExpanded = (externalAnchor === null || externalAnchor === void 0 ? void 0 : externalAnchor.props['aria-expanded']) !== undefined ? externalAnchor.props['aria-expanded'] : isOpen ? true : undefined;
234
- const actualAnchor = externalAnchor !== undefined ? ( /*#__PURE__*/React__default.cloneElement(externalAnchor, {
234
+ const actualAnchor = externalAnchor !== undefined ? (/*#__PURE__*/React__default.cloneElement(externalAnchor, {
235
235
  ref: mergeRefs(ref, anchorRef, externalAnchor.ref),
236
236
  tabIndex: (_externalAnchor$props7 = externalAnchor.props.tabIndex) !== null && _externalAnchor$props7 !== void 0 ? _externalAnchor$props7 : 0,
237
237
  role: (_externalAnchor$props8 = externalAnchor.props.role) !== null && _externalAnchor$props8 !== void 0 ? _externalAnchor$props8 : 'button',
@@ -285,7 +285,7 @@ const BaseMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
285
285
  const popperIsOpen = !disabled && isOpen;
286
286
  if (!listItems.length) {
287
287
  noResults = true;
288
- listItems.push( /*#__PURE__*/React__default.createElement("div", {
288
+ listItems.push(/*#__PURE__*/React__default.createElement("div", {
289
289
  key: "no-list-items",
290
290
  className: classNames(menuStyles.menuItem, menuStyles.noMenuItems),
291
291
  role: "menuitem"
@@ -418,7 +418,7 @@ function getDescendent(children, value) {
418
418
  }
419
419
  function getLabel(menuOptionNode) {
420
420
  var _menuOptionNode$props;
421
- if ( /*#__PURE__*/isValidElement(menuOptionNode)) return getLabel(menuOptionNode === null || menuOptionNode === void 0 || (_menuOptionNode$props = menuOptionNode.props) === null || _menuOptionNode$props === void 0 ? void 0 : _menuOptionNode$props.children);
421
+ if (/*#__PURE__*/isValidElement(menuOptionNode)) return getLabel(menuOptionNode === null || menuOptionNode === void 0 || (_menuOptionNode$props = menuOptionNode.props) === null || _menuOptionNode$props === void 0 ? void 0 : _menuOptionNode$props.children);
422
422
  return menuOptionNode;
423
423
  }
424
424
  function union(arr1, arr2) {
@@ -6,8 +6,6 @@ const {
6
6
  Provider: TabCtxProvider,
7
7
  useContext: useTabContext
8
8
  } = createContextUtilities();
9
- // For now the provider props are identical to the contents of the context.
10
-
11
9
  const TabContextProvider = _ref => {
12
10
  let {
13
11
  activeTab,
@@ -14,7 +14,7 @@ import Popper from '../../utils/Popper/Popper.js';
14
14
  import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
15
15
 
16
16
  const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
17
- var _children$ref;
17
+ var _ref2;
18
18
  let {
19
19
  content,
20
20
  unstable_contentKey: contentKey,
@@ -195,7 +195,7 @@ const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
195
195
  open: isInDOM,
196
196
  placement: placement,
197
197
  anchor: /*#__PURE__*/React__default.cloneElement(children, {
198
- ref: mergeRefs(anchorRef, (_children$ref = children.ref) !== null && _children$ref !== void 0 ? _children$ref : null)
198
+ ref: mergeRefs(anchorRef, (_ref2 = children.ref) !== null && _ref2 !== void 0 ? _ref2 : null)
199
199
  }),
200
200
  popper: /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
201
201
  id: flyoutContainerId,
@@ -39,7 +39,7 @@ const NumberStepperDecrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
39
39
  } = useNumberStepperContext();
40
40
 
41
41
  // Indicates if the button is disabled
42
- const isDisabled = inputValue <= min || isExternallyDisabled;
42
+ const isDisabled = Number(inputValue) <= min || isExternallyDisabled;
43
43
 
44
44
  /**
45
45
  * Calls `onClick` if it is defined.
@@ -39,7 +39,7 @@ const NumberStepperIncrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
39
39
  } = useNumberStepperContext();
40
40
 
41
41
  // Indicates if the button is disabled
42
- const isDisabled = inputValue >= max || isExternallyDisabled;
42
+ const isDisabled = Number(inputValue) >= max || isExternallyDisabled;
43
43
 
44
44
  /**
45
45
  * Calls `onClick` if it is defined.
@@ -70,7 +70,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
70
70
  active,
71
71
  tabIndex: active ? tabIndexOfActiveTab : -1
72
72
  };
73
- tabs.push( /*#__PURE__*/React__default.createElement(TabContextProvider, {
73
+ tabs.push(/*#__PURE__*/React__default.createElement(TabContextProvider, {
74
74
  key: key,
75
75
  value: context
76
76
  }, /*#__PURE__*/React__default.cloneElement(child, {
@@ -106,7 +106,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
106
106
  const panelClasses = classNames(styles.panel, {
107
107
  [styles.inactive]: !isActive
108
108
  });
109
- panels.push( /*#__PURE__*/React__default.createElement("div", {
109
+ panels.push(/*#__PURE__*/React__default.createElement("div", {
110
110
  key: key,
111
111
  role: "tabpanel",
112
112
  "aria-labelledby": (_child$props$id2 = child.props.id) !== null && _child$props$id2 !== void 0 ? _child$props$id2 : tabIdPrefix + key,
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import { ForwardRefExoticComponent } from 'react';
4
2
  import { default as React_2 } from 'react';
5
3
  import { RefAttributes } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import { ButtonHTMLAttributes } from 'react';
4
2
  import type { ChangeEvent } from 'react';
5
3
  import type { ClipboardEvent as ClipboardEvent_2 } from 'react';
@@ -2318,7 +2316,7 @@ declare interface NamedIconsProps extends React_2.SVGProps<SVGSVGElement> {
2318
2316
  [prop: string]: any;
2319
2317
  }
2320
2318
 
2321
- declare type NavLink = RenderFunction<NavLinkV5Props> | RenderFunction<NavLinkV6Props>;
2319
+ declare type NavLink = RenderFunctionNavLinkV5 | RenderFunctionNavLinkV6;
2322
2320
 
2323
2321
  declare interface NavLinkV5Props extends BaseNavLinkProps {
2324
2322
  className: (isActive: boolean) => string;
@@ -2792,7 +2790,13 @@ export declare interface RangeSliderProps extends Omit<React_2.AllHTMLAttributes
2792
2790
  [prop: string]: any;
2793
2791
  }
2794
2792
 
2795
- declare type RenderFunction<T> = (props: T & RefAttributes<HTMLAnchorElement>) => ReactElement<any, any> | null;
2793
+ declare type RenderFunctionNavLinkV5 = (props: RenderFunctionPropsTypeV5) => ReactElement<any, any> | null;
2794
+
2795
+ declare type RenderFunctionNavLinkV6 = (props: RenderFunctionPropsTypeV6) => ReactElement<any, any> | null;
2796
+
2797
+ declare type RenderFunctionPropsTypeV5 = NavLinkV5Props & RefAttributes<HTMLAnchorElement>;
2798
+
2799
+ declare type RenderFunctionPropsTypeV6 = NavLinkV6Props & RefAttributes<HTMLAnchorElement>;
2796
2800
 
2797
2801
  export declare const SearchInput: React_2.ForwardRefExoticComponent<SearchInputProps & React_2.RefAttributes<HTMLInputElement>>;
2798
2802
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./__shared/cjs/index-96632417.js');
5
+ var index = require('./__shared/cjs/index-65fe6015.js');
6
6
  require('react');
7
7
  require('classnames');
8
8
  require('./__shared/cjs/index-43c0270d.js');