@carbon/react 1.8.0 → 1.10.0-rc.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 (34) hide show
  1. package/es/components/ComposedModal/ComposedModal.js +172 -577
  2. package/es/components/ComposedModal/{next/ModalFooter.js → ModalFooter.js} +4 -4
  3. package/es/components/ComposedModal/{next/ModalHeader.js → ModalHeader.js} +2 -2
  4. package/es/components/DataTable/tools/sorting.js +8 -0
  5. package/es/components/Icon/Icon.Skeleton.js +4 -12
  6. package/es/components/InlineCheckbox/InlineCheckbox.js +0 -1
  7. package/es/components/Menu/Menu.js +1 -1
  8. package/es/components/NumberInput/NumberInput.Skeleton.js +3 -4
  9. package/es/components/NumberInput/NumberInput.js +311 -362
  10. package/es/components/TileGroup/TileGroup.js +1 -1
  11. package/es/index.js +5 -4
  12. package/es/internal/useControllableState.js +1 -1
  13. package/lib/components/ComposedModal/ComposedModal.js +174 -581
  14. package/lib/components/ComposedModal/{next/ModalFooter.js → ModalFooter.js} +4 -4
  15. package/lib/components/ComposedModal/{next/ModalHeader.js → ModalHeader.js} +2 -2
  16. package/lib/components/DataTable/tools/sorting.js +8 -0
  17. package/lib/components/Icon/Icon.Skeleton.js +4 -12
  18. package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -1
  19. package/lib/components/Menu/Menu.js +1 -1
  20. package/lib/components/NumberInput/NumberInput.Skeleton.js +3 -4
  21. package/lib/components/NumberInput/NumberInput.js +308 -379
  22. package/lib/components/TileGroup/TileGroup.js +1 -1
  23. package/lib/index.js +57 -56
  24. package/lib/internal/useControllableState.js +1 -1
  25. package/package.json +6 -6
  26. package/scss/utilities/_hide-at-breakpoint.scss +9 -0
  27. package/es/components/ComposedModal/index.js +0 -19
  28. package/es/components/ComposedModal/next/ComposedModal.js +0 -225
  29. package/es/internal/FeatureFlags.js +0 -52
  30. package/es/prop-types/requiredIfValueExists.js +0 -32
  31. package/lib/components/ComposedModal/index.js +0 -45
  32. package/lib/components/ComposedModal/next/ComposedModal.js +0 -236
  33. package/lib/internal/FeatureFlags.js +0 -56
  34. package/lib/prop-types/requiredIfValueExists.js +0 -36
@@ -5,13 +5,13 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import PropTypes from 'prop-types';
11
- import Button from '../../Button/Button.js';
12
- import ButtonSet from '../../ButtonSet/ButtonSet.js';
11
+ import Button from '../Button/Button.js';
12
+ import ButtonSet from '../ButtonSet/ButtonSet.js';
13
13
  import cx from 'classnames';
14
- import { usePrefix } from '../../../internal/usePrefix.js';
14
+ import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
16
  var _excluded = ["children", "className", "closeModal", "danger", "inputref", "onRequestClose", "onRequestSubmit", "primaryButtonDisabled", "primaryButtonText", "primaryClassName", "secondaryButtonText", "secondaryButtons", "secondaryClassName"];
17
17
 
@@ -5,12 +5,12 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { Close } from '@carbon/icons-react';
13
- import { usePrefix } from '../../../internal/usePrefix.js';
13
+ import { usePrefix } from '../../internal/usePrefix.js';
14
14
 
15
15
  var _excluded = ["buttonOnClick", "children", "className", "closeClassName", "closeIconClassName", "closeModal", "iconDescription", "label", "labelClassName", "title", "titleClassName"];
16
16
  var ModalHeader = /*#__PURE__*/React__default.forwardRef(function ModalHeader(_ref, ref) {
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import { typeof as _typeof } from '../../../_virtual/_rollupPluginBabelHelpers.js';
8
9
  import { getCellId } from './cells.js';
9
10
  import { sortStates } from '../state/sortStates.js';
10
11
 
@@ -29,6 +30,13 @@ var compare = function compare(a, b) {
29
30
 
30
31
  if (typeof a === 'string' && typeof b === 'string') {
31
32
  return compareStrings(a, b, locale);
33
+ } // if column has React elements, this should sort by the child string if there is one
34
+
35
+
36
+ if (_typeof(a) === 'object' && _typeof(b) === 'object') {
37
+ if (typeof a.props.children === 'string' && typeof b.props.children === 'string') {
38
+ return compareStrings(a.props.children, b.props.children, locale);
39
+ }
32
40
  }
33
41
 
34
42
  return compareStrings('' + a, '' + b, locale);
@@ -11,18 +11,15 @@ import React__default from 'react';
11
11
  import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
- var _excluded = ["style", "className"];
14
+ var _excluded = ["className"];
15
15
 
16
16
  var IconSkeleton = function IconSkeleton(_ref) {
17
- var style = _ref.style,
18
- className = _ref.className,
17
+ var className = _ref.className,
19
18
  rest = _objectWithoutProperties(_ref, _excluded);
20
19
 
21
20
  var prefix = usePrefix();
22
21
 
23
- var props = _objectSpread2({
24
- style: style
25
- }, rest);
22
+ var props = _objectSpread2({}, rest);
26
23
 
27
24
  return /*#__PURE__*/React__default.createElement("div", _extends({
28
25
  className: cx("".concat(prefix, "--icon--skeleton"), className)
@@ -33,12 +30,7 @@ IconSkeleton.propTypes = {
33
30
  /**
34
31
  * Specify an optional className to add.
35
32
  */
36
- className: PropTypes.string,
37
-
38
- /**
39
- * The CSS styles.
40
- */
41
- style: PropTypes.object
33
+ className: PropTypes.string
42
34
  };
43
35
  var IconSkeleton$1 = IconSkeleton;
44
36
 
@@ -44,7 +44,6 @@ var InlineCheckbox = /*#__PURE__*/React__default.forwardRef(function InlineCheck
44
44
 
45
45
  if (indeterminate) {
46
46
  inputProps.checked = false;
47
- inputProps['aria-checked'] = 'mixed';
48
47
  }
49
48
 
50
49
  useEffect(function () {
@@ -311,7 +311,7 @@ Menu.propTypes = {
311
311
  /**
312
312
  * Optionally pass an element the Menu should be appended to as a child. Defaults to document.body.
313
313
  */
314
- target: PropTypes.element,
314
+ target: PropTypes.object,
315
315
 
316
316
  /**
317
317
  * Specify the x position where this menu is rendered
@@ -13,7 +13,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
14
  var _excluded = ["hideLabel", "className"];
15
15
 
16
- var NumberInputSkeleton = function NumberInputSkeleton(_ref) {
16
+ function NumberInputSkeleton(_ref) {
17
17
  var hideLabel = _ref.hideLabel,
18
18
  className = _ref.className,
19
19
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -26,7 +26,7 @@ var NumberInputSkeleton = function NumberInputSkeleton(_ref) {
26
26
  }), /*#__PURE__*/React__default.createElement("div", {
27
27
  className: "".concat(prefix, "--number ").concat(prefix, "--skeleton")
28
28
  }));
29
- };
29
+ }
30
30
 
31
31
  NumberInputSkeleton.propTypes = {
32
32
  /**
@@ -39,6 +39,5 @@ NumberInputSkeleton.propTypes = {
39
39
  */
40
40
  hideLabel: PropTypes.bool
41
41
  };
42
- var NumberInputSkeleton$1 = NumberInputSkeleton;
43
42
 
44
- export { NumberInputSkeleton$1 as default };
43
+ export { NumberInputSkeleton as default };