@carbon/react 1.53.0 → 1.53.1

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import PropTypes from 'prop-types';
10
+ import React__default from 'react';
11
+ import cx from 'classnames';
12
+ import { usePrefix } from '../../internal/usePrefix.js';
13
+ import SkeletonIcon from '../SkeletonIcon/SkeletonIcon.js';
14
+
15
+ const AiSkeletonIcon = _ref => {
16
+ let {
17
+ className,
18
+ ...rest
19
+ } = _ref;
20
+ const prefix = usePrefix();
21
+ const AiSkeletonIconClasses = cx(className, {
22
+ [`${prefix}--skeleton__icon--ai`]: true
23
+ });
24
+ return /*#__PURE__*/React__default.createElement(SkeletonIcon, _extends({
25
+ className: AiSkeletonIconClasses
26
+ }, rest));
27
+ };
28
+ AiSkeletonIcon.propTypes = {
29
+ /**
30
+ * Specify an optional className to add.
31
+ */
32
+ className: PropTypes.string,
33
+ /**
34
+ * The CSS styles.
35
+ */
36
+ style: PropTypes.object
37
+ };
38
+
39
+ export { AiSkeletonIcon as default };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default from 'react';
10
+ import PropTypes from 'prop-types';
11
+ import cx from 'classnames';
12
+ import { usePrefix } from '../../internal/usePrefix.js';
13
+ import SkeletonPlaceholder from '../SkeletonPlaceholder/SkeletonPlaceholder.js';
14
+
15
+ const AiSkeletonPlaceholder = _ref => {
16
+ let {
17
+ className,
18
+ ...other
19
+ } = _ref;
20
+ const prefix = usePrefix();
21
+ const AiSkeletonPlaceholderClasses = cx({
22
+ className,
23
+ [`${prefix}--skeleton__placeholder--ai`]: true
24
+ }, className);
25
+ return /*#__PURE__*/React__default.createElement(SkeletonPlaceholder, _extends({
26
+ className: AiSkeletonPlaceholderClasses
27
+ }, other));
28
+ };
29
+ AiSkeletonPlaceholder.propTypes = {
30
+ /**
31
+ * Add a custom class to the component
32
+ * to set the height and width
33
+ */
34
+ className: PropTypes.string
35
+ };
36
+
37
+ export { AiSkeletonPlaceholder as default };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import PropTypes from 'prop-types';
10
+ import React__default from 'react';
11
+ import cx from 'classnames';
12
+ import { usePrefix } from '../../internal/usePrefix.js';
13
+ import SkeletonText from '../SkeletonText/SkeletonText.js';
14
+
15
+ const AiSkeletonText = _ref => {
16
+ let {
17
+ className,
18
+ ...rest
19
+ } = _ref;
20
+ const prefix = usePrefix();
21
+ const aiSkeletonTextClasses = cx(className, {
22
+ [`${prefix}--skeleton__text--ai`]: true
23
+ });
24
+ return /*#__PURE__*/React__default.createElement(SkeletonText, _extends({
25
+ className: aiSkeletonTextClasses
26
+ }, rest));
27
+ };
28
+ AiSkeletonText.propTypes = {
29
+ /**
30
+ * Specify an optional className to be applied to the container node
31
+ */
32
+ className: PropTypes.string,
33
+ /**
34
+ * generates skeleton text at a larger size
35
+ */
36
+ heading: PropTypes.bool,
37
+ /**
38
+ * the number of lines shown if paragraph is true
39
+ */
40
+ lineCount: PropTypes.number,
41
+ /**
42
+ * will generate multiple lines of text
43
+ */
44
+ paragraph: PropTypes.bool,
45
+ /**
46
+ * width (in px or %) of single line of text or max-width of paragraph lines
47
+ */
48
+ width: PropTypes.string
49
+ };
50
+
51
+ export { AiSkeletonText as default };
@@ -76,7 +76,6 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
76
76
  autoAlign = true,
77
77
  children,
78
78
  className,
79
- dotType,
80
79
  kind = 'default',
81
80
  onRevertClick,
82
81
  revertActive,
@@ -89,11 +88,6 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
89
88
  const id = useId('slug');
90
89
  const slugClasses = cx(className, {
91
90
  [`${prefix}--slug`]: true,
92
- [`${prefix}--slug--hollow`]: kind === 'hollow' || dotType === 'hollow',
93
- // Need to come up with a better name; explainable?
94
- // Need to be able to target the non-hollow variant another way
95
- // other than using `:not` all over the styles
96
- [`${prefix}--slug--enabled`]: kind !== 'hollow' && dotType !== 'hollow',
97
91
  [`${prefix}--slug--revert`]: revertActive
98
92
  });
99
93
  const slugButtonClasses = cx({
@@ -155,14 +149,10 @@ Slug.propTypes = {
155
149
  * Specify an optional className to be added to the AI slug
156
150
  */
157
151
  className: PropTypes.string,
158
- /**
159
- * Specify the type of dot that should be rendered in front of the inline variant
160
- */
161
- dotType: PropTypes.oneOf(['default', 'hollow']),
162
152
  /**
163
153
  * Specify the type of Slug, from the following list of types:
164
154
  */
165
- kind: PropTypes.oneOf(['default', 'hollow', 'inline']),
155
+ kind: PropTypes.oneOf(['default', 'inline']),
166
156
  /**
167
157
  * Callback function that fires when the revert button is clicked
168
158
  */
package/es/index.d.ts CHANGED
@@ -116,6 +116,7 @@ export * from './components/Popover';
116
116
  export * from './components/ProgressBar';
117
117
  export { Slug as unstable__Slug, SlugContent as unstable__SlugContent, SlugActions as unstable__SlugActions, } from './components/Slug';
118
118
  export { ChatButton as unstable__ChatButton, ChatButtonSkeleton as unstable__ChatButtonSkeleton, } from './components/ChatButton';
119
+ export { AiSkeletonText as unstable__AiSkeletonText, AiSkeletonIcon as unstable__AiSkeletonIcon, AiSkeletonPlaceholder as unstable__AiSkeletonPlaceholder, } from './components/AiSkeleton';
119
120
  export * from './components/Stack';
120
121
  export * from './components/Tooltip';
121
122
  export { Text as unstable_Text, TextDirection as unstable_TextDirection, } from './components/Text';
package/es/index.js CHANGED
@@ -151,6 +151,9 @@ export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/Overflow
151
151
  export { Popover, PopoverContent } from './components/Popover/index.js';
152
152
  export { default as ProgressBar } from './components/ProgressBar/ProgressBar.js';
153
153
  export { Slug as unstable__Slug, SlugActions as unstable__SlugActions, SlugContent as unstable__SlugContent } from './components/Slug/index.js';
154
+ export { default as unstable__AiSkeletonPlaceholder } from './components/AiSkeleton/AiSkeletonPlaceholder.js';
155
+ export { default as unstable__AiSkeletonIcon } from './components/AiSkeleton/AiSkeletonIcon.js';
156
+ export { default as unstable__AiSkeletonText } from './components/AiSkeleton/AiSkeletonText.js';
154
157
  export { HStack, VStack } from './components/Stack/index.js';
155
158
  export { DefinitionTooltip } from './components/Tooltip/DefinitionTooltip.js';
156
159
  export { Tooltip } from './components/Tooltip/Tooltip.js';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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 _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var PropTypes = require('prop-types');
14
+ var React = require('react');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonIcon = require('../SkeletonIcon/SkeletonIcon.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonIcon = _ref => {
26
+ let {
27
+ className,
28
+ ...rest
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const AiSkeletonIconClasses = cx__default["default"](className, {
32
+ [`${prefix}--skeleton__icon--ai`]: true
33
+ });
34
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonIcon["default"], _rollupPluginBabelHelpers["extends"]({
35
+ className: AiSkeletonIconClasses
36
+ }, rest));
37
+ };
38
+ AiSkeletonIcon.propTypes = {
39
+ /**
40
+ * Specify an optional className to add.
41
+ */
42
+ className: PropTypes__default["default"].string,
43
+ /**
44
+ * The CSS styles.
45
+ */
46
+ style: PropTypes__default["default"].object
47
+ };
48
+
49
+ exports["default"] = AiSkeletonIcon;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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 _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var PropTypes = require('prop-types');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonPlaceholder = require('../SkeletonPlaceholder/SkeletonPlaceholder.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonPlaceholder = _ref => {
26
+ let {
27
+ className,
28
+ ...other
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const AiSkeletonPlaceholderClasses = cx__default["default"]({
32
+ className,
33
+ [`${prefix}--skeleton__placeholder--ai`]: true
34
+ }, className);
35
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonPlaceholder["default"], _rollupPluginBabelHelpers["extends"]({
36
+ className: AiSkeletonPlaceholderClasses
37
+ }, other));
38
+ };
39
+ AiSkeletonPlaceholder.propTypes = {
40
+ /**
41
+ * Add a custom class to the component
42
+ * to set the height and width
43
+ */
44
+ className: PropTypes__default["default"].string
45
+ };
46
+
47
+ exports["default"] = AiSkeletonPlaceholder;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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 _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var PropTypes = require('prop-types');
14
+ var React = require('react');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonText = require('../SkeletonText/SkeletonText.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonText = _ref => {
26
+ let {
27
+ className,
28
+ ...rest
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const aiSkeletonTextClasses = cx__default["default"](className, {
32
+ [`${prefix}--skeleton__text--ai`]: true
33
+ });
34
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonText["default"], _rollupPluginBabelHelpers["extends"]({
35
+ className: aiSkeletonTextClasses
36
+ }, rest));
37
+ };
38
+ AiSkeletonText.propTypes = {
39
+ /**
40
+ * Specify an optional className to be applied to the container node
41
+ */
42
+ className: PropTypes__default["default"].string,
43
+ /**
44
+ * generates skeleton text at a larger size
45
+ */
46
+ heading: PropTypes__default["default"].bool,
47
+ /**
48
+ * the number of lines shown if paragraph is true
49
+ */
50
+ lineCount: PropTypes__default["default"].number,
51
+ /**
52
+ * will generate multiple lines of text
53
+ */
54
+ paragraph: PropTypes__default["default"].bool,
55
+ /**
56
+ * width (in px or %) of single line of text or max-width of paragraph lines
57
+ */
58
+ width: PropTypes__default["default"].string
59
+ };
60
+
61
+ exports["default"] = AiSkeletonText;
@@ -86,7 +86,6 @@ const Slug = /*#__PURE__*/React__default["default"].forwardRef(function Slug(_re
86
86
  autoAlign = true,
87
87
  children,
88
88
  className,
89
- dotType,
90
89
  kind = 'default',
91
90
  onRevertClick,
92
91
  revertActive,
@@ -99,11 +98,6 @@ const Slug = /*#__PURE__*/React__default["default"].forwardRef(function Slug(_re
99
98
  const id = useId.useId('slug');
100
99
  const slugClasses = cx__default["default"](className, {
101
100
  [`${prefix}--slug`]: true,
102
- [`${prefix}--slug--hollow`]: kind === 'hollow' || dotType === 'hollow',
103
- // Need to come up with a better name; explainable?
104
- // Need to be able to target the non-hollow variant another way
105
- // other than using `:not` all over the styles
106
- [`${prefix}--slug--enabled`]: kind !== 'hollow' && dotType !== 'hollow',
107
101
  [`${prefix}--slug--revert`]: revertActive
108
102
  });
109
103
  const slugButtonClasses = cx__default["default"]({
@@ -165,14 +159,10 @@ Slug.propTypes = {
165
159
  * Specify an optional className to be added to the AI slug
166
160
  */
167
161
  className: PropTypes__default["default"].string,
168
- /**
169
- * Specify the type of dot that should be rendered in front of the inline variant
170
- */
171
- dotType: PropTypes__default["default"].oneOf(['default', 'hollow']),
172
162
  /**
173
163
  * Specify the type of Slug, from the following list of types:
174
164
  */
175
- kind: PropTypes__default["default"].oneOf(['default', 'hollow', 'inline']),
165
+ kind: PropTypes__default["default"].oneOf(['default', 'inline']),
176
166
  /**
177
167
  * Callback function that fires when the revert button is clicked
178
168
  */
package/lib/index.d.ts CHANGED
@@ -116,6 +116,7 @@ export * from './components/Popover';
116
116
  export * from './components/ProgressBar';
117
117
  export { Slug as unstable__Slug, SlugContent as unstable__SlugContent, SlugActions as unstable__SlugActions, } from './components/Slug';
118
118
  export { ChatButton as unstable__ChatButton, ChatButtonSkeleton as unstable__ChatButtonSkeleton, } from './components/ChatButton';
119
+ export { AiSkeletonText as unstable__AiSkeletonText, AiSkeletonIcon as unstable__AiSkeletonIcon, AiSkeletonPlaceholder as unstable__AiSkeletonPlaceholder, } from './components/AiSkeleton';
119
120
  export * from './components/Stack';
120
121
  export * from './components/Tooltip';
121
122
  export { Text as unstable_Text, TextDirection as unstable_TextDirection, } from './components/Text';
package/lib/index.js CHANGED
@@ -155,6 +155,9 @@ var index$2 = require('./components/OverflowMenuV2/index.js');
155
155
  var index$g = require('./components/Popover/index.js');
156
156
  var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
157
157
  var index$3 = require('./components/Slug/index.js');
158
+ var AiSkeletonPlaceholder = require('./components/AiSkeleton/AiSkeletonPlaceholder.js');
159
+ var AiSkeletonIcon = require('./components/AiSkeleton/AiSkeletonIcon.js');
160
+ var AiSkeletonText = require('./components/AiSkeleton/AiSkeletonText.js');
158
161
  var index$h = require('./components/Stack/index.js');
159
162
  var DefinitionTooltip = require('./components/Tooltip/DefinitionTooltip.js');
160
163
  var Tooltip = require('./components/Tooltip/Tooltip.js');
@@ -416,6 +419,9 @@ exports.ProgressBar = ProgressBar["default"];
416
419
  exports.unstable__Slug = index$3.Slug;
417
420
  exports.unstable__SlugActions = index$3.SlugActions;
418
421
  exports.unstable__SlugContent = index$3.SlugContent;
422
+ exports.unstable__AiSkeletonPlaceholder = AiSkeletonPlaceholder["default"];
423
+ exports.unstable__AiSkeletonIcon = AiSkeletonIcon["default"];
424
+ exports.unstable__AiSkeletonText = AiSkeletonText["default"];
419
425
  exports.HStack = index$h.HStack;
420
426
  exports.VStack = index$h.VStack;
421
427
  exports.DefinitionTooltip = DefinitionTooltip.DefinitionTooltip;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/react",
3
3
  "description": "React components for the Carbon Design System",
4
- "version": "1.53.0",
4
+ "version": "1.53.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -51,7 +51,7 @@
51
51
  "@carbon/feature-flags": "^0.18.0",
52
52
  "@carbon/icons-react": "^11.38.0",
53
53
  "@carbon/layout": "^11.21.0",
54
- "@carbon/styles": "^1.53.0",
54
+ "@carbon/styles": "^1.53.1",
55
55
  "@ibm/telemetry-js": "^1.2.1",
56
56
  "classnames": "2.5.1",
57
57
  "copy-to-clipboard": "^3.3.1",
@@ -79,7 +79,7 @@
79
79
  "@babel/preset-react": "^7.22.3",
80
80
  "@babel/preset-typescript": "^7.21.5",
81
81
  "@carbon/test-utils": "^10.30.0",
82
- "@carbon/themes": "^11.33.0",
82
+ "@carbon/themes": "^11.33.1",
83
83
  "@rollup/plugin-babel": "^6.0.0",
84
84
  "@rollup/plugin-commonjs": "^25.0.0",
85
85
  "@rollup/plugin-node-resolve": "^15.0.0",
@@ -139,5 +139,5 @@
139
139
  "**/*.scss",
140
140
  "**/*.css"
141
141
  ],
142
- "gitHead": "7920f5261d5867837e0b7e6092c98a6597ac0771"
142
+ "gitHead": "56291fbf93e5fe5a8b75cdc162131784cdc57947"
143
143
  }