@carbon/ibm-products 1.57.0 → 1.58.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/css/index-full-carbon.css +336 -900
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -3
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon.css +336 -900
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +3 -3
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +336 -900
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +3 -3
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/Checklist/Checklist.js +277 -0
  14. package/es/components/Checklist/ChecklistChart.js +104 -0
  15. package/es/components/Checklist/ChecklistIcon.js +105 -0
  16. package/es/components/Checklist/index.js +8 -0
  17. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -0
  18. package/es/components/NonLinearReading/NonLinearReading.js +9 -4
  19. package/es/components/index.js +2 -1
  20. package/es/global/js/package-settings.js +1 -0
  21. package/lib/components/Checklist/Checklist.js +267 -0
  22. package/lib/components/Checklist/ChecklistChart.js +94 -0
  23. package/lib/components/Checklist/ChecklistIcon.js +92 -0
  24. package/lib/components/Checklist/index.js +12 -0
  25. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -0
  26. package/lib/components/NonLinearReading/NonLinearReading.js +8 -3
  27. package/lib/components/index.js +8 -1
  28. package/lib/global/js/package-settings.js +1 -0
  29. package/package.json +2 -2
  30. package/scss/components/Checklist/_checklist.scss +231 -0
  31. package/scss/components/Checklist/_index.scss +8 -0
  32. package/scss/components/Checklist/_storybook-styles.scss +13 -0
  33. package/scss/components/Datagrid/styles/_datagrid.scss +31 -5
  34. package/scss/components/NonLinearReading/_non-linear-reading.scss +76 -64
  35. package/scss/components/_index.scss +1 -0
@@ -0,0 +1,277 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
+ var _excluded = ["chartValue", "chartLabel", "checklistAriaLabel", "checklistToggleAriaLabel", "className", "onClickViewAll", "onToggle", "open", "showToggle", "taskLists", "theme", "title", "viewAllLabel"];
6
+ /**
7
+ * Copyright IBM Corp. 2023, 2023
8
+ *
9
+ * This source code is licensed under the Apache-2.0 license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+
13
+ /**
14
+ * TODO: Breakdown titles, icons, clickable items into sub-components
15
+ * See
16
+ * ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
17
+ * PageHeader (PageHeaderTitle, PageHeaderUtils)
18
+ */
19
+
20
+ // Import portions of React that are needed.
21
+ import React, { useEffect, useRef, useState } from 'react';
22
+
23
+ // Other standard imports.
24
+ import PropTypes from 'prop-types';
25
+ import cx from 'classnames';
26
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
27
+ import uuidv4 from '../../global/js/utils/uuidv4';
28
+ import { pkg /*, carbon */ } from '../../settings';
29
+
30
+ // Carbon and package components we use.
31
+ /* TODO: @import(s) of carbon components and other package components. */
32
+ import { Button } from 'carbon-components-react';
33
+ import { ChevronUp16 } from '@carbon/icons-react';
34
+ import { ChecklistIcon } from './ChecklistIcon';
35
+ import { ChecklistChart } from './ChecklistChart';
36
+
37
+ // The block part of our conventional BEM class names (blockClass__E--M).
38
+ var blockClass = "".concat(pkg.prefix, "--checklist");
39
+ var componentName = 'Checklist';
40
+
41
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
42
+
43
+ // Default values can be included here and then assigned to the prop params,
44
+ // e.g. prop = defaults.prop,
45
+ // This gathers default values together neatly and ensures non-primitive
46
+ // values are initialized early to avoid react making unnecessary re-renders.
47
+ // Note that default values are not required for props that are 'required',
48
+ // nor for props where the component can apply undefined values reasonably.
49
+ // Default values should be provided when the component needs to make a choice
50
+ // or assumption when a prop is not supplied.
51
+
52
+ // Default values for props
53
+ var defaults = {
54
+ checklistAriaLabel: 'Checklist',
55
+ checklistToggleAriaLabel: 'Checklist toggle',
56
+ onClickViewAll: function onClickViewAll() {},
57
+ onToggle: function onToggle() {},
58
+ open: true,
59
+ showToggle: true,
60
+ taskLists: [],
61
+ theme: 'light'
62
+ };
63
+
64
+ /**
65
+ * TODO: A description of the component.
66
+ */
67
+ export var Checklist = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
68
+ var chartValue = _ref.chartValue,
69
+ chartLabel = _ref.chartLabel,
70
+ _ref$checklistAriaLab = _ref.checklistAriaLabel,
71
+ checklistAriaLabel = _ref$checklistAriaLab === void 0 ? defaults.checklistAriaLabel : _ref$checklistAriaLab,
72
+ _ref$checklistToggleA = _ref.checklistToggleAriaLabel,
73
+ checklistToggleAriaLabel = _ref$checklistToggleA === void 0 ? defaults.checklistToggleAriaLabel : _ref$checklistToggleA,
74
+ className = _ref.className,
75
+ _ref$onClickViewAll = _ref.onClickViewAll,
76
+ onClickViewAll = _ref$onClickViewAll === void 0 ? defaults.onClickViewAll : _ref$onClickViewAll,
77
+ _ref$onToggle = _ref.onToggle,
78
+ onToggle = _ref$onToggle === void 0 ? defaults.onToggle : _ref$onToggle,
79
+ _ref$open = _ref.open,
80
+ open = _ref$open === void 0 ? defaults.open : _ref$open,
81
+ _ref$showToggle = _ref.showToggle,
82
+ showToggle = _ref$showToggle === void 0 ? defaults.showToggle : _ref$showToggle,
83
+ _ref$taskLists = _ref.taskLists,
84
+ taskLists = _ref$taskLists === void 0 ? defaults.taskLists : _ref$taskLists,
85
+ _ref$theme = _ref.theme,
86
+ theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
87
+ title = _ref.title,
88
+ viewAllLabel = _ref.viewAllLabel,
89
+ rest = _objectWithoutProperties(_ref, _excluded);
90
+ var _useState = useState(open),
91
+ _useState2 = _slicedToArray(_useState, 2),
92
+ isOpen = _useState2[0],
93
+ setIsOpen = _useState2[1];
94
+ var listContainerId = useRef(uuidv4()).current;
95
+ var chartLabelId = useRef(uuidv4()).current;
96
+
97
+ // Don't use this test: {chartValue && chartLabel && (render...)}.
98
+ // If `chartValue` is 0 (zero) - a valid value - then it will render 0 and skip the remaining statement.
99
+ // Use this test instead: {chartLabelAndValue && (render...)}.
100
+ // The ChecklistChart component will validate `chartValue`.
101
+ var chartLabelAndValue = typeof chartValue === 'number' && chartLabel;
102
+ var handleClickToggle = function handleClickToggle() {
103
+ setIsOpen(function (prevOpen) {
104
+ return !prevOpen;
105
+ });
106
+ };
107
+ var handleClickViewAll = function handleClickViewAll() {
108
+ onClickViewAll();
109
+ };
110
+
111
+ // If state changes, then trigger callback.
112
+ useEffect(function () {
113
+ onToggle(isOpen);
114
+ }, [isOpen, onToggle]);
115
+
116
+ // If the "open" prop is changed after initialization,
117
+ // then update internal state.
118
+ useEffect(function () {
119
+ setIsOpen(open);
120
+ }, [open]);
121
+ return /*#__PURE__*/React.createElement("aside", _extends({}, rest, {
122
+ "aria-label": checklistAriaLabel,
123
+ className: cx(blockClass,
124
+ // Apply the block class to the main HTML element
125
+ className, // Apply any supplied class names to the main HTML element.
126
+ // example: `${blockClass}__template-string-class-${kind}-n-${size}`,
127
+ _defineProperty({}, "".concat(blockClass, "__closed"), !isOpen)),
128
+ ref: ref
129
+ }, getDevtoolsProps(componentName)), (title || chartLabelAndValue) && /*#__PURE__*/React.createElement("header", {
130
+ className: "".concat(blockClass, "__header")
131
+ }, chartLabelAndValue && /*#__PURE__*/React.createElement(ChecklistChart, {
132
+ ariaLabelledById: chartLabelId,
133
+ value: chartValue,
134
+ theme: theme
135
+ }), /*#__PURE__*/React.createElement("div", {
136
+ className: "".concat(blockClass, "__titles")
137
+ }, title && /*#__PURE__*/React.createElement("h2", {
138
+ className: "".concat(blockClass, "__title")
139
+ }, title), chartLabelAndValue && /*#__PURE__*/React.createElement("h3", {
140
+ id: chartLabelId,
141
+ className: "".concat(blockClass, "__chart-label")
142
+ }, chartLabel)), showToggle && /*#__PURE__*/React.createElement(Button, {
143
+ "aria-controls": listContainerId,
144
+ "aria-expanded": isOpen,
145
+ "aria-label": checklistToggleAriaLabel,
146
+ className: "".concat(blockClass, "__toggle"),
147
+ kind: "ghost",
148
+ onClick: handleClickToggle,
149
+ size: "small"
150
+ }, /*#__PURE__*/React.createElement(ChevronUp16, {
151
+ className: cx("".concat(blockClass, "__chevron"))
152
+ }))), /*#__PURE__*/React.createElement("div", {
153
+ id: listContainerId,
154
+ className: "".concat(blockClass, "__content-outer")
155
+ }, /*#__PURE__*/React.createElement("div", {
156
+ className: "".concat(blockClass, "__content-inner")
157
+ }, /*#__PURE__*/React.createElement("section", {
158
+ className: cx("".concat(blockClass, "__body"))
159
+ }, taskLists.map(function (list, index) {
160
+ return /*#__PURE__*/React.createElement("div", {
161
+ className: "".concat(blockClass, "__list-group"),
162
+ key: "".concat(list.title, "-").concat(index)
163
+ }, list.title && /*#__PURE__*/React.createElement("h3", {
164
+ title: list.title,
165
+ className: "".concat(blockClass, "__list-title")
166
+ }, list.title), /*#__PURE__*/React.createElement("ol", {
167
+ className: "".concat(blockClass, "__list")
168
+ }, list.tasks.map(function (item, index) {
169
+ return /*#__PURE__*/React.createElement("li", {
170
+ className: "".concat(blockClass, "__list-item"),
171
+ key: "".concat(item.label, "-").concat(index)
172
+ }, /*#__PURE__*/React.createElement(ChecklistIcon, {
173
+ kind: item.kind
174
+ }), typeof item.onClick === 'function' ? /*#__PURE__*/React.createElement(Button, {
175
+ className: cx("".concat(blockClass, "__button"), _defineProperty({}, "".concat(blockClass, "__button--error"), item.kind === 'error')),
176
+ onClick: function onClick() {
177
+ item.onClick(item);
178
+ },
179
+ size: "small"
180
+ }, /*#__PURE__*/React.createElement("div", {
181
+ title: item.label
182
+ }, item.label)) : /*#__PURE__*/React.createElement("span", {
183
+ className: cx("".concat(blockClass, "__label"), "".concat(blockClass, "__label--").concat(item.kind)),
184
+ title: item.label
185
+ }, item.label));
186
+ })));
187
+ })), viewAllLabel && /*#__PURE__*/React.createElement("footer", {
188
+ className: "".concat(blockClass, "__footer")
189
+ }, /*#__PURE__*/React.createElement(Button, {
190
+ className: cx("".concat(blockClass, "__button"), "".concat(blockClass, "__view-all")),
191
+ onClick: handleClickViewAll,
192
+ size: "small"
193
+ }, /*#__PURE__*/React.createElement("div", null, viewAllLabel))))));
194
+ });
195
+
196
+ // Return a placeholder if not released and not enabled by feature flag
197
+ Checklist = pkg.checkComponentEnabled(Checklist, componentName);
198
+
199
+ // The display name of the component, used by React. Note that displayName
200
+ // is used in preference to relying on function.name.
201
+ Checklist.displayName = componentName;
202
+
203
+ // The types and DocGen commentary for the component props,
204
+ // in alphabetical order (for consistency).
205
+ // See https://www.npmjs.com/package/prop-types#usage.
206
+ Checklist.propTypes = {
207
+ /**
208
+ * Define both `chartLabel` and `chartValue` to show the chart and its label together.
209
+ */
210
+ chartLabel: PropTypes.string,
211
+ /**
212
+ * A number between 0 and 1.
213
+ *
214
+ * Define both `chartLabel` and `chartValue` to show the chart and its label together.
215
+ */
216
+ chartValue: PropTypes.number,
217
+ /**
218
+ * Aria-label for the Checklist component.
219
+ */
220
+ checklistAriaLabel: PropTypes.string,
221
+ /**
222
+ * Aria-label for the Checklist's toggle component.
223
+ */
224
+ checklistToggleAriaLabel: PropTypes.string,
225
+ /**
226
+ * Provide an optional class to be applied to the containing node.
227
+ */
228
+ className: PropTypes.string,
229
+ /**
230
+ * Callback for the "View all" button. See also `viewAllLabel`.
231
+ */
232
+ onClickViewAll: PropTypes.func,
233
+ /**
234
+ * Optional callback for when the list is opened/closed.
235
+ */
236
+ onToggle: PropTypes.func,
237
+ /**
238
+ * Specifies whether the component is opened or closed.
239
+ * This can be set during initialization, or changed after being rendered.
240
+ */
241
+ open: PropTypes.bool,
242
+ /**
243
+ * Whether or not to show the open/close toggle.
244
+ */
245
+ showToggle: PropTypes.bool,
246
+ /**
247
+ * The task list can be broken down into sub-lists.
248
+ *
249
+ * Each sub-list can include an optional `title`.
250
+ *
251
+ * Each task must specify the appropriate icon (`kind`) and `label`.
252
+ *
253
+ * If any task has an `onClick` callback function defined,
254
+ * then the `label` will be rendered as a button,
255
+ * else the `label` will be rendered as plain text.
256
+ */
257
+ taskLists: PropTypes.arrayOf(PropTypes.shape({
258
+ title: PropTypes.string,
259
+ tasks: PropTypes.arrayOf(PropTypes.shape({
260
+ kind: PropTypes.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']).isRequired,
261
+ label: PropTypes.string.isRequired,
262
+ onClick: PropTypes.func
263
+ })).isRequired
264
+ })).isRequired,
265
+ /**
266
+ * Determines the theme of the component.
267
+ */
268
+ theme: PropTypes.oneOf(['light', 'dark']),
269
+ /**
270
+ * The title of the component.
271
+ */
272
+ title: PropTypes.string,
273
+ /**
274
+ * If defined, will show and enable the "View all (#)" button at the bottom of the list.
275
+ */
276
+ viewAllLabel: PropTypes.string
277
+ };
@@ -0,0 +1,104 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["className", "ariaLabelledById", "value", "theme"];
4
+ /**
5
+ * Copyright IBM Corp. 2023, 2023
6
+ *
7
+ * This source code is licensed under the Apache-2.0 license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ /**
12
+ * TODO: Breakdown titles, icons, clickable items into sub-components
13
+ * See
14
+ * ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
15
+ * PageHeader (PageHeaderTitle, PageHeaderUtils)
16
+ */
17
+
18
+ // Import portions of React that are needed.
19
+ import React from 'react';
20
+
21
+ // Other standard imports.
22
+ import PropTypes from 'prop-types';
23
+ import cx from 'classnames';
24
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
25
+ import { pkg /*, carbon */ } from '../../settings';
26
+ import clamp from 'lodash/clamp';
27
+
28
+ // Carbon and package components we use.
29
+ /* TODO: @import(s) of carbon components and other package components. */
30
+
31
+ // The block part of our conventional BEM class names (blockClass__E--M).
32
+ var blockClass = "".concat(pkg.prefix, "--checklist__chart");
33
+ var componentName = 'ChecklistChart';
34
+
35
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
36
+
37
+ // Default values can be included here and then assigned to the prop params,
38
+ // e.g. prop = defaults.prop,
39
+ // This gathers default values together neatly and ensures non-primitive
40
+ // values are initialized early to avoid react making unnecessary re-renders.
41
+ // Note that default values are not required for props that are 'required',
42
+ // nor for props where the component can apply undefined values reasonably.
43
+ // Default values should be provided when the component needs to make a choice
44
+ // or assumption when a prop is not supplied.
45
+
46
+ // Default values for props
47
+ var defaults = {
48
+ theme: 'light'
49
+ };
50
+
51
+ /**
52
+ * TODO: A description of the component.
53
+ */
54
+ export var ChecklistChart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
55
+ var className = _ref.className,
56
+ ariaLabelledById = _ref.ariaLabelledById,
57
+ value = _ref.value,
58
+ _ref$theme = _ref.theme,
59
+ theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
60
+ rest = _objectWithoutProperties(_ref, _excluded);
61
+ var numDegrees = clamp(value * 360, 0, 360);
62
+ var circleColor = theme === 'light' ? '#c6c6c6' : '#525252'; // $gray-30, $gray-70
63
+ var progressColor = theme === 'light' ? '#6929c4' : '#A56EFF'; // $purple-70, $purple-50
64
+
65
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
66
+ "aria-labelledby": ariaLabelledById,
67
+ className: cx(blockClass, className),
68
+ style: {
69
+ backgroundImage: "conic-gradient(".concat(progressColor, " ").concat(numDegrees, "deg, ").concat(circleColor, " ").concat(numDegrees, "deg 360deg)"),
70
+ borderRadius: '50%'
71
+ },
72
+ ref: ref,
73
+ role: "img"
74
+ }, getDevtoolsProps(componentName)));
75
+ });
76
+
77
+ // Return a placeholder if not released and not enabled by feature flag
78
+ // ChecklistChart = pkg.checkComponentEnabled(ChecklistChart, componentName);
79
+
80
+ // The display name of the component, used by React. Note that displayName
81
+ // is used in preference to relying on function.name.
82
+ // ChecklistChart.displayName = componentName;
83
+
84
+ // The types and DocGen commentary for the component props,
85
+ // in alphabetical order (for consistency).
86
+ // See https://www.npmjs.com/package/prop-types#usage.
87
+ ChecklistChart.propTypes = {
88
+ /**
89
+ * Id of the parent's aria-label for accessibility.
90
+ */
91
+ ariaLabelledById: PropTypes.string.isRequired,
92
+ /**
93
+ * Optional class name for this component.
94
+ */
95
+ className: PropTypes.string,
96
+ /**
97
+ * Determines the theme of the component.
98
+ */
99
+ theme: PropTypes.oneOf(['light', 'dark']),
100
+ /**
101
+ * Number between 0 and 1.
102
+ */
103
+ value: PropTypes.number.isRequired
104
+ };
@@ -0,0 +1,105 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["className", "kind", "theme"];
4
+ /**
5
+ * Copyright IBM Corp. 2023, 2023
6
+ *
7
+ * This source code is licensed under the Apache-2.0 license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ /**
12
+ * TODO: Breakdown titles, icons, clickable items into sub-components
13
+ * See
14
+ * ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
15
+ * PageHeader (PageHeaderTitle, PageHeaderUtils)
16
+ */
17
+
18
+ // Import portions of React that are needed.
19
+ import React from 'react';
20
+
21
+ // Other standard imports.
22
+ import PropTypes from 'prop-types';
23
+ import cx from 'classnames';
24
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
25
+ import { pkg /*, carbon */ } from '../../settings';
26
+
27
+ // Carbon and package components we use.
28
+ /* TODO: @import(s) of carbon components and other package components. */
29
+ import { CheckmarkOutline16, CircleDash16, Incomplete16, Warning16 } from '@carbon/icons-react';
30
+
31
+ // The block part of our conventional BEM class names (blockClass__E--M).
32
+ var blockClass = "".concat(pkg.prefix, "--checklist__icon");
33
+ var componentName = 'ChecklistIcon';
34
+
35
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
36
+
37
+ // Default values can be included here and then assigned to the prop params,
38
+ // e.g. prop = defaults.prop,
39
+ // This gathers default values together neatly and ensures non-primitive
40
+ // values are initialized early to avoid react making unnecessary re-renders.
41
+ // Note that default values are not required for props that are 'required',
42
+ // nor for props where the component can apply undefined values reasonably.
43
+ // Default values should be provided when the component needs to make a choice
44
+ // or assumption when a prop is not supplied.
45
+
46
+ // Default values for props
47
+ var defaults = {
48
+ theme: 'light'
49
+ };
50
+
51
+ /**
52
+ * TODO: A description of the component.
53
+ */
54
+ export var ChecklistIcon = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
55
+ var className = _ref.className,
56
+ kind = _ref.kind,
57
+ _ref$theme = _ref.theme,
58
+ theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
59
+ rest = _objectWithoutProperties(_ref, _excluded);
60
+ var Icon;
61
+ switch (kind) {
62
+ case 'error':
63
+ Icon = Warning16;
64
+ break;
65
+ case 'indeterminate':
66
+ Icon = Incomplete16;
67
+ break;
68
+ case 'checked':
69
+ Icon = CheckmarkOutline16;
70
+ break;
71
+ default:
72
+ // "unchecked" or "disabled"
73
+ Icon = CircleDash16;
74
+ break;
75
+ }
76
+ return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
77
+ className: cx(blockClass, className, "".concat(blockClass, "--").concat(kind), "".concat(blockClass, "__").concat(theme)),
78
+ ref: ref
79
+ }, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(Icon, null));
80
+ });
81
+
82
+ // Return a placeholder if not released and not enabled by feature flag
83
+ // ChecklistIcon = pkg.checkComponentEnabled(ChecklistIcon, componentName);
84
+
85
+ // The display name of the component, used by React. Note that displayName
86
+ // is used in preference to relying on function.name.
87
+ // ChecklistIcon.displayName = componentName;
88
+
89
+ // The types and DocGen commentary for the component props,
90
+ // in alphabetical order (for consistency).
91
+ // See https://www.npmjs.com/package/prop-types#usage.
92
+ ChecklistIcon.propTypes = {
93
+ /**
94
+ * Provide an optional class to be applied to the containing node.
95
+ */
96
+ className: PropTypes.string,
97
+ /**
98
+ * The icon to be displayed.
99
+ */
100
+ kind: PropTypes.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']),
101
+ /**
102
+ * Determines the theme of the component.
103
+ */
104
+ theme: PropTypes.oneOf(['light', 'dark'])
105
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 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
+ export { Checklist } from './Checklist';
@@ -47,6 +47,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
47
47
  gridHeight = _ref.gridHeight;
48
48
  headerRowElement.style.setProperty("--".concat(blockClass, "--row-height"), px(rowHeight));
49
49
  headerRowElement.style.setProperty("--".concat(blockClass, "--grid-height"), px(gridHeight - scrollBuffer - tableToolbarHeight));
50
+ headerRowElement.style.setProperty("--".concat(blockClass, "--header-height"), px(headerRowElement.offsetHeight));
50
51
  };
51
52
  setCustomValues({
52
53
  gridHeight: gridElement.offsetHeight,
@@ -9,11 +9,12 @@ var _excluded = ["children", "className", "definition", "theme"];
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
 
12
- import React, { useState } from 'react';
12
+ import React, { useRef, useState } from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import cx from 'classnames';
15
15
  import { ChevronDown16 } from '@carbon/icons-react';
16
16
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
+ import uuidv4 from '../../global/js/utils/uuidv4';
17
18
  import { pkg } from '../../settings';
18
19
 
19
20
  // The block part of our conventional BEM class names (blockClass__E--M).
@@ -41,6 +42,7 @@ export var NonLinearReading = /*#__PURE__*/React.forwardRef(function (_ref, ref)
41
42
  _useState2 = _slicedToArray(_useState, 2),
42
43
  isOpen = _useState2[0],
43
44
  setOpen = _useState2[1];
45
+ var contentId = useRef(uuidv4()).current;
44
46
  var handleToggle = function handleToggle() {
45
47
  setOpen(function (prevState) {
46
48
  return !prevState;
@@ -52,12 +54,15 @@ export var NonLinearReading = /*#__PURE__*/React.forwardRef(function (_ref, ref)
52
54
  role: "main"
53
55
  }, getDevtoolsProps(componentName)), ' ', /*#__PURE__*/React.createElement("button", {
54
56
  type: "button",
57
+ "aria-controls": contentId,
55
58
  "aria-expanded": isOpen,
56
59
  className: cx("".concat(blockClass, "__keyword"), [isOpen ? ["".concat(blockClass, "__keyword-open")] : ["".concat(blockClass, "__keyword-closed")]]),
57
60
  onClick: handleToggle
58
- }, children, /*#__PURE__*/React.createElement(ChevronDown16, null)), ' ', isOpen && /*#__PURE__*/React.createElement("span", {
59
- className: "".concat(blockClass, "__body")
60
- }, definition), ' ');
61
+ }, children, /*#__PURE__*/React.createElement(ChevronDown16, null)), ' ', /*#__PURE__*/React.createElement("span", {
62
+ id: contentId,
63
+ className: "".concat(blockClass, "__body"),
64
+ hidden: !isOpen
65
+ }, isOpen && definition), ' ');
61
66
  });
62
67
 
63
68
  // Return a placeholder if not released and not enabled by feature flag
@@ -53,4 +53,5 @@ export { CoachmarkButton } from './CoachmarkButton';
53
53
  export { CoachmarkOverlayElements } from './CoachmarkOverlayElements';
54
54
  export { CoachmarkOverlayElement } from './CoachmarkOverlayElement';
55
55
  export { CoachmarkStack } from './CoachmarkStack';
56
- export { InlineTip } from './InlineTip';
56
+ export { InlineTip } from './InlineTip';
57
+ export { Checklist } from './Checklist';
@@ -75,6 +75,7 @@ var defaults = {
75
75
  InlineTip: false,
76
76
  Guidebanner: false,
77
77
  NonLinearReading: false,
78
+ Checklist: false,
78
79
  Coachmark: false,
79
80
  CoachmarkBeacon: false,
80
81
  CoachmarkButton: false,