@carbon/react 1.16.0 → 1.17.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 (63) hide show
  1. package/es/components/Checkbox/Checkbox.Skeleton.d.ts +18 -0
  2. package/es/components/Checkbox/Checkbox.Skeleton.js +1 -2
  3. package/es/components/Checkbox/Checkbox.d.ts +47 -0
  4. package/es/components/Checkbox/Checkbox.js +6 -7
  5. package/es/components/Checkbox/index.d.ts +10 -0
  6. package/es/components/Checkbox/index.js +10 -0
  7. package/es/components/DataTable/TableToolbarSearch.js +1 -1
  8. package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
  9. package/es/components/Grid/Grid.js +0 -5
  10. package/es/components/Search/Search.js +160 -184
  11. package/es/components/Search/index.js +2 -8
  12. package/es/components/Tab/index.js +1 -1
  13. package/es/components/Tabs/Tabs.Skeleton.js +6 -6
  14. package/es/components/Tabs/Tabs.js +582 -508
  15. package/es/components/Tabs/index.js +2 -12
  16. package/es/components/Tabs/{next/usePressable.js → usePressable.js} +1 -1
  17. package/es/components/Text/Text.d.ts +33 -0
  18. package/es/components/Text/Text.js +8 -5
  19. package/es/components/Text/TextDirection.d.ts +35 -0
  20. package/es/components/Text/TextDirectionContext.js +2 -0
  21. package/es/components/Text/createTextComponent.d.ts +18 -0
  22. package/es/components/Text/index.d.ts +18 -0
  23. package/es/components/Text/index.js +2 -0
  24. package/es/components/Tile/Tile.js +339 -502
  25. package/es/index.js +6 -6
  26. package/es/internal/usePrefix.d.ts +9 -0
  27. package/lib/components/Checkbox/Checkbox.Skeleton.d.ts +18 -0
  28. package/lib/components/Checkbox/Checkbox.Skeleton.js +1 -2
  29. package/lib/components/Checkbox/Checkbox.d.ts +47 -0
  30. package/lib/components/Checkbox/Checkbox.js +6 -7
  31. package/lib/components/Checkbox/index.d.ts +10 -0
  32. package/lib/components/Checkbox/index.js +18 -0
  33. package/lib/components/DataTable/TableToolbarSearch.js +2 -2
  34. package/lib/components/ExpandableSearch/ExpandableSearch.js +3 -3
  35. package/lib/components/Grid/Grid.js +0 -5
  36. package/lib/components/Search/Search.js +159 -183
  37. package/lib/components/Search/index.js +2 -25
  38. package/lib/components/Tab/index.js +1 -1
  39. package/lib/components/Tabs/Tabs.Skeleton.js +6 -6
  40. package/lib/components/Tabs/Tabs.js +586 -507
  41. package/lib/components/Tabs/index.js +7 -33
  42. package/lib/components/Tabs/{next/usePressable.js → usePressable.js} +1 -1
  43. package/lib/components/Text/Text.d.ts +33 -0
  44. package/lib/components/Text/Text.js +8 -5
  45. package/lib/components/Text/TextDirection.d.ts +35 -0
  46. package/lib/components/Text/TextDirectionContext.js +2 -0
  47. package/lib/components/Text/createTextComponent.d.ts +18 -0
  48. package/lib/components/Text/index.d.ts +18 -0
  49. package/lib/components/Text/index.js +4 -0
  50. package/lib/components/Tile/Tile.js +336 -499
  51. package/lib/index.js +71 -71
  52. package/lib/internal/usePrefix.d.ts +9 -0
  53. package/package.json +7 -3
  54. package/es/components/Search/next/Search.js +0 -265
  55. package/es/components/Tabs/next/Tabs.Skeleton.js +0 -53
  56. package/es/components/Tabs/next/Tabs.js +0 -692
  57. package/es/components/Tile/index.js +0 -19
  58. package/es/components/Tile/next/Tile.js +0 -604
  59. package/lib/components/Search/next/Search.js +0 -275
  60. package/lib/components/Tabs/next/Tabs.Skeleton.js +0 -63
  61. package/lib/components/Tabs/next/Tabs.js +0 -708
  62. package/lib/components/Tile/index.js +0 -48
  63. package/lib/components/Tile/next/Tile.js +0 -619
package/es/index.js CHANGED
@@ -55,7 +55,8 @@ export { default as PaginationNav } from './components/PaginationNav/PaginationN
55
55
  export { default as PrimaryButton } from './components/PrimaryButton/PrimaryButton.js';
56
56
  export { default as RadioButton } from './components/RadioButton/RadioButton.js';
57
57
  export { default as RadioButtonGroup } from './components/RadioButtonGroup/RadioButtonGroup.js';
58
- export { default as Search } from './components/Search/index.js';
58
+ export { default as Search } from './components/Search/Search.js';
59
+ export { default as SearchSkeleton } from './components/Search/Search.Skeleton.js';
59
60
  export { default as ExpandableSearch } from './components/ExpandableSearch/ExpandableSearch.js';
60
61
  export { default as SecondaryButton } from './components/SecondaryButton/SecondaryButton.js';
61
62
  export { default as SelectSkeleton } from './components/Select/Select.Skeleton.js';
@@ -67,13 +68,13 @@ export { default as Slider } from './components/Slider/index.js';
67
68
  export { StructuredListBody, StructuredListCell, StructuredListHead, StructuredListInput, StructuredListRow, StructuredListWrapper } from './components/StructuredList/index.js';
68
69
  export { default as Tab } from './components/Tab/index.js';
69
70
  export { default as TabContent } from './components/TabContent/TabContent.js';
70
- export { default as Tabs } from './components/Tabs/index.js';
71
+ export { IconTab, TabList, TabPanel, TabPanels, Tabs } from './components/Tabs/Tabs.js';
72
+ export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
71
73
  export { default as TagSkeleton } from './components/Tag/Tag.Skeleton.js';
72
74
  export { default as Tag } from './components/Tag/Tag.js';
73
75
  export { default as TextAreaSkeleton } from './components/TextArea/TextArea.Skeleton.js';
74
76
  export { default as TextArea } from './components/TextArea/TextArea.js';
75
77
  import './components/TextInput/index.js';
76
- export { ClickableTile, ExpandableTile, SelectableTile, Tile, TileAboveTheFoldContent, TileBelowTheFoldContent } from './components/Tile/index.js';
77
78
  export { default as RadioTile } from './components/RadioTile/RadioTile.js';
78
79
  export { default as TileGroup } from './components/TileGroup/index.js';
79
80
  export { default as TimePicker } from './components/TimePicker/index.js';
@@ -90,9 +91,7 @@ export { default as DataTableSkeleton } from './components/DataTableSkeleton/Dat
90
91
  export { default as BreadcrumbSkeleton } from './components/Breadcrumb/Breadcrumb.Skeleton.js';
91
92
  export { default as ProgressIndicatorSkeleton } from './components/ProgressIndicator/ProgressIndicator.Skeleton.js';
92
93
  export { default as RadioButtonSkeleton } from './components/RadioButton/RadioButton.Skeleton.js';
93
- export { default as SearchSkeleton } from './components/Search/Search.Skeleton.js';
94
94
  export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
95
- export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
96
95
  export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
97
96
  export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
98
97
  export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
@@ -105,6 +104,7 @@ import './components/Menu/index.js';
105
104
  export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2/index.js';
106
105
  export { Popover, PopoverContent } from './components/Popover/index.js';
107
106
  export { HStack, VStack } from './components/Stack/index.js';
107
+ import './components/Text/index.js';
108
108
  export { DefinitionTooltip } from './components/Tooltip/next/DefinitionTooltip.js';
109
109
  export { GlobalTheme, Theme, useTheme } from './components/Theme/index.js';
110
110
  export { usePrefix } from './internal/usePrefix.js';
@@ -177,7 +177,7 @@ export { default as ControlledPasswordInput } from './components/TextInput/Contr
177
177
  export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
178
178
  export { ProgressIndicator, ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
179
179
  export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
180
- export { IconTab, TabList, TabPanel, TabPanels } from './components/Tabs/next/Tabs.js';
180
+ export { ClickableTile, ExpandableTile, SelectableTile, Tile, TileAboveTheFoldContent, TileBelowTheFoldContent } from './components/Tile/Tile.js';
181
181
  export { default as Content } from './components/UIShell/Content.js';
182
182
  export { default as Header } from './components/UIShell/Header.js';
183
183
  export { default as HeaderContainer } from './components/UIShell/HeaderContainer.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2018
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ export declare const PrefixContext: React.Context<string>;
9
+ export declare function usePrefix(): string;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2018
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
8
+ import { HTMLAttributes } from 'react';
9
+ declare const CheckboxSkeleton: {
10
+ ({ className, ...rest }: HTMLAttributes<HTMLDivElement>): JSX.Element;
11
+ propTypes: {
12
+ /**
13
+ * Specify an optional className to add.
14
+ */
15
+ className: PropTypes.Requireable<string>;
16
+ };
17
+ };
18
+ export default CheckboxSkeleton;
@@ -43,6 +43,5 @@ CheckboxSkeleton.propTypes = {
43
43
  */
44
44
  className: PropTypes__default["default"].string
45
45
  };
46
- var CheckboxSkeleton$1 = CheckboxSkeleton;
47
46
 
48
- exports["default"] = CheckboxSkeleton$1;
47
+ exports["default"] = CheckboxSkeleton;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2018
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { ReactNodeLike } from 'prop-types';
8
+ import React from 'react';
9
+ declare type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type';
10
+ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
11
+ /**
12
+ * Provide an `id` to uniquely identify the Checkbox input
13
+ */
14
+ id: string;
15
+ /**
16
+ * Provide a label to provide a description of the Checkbox input that you are
17
+ * exposing to the user
18
+ */
19
+ labelText: NonNullable<ReactNodeLike>;
20
+ /**
21
+ * Specify whether the underlying input should be checked by default
22
+ */
23
+ defaultChecked?: boolean;
24
+ /**
25
+ * Specify whether the Checkbox should be disabled
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Specify whether the label should be hidden, or not
30
+ */
31
+ hideLabel?: boolean;
32
+ /**
33
+ * Specify whether the Checkbox is in an indeterminate state
34
+ */
35
+ indeterminate?: boolean;
36
+ /**
37
+ * Provide an optional handler that is called when the internal state of
38
+ * Checkbox changes. This handler is called with event and state info.
39
+ * `(event, { checked, id }) => void`
40
+ */
41
+ onChange?: (evt: React.ChangeEvent<HTMLInputElement>, data: {
42
+ checked: boolean;
43
+ id: string;
44
+ }) => void;
45
+ }
46
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<unknown>>;
47
+ export default Checkbox;
@@ -24,7 +24,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
25
 
26
26
  var _excluded = ["className", "id", "labelText", "onChange", "indeterminate", "hideLabel", "title"];
27
- var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkbox(_ref, _ref2) {
27
+ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, _ref2) {
28
28
  var className = _ref.className,
29
29
  id = _ref.id,
30
30
  labelText = _ref.labelText,
@@ -43,7 +43,7 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
43
43
  }, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, other, {
44
44
  type: "checkbox",
45
45
  onChange: function onChange(evt) {
46
- _onChange(evt, {
46
+ _onChange && _onChange(evt, {
47
47
  checked: evt.target.checked,
48
48
  id: id
49
49
  });
@@ -51,20 +51,20 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
51
51
  className: "".concat(prefix, "--checkbox"),
52
52
  id: id,
53
53
  ref: function ref(el) {
54
- if (el) {
54
+ if (el && indeterminate) {
55
55
  el.indeterminate = indeterminate;
56
56
  }
57
57
 
58
58
  if (typeof _ref2 === 'function') {
59
59
  _ref2(el);
60
- } else if (Object(_ref2) === _ref2) {
60
+ } else if (_ref2 && Object(_ref2) === _ref2) {
61
61
  _ref2.current = el;
62
62
  }
63
63
  }
64
64
  })), /*#__PURE__*/React__default["default"].createElement("label", {
65
65
  htmlFor: id,
66
66
  className: "".concat(prefix, "--checkbox-label"),
67
- title: title || null
67
+ title: title
68
68
  }, /*#__PURE__*/React__default["default"].createElement(Text.Text, {
69
69
  className: innerLabelClasses
70
70
  }, labelText)));
@@ -128,6 +128,5 @@ Checkbox.defaultProps = {
128
128
  indeterminate: false
129
129
  };
130
130
  Checkbox.displayName = 'Checkbox';
131
- var Checkbox$1 = Checkbox;
132
131
 
133
- exports["default"] = Checkbox$1;
132
+ exports["default"] = Checkbox;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2018
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { default as CheckboxSkeleton } from './Checkbox.Skeleton';
8
+ import Checkbox, { CheckboxProps } from './Checkbox';
9
+ export type { CheckboxProps };
10
+ export default Checkbox;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2022
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var Checkbox_Skeleton = require('./Checkbox.Skeleton.js');
13
+ var Checkbox = require('./Checkbox.js');
14
+
15
+
16
+
17
+ exports.CheckboxSkeleton = Checkbox_Skeleton["default"];
18
+ exports["default"] = Checkbox["default"];
@@ -13,7 +13,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
- var index = require('../Search/index.js');
16
+ var Search = require('../Search/Search.js');
17
17
  var instanceId = require('./tools/instanceId.js');
18
18
  var usePrefix = require('../../internal/usePrefix.js');
19
19
 
@@ -124,7 +124,7 @@ var TableToolbarSearch = function TableToolbarSearch(_ref) {
124
124
  return !value && handleExpand(event, false);
125
125
  };
126
126
 
127
- return /*#__PURE__*/React__default["default"].createElement(index["default"], _rollupPluginBabelHelpers["extends"]({
127
+ return /*#__PURE__*/React__default["default"].createElement(Search["default"], _rollupPluginBabelHelpers["extends"]({
128
128
  disabled: disabled,
129
129
  className: searchClasses,
130
130
  value: value,
@@ -12,7 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var React = require('react');
14
14
  var cx = require('classnames');
15
- var index = require('../Search/index.js');
15
+ var Search = require('../Search/Search.js');
16
16
  var usePrefix = require('../../internal/usePrefix.js');
17
17
  var events = require('../../tools/events.js');
18
18
 
@@ -68,7 +68,7 @@ function ExpandableSearch(_ref) {
68
68
  }
69
69
 
70
70
  var classes = cx__default["default"]("".concat(prefix, "--search--expandable"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--search--expanded"), expanded), props.className);
71
- return /*#__PURE__*/React__default["default"].createElement(index["default"], _rollupPluginBabelHelpers["extends"]({}, props, {
71
+ return /*#__PURE__*/React__default["default"].createElement(Search["default"], _rollupPluginBabelHelpers["extends"]({}, props, {
72
72
  ref: searchRef,
73
73
  className: classes,
74
74
  onFocus: events.composeEventHandlers([onFocus, handleFocus]),
@@ -78,6 +78,6 @@ function ExpandableSearch(_ref) {
78
78
  }));
79
79
  }
80
80
 
81
- ExpandableSearch.propTypes = index["default"].propTypes;
81
+ ExpandableSearch.propTypes = Search["default"].propTypes;
82
82
 
83
83
  exports["default"] = ExpandableSearch;
@@ -46,11 +46,6 @@ Grid.propTypes = {
46
46
  */
47
47
  className: PropTypes__default["default"].string,
48
48
 
49
- /**
50
- * Specify how many columns wide the Grid should span
51
- */
52
- columns: PropTypes__default["default"].number,
53
-
54
49
  /**
55
50
  * Collapse the gutter to 1px. Useful for fluid layouts.
56
51
  * Rows have 1px of margin between them to match gutter.