@lumx/react 3.18.1-alpha.0 → 3.18.2-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 (39) hide show
  1. package/index.d.ts +13 -8
  2. package/index.js +217 -152
  3. package/index.js.map +1 -1
  4. package/package.json +3 -3
  5. package/src/components/autocomplete/Autocomplete.tsx +5 -4
  6. package/src/components/autocomplete/AutocompleteMultiple.tsx +5 -3
  7. package/src/components/button/Button.stories.tsx +1 -0
  8. package/src/components/button/Button.test.tsx +41 -2
  9. package/src/components/button/ButtonRoot.tsx +10 -11
  10. package/src/components/checkbox/Checkbox.stories.tsx +13 -2
  11. package/src/components/checkbox/Checkbox.test.tsx +29 -0
  12. package/src/components/checkbox/Checkbox.tsx +8 -7
  13. package/src/components/chip/Chip.stories.tsx +17 -0
  14. package/src/components/chip/Chip.test.tsx +44 -0
  15. package/src/components/chip/Chip.tsx +10 -9
  16. package/src/components/date-picker/DatePickerField.stories.tsx +18 -0
  17. package/src/components/date-picker/DatePickerField.tsx +4 -4
  18. package/src/components/link/Link.stories.tsx +4 -1
  19. package/src/components/link/Link.test.tsx +45 -6
  20. package/src/components/link/Link.tsx +7 -6
  21. package/src/components/list/ListItem.stories.tsx +14 -48
  22. package/src/components/list/ListItem.test.tsx +78 -7
  23. package/src/components/list/ListItem.tsx +11 -9
  24. package/src/components/progress-tracker/ProgressTrackerStep.tsx +7 -7
  25. package/src/components/radio-button/RadioButton.stories.tsx +32 -0
  26. package/src/components/radio-button/RadioButton.test.tsx +30 -0
  27. package/src/components/radio-button/RadioButton.tsx +8 -7
  28. package/src/components/slider/Slider.tsx +6 -7
  29. package/src/components/switch/Switch.stories.tsx +11 -1
  30. package/src/components/switch/Switch.test.tsx +30 -0
  31. package/src/components/switch/Switch.tsx +8 -7
  32. package/src/components/table/TableRow.tsx +8 -6
  33. package/src/components/tabs/Tab.tsx +12 -9
  34. package/src/components/text-field/TextField.stories.tsx +22 -0
  35. package/src/components/text-field/TextField.test.tsx +56 -0
  36. package/src/components/text-field/TextField.tsx +12 -10
  37. package/src/utils/disabled/index.ts +1 -0
  38. package/src/utils/disabled/useDisableStateProps.tsx +34 -0
  39. package/src/utils/type/HasAriaDisabled.ts +6 -0
package/index.js CHANGED
@@ -360,7 +360,7 @@ const mdiRadioboxBlank = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0
360
360
 
361
361
  const mdiRadioboxMarked = 'M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 5a5 5 0 0 0-5 5 5 5 0 0 0 5 5 5 5 0 0 0 5-5 5 5 0 0 0-5-5';
362
362
 
363
- const _excluded$1t = ["prefix"];
363
+ const _excluded$1u = ["prefix"];
364
364
 
365
365
  /**
366
366
  * Enhance isEmpty method to also works with numbers.
@@ -417,7 +417,7 @@ function handleBasicClasses(_ref) {
417
417
  let {
418
418
  prefix
419
419
  } = _ref,
420
- props = _objectWithoutProperties(_ref, _excluded$1t);
420
+ props = _objectWithoutProperties(_ref, _excluded$1u);
421
421
  const otherClasses = {};
422
422
  if (!isEmpty(props)) {
423
423
  Object.keys(props).forEach(prop => {
@@ -651,7 +651,7 @@ function useId() {
651
651
  */
652
652
  const forwardRef = React__default.forwardRef;
653
653
 
654
- const _excluded$1s = ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"],
654
+ const _excluded$1t = ["id", "title", "className", "cancelProps", "confirmProps", "kind", "size", "dialogProps", "children"],
655
655
  _excluded2$3 = ["label", "onClick"],
656
656
  _excluded3 = ["label", "onClick"];
657
657
  /**
@@ -715,7 +715,7 @@ const AlertDialog = forwardRef((props, ref) => {
715
715
  dialogProps,
716
716
  children
717
717
  } = props,
718
- forwardedProps = _objectWithoutProperties(props, _excluded$1s);
718
+ forwardedProps = _objectWithoutProperties(props, _excluded$1t);
719
719
  const cancelButtonRef = React__default.useRef(null);
720
720
  const confirmationButtonRef = React__default.useRef(null);
721
721
  const {
@@ -842,7 +842,39 @@ function useTheme() {
842
842
  return React__default.useContext(ThemeContext);
843
843
  }
844
844
 
845
- const _excluded$1r = ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "disabled", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isDisabled", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps", "focusAnchorOnClose"];
845
+ const _excluded$1s = ["disabled", "isDisabled", "aria-disabled", "onClick", "onChange"];
846
+ /**
847
+ * Resolve disabled state from props.
848
+ * (handles `disabled`, `isDisabled` and `aria-disabled`)
849
+ *
850
+ * @params component props
851
+ */
852
+ function useDisableStateProps(props) {
853
+ const {
854
+ disabled,
855
+ isDisabled = disabled,
856
+ 'aria-disabled': ariaDisabled,
857
+ onClick,
858
+ onChange
859
+ } = props,
860
+ otherProps = _objectWithoutProperties(props, _excluded$1s);
861
+ const disabledStateProps = {
862
+ disabled: isDisabled,
863
+ 'aria-disabled': ariaDisabled === true || ariaDisabled === 'true'
864
+ };
865
+ const isAnyDisabled = disabledStateProps['aria-disabled'] || disabledStateProps.disabled;
866
+ if (!isAnyDisabled) {
867
+ otherProps.onClick = onClick;
868
+ otherProps.onChange = onChange;
869
+ }
870
+ return {
871
+ disabledStateProps,
872
+ otherProps: otherProps,
873
+ isAnyDisabled
874
+ };
875
+ }
876
+
877
+ const _excluded$1r = ["anchorToInput", "children", "chips", "className", "closeOnClick", "closeOnClickAway", "closeOnEscape", "error", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClose", "onFocus", "onInfiniteScroll", "placeholder", "placement", "shouldFocusOnClose", "theme", "value", "textFieldProps", "focusAnchorOnClose"];
846
878
 
847
879
  /**
848
880
  * Defines the props of the component.
@@ -878,6 +910,10 @@ const DEFAULT_PROPS$12 = {
878
910
  */
879
911
  const Autocomplete = forwardRef((props, ref) => {
880
912
  const defaultTheme = useTheme();
913
+ const {
914
+ disabledStateProps,
915
+ otherProps
916
+ } = useDisableStateProps(props);
881
917
  const {
882
918
  anchorToInput = DEFAULT_PROPS$12.anchorToInput,
883
919
  children,
@@ -886,7 +922,6 @@ const Autocomplete = forwardRef((props, ref) => {
886
922
  closeOnClick = DEFAULT_PROPS$12.closeOnClick,
887
923
  closeOnClickAway = DEFAULT_PROPS$12.closeOnClickAway,
888
924
  closeOnEscape = DEFAULT_PROPS$12.closeOnEscape,
889
- disabled,
890
925
  error,
891
926
  fitToAnchorWidth,
892
927
  hasError,
@@ -894,7 +929,6 @@ const Autocomplete = forwardRef((props, ref) => {
894
929
  icon,
895
930
  inputRef,
896
931
  clearButtonProps,
897
- isDisabled = disabled,
898
932
  isRequired,
899
933
  isOpen,
900
934
  isValid,
@@ -913,8 +947,8 @@ const Autocomplete = forwardRef((props, ref) => {
913
947
  value,
914
948
  textFieldProps = {},
915
949
  focusAnchorOnClose
916
- } = props,
917
- forwardedProps = _objectWithoutProperties(props, _excluded$1r);
950
+ } = otherProps,
951
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1r);
918
952
  const inputAnchorRef = useRef(null);
919
953
  const textFieldRef = useRef(null);
920
954
  useFocus(inputAnchorRef.current, !isOpen && shouldFocusOnClose);
@@ -929,8 +963,8 @@ const Autocomplete = forwardRef((props, ref) => {
929
963
  helper: helper,
930
964
  icon: icon,
931
965
  inputRef: mergeRefs(inputAnchorRef, inputRef),
932
- clearButtonProps: clearButtonProps,
933
- isDisabled: isDisabled,
966
+ clearButtonProps: clearButtonProps
967
+ }, disabledStateProps, {
934
968
  isRequired: isRequired,
935
969
  isValid: isValid,
936
970
  label: label,
@@ -962,7 +996,7 @@ Autocomplete.displayName = COMPONENT_NAME$1m;
962
996
  Autocomplete.className = CLASSNAME$1j;
963
997
  Autocomplete.defaultProps = DEFAULT_PROPS$12;
964
998
 
965
- const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isDisabled", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClear", "onClose", "onFocus", "onInfiniteScroll", "onKeyDown", "placeholder", "placement", "selectedChipRender", "shouldFocusOnClose", "theme", "type", "value", "values"];
999
+ const _excluded$1q = ["anchorToInput", "children", "chipsAlignment", "className", "closeOnClickAway", "closeOnEscape", "fitToAnchorWidth", "hasError", "helper", "icon", "inputRef", "clearButtonProps", "isRequired", "isOpen", "isValid", "label", "name", "offset", "onBlur", "onChange", "onClear", "onClose", "onFocus", "onInfiniteScroll", "onKeyDown", "placeholder", "placement", "selectedChipRender", "shouldFocusOnClose", "theme", "type", "value", "values"];
966
1000
 
967
1001
  /**
968
1002
  * Defines the props of the component.
@@ -1010,6 +1044,10 @@ const DEFAULT_PROPS$11 = {
1010
1044
  */
1011
1045
  const AutocompleteMultiple = forwardRef((props, ref) => {
1012
1046
  const defaultTheme = useTheme();
1047
+ const {
1048
+ disabledStateProps,
1049
+ otherProps
1050
+ } = useDisableStateProps(props);
1013
1051
  const {
1014
1052
  anchorToInput,
1015
1053
  children,
@@ -1025,7 +1063,6 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
1025
1063
  icon,
1026
1064
  inputRef,
1027
1065
  clearButtonProps,
1028
- isDisabled,
1029
1066
  isRequired,
1030
1067
  isOpen,
1031
1068
  isValid,
@@ -1047,8 +1084,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
1047
1084
  type,
1048
1085
  value,
1049
1086
  values = DEFAULT_PROPS$11.values
1050
- } = props,
1051
- forwardedProps = _objectWithoutProperties(props, _excluded$1q);
1087
+ } = otherProps,
1088
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1q);
1052
1089
  return /*#__PURE__*/React__default.createElement(Autocomplete, _extends({
1053
1090
  ref: ref
1054
1091
  }, forwardedProps, {
@@ -1065,8 +1102,8 @@ const AutocompleteMultiple = forwardRef((props, ref) => {
1065
1102
  helper: helper,
1066
1103
  icon: icon,
1067
1104
  inputRef: inputRef,
1068
- chips: values && values.map((chip, index) => selectedChipRender === null || selectedChipRender === void 0 ? void 0 : selectedChipRender(chip, index, onClear)),
1069
- isDisabled: isDisabled,
1105
+ chips: values && values.map((chip, index) => selectedChipRender === null || selectedChipRender === void 0 ? void 0 : selectedChipRender(chip, index, onClear))
1106
+ }, disabledStateProps, {
1070
1107
  isRequired: isRequired,
1071
1108
  clearButtonProps: clearButtonProps,
1072
1109
  isValid: isValid,
@@ -1307,7 +1344,7 @@ const renderLink = (_ref, ...children) => {
1307
1344
  return /*#__PURE__*/React__default.createElement(linkAs || 'a', forwardedProps, ...children);
1308
1345
  };
1309
1346
 
1310
- const _excluded$1l = ["aria-label", "children", "className", "color", "disabled", "emphasis", "hasBackground", "href", "isDisabled", "aria-disabled", "isSelected", "isActive", "isFocused", "isHovered", "linkAs", "name", "size", "target", "theme", "variant", "type", "fullWidth"];
1347
+ const _excluded$1l = ["aria-label", "children", "className", "color", "emphasis", "hasBackground", "href", "isSelected", "isActive", "isFocused", "isHovered", "linkAs", "name", "size", "target", "theme", "variant", "type", "fullWidth"];
1311
1348
 
1312
1349
  /**
1313
1350
  * Button size definition.
@@ -1356,17 +1393,19 @@ const renderButtonWrapper = props => {
1356
1393
  * @return React element.
1357
1394
  */
1358
1395
  const ButtonRoot = forwardRef((props, ref) => {
1396
+ const {
1397
+ isAnyDisabled,
1398
+ disabledStateProps,
1399
+ otherProps
1400
+ } = useDisableStateProps(props);
1359
1401
  const {
1360
1402
  'aria-label': ariaLabel,
1361
1403
  children,
1362
1404
  className,
1363
1405
  color,
1364
- disabled,
1365
1406
  emphasis,
1366
1407
  hasBackground,
1367
1408
  href,
1368
- isDisabled = disabled,
1369
- 'aria-disabled': ariaDisabled = isDisabled,
1370
1409
  isSelected,
1371
1410
  isActive,
1372
1411
  isFocused,
@@ -1379,8 +1418,8 @@ const ButtonRoot = forwardRef((props, ref) => {
1379
1418
  variant,
1380
1419
  type = 'button',
1381
1420
  fullWidth
1382
- } = props,
1383
- forwardedProps = _objectWithoutProperties(props, _excluded$1l);
1421
+ } = otherProps,
1422
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1l);
1384
1423
  const adaptedColor = color || emphasis !== Emphasis.high && theme === Theme.dark && ColorPalette.light || emphasis === Emphasis.high && ColorPalette.primary || ColorPalette.dark;
1385
1424
  if (hasBackground) {
1386
1425
  return renderButtonWrapper(_objectSpread2(_objectSpread2({}, props), {}, {
@@ -1393,7 +1432,7 @@ const ButtonRoot = forwardRef((props, ref) => {
1393
1432
  color: adaptedColor,
1394
1433
  emphasis,
1395
1434
  isSelected,
1396
- isDisabled,
1435
+ isDisabled: isAnyDisabled,
1397
1436
  isActive,
1398
1437
  isFocused,
1399
1438
  isHovered,
@@ -1410,7 +1449,7 @@ const ButtonRoot = forwardRef((props, ref) => {
1410
1449
  *
1411
1450
  * However, in any case, if the component is disabled, we returned a <button> since disabled is not compatible with <a>.
1412
1451
  */
1413
- if ((linkAs || !isEmpty(props.href)) && !isDisabled) {
1452
+ if ((linkAs || !isEmpty(props.href)) && !isAnyDisabled) {
1414
1453
  return renderLink(_objectSpread2(_objectSpread2({
1415
1454
  linkAs
1416
1455
  }, forwardedProps), {}, {
@@ -1421,11 +1460,7 @@ const ButtonRoot = forwardRef((props, ref) => {
1421
1460
  ref: ref
1422
1461
  }), children);
1423
1462
  }
1424
- return /*#__PURE__*/React__default.createElement("button", _extends({}, forwardedProps, ariaDisabled ? {
1425
- onClick: undefined
1426
- } : undefined, {
1427
- disabled: isDisabled,
1428
- "aria-disabled": ariaDisabled,
1463
+ return /*#__PURE__*/React__default.createElement("button", _extends({}, forwardedProps, disabledStateProps, {
1429
1464
  "aria-label": ariaLabel,
1430
1465
  ref: ref,
1431
1466
  className: buttonClassName,
@@ -1633,8 +1668,7 @@ ButtonGroup.displayName = COMPONENT_NAME$1e;
1633
1668
  ButtonGroup.className = CLASSNAME$1c;
1634
1669
  ButtonGroup.defaultProps = DEFAULT_PROPS$Y;
1635
1670
 
1636
- const _excluded$1h = ["checked", "className", "disabled", "helper", "id", "inputRef", "isChecked", "isDisabled", "label", "name", "onChange", "theme", "value", "inputProps"];
1637
-
1671
+ const _excluded$1h = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
1638
1672
  /**
1639
1673
  * Intermediate state of checkbox.
1640
1674
  */
@@ -1667,24 +1701,27 @@ const DEFAULT_PROPS$X = {};
1667
1701
  * @return React element.
1668
1702
  */
1669
1703
  const Checkbox = forwardRef((props, ref) => {
1704
+ const {
1705
+ isAnyDisabled,
1706
+ disabledStateProps,
1707
+ otherProps
1708
+ } = useDisableStateProps(props);
1670
1709
  const defaultTheme = useTheme() || Theme.light;
1671
1710
  const {
1672
1711
  checked,
1673
1712
  className,
1674
- disabled,
1675
1713
  helper,
1676
1714
  id,
1677
1715
  inputRef,
1678
1716
  isChecked = checked,
1679
- isDisabled = disabled,
1680
1717
  label,
1681
1718
  name,
1682
1719
  onChange,
1683
1720
  theme = defaultTheme,
1684
1721
  value,
1685
1722
  inputProps = {}
1686
- } = props,
1687
- forwardedProps = _objectWithoutProperties(props, _excluded$1h);
1723
+ } = otherProps,
1724
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1h);
1688
1725
  const localInputRef = React__default.useRef(null);
1689
1726
  const generatedInputId = useId();
1690
1727
  const inputId = id || generatedInputId;
@@ -1704,7 +1741,7 @@ const Checkbox = forwardRef((props, ref) => {
1704
1741
  className: classNames(className, handleBasicClasses({
1705
1742
  // Whether state is intermediate class name will "-checked"
1706
1743
  isChecked: intermediateState ? true : isChecked,
1707
- isDisabled,
1744
+ isDisabled: isAnyDisabled,
1708
1745
  isUnchecked: !isChecked,
1709
1746
  prefix: CLASSNAME$1b,
1710
1747
  theme
@@ -1715,15 +1752,15 @@ const Checkbox = forwardRef((props, ref) => {
1715
1752
  ref: useMergeRefs(inputRef, localInputRef),
1716
1753
  type: "checkbox",
1717
1754
  id: inputId,
1718
- className: `${CLASSNAME$1b}__input-native`,
1719
- disabled: isDisabled,
1720
- tabIndex: isDisabled ? -1 : 0,
1755
+ className: `${CLASSNAME$1b}__input-native`
1756
+ }, disabledStateProps, {
1721
1757
  name: name,
1722
1758
  value: value,
1723
1759
  checked: isChecked,
1724
1760
  onChange: handleChange,
1725
1761
  "aria-describedby": helper ? `${inputId}-helper` : undefined,
1726
- "aria-checked": intermediateState ? 'mixed' : Boolean(isChecked)
1762
+ "aria-checked": intermediateState ? 'mixed' : Boolean(isChecked),
1763
+ readOnly: inputProps.readOnly || disabledStateProps['aria-disabled']
1727
1764
  }, inputProps)), /*#__PURE__*/React__default.createElement("div", {
1728
1765
  className: `${CLASSNAME$1b}__input-placeholder`
1729
1766
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -1764,7 +1801,7 @@ function useStopPropagation(handler) {
1764
1801
  }, [handler]);
1765
1802
  }
1766
1803
 
1767
- const _excluded$1g = ["after", "before", "children", "className", "color", "disabled", "isClickable", "isDisabled", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
1804
+ const _excluded$1g = ["after", "before", "children", "className", "color", "isClickable", "isHighlighted", "isSelected", "onAfterClick", "onBeforeClick", "onClick", "size", "theme", "href", "onKeyDown"];
1768
1805
 
1769
1806
  /**
1770
1807
  * Chip sizes.
@@ -1800,15 +1837,18 @@ const DEFAULT_PROPS$W = {
1800
1837
  */
1801
1838
  const Chip = forwardRef((props, ref) => {
1802
1839
  const defaultTheme = useTheme() || Theme.light;
1840
+ const {
1841
+ isAnyDisabled,
1842
+ disabledStateProps,
1843
+ otherProps
1844
+ } = useDisableStateProps(props);
1803
1845
  const {
1804
1846
  after,
1805
1847
  before,
1806
1848
  children,
1807
1849
  className,
1808
1850
  color,
1809
- disabled,
1810
1851
  isClickable: propIsClickable,
1811
- isDisabled = disabled,
1812
1852
  isHighlighted,
1813
1853
  isSelected,
1814
1854
  onAfterClick,
@@ -1818,11 +1858,11 @@ const Chip = forwardRef((props, ref) => {
1818
1858
  theme = defaultTheme,
1819
1859
  href,
1820
1860
  onKeyDown
1821
- } = props,
1822
- forwardedProps = _objectWithoutProperties(props, _excluded$1g);
1861
+ } = otherProps,
1862
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1g);
1823
1863
  const hasAfterClick = isFunction(onAfterClick);
1824
1864
  const hasBeforeClick = isFunction(onBeforeClick);
1825
- const hasOnClick = isFunction(onClick);
1865
+ const hasOnClick = isFunction(props.onClick);
1826
1866
  const isButton = hasOnClick && !href;
1827
1867
  const isClickable = Boolean(hasOnClick) || Boolean(href) || propIsClickable;
1828
1868
 
@@ -1841,14 +1881,14 @@ const Chip = forwardRef((props, ref) => {
1841
1881
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
1842
1882
  React__default.createElement("a", _extends({
1843
1883
  role: isButton ? 'button' : undefined,
1844
- tabIndex: isClickable ? 0 : undefined
1884
+ tabIndex: isClickable && !disabledStateProps.disabled ? 0 : undefined
1845
1885
  }, forwardedProps, {
1846
- href: href,
1886
+ href: !disabledStateProps.disabled ? href : undefined,
1847
1887
  ref: ref,
1848
1888
  className: classNames(className, handleBasicClasses({
1849
1889
  clickable: isClickable,
1850
1890
  color: chipColor,
1851
- isDisabled,
1891
+ isDisabled: isAnyDisabled,
1852
1892
  hasAfter: Boolean(after),
1853
1893
  hasBefore: Boolean(before),
1854
1894
  highlighted: Boolean(isHighlighted),
@@ -1857,7 +1897,7 @@ const Chip = forwardRef((props, ref) => {
1857
1897
  size,
1858
1898
  unselected: Boolean(!isSelected)
1859
1899
  })),
1860
- "aria-disabled": isClickable && isDisabled || undefined,
1900
+ "aria-disabled": isClickable && isAnyDisabled || undefined,
1861
1901
  onClick: hasOnClick ? onClick : undefined,
1862
1902
  onKeyDown: handleKeyDown
1863
1903
  }), before &&
@@ -2582,7 +2622,7 @@ const useBooleanState = defaultValue => {
2582
2622
  return [booleanValue, setToFalse, setToTrue, toggleBoolean];
2583
2623
  };
2584
2624
 
2585
- const _excluded$1c = ["defaultMonth", "disabled", "isDisabled", "locale", "maxDate", "minDate", "name", "nextButtonProps", "onChange", "previousButtonProps", "value"];
2625
+ const _excluded$1c = ["defaultMonth", "locale", "maxDate", "minDate", "name", "nextButtonProps", "onChange", "previousButtonProps", "value"];
2586
2626
 
2587
2627
  /**
2588
2628
  * Defines the props of the component.
@@ -2601,10 +2641,12 @@ const COMPONENT_NAME$17 = 'DatePickerField';
2601
2641
  * @return React element.
2602
2642
  */
2603
2643
  const DatePickerField = forwardRef((props, ref) => {
2644
+ const {
2645
+ disabledStateProps,
2646
+ otherProps
2647
+ } = useDisableStateProps(props);
2604
2648
  const {
2605
2649
  defaultMonth,
2606
- disabled,
2607
- isDisabled = disabled,
2608
2650
  locale = getCurrentLocale(),
2609
2651
  maxDate,
2610
2652
  minDate,
@@ -2613,8 +2655,8 @@ const DatePickerField = forwardRef((props, ref) => {
2613
2655
  onChange,
2614
2656
  previousButtonProps,
2615
2657
  value
2616
- } = props,
2617
- forwardedProps = _objectWithoutProperties(props, _excluded$1c);
2658
+ } = otherProps,
2659
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$1c);
2618
2660
  const anchorRef = useRef(null);
2619
2661
  const [isOpen, close,, toggleOpen] = useBooleanState(false);
2620
2662
  const handleKeyboardNav = useCallback(evt => {
@@ -2648,8 +2690,8 @@ const DatePickerField = forwardRef((props, ref) => {
2648
2690
  value: textFieldValue,
2649
2691
  onClick: toggleOpen,
2650
2692
  onChange: onTextFieldChange,
2651
- onKeyPress: handleKeyboardNav,
2652
- isDisabled: isDisabled,
2693
+ onKeyPress: handleKeyboardNav
2694
+ }, disabledStateProps, {
2653
2695
  readOnly: true,
2654
2696
  "aria-haspopup": "dialog"
2655
2697
  })), isOpen ? /*#__PURE__*/React__default.createElement(PopoverDialog
@@ -3595,7 +3637,7 @@ const useKeyboardListNavigation = (items, ref, onListItemSelected, onListItemNav
3595
3637
  };
3596
3638
  };
3597
3639
 
3598
- const _excluded$18 = ["after", "before", "children", "className", "isHighlighted", "isSelected", "isDisabled", "linkAs", "linkProps", "linkRef", "onItemSelected", "size"];
3640
+ const _excluded$18 = ["after", "before", "children", "className", "isHighlighted", "isSelected", "linkAs", "linkProps", "linkRef", "onItemSelected", "size"];
3599
3641
 
3600
3642
  /**
3601
3643
  * Defines the props of the component.
@@ -3637,6 +3679,11 @@ function isClickable({
3637
3679
  * @return React element.
3638
3680
  */
3639
3681
  const ListItem = forwardRef((props, ref) => {
3682
+ const {
3683
+ isAnyDisabled,
3684
+ disabledStateProps,
3685
+ otherProps
3686
+ } = useDisableStateProps(props);
3640
3687
  const {
3641
3688
  after,
3642
3689
  before,
@@ -3644,14 +3691,13 @@ const ListItem = forwardRef((props, ref) => {
3644
3691
  className,
3645
3692
  isHighlighted,
3646
3693
  isSelected,
3647
- isDisabled,
3648
3694
  linkAs,
3649
3695
  linkProps = {},
3650
3696
  linkRef,
3651
3697
  onItemSelected,
3652
3698
  size = DEFAULT_PROPS$R.size
3653
- } = props,
3654
- forwardedProps = _objectWithoutProperties(props, _excluded$18);
3699
+ } = otherProps,
3700
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$18);
3655
3701
  const role = linkAs || linkProps.href ? 'link' : 'button';
3656
3702
  const onKeyDown = useMemo(() => {
3657
3703
  if (onItemSelected && role === 'link') return onEnterPressed(onItemSelected);
@@ -3678,19 +3724,19 @@ const ListItem = forwardRef((props, ref) => {
3678
3724
  }) ? (/* Clickable list item */
3679
3725
  renderLink(_objectSpread2(_objectSpread2({
3680
3726
  linkAs,
3681
- tabIndex: !isDisabled && role === 'button' ? 0 : undefined,
3727
+ tabIndex: !disabledStateProps.disabled ? 0 : undefined,
3682
3728
  role,
3683
- 'aria-disabled': isDisabled
3729
+ 'aria-disabled': isAnyDisabled
3684
3730
  }, linkProps), {}, {
3685
- href: isDisabled ? undefined : linkProps.href,
3731
+ href: isAnyDisabled ? undefined : linkProps.href,
3686
3732
  className: classNames(handleBasicClasses({
3687
3733
  prefix: `${CLASSNAME$13}__link`,
3688
3734
  isHighlighted,
3689
3735
  isSelected,
3690
- isDisabled
3736
+ isDisabled: isAnyDisabled
3691
3737
  })),
3692
- onClick: isDisabled ? undefined : onItemSelected,
3693
- onKeyDown,
3738
+ onClick: isAnyDisabled ? undefined : onItemSelected,
3739
+ onKeyDown: isAnyDisabled ? undefined : onKeyDown,
3694
3740
  ref: linkRef
3695
3741
  }), content)) :
3696
3742
  /*#__PURE__*/
@@ -8939,7 +8985,7 @@ const Lightbox = forwardRef((props, ref) => {
8939
8985
  Lightbox.displayName = COMPONENT_NAME$M;
8940
8986
  Lightbox.className = CLASSNAME$M;
8941
8987
 
8942
- const _excluded$P = ["children", "className", "color", "colorVariant", "disabled", "isDisabled", "href", "leftIcon", "linkAs", "rightIcon", "target", "typography"];
8988
+ const _excluded$P = ["children", "className", "color", "colorVariant", "href", "leftIcon", "linkAs", "rightIcon", "target", "typography"];
8943
8989
 
8944
8990
  /**
8945
8991
  * Defines the props of the component.
@@ -8963,28 +9009,31 @@ const CLASSNAME$L = getRootClassName(COMPONENT_NAME$L);
8963
9009
  * @return React element.
8964
9010
  */
8965
9011
  const Link = forwardRef((props, ref) => {
9012
+ const {
9013
+ isAnyDisabled,
9014
+ disabledStateProps,
9015
+ otherProps
9016
+ } = useDisableStateProps(props);
8966
9017
  const {
8967
9018
  children,
8968
9019
  className,
8969
9020
  color: propColor,
8970
9021
  colorVariant: propColorVariant,
8971
- disabled,
8972
- isDisabled = disabled,
8973
9022
  href,
8974
9023
  leftIcon,
8975
9024
  linkAs,
8976
9025
  rightIcon,
8977
9026
  target,
8978
9027
  typography
8979
- } = props,
8980
- forwardedProps = _objectWithoutProperties(props, _excluded$P);
9028
+ } = otherProps,
9029
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$P);
8981
9030
  const [color, colorVariant] = resolveColorWithVariants(propColor, propColorVariant);
8982
9031
  const isLink = linkAs || href;
8983
- const Component = isLink && !isDisabled ? linkAs || 'a' : 'button';
9032
+ const Component = isLink && !isAnyDisabled ? linkAs || 'a' : 'button';
8984
9033
  const baseProps = {};
8985
9034
  if (Component === 'button') {
8986
9035
  baseProps.type = 'button';
8987
- baseProps.disabled = isDisabled;
9036
+ Object.assign(baseProps, disabledStateProps);
8988
9037
  } else if (isLink) {
8989
9038
  baseProps.href = href;
8990
9039
  baseProps.target = target;
@@ -10347,7 +10396,7 @@ ProgressTracker.displayName = COMPONENT_NAME$w;
10347
10396
  ProgressTracker.className = CLASSNAME$w;
10348
10397
  ProgressTracker.defaultProps = DEFAULT_PROPS$r;
10349
10398
 
10350
- const _excluded$y = ["className", "disabled", "hasError", "helper", "id", "isActive", "isComplete", "isDisabled", "label", "onFocus", "onKeyPress", "tabIndex"];
10399
+ const _excluded$y = ["className", "hasError", "helper", "id", "isActive", "isComplete", "label", "onFocus", "onKeyPress", "tabIndex"];
10351
10400
 
10352
10401
  /**
10353
10402
  * Defines the props of the component.
@@ -10378,29 +10427,31 @@ const DEFAULT_PROPS$q = {};
10378
10427
  * @return React element.
10379
10428
  */
10380
10429
  const ProgressTrackerStep = forwardRef((props, ref) => {
10430
+ const {
10431
+ isAnyDisabled,
10432
+ otherProps
10433
+ } = useDisableStateProps(props);
10381
10434
  const {
10382
10435
  className,
10383
- disabled,
10384
10436
  hasError,
10385
10437
  helper,
10386
10438
  id,
10387
10439
  isActive: propIsActive,
10388
10440
  isComplete,
10389
- isDisabled = disabled,
10390
10441
  label,
10391
10442
  onFocus,
10392
10443
  onKeyPress,
10393
10444
  tabIndex = -1
10394
- } = props,
10395
- forwardedProps = _objectWithoutProperties(props, _excluded$y);
10445
+ } = otherProps,
10446
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$y);
10396
10447
  const state = useTabProviderContext('tab', id);
10397
10448
  const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
10398
10449
  const changeToCurrentTab = useCallback(() => {
10399
- if (isDisabled) {
10450
+ if (isAnyDisabled) {
10400
10451
  return;
10401
10452
  }
10402
10453
  state === null || state === void 0 ? void 0 : state.changeToTab();
10403
- }, [isDisabled, state]);
10454
+ }, [isAnyDisabled, state]);
10404
10455
  const handleFocus = useCallback(event => {
10405
10456
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
10406
10457
  if (state !== null && state !== void 0 && state.shouldActivateOnFocus) {
@@ -10432,7 +10483,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
10432
10483
  prefix: CLASSNAME$v,
10433
10484
  hasError,
10434
10485
  isActive,
10435
- isClickable: state && !isDisabled,
10486
+ isClickable: state && !isAnyDisabled,
10436
10487
  isComplete
10437
10488
  })),
10438
10489
  onClick: changeToCurrentTab,
@@ -10440,7 +10491,7 @@ const ProgressTrackerStep = forwardRef((props, ref) => {
10440
10491
  onFocus: handleFocus,
10441
10492
  role: "tab",
10442
10493
  tabIndex: isActive ? 0 : tabIndex,
10443
- "aria-disabled": isDisabled,
10494
+ "aria-disabled": isAnyDisabled,
10444
10495
  "aria-selected": isActive,
10445
10496
  "aria-controls": state === null || state === void 0 ? void 0 : state.tabPanelId
10446
10497
  }), /*#__PURE__*/React__default.createElement(Icon, {
@@ -10516,7 +10567,7 @@ ProgressTrackerStepPanel.displayName = COMPONENT_NAME$u;
10516
10567
  ProgressTrackerStepPanel.className = CLASSNAME$u;
10517
10568
  ProgressTrackerStepPanel.defaultProps = DEFAULT_PROPS$p;
10518
10569
 
10519
- const _excluded$w = ["checked", "className", "disabled", "helper", "id", "inputRef", "isChecked", "isDisabled", "label", "name", "onChange", "theme", "value", "inputProps"];
10570
+ const _excluded$w = ["checked", "className", "helper", "id", "inputRef", "isChecked", "label", "name", "onChange", "theme", "value", "inputProps"];
10520
10571
 
10521
10572
  /**
10522
10573
  * Defines the props of the component.
@@ -10545,24 +10596,27 @@ const DEFAULT_PROPS$o = {};
10545
10596
  * @return React element.
10546
10597
  */
10547
10598
  const RadioButton = forwardRef((props, ref) => {
10599
+ const {
10600
+ isAnyDisabled,
10601
+ disabledStateProps,
10602
+ otherProps
10603
+ } = useDisableStateProps(props);
10548
10604
  const defaultTheme = useTheme() || Theme.light;
10549
10605
  const {
10550
10606
  checked,
10551
10607
  className,
10552
- disabled,
10553
10608
  helper,
10554
10609
  id,
10555
10610
  inputRef,
10556
10611
  isChecked = checked,
10557
- isDisabled = disabled,
10558
10612
  label,
10559
10613
  name,
10560
10614
  onChange,
10561
10615
  theme = defaultTheme,
10562
10616
  value,
10563
10617
  inputProps
10564
- } = props,
10565
- forwardedProps = _objectWithoutProperties(props, _excluded$w);
10618
+ } = otherProps,
10619
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$w);
10566
10620
  const generatedInputId = useId();
10567
10621
  const inputId = id || generatedInputId;
10568
10622
  const handleChange = event => {
@@ -10575,7 +10629,7 @@ const RadioButton = forwardRef((props, ref) => {
10575
10629
  }, forwardedProps, {
10576
10630
  className: classNames(className, handleBasicClasses({
10577
10631
  isChecked,
10578
- isDisabled,
10632
+ isDisabled: isAnyDisabled,
10579
10633
  isUnchecked: !isChecked,
10580
10634
  prefix: CLASSNAME$t,
10581
10635
  theme
@@ -10584,15 +10638,15 @@ const RadioButton = forwardRef((props, ref) => {
10584
10638
  className: `${CLASSNAME$t}__input-wrapper`
10585
10639
  }, /*#__PURE__*/React__default.createElement("input", _extends({
10586
10640
  ref: inputRef,
10587
- className: `${CLASSNAME$t}__input-native`,
10588
- disabled: isDisabled,
10641
+ className: `${CLASSNAME$t}__input-native`
10642
+ }, disabledStateProps, {
10589
10643
  id: inputId,
10590
- tabIndex: isDisabled ? -1 : 0,
10591
10644
  type: "radio",
10592
10645
  name: name,
10593
10646
  value: value,
10594
10647
  checked: isChecked,
10595
10648
  onChange: handleChange,
10649
+ readOnly: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.readOnly) || isAnyDisabled,
10596
10650
  "aria-describedby": helper ? `${inputId}-helper` : undefined
10597
10651
  }, inputProps)), /*#__PURE__*/React__default.createElement("div", {
10598
10652
  className: `${CLASSNAME$t}__input-placeholder`
@@ -11412,7 +11466,7 @@ const clamp = (value, min, max) => {
11412
11466
  return value;
11413
11467
  };
11414
11468
 
11415
- const _excluded$l = ["className", "disabled", "helper", "hideMinMaxLabel", "id", "isDisabled", "label", "max", "min", "name", "onChange", "onMouseDown", "precision", "steps", "theme", "value"];
11469
+ const _excluded$l = ["className", "helper", "hideMinMaxLabel", "id", "label", "max", "min", "name", "onChange", "onMouseDown", "precision", "steps", "theme", "value"];
11416
11470
 
11417
11471
  /**
11418
11472
  * Defines the props of the component.
@@ -11465,14 +11519,17 @@ const computePercentFromValue = (value, min, max) => Number((value - min) / (max
11465
11519
  * @return React element.
11466
11520
  */
11467
11521
  const Slider = forwardRef((props, ref) => {
11522
+ const {
11523
+ isAnyDisabled,
11524
+ disabledStateProps,
11525
+ otherProps
11526
+ } = useDisableStateProps(props);
11468
11527
  const defaultTheme = useTheme() || Theme.light;
11469
11528
  const {
11470
11529
  className,
11471
- disabled,
11472
11530
  helper,
11473
11531
  hideMinMaxLabel,
11474
11532
  id,
11475
- isDisabled = disabled,
11476
11533
  label,
11477
11534
  max,
11478
11535
  min,
@@ -11483,8 +11540,8 @@ const Slider = forwardRef((props, ref) => {
11483
11540
  steps = DEFAULT_PROPS$h.steps,
11484
11541
  theme = defaultTheme,
11485
11542
  value
11486
- } = props,
11487
- forwardedProps = _objectWithoutProperties(props, _excluded$l);
11543
+ } = otherProps,
11544
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$l);
11488
11545
  const generatedId = useId();
11489
11546
  const sliderId = id || generatedId;
11490
11547
  const sliderLabelId = useMemo(() => `label-${sliderId}`, [sliderId]);
@@ -11604,7 +11661,7 @@ const Slider = forwardRef((props, ref) => {
11604
11661
  const {
11605
11662
  current: slider
11606
11663
  } = sliderRef;
11607
- if (isDisabled || !slider) return;
11664
+ if (isAnyDisabled || !slider) return;
11608
11665
  const newValue = getPercentValue(event, slider);
11609
11666
  if (onChange) {
11610
11667
  onChange(computeValueFromPercent(newValue, min, max, precision), name, event);
@@ -11621,8 +11678,7 @@ const Slider = forwardRef((props, ref) => {
11621
11678
  theme,
11622
11679
  hasLabel: Boolean(label)
11623
11680
  })),
11624
- onMouseDown: handleMouseDown,
11625
- "aria-disabled": isDisabled
11681
+ onMouseDown: handleMouseDown
11626
11682
  }), label && /*#__PURE__*/React__default.createElement(InputLabel, {
11627
11683
  id: sliderLabelId,
11628
11684
  htmlFor: sliderId,
@@ -11653,7 +11709,7 @@ const Slider = forwardRef((props, ref) => {
11653
11709
  style: {
11654
11710
  left: `${step * 100}%`
11655
11711
  }
11656
- }))) : null, /*#__PURE__*/React__default.createElement("button", {
11712
+ }))) : null, /*#__PURE__*/React__default.createElement("button", _extends({
11657
11713
  type: "button",
11658
11714
  "aria-labelledby": sliderLabelId,
11659
11715
  name: name,
@@ -11662,9 +11718,8 @@ const Slider = forwardRef((props, ref) => {
11662
11718
  style: {
11663
11719
  left: percentString
11664
11720
  },
11665
- onKeyDown: handleKeyDown,
11666
- disabled: isDisabled
11667
- })), !hideMinMaxLabel && /*#__PURE__*/React__default.createElement("span", {
11721
+ onKeyDown: isAnyDisabled ? undefined : handleKeyDown
11722
+ }, disabledStateProps))), !hideMinMaxLabel && /*#__PURE__*/React__default.createElement("span", {
11668
11723
  className: `${CLASSNAME$j}__value-label ${CLASSNAME$j}__value-label--max`
11669
11724
  }, max)));
11670
11725
  });
@@ -12478,7 +12533,7 @@ const Slides = forwardRef((props, ref) => {
12478
12533
  Slides.displayName = COMPONENT_NAME$f;
12479
12534
  Slides.className = CLASSNAME$f;
12480
12535
 
12481
- const _excluded$f = ["checked", "children", "className", "disabled", "helper", "id", "isChecked", "isDisabled", "name", "onChange", "position", "theme", "value", "inputProps"];
12536
+ const _excluded$f = ["checked", "children", "className", "helper", "id", "isChecked", "name", "onChange", "position", "theme", "value", "inputProps"];
12482
12537
 
12483
12538
  /**
12484
12539
  * Defines the props of the component.
@@ -12509,24 +12564,27 @@ const DEFAULT_PROPS$e = {
12509
12564
  * @return React element.
12510
12565
  */
12511
12566
  const Switch = forwardRef((props, ref) => {
12567
+ const {
12568
+ isAnyDisabled,
12569
+ disabledStateProps,
12570
+ otherProps
12571
+ } = useDisableStateProps(props);
12512
12572
  const defaultTheme = useTheme() || Theme.light;
12513
12573
  const {
12514
12574
  checked,
12515
12575
  children,
12516
12576
  className,
12517
- disabled,
12518
12577
  helper,
12519
12578
  id,
12520
12579
  isChecked = checked,
12521
- isDisabled = disabled,
12522
12580
  name,
12523
12581
  onChange,
12524
12582
  position = DEFAULT_PROPS$e.position,
12525
12583
  theme = defaultTheme,
12526
12584
  value,
12527
12585
  inputProps = {}
12528
- } = props,
12529
- forwardedProps = _objectWithoutProperties(props, _excluded$f);
12586
+ } = otherProps,
12587
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$f);
12530
12588
  const generatedInputId = useId();
12531
12589
  const inputId = id || generatedInputId;
12532
12590
  const handleChange = event => {
@@ -12540,12 +12598,11 @@ const Switch = forwardRef((props, ref) => {
12540
12598
  className: classNames(className, handleBasicClasses({
12541
12599
  prefix: CLASSNAME$e,
12542
12600
  isChecked,
12543
- isDisabled,
12601
+ isDisabled: isAnyDisabled,
12544
12602
  position,
12545
12603
  theme,
12546
12604
  isUnchecked: !isChecked
12547
- })),
12548
- "aria-disabled": isDisabled
12605
+ }))
12549
12606
  }), /*#__PURE__*/React__default.createElement("div", {
12550
12607
  className: `${CLASSNAME$e}__input-wrapper`
12551
12608
  }, /*#__PURE__*/React__default.createElement("input", _extends({
@@ -12554,8 +12611,9 @@ const Switch = forwardRef((props, ref) => {
12554
12611
  id: inputId,
12555
12612
  className: `${CLASSNAME$e}__input-native`,
12556
12613
  name: name,
12557
- value: value,
12558
- disabled: isDisabled,
12614
+ value: value
12615
+ }, disabledStateProps, {
12616
+ readOnly: inputProps.readOnly || isAnyDisabled,
12559
12617
  checked: isChecked,
12560
12618
  "aria-checked": Boolean(isChecked),
12561
12619
  onChange: handleChange,
@@ -12823,7 +12881,7 @@ TableHeader.displayName = COMPONENT_NAME$a;
12823
12881
  TableHeader.className = CLASSNAME$a;
12824
12882
  TableHeader.defaultProps = DEFAULT_PROPS$b;
12825
12883
 
12826
- const _excluded$a = ["children", "className", "disabled", "isClickable", "isDisabled", "isSelected"];
12884
+ const _excluded$a = ["children", "className", "isClickable", "isSelected"];
12827
12885
 
12828
12886
  /**
12829
12887
  * Defines the props of the component.
@@ -12852,26 +12910,29 @@ const DEFAULT_PROPS$a = {};
12852
12910
  * @return React element.
12853
12911
  */
12854
12912
  const TableRow = forwardRef((props, ref) => {
12913
+ const {
12914
+ isAnyDisabled,
12915
+ disabledStateProps,
12916
+ otherProps
12917
+ } = useDisableStateProps(props);
12855
12918
  const {
12856
12919
  children,
12857
12920
  className,
12858
- disabled,
12859
12921
  isClickable,
12860
- isDisabled = disabled,
12861
12922
  isSelected
12862
- } = props,
12863
- forwardedProps = _objectWithoutProperties(props, _excluded$a);
12923
+ } = otherProps,
12924
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$a);
12864
12925
  return /*#__PURE__*/React__default.createElement("tr", _extends({
12865
12926
  ref: ref,
12866
- tabIndex: isClickable && !isDisabled ? 0 : -1
12927
+ tabIndex: isClickable && !disabledStateProps.disabled ? 0 : -1
12867
12928
  }, forwardedProps, {
12868
12929
  className: classNames(className, handleBasicClasses({
12869
- isClickable: isClickable && !isDisabled,
12870
- isDisabled,
12871
- isSelected: isSelected && !isDisabled,
12930
+ isClickable: isClickable && !isAnyDisabled,
12931
+ isDisabled: isAnyDisabled,
12932
+ isSelected: isSelected && !isAnyDisabled,
12872
12933
  prefix: CLASSNAME$9
12873
12934
  })),
12874
- "aria-disabled": isDisabled
12935
+ "aria-disabled": isAnyDisabled
12875
12936
  }), children);
12876
12937
  });
12877
12938
  TableRow.displayName = COMPONENT_NAME$9;
@@ -13008,7 +13069,7 @@ TabList.displayName = COMPONENT_NAME$8;
13008
13069
  TabList.className = CLASSNAME$8;
13009
13070
  TabList.defaultProps = DEFAULT_PROPS$8;
13010
13071
 
13011
- const _excluded$7 = ["className", "disabled", "icon", "iconProps", "id", "isActive", "isDisabled", "label", "onFocus", "onKeyPress", "tabIndex"];
13072
+ const _excluded$7 = ["className", "icon", "iconProps", "id", "isActive", "label", "onFocus", "onKeyPress", "tabIndex"];
13012
13073
 
13013
13074
  /**
13014
13075
  * Defines the props of the component.
@@ -13039,28 +13100,30 @@ const DEFAULT_PROPS$7 = {};
13039
13100
  * @return React element.
13040
13101
  */
13041
13102
  const Tab = forwardRef((props, ref) => {
13103
+ const {
13104
+ isAnyDisabled,
13105
+ otherProps
13106
+ } = useDisableStateProps(props);
13042
13107
  const {
13043
13108
  className,
13044
- disabled,
13045
13109
  icon,
13046
13110
  iconProps = {},
13047
13111
  id,
13048
13112
  isActive: propIsActive,
13049
- isDisabled = disabled,
13050
13113
  label,
13051
13114
  onFocus,
13052
13115
  onKeyPress,
13053
13116
  tabIndex = -1
13054
- } = props,
13055
- forwardedProps = _objectWithoutProperties(props, _excluded$7);
13117
+ } = otherProps,
13118
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded$7);
13056
13119
  const state = useTabProviderContext('tab', id);
13057
13120
  const isActive = propIsActive || (state === null || state === void 0 ? void 0 : state.isActive);
13058
13121
  const changeToCurrentTab = useCallback(() => {
13059
- if (isDisabled) {
13122
+ if (isAnyDisabled) {
13060
13123
  return;
13061
13124
  }
13062
13125
  state === null || state === void 0 ? void 0 : state.changeToTab();
13063
- }, [isDisabled, state]);
13126
+ }, [isAnyDisabled, state]);
13064
13127
  const handleFocus = useCallback(event => {
13065
13128
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
13066
13129
  if (state !== null && state !== void 0 && state.shouldActivateOnFocus) {
@@ -13069,11 +13132,11 @@ const Tab = forwardRef((props, ref) => {
13069
13132
  }, [changeToCurrentTab, onFocus, state === null || state === void 0 ? void 0 : state.shouldActivateOnFocus]);
13070
13133
  const handleKeyPress = useCallback(event => {
13071
13134
  onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(event);
13072
- if (event.key !== 'Enter') {
13135
+ if (event.key !== 'Enter' || isAnyDisabled) {
13073
13136
  return;
13074
13137
  }
13075
13138
  changeToCurrentTab();
13076
- }, [changeToCurrentTab, onKeyPress]);
13139
+ }, [changeToCurrentTab, isAnyDisabled, onKeyPress]);
13077
13140
  return /*#__PURE__*/React__default.createElement("button", _extends({
13078
13141
  ref: ref
13079
13142
  }, forwardedProps, {
@@ -13082,14 +13145,14 @@ const Tab = forwardRef((props, ref) => {
13082
13145
  className: classNames(className, handleBasicClasses({
13083
13146
  prefix: CLASSNAME$7,
13084
13147
  isActive,
13085
- isDisabled
13148
+ isDisabled: isAnyDisabled
13086
13149
  })),
13087
13150
  onClick: changeToCurrentTab,
13088
13151
  onKeyPress: handleKeyPress,
13089
13152
  onFocus: handleFocus,
13090
13153
  role: "tab",
13091
13154
  tabIndex: isActive ? 0 : tabIndex,
13092
- "aria-disabled": isDisabled,
13155
+ "aria-disabled": isAnyDisabled,
13093
13156
  "aria-selected": isActive,
13094
13157
  "aria-controls": state === null || state === void 0 ? void 0 : state.tabPanelId
13095
13158
  }), icon && /*#__PURE__*/React__default.createElement(Icon, _extends({
@@ -13161,8 +13224,8 @@ TabPanel.displayName = COMPONENT_NAME$6;
13161
13224
  TabPanel.className = CLASSNAME$6;
13162
13225
  TabPanel.defaultProps = DEFAULT_PROPS$6;
13163
13226
 
13164
- const _excluded$5 = ["id", "isDisabled", "isRequired", "placeholder", "multiline", "value", "setFocus", "onChange", "onFocus", "onBlur", "inputRef", "rows", "recomputeNumberOfRows", "type", "name", "hasError", "describedById"],
13165
- _excluded2 = ["chips", "className", "clearButtonProps", "disabled", "error", "forceFocusStyle", "hasError", "helper", "icon", "id", "inputRef", "isDisabled", "isRequired", "isValid", "label", "labelProps", "maxLength", "minimumRows", "multiline", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "textFieldRef", "theme", "type", "value", "afterElement"];
13227
+ const _excluded$5 = ["id", "isRequired", "placeholder", "multiline", "value", "setFocus", "onChange", "onFocus", "onBlur", "inputRef", "rows", "recomputeNumberOfRows", "type", "name", "hasError", "describedById"],
13228
+ _excluded2 = ["chips", "className", "clearButtonProps", "error", "forceFocusStyle", "hasError", "helper", "icon", "id", "inputRef", "isRequired", "isValid", "label", "labelProps", "maxLength", "minimumRows", "multiline", "name", "onBlur", "onChange", "onClear", "onFocus", "placeholder", "textFieldRef", "theme", "type", "value", "afterElement"];
13166
13229
 
13167
13230
  /**
13168
13231
  * Defines the props of the component.
@@ -13228,7 +13291,6 @@ const useComputeNumberOfRows = minimumRows => {
13228
13291
  const renderInputNative = props => {
13229
13292
  const {
13230
13293
  id,
13231
- isDisabled,
13232
13294
  isRequired,
13233
13295
  placeholder,
13234
13296
  multiline,
@@ -13274,13 +13336,13 @@ const renderInputNative = props => {
13274
13336
  placeholder,
13275
13337
  value,
13276
13338
  name,
13277
- disabled: isDisabled,
13278
13339
  required: isRequired,
13279
13340
  onFocus: onTextFieldFocus,
13280
13341
  onBlur: onTextFieldBlur,
13281
13342
  onChange: handleChange,
13282
13343
  'aria-invalid': hasError ? 'true' : undefined,
13283
13344
  'aria-describedby': describedById,
13345
+ readOnly: forwardedProps.readOnly || forwardedProps['aria-disabled'],
13284
13346
  ref: mergeRefs(inputRef, ref)
13285
13347
  });
13286
13348
  if (multiline) {
@@ -13299,12 +13361,16 @@ const renderInputNative = props => {
13299
13361
  * @return React element.
13300
13362
  */
13301
13363
  const TextField = forwardRef((props, ref) => {
13364
+ const {
13365
+ isAnyDisabled,
13366
+ disabledStateProps,
13367
+ otherProps
13368
+ } = useDisableStateProps(props);
13302
13369
  const defaultTheme = useTheme() || Theme.light;
13303
13370
  const {
13304
13371
  chips,
13305
13372
  className,
13306
13373
  clearButtonProps,
13307
- disabled,
13308
13374
  error,
13309
13375
  forceFocusStyle,
13310
13376
  hasError,
@@ -13312,7 +13378,6 @@ const TextField = forwardRef((props, ref) => {
13312
13378
  icon,
13313
13379
  id,
13314
13380
  inputRef: inputRefProps,
13315
- isDisabled = disabled,
13316
13381
  isRequired,
13317
13382
  isValid,
13318
13383
  label,
@@ -13331,8 +13396,8 @@ const TextField = forwardRef((props, ref) => {
13331
13396
  type = DEFAULT_PROPS$5.type,
13332
13397
  value,
13333
13398
  afterElement
13334
- } = props,
13335
- forwardedProps = _objectWithoutProperties(props, _excluded2);
13399
+ } = otherProps,
13400
+ forwardedProps = _objectWithoutProperties(otherProps, _excluded2);
13336
13401
  const generatedTextFieldId = useId();
13337
13402
  const textFieldId = id || generatedTextFieldId;
13338
13403
  /** Keep a clean local input ref to manage focus */
@@ -13390,7 +13455,7 @@ const TextField = forwardRef((props, ref) => {
13390
13455
  hasPlaceholder: Boolean(placeholder),
13391
13456
  hasTextarea: multiline,
13392
13457
  hasValue: Boolean(value),
13393
- isDisabled,
13458
+ isDisabled: isAnyDisabled,
13394
13459
  isFocus: isFocus || forceFocusStyle,
13395
13460
  isValid,
13396
13461
  prefix: CLASSNAME$5,
@@ -13418,10 +13483,10 @@ const TextField = forwardRef((props, ref) => {
13418
13483
  size: Size.xs
13419
13484
  }), chips && /*#__PURE__*/React__default.createElement("div", {
13420
13485
  className: `${CLASSNAME$5}__chips`
13421
- }, chips, renderInputNative(_objectSpread2({
13486
+ }, chips, renderInputNative(_objectSpread2(_objectSpread2({
13422
13487
  id: textFieldId,
13423
- inputRef,
13424
- isDisabled,
13488
+ inputRef
13489
+ }, disabledStateProps), {}, {
13425
13490
  isRequired,
13426
13491
  maxLength,
13427
13492
  multiline,
@@ -13439,10 +13504,10 @@ const TextField = forwardRef((props, ref) => {
13439
13504
  describedById
13440
13505
  }, forwardedProps))), !chips && /*#__PURE__*/React__default.createElement("div", {
13441
13506
  className: `${CLASSNAME$5}__input-wrapper`
13442
- }, renderInputNative(_objectSpread2({
13507
+ }, renderInputNative(_objectSpread2(_objectSpread2({
13443
13508
  id: textFieldId,
13444
- inputRef,
13445
- isDisabled,
13509
+ inputRef
13510
+ }, disabledStateProps), {}, {
13446
13511
  isRequired,
13447
13512
  maxLength,
13448
13513
  multiline,
@@ -13463,7 +13528,7 @@ const TextField = forwardRef((props, ref) => {
13463
13528
  color: theme === Theme.dark ? 'light' : undefined,
13464
13529
  icon: isValid ? mdiCheckCircle : mdiAlertCircle,
13465
13530
  size: Size.xxs
13466
- }), clearButtonProps && isNotEmpty && /*#__PURE__*/React__default.createElement(IconButton, _extends({}, clearButtonProps, {
13531
+ }), clearButtonProps && isNotEmpty && !isAnyDisabled && /*#__PURE__*/React__default.createElement(IconButton, _extends({}, clearButtonProps, {
13467
13532
  className: `${CLASSNAME$5}__input-clear`,
13468
13533
  icon: mdiCloseCircle,
13469
13534
  emphasis: Emphasis.low,