@carbon/react 1.9.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.
@@ -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 () {
@@ -316,9 +316,9 @@ NumberInput.propTypes = {
316
316
  min: PropTypes.number,
317
317
 
318
318
  /**
319
- * The new value is available in 'imaginaryTarget.value'
320
- * i.e. to get the value: evt.imaginaryTarget.value
321
- *
319
+ * Provide an optional handler that is called when the internal state of
320
+ * NumberInput changes. This handler is called with event and state info.
321
+ * `(event, { value, direction }) => void`
322
322
  */
323
323
  onChange: PropTypes.func,
324
324
 
@@ -72,7 +72,7 @@ var TileGroup = /*#__PURE__*/function (_React$Component) {
72
72
  _defineProperty(_assertThisInitialized(_this), "renderLegend", function (legend) {
73
73
  if (legend) {
74
74
  return /*#__PURE__*/React__default.createElement("legend", {
75
- className: "".concat(_this.prefix, "--label")
75
+ className: "".concat(_this.context, "--label")
76
76
  }, legend);
77
77
  }
78
78
  });
package/es/index.js CHANGED
@@ -18,7 +18,6 @@ export { ClassPrefix } from './components/ClassPrefix/index.js';
18
18
  export { default as CodeSnippetSkeleton } from './components/CodeSnippet/CodeSnippet.Skeleton.js';
19
19
  export { default as CodeSnippet } from './components/CodeSnippet/CodeSnippet.js';
20
20
  export { default as ComboBox } from './components/ComboBox/ComboBox.js';
21
- export { ComposedModal, ModalFooter, ModalHeader } from './components/ComposedModal/index.js';
22
21
  export { default as ContentSwitcher } from './components/ContentSwitcher/index.js';
23
22
  export { default as Copy } from './components/Copy/Copy.js';
24
23
  export { default as CopyButton } from './components/CopyButton/CopyButton.js';
@@ -139,7 +138,9 @@ export { default as unstable_Menu } from './components/Menu/Menu.js';
139
138
  export { default as unstable_TreeView } from './components/TreeView/TreeView.js';
140
139
  export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.js';
141
140
  export { default as BreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem.js';
142
- export { ModalBody } from './components/ComposedModal/ComposedModal.js';
141
+ export { default as ComposedModal, ModalBody } from './components/ComposedModal/ComposedModal.js';
142
+ export { ModalHeader } from './components/ComposedModal/ModalHeader.js';
143
+ export { ModalFooter } from './components/ComposedModal/ModalFooter.js';
143
144
  export { default as Table } from './components/DataTable/Table.js';
144
145
  export { default as TableActionList } from './components/DataTable/TableActionList.js';
145
146
  export { default as TableBatchAction } from './components/DataTable/TableBatchAction.js';
@@ -17,7 +17,7 @@ import { warning } from './warning.js';
17
17
  * owners of controlled components.
18
18
  *
19
19
  * Note: this hook will warn if a component is switching from controlled to
20
- * uncontrolled, or vice-verse.
20
+ * uncontrolled, or vice-versa.
21
21
  *
22
22
  * @param {object} config
23
23
  * @param {string} config.name - the name of the custom component