@carbon/ibm-products 2.17.1 → 2.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. package/css/index-full-carbon.css +17078 -15669
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +71 -9
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +5763 -6355
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +124 -9
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Carousel/Carousel.docs-page.js +11 -0
  18. package/es/components/Carousel/Carousel.js +322 -0
  19. package/es/components/Carousel/CarouselItem.js +53 -0
  20. package/es/components/Carousel/index.js +9 -0
  21. package/es/components/Carousel/utils.js +98 -0
  22. package/es/components/CreateSidePanel/CreateSidePanel.js +7 -1
  23. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -1
  24. package/es/components/Datagrid/Datagrid/DatagridRow.js +13 -3
  25. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +4 -3
  26. package/es/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +7 -1
  27. package/es/components/Datagrid/useExpandedRow.js +3 -6
  28. package/es/components/Datagrid/useFocusRowExpander.js +40 -0
  29. package/es/components/Datagrid/useNestedRowExpander.js +9 -0
  30. package/es/components/Datagrid/useNestedRows.js +1 -5
  31. package/es/components/Datagrid/useRowExpander.js +9 -0
  32. package/es/components/Datagrid/useSelectRows.js +9 -2
  33. package/es/components/Datagrid/utils/handleFilterTagLabelText.js +26 -0
  34. package/es/components/EditSidePanel/EditSidePanel.js +8 -2
  35. package/es/components/FilterSummary/FilterSummary.js +21 -7
  36. package/es/components/Guidebanner/Guidebanner.docs-page.js +15 -0
  37. package/es/components/Guidebanner/Guidebanner.js +221 -0
  38. package/es/components/Guidebanner/GuidebannerElement.js +72 -0
  39. package/es/components/Guidebanner/GuidebannerElementButton.js +80 -0
  40. package/es/components/Guidebanner/GuidebannerElementLink.js +57 -0
  41. package/es/components/Guidebanner/index.js +11 -0
  42. package/es/components/NonLinearReading/NonLinearReading.docs-page.js +15 -0
  43. package/es/components/NonLinearReading/NonLinearReading.js +89 -0
  44. package/es/components/NonLinearReading/index.js +8 -0
  45. package/es/components/SidePanel/SidePanel.js +48 -27
  46. package/es/components/TagSet/TagSet.js +22 -5
  47. package/es/components/WebTerminal/WebTerminal.js +5 -3
  48. package/es/global/js/hooks/useCreateComponentStepChange.js +1 -1
  49. package/es/global/js/package-settings.js +6 -3
  50. package/lib/components/Carousel/Carousel.docs-page.js +21 -0
  51. package/lib/components/Carousel/Carousel.js +329 -0
  52. package/lib/components/Carousel/CarouselItem.js +54 -0
  53. package/lib/components/Carousel/index.js +19 -0
  54. package/lib/components/Carousel/utils.js +105 -0
  55. package/lib/components/CreateSidePanel/CreateSidePanel.js +7 -1
  56. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -1
  57. package/lib/components/Datagrid/Datagrid/DatagridRow.js +13 -3
  58. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +4 -3
  59. package/lib/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +7 -1
  60. package/lib/components/Datagrid/useExpandedRow.js +2 -5
  61. package/lib/components/Datagrid/useFocusRowExpander.js +45 -0
  62. package/lib/components/Datagrid/useNestedRowExpander.js +9 -0
  63. package/lib/components/Datagrid/useNestedRows.js +1 -5
  64. package/lib/components/Datagrid/useRowExpander.js +9 -0
  65. package/lib/components/Datagrid/useSelectRows.js +9 -2
  66. package/lib/components/Datagrid/utils/handleFilterTagLabelText.js +32 -0
  67. package/lib/components/EditSidePanel/EditSidePanel.js +8 -2
  68. package/lib/components/FilterSummary/FilterSummary.js +24 -7
  69. package/lib/components/Guidebanner/Guidebanner.docs-page.js +25 -0
  70. package/lib/components/Guidebanner/Guidebanner.js +229 -0
  71. package/lib/components/Guidebanner/GuidebannerElement.js +77 -0
  72. package/lib/components/Guidebanner/GuidebannerElementButton.js +85 -0
  73. package/lib/components/Guidebanner/GuidebannerElementLink.js +62 -0
  74. package/lib/components/Guidebanner/index.js +33 -0
  75. package/lib/components/NonLinearReading/NonLinearReading.docs-page.js +25 -0
  76. package/lib/components/NonLinearReading/NonLinearReading.js +97 -0
  77. package/lib/components/NonLinearReading/index.js +12 -0
  78. package/lib/components/SidePanel/SidePanel.js +47 -26
  79. package/lib/components/TagSet/TagSet.js +22 -5
  80. package/lib/components/WebTerminal/WebTerminal.js +4 -2
  81. package/lib/global/js/hooks/useCreateComponentStepChange.js +1 -1
  82. package/lib/global/js/package-settings.js +6 -3
  83. package/package.json +5 -5
  84. package/scss/components/Carousel/_carbon-imports.scss +6 -0
  85. package/scss/components/Carousel/_carousel.scss +72 -0
  86. package/scss/components/Carousel/_index-with-carbon.scss +9 -0
  87. package/scss/components/Carousel/_index.scss +8 -0
  88. package/scss/components/Datagrid/styles/_useExpandedRow.scss +21 -0
  89. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -0
  90. package/scss/components/FilterSummary/_filter-summary.scss +6 -1
  91. package/scss/components/Guidebanner/_carbon-imports.scss +6 -0
  92. package/scss/components/Guidebanner/_guidebanner.scss +248 -0
  93. package/scss/components/Guidebanner/_index-with-carbon.scss +9 -0
  94. package/scss/components/Guidebanner/_index.scss +8 -0
  95. package/scss/components/NonLinearReading/_carbon-imports.scss +6 -0
  96. package/scss/components/NonLinearReading/_index-with-carbon.scss +9 -0
  97. package/scss/components/NonLinearReading/_index.scss +8 -0
  98. package/scss/components/NonLinearReading/_non-linear-reading.scss +122 -0
  99. package/scss/components/SidePanel/_side-panel.scss +22 -6
  100. package/scss/components/WebTerminal/_web-terminal.scss +1 -2
  101. package/scss/components/_Canary/_canary.scss +1 -2
  102. package/scss/components/_Canary/_carbon-imports.scss +7 -0
  103. package/scss/components/_Canary/_index-with-carbon.scss +8 -0
  104. package/scss/components/_Canary/_index.scss +7 -0
  105. package/scss/components/_index-with-carbon.scss +1 -1
  106. package/scss/components/_index.scss +5 -2
  107. /package/es/components/Datagrid/{Extensions → Datagrid.stories}/ColumnAlignment/ColumnAlignment.docs-page.js +0 -0
  108. /package/lib/components/Datagrid/{Extensions → Datagrid.stories}/ColumnAlignment/ColumnAlignment.docs-page.js +0 -0
@@ -0,0 +1,80 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "className", "type"];
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
+ // Import portions of React that are needed.
12
+ import React from 'react';
13
+ import PropTypes from 'prop-types';
14
+ import cx from 'classnames';
15
+ import { Button } from '@carbon/react';
16
+ import { Crossroads } from '@carbon/react/icons';
17
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
18
+ import { pkg } from '../../settings';
19
+
20
+ // The block part of our conventional BEM class names (blockClass__E--M).
21
+ var blockClass = "".concat(pkg.prefix, "--guidebanner__element-button");
22
+ var componentName = 'GuidebannerElementButton';
23
+
24
+ /**
25
+ * One of two buttons styled specifically for the GuidebannerElement.
26
+ */
27
+ export var GuidebannerElementButton = function GuidebannerElementButton(_ref) {
28
+ var children = _ref.children,
29
+ className = _ref.className,
30
+ type = _ref.type,
31
+ rest = _objectWithoutProperties(_ref, _excluded);
32
+ if (type === 'primary') {
33
+ return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
34
+ className: cx(blockClass, className),
35
+ iconDescription: 'Crossroads',
36
+ kind: "tertiary",
37
+ renderIcon: function renderIcon() {
38
+ return /*#__PURE__*/React.createElement(Crossroads, {
39
+ size: 16
40
+ });
41
+ },
42
+ role: "button",
43
+ size: "md"
44
+ }, getDevtoolsProps(componentName)), children);
45
+ }
46
+ return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
47
+ className: cx(blockClass, className),
48
+ kind: "ghost",
49
+ role: "button",
50
+ size: "md"
51
+ }, getDevtoolsProps(componentName)), children);
52
+ };
53
+
54
+ // Return a placeholder if not released and not enabled by feature flag
55
+ GuidebannerElementButton = pkg.checkComponentEnabled(GuidebannerElementButton, componentName);
56
+
57
+ // The display name of the component, used by React. Note that displayName
58
+ // is used in preference to relying on function.name.
59
+ GuidebannerElementButton.displayName = componentName;
60
+
61
+ // The types and DocGen commentary for the component props,
62
+ // in alphabetical order (for consistency).
63
+ // See https://www.npmjs.com/package/prop-types#usage.
64
+ GuidebannerElementButton.propTypes = {
65
+ /**
66
+ * Provide the contents of the GuidebannerElementButton.
67
+ */
68
+ children: PropTypes.node.isRequired,
69
+ /**
70
+ * Provide an optional class to be applied to the containing node.
71
+ */
72
+ className: PropTypes.string,
73
+ /**
74
+ * If type is "primary", then return a tertiary button with the "crossroads" icon,
75
+ * else return a ghost button.
76
+ */
77
+ type: PropTypes.string
78
+
79
+ /* TODO: add types and DocGen for all props. */
80
+ };
@@ -0,0 +1,57 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "className"];
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
+ // Import portions of React that are needed.
12
+ import React from 'react';
13
+ import PropTypes from 'prop-types';
14
+ import cx from 'classnames';
15
+ import { Link } from '@carbon/react';
16
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
+ import { pkg } from '../../settings';
18
+
19
+ // The block part of our conventional BEM class names (blockClass__E--M).
20
+ var blockClass = "".concat(pkg.prefix, "--guidebanner__element-link");
21
+ var componentName = 'GuidebannerElementLink';
22
+
23
+ /**
24
+ * A link styled specifically for the GuidebannerElement.
25
+ */
26
+ export var GuidebannerElementLink = function GuidebannerElementLink(_ref) {
27
+ var children = _ref.children,
28
+ className = _ref.className,
29
+ rest = _objectWithoutProperties(_ref, _excluded);
30
+ return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
31
+ className: cx(blockClass, className),
32
+ kind: "ghost",
33
+ role: "link",
34
+ size: "md"
35
+ }, getDevtoolsProps(componentName)), children);
36
+ };
37
+
38
+ // Return a placeholder if not released and not enabled by feature flag
39
+ GuidebannerElementLink = pkg.checkComponentEnabled(GuidebannerElementLink, componentName);
40
+
41
+ // The display name of the component, used by React. Note that displayName
42
+ // is used in preference to relying on function.name.
43
+ GuidebannerElementLink.displayName = componentName;
44
+
45
+ // The types and DocGen commentary for the component props,
46
+ // in alphabetical order (for consistency).
47
+ // See https://www.npmjs.com/package/prop-types#usage.
48
+ GuidebannerElementLink.propTypes = {
49
+ /**
50
+ * Provide the contents of the GuidebannerElementLink.
51
+ */
52
+ children: PropTypes.node.isRequired,
53
+ /**
54
+ * Provide an optional class to be applied to the containing node.
55
+ */
56
+ className: PropTypes.string
57
+ };
@@ -0,0 +1,11 @@
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 { Guidebanner } from './Guidebanner';
9
+ export { GuidebannerElement } from './GuidebannerElement';
10
+ export { GuidebannerElementButton } from './GuidebannerElementButton';
11
+ export { GuidebannerElementLink } from './GuidebannerElementLink';
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage';
3
+ import * as stories from './NonLinearReading.stories';
4
+ var DocsPage = function DocsPage() {
5
+ return /*#__PURE__*/React.createElement(StoryDocsPage, {
6
+ blocks: [{
7
+ story: stories.singleLevel
8
+ }, {
9
+ story: stories.multipleLevel
10
+ }, {
11
+ story: stories.withGradientBackground
12
+ }]
13
+ });
14
+ };
15
+ export default DocsPage;
@@ -0,0 +1,89 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["children", "className", "definition", "theme"];
5
+ /**
6
+ * Copyright IBM Corp. 2023, 2023
7
+ *
8
+ * This source code is licensed under the Apache-2.0 license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ import React, { useRef, useState } from 'react';
13
+ import PropTypes from 'prop-types';
14
+ import cx from 'classnames';
15
+ import { ChevronDown } from '@carbon/react/icons';
16
+ import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
+ import uuidv4 from '../../global/js/utils/uuidv4';
18
+ import { pkg } from '../../settings';
19
+
20
+ // The block part of our conventional BEM class names (blockClass__E--M).
21
+ var blockClass = "".concat(pkg.prefix, "--non-linear-reading");
22
+ var componentName = 'NonLinearReading';
23
+
24
+ // Default values for props
25
+ var defaults = {
26
+ theme: 'light'
27
+ };
28
+
29
+ /**
30
+ * Use non-linear reading when space is limited to share a
31
+ * brief, at-a-glance, summary of a concept that may require
32
+ * more explanation for some users.
33
+ */
34
+ export var NonLinearReading = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
+ var children = _ref.children,
36
+ className = _ref.className,
37
+ definition = _ref.definition,
38
+ _ref$theme = _ref.theme,
39
+ theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
40
+ rest = _objectWithoutProperties(_ref, _excluded);
41
+ var _useState = useState(false),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ isOpen = _useState2[0],
44
+ setOpen = _useState2[1];
45
+ var contentId = useRef(uuidv4()).current;
46
+ var handleToggle = function handleToggle() {
47
+ setOpen(function (prevState) {
48
+ return !prevState;
49
+ });
50
+ };
51
+ return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
52
+ className: cx(blockClass, "".concat(blockClass, "__").concat(theme), className),
53
+ ref: ref
54
+ }, getDevtoolsProps(componentName)), ' ', /*#__PURE__*/React.createElement("button", {
55
+ type: "button",
56
+ "aria-controls": contentId,
57
+ "aria-expanded": isOpen,
58
+ className: cx("".concat(blockClass, "__keyword"), [isOpen ? ["".concat(blockClass, "__keyword-open")] : ["".concat(blockClass, "__keyword-closed")]]),
59
+ onClick: handleToggle
60
+ }, children, /*#__PURE__*/React.createElement(ChevronDown, {
61
+ size: 16
62
+ })), ' ', /*#__PURE__*/React.createElement("span", {
63
+ id: contentId,
64
+ className: "".concat(blockClass, "__body"),
65
+ hidden: !isOpen
66
+ }, isOpen && definition), ' ');
67
+ });
68
+
69
+ // Return a placeholder if not released and not enabled by feature flag
70
+ NonLinearReading = pkg.checkComponentEnabled(NonLinearReading, componentName);
71
+ NonLinearReading.displayName = componentName;
72
+ NonLinearReading.propTypes = {
73
+ /**
74
+ * The keyword of the component appears as a pill.
75
+ */
76
+ children: PropTypes.node.isRequired,
77
+ /**
78
+ * Provide an optional class to be applied to the containing node.
79
+ */
80
+ className: PropTypes.string,
81
+ /**
82
+ * The content that appears when the keyword is toggled open.
83
+ */
84
+ definition: PropTypes.node.isRequired,
85
+ /**
86
+ * Determines the theme of the component.
87
+ */
88
+ theme: PropTypes.oneOf(['light', 'dark'])
89
+ };
@@ -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 { NonLinearReading } from './NonLinearReading';
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
5
+ var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "id", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "slug", "subtitle", "title"],
6
6
  _excluded2 = ["label", "kind", "icon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
14
14
  */
15
15
 
16
16
  // Import portions of React that are needed.
17
- import React, { useState, useEffect, useRef } from 'react';
17
+ import React, { useState, useEffect, useRef, useCallback } from 'react';
18
18
  import { motion, AnimatePresence } from 'framer-motion';
19
19
 
20
20
  // Other standard imports.
@@ -65,6 +65,8 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
65
65
  condensedActions = _ref.condensedActions,
66
66
  _ref$currentStep = _ref.currentStep,
67
67
  currentStep = _ref$currentStep === void 0 ? defaults.currentStep : _ref$currentStep,
68
+ _ref$id = _ref.id,
69
+ id = _ref$id === void 0 ? blockClass : _ref$id,
68
70
  includeOverlay = _ref.includeOverlay,
69
71
  labelText = _ref.labelText,
70
72
  _ref$navigationBackIc = _ref.navigationBackIconDescription,
@@ -81,6 +83,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
81
83
  _ref$size = _ref.size,
82
84
  size = _ref$size === void 0 ? defaults.size : _ref$size,
83
85
  slideIn = _ref.slideIn,
86
+ slug = _ref.slug,
84
87
  subtitle = _ref.subtitle,
85
88
  title = _ref.title,
86
89
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -105,6 +108,10 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
105
108
  var reducedMotion = typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
106
109
  matches: true
107
110
  };
111
+ var getActionsContainerElement = useCallback(function () {
112
+ var sidePanelOuter = document.querySelector("#".concat(id));
113
+ return sidePanelOuter && sidePanelOuter.querySelector(".".concat(blockClass, "__actions-container"));
114
+ }, [id]);
108
115
 
109
116
  // scroll panel to top going between steps
110
117
  useEffect(function () {
@@ -112,7 +119,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
112
119
  if (panelRef && panelRef.current) {
113
120
  var _document$querySelect;
114
121
  var scrollableSection = panelRef.current.querySelector(".".concat(blockClass, "__inner-content"));
115
- var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
122
+ var sidePanelOuter = document.querySelector("#".concat(id));
116
123
  var initialTitleHeight = (_document$querySelect = document.querySelector(".".concat(blockClass, "__title-container"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.offsetHeight;
117
124
  scrollableSection.scrollTop = 0;
118
125
  // The size of the panel has changed while it is still opened
@@ -124,7 +131,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
124
131
  sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style = sidePanelOuter.style) === null || _sidePanelOuter$style === void 0 || _sidePanelOuter$style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
125
132
  }
126
133
  }
127
- }, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size]);
134
+ }, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size, id]);
128
135
 
129
136
  // set initial focus when side panel opens
130
137
  useEffect(function () {
@@ -148,13 +155,13 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
148
155
  useEffect(function () {
149
156
  if (open && actions && actions.length && animationComplete) {
150
157
  var _sidePanelOuter$style2;
151
- var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
158
+ var sidePanelOuter = document.querySelector("#".concat(id));
152
159
  var actionsContainer = getActionsContainerElement();
153
160
  var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
154
161
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
155
162
  sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style2 = sidePanelOuter.style) === null || _sidePanelOuter$style2 === void 0 || _sidePanelOuter$style2.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
156
163
  }
157
- }, [actions, condensedActions, open, animationComplete]);
164
+ }, [actions, condensedActions, open, animationComplete, id, getActionsContainerElement]);
158
165
 
159
166
  // Add console warning if labelText is provided without a title.
160
167
  // This combination is not allowed.
@@ -169,23 +176,19 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
169
176
  var _sidePanelOuter$style3;
170
177
  var height = _ref2.height;
171
178
  setPanelHeight(height);
172
- var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
179
+ var sidePanelOuter = document.querySelector("#".concat(id));
173
180
  var actionsContainer = getActionsContainerElement();
174
181
  var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
175
182
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
176
183
  sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style3 = sidePanelOuter.style) === null || _sidePanelOuter$style3 === void 0 || _sidePanelOuter$style3.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
177
184
  };
178
- var getActionsContainerElement = function getActionsContainerElement() {
179
- var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
180
- return sidePanelOuter && sidePanelOuter.querySelector(".".concat(blockClass, "__actions-container"));
181
- };
182
185
 
183
186
  // Title and subtitle scroll animation
184
187
  useEffect(function () {
185
188
  if (open && animateTitle && animationComplete && title && title.length && !reducedMotion.matches) {
186
189
  var _document$querySelect2, _document$querySelect3, _document$querySelect4;
187
- var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
188
- var sidePanelScrollArea = document.querySelector("#".concat(blockClass, "-outer .").concat(blockClass, "__inner-content"));
190
+ var sidePanelOuter = document.querySelector("#".concat(id));
191
+ var sidePanelScrollArea = document.querySelector("#".concat(id, " .").concat(blockClass, "__inner-content"));
189
192
  var sidePanelTitleElement = document.querySelector(".".concat(blockClass, "__title-text"));
190
193
  var sidePanelCollapsedTitleElement = document.querySelector(".".concat(blockClass, "__collapsed-title-text"));
191
194
  var sidePanelSubtitleElement = document.querySelector(".".concat("".concat(blockClass, "__subtitle-text")));
@@ -260,7 +263,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
260
263
  });
261
264
  }
262
265
  if (open && !animateTitle) {
263
- var _sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
266
+ var _sidePanelOuter = document.querySelector("#".concat(id));
264
267
  var _sidePanelTitleElement = document.querySelector(".".concat(blockClass, "__title-container .").concat(blockClass, "__title-text"));
265
268
  var _sidePanelSubtitleElement = document.querySelector(".".concat(blockClass, "__subtitle-text"));
266
269
  var actionToolbarElement = document.querySelector(".".concat(blockClass, "__action-toolbar"));
@@ -274,7 +277,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
274
277
  _sidePanelOuter === null || _sidePanelOuter === void 0 || _sidePanelOuter.style.setProperty("--".concat(blockClass, "--action-bar-container-height"), "".concat(sidePanelActionBarElementHeight, "px"));
275
278
  _sidePanelOuter === null || _sidePanelOuter === void 0 || _sidePanelOuter.style.setProperty("--".concat(blockClass, "--label-text-height"), "".concat(labelHeight, "px"));
276
279
  }
277
- }, [open, animateTitle, animationComplete, panelHeight, title, size, reducedMotion.matches]);
280
+ }, [open, animateTitle, animationComplete, panelHeight, title, size, reducedMotion.matches, id]);
278
281
 
279
282
  // click outside functionality if `includeOverlay` prop is set
280
283
  useEffect(function () {
@@ -326,9 +329,9 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
326
329
  if (!open && slideIn) {
327
330
  var pageContentElement = document.querySelector(selectorPageContent);
328
331
  if (placement && placement === 'right' && pageContentElement) {
329
- pageContentElement.style.marginRight = 0;
332
+ pageContentElement.style.marginInlineEnd = 0;
330
333
  } else if (pageContentElement) {
331
- pageContentElement.style.marginLeft = 0;
334
+ pageContentElement.style.marginInlineStart = 0;
332
335
  }
333
336
  }
334
337
  }, [open, placement, selectorPageContent, slideIn]);
@@ -342,14 +345,15 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
342
345
  useEffect(function () {
343
346
  if (open && slideIn) {
344
347
  var pageContentElement = document.querySelector(selectorPageContent);
348
+ pageContentElement.style.inlineSize = 'auto';
345
349
  if (placement && placement === 'right' && pageContentElement) {
346
- pageContentElement.style.marginRight = 0;
347
- pageContentElement.style.transition = !reducedMotion.matches ? "margin-right ".concat(moderate02) : null;
348
- pageContentElement.style.marginRight = SIDE_PANEL_SIZES[size];
350
+ pageContentElement.style.marginInlineEnd = 0;
351
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-end ".concat(moderate02) : null;
352
+ pageContentElement.style.marginInlineEnd = SIDE_PANEL_SIZES[size];
349
353
  } else if (pageContentElement) {
350
- pageContentElement.style.marginLeft = 0;
351
- pageContentElement.style.transition = !reducedMotion.matches ? "margin-left ".concat(moderate02) : null;
352
- pageContentElement.style.marginLeft = SIDE_PANEL_SIZES[size];
354
+ pageContentElement.style.marginInlineStart = 0;
355
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-start ".concat(moderate02) : null;
356
+ pageContentElement.style.marginInlineStart = SIDE_PANEL_SIZES[size];
353
357
  }
354
358
  }
355
359
  }, [slideIn, selectorPageContent, placement, size, reducedMotion.matches, open]);
@@ -371,9 +375,16 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
371
375
  }
372
376
  };
373
377
  var primaryActionContainerClassNames = cx(["".concat(blockClass, "__actions-container"), _defineProperty({}, "".concat(blockClass, "__actions-container-condensed"), condensedActions)]);
374
- var mainPanelClassNames = cx([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref5 = {}, _defineProperty(_ref5, "".concat(blockClass, "__container-right-placement"), placement === 'right'), _defineProperty(_ref5, "".concat(blockClass, "__container-left-placement"), placement === 'left'), _defineProperty(_ref5, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), _defineProperty(_ref5, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), _defineProperty(_ref5, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _ref5)]);
378
+ var mainPanelClassNames = cx([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref5 = {}, _defineProperty(_ref5, "".concat(blockClass, "__container-right-placement"), placement === 'right'), _defineProperty(_ref5, "".concat(blockClass, "__container-left-placement"), placement === 'left'), _defineProperty(_ref5, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), _defineProperty(_ref5, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), _defineProperty(_ref5, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _defineProperty(_ref5, "".concat(blockClass, "__container--has-slug"), slug), _ref5)]);
375
379
  var renderHeader = function renderHeader() {
376
380
  var _cx, _cx2;
381
+ var normalizedSlug;
382
+ if (slug) {
383
+ normalizedSlug = /*#__PURE__*/React.cloneElement(slug, {
384
+ // slug size is sm unless actions and size > md
385
+ size: actions.length && /l/.test(size) ? 'md' : 'sm'
386
+ });
387
+ }
377
388
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
378
389
  className: cx("".concat(blockClass, "__title-container"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), _defineProperty(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), _defineProperty(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), _defineProperty(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), _defineProperty(_cx, "".concat(blockClass, "__title-container-without-title"), !title), _defineProperty(_cx, "".concat(blockClass, "__title-container--reduced-motion"), reducedMotion.matches), _cx))
379
390
  }, currentStep > 0 && /*#__PURE__*/React.createElement(Button, {
@@ -391,7 +402,9 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
391
402
  onClick: onNavigationBack
392
403
  }), title && title.length && labelText && labelText.length && /*#__PURE__*/React.createElement("p", {
393
404
  className: "".concat(blockClass, "__label-text")
394
- }, labelText), title && title.length && renderTitle()), /*#__PURE__*/React.createElement(Button, {
405
+ }, labelText), title && title.length && renderTitle()), /*#__PURE__*/React.createElement("div", {
406
+ className: "".concat(blockClass, "__slug-and-close")
407
+ }, normalizedSlug, /*#__PURE__*/React.createElement(Button, {
395
408
  "aria-label": closeIconDescription,
396
409
  kind: "ghost",
397
410
  size: "sm",
@@ -404,7 +417,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
404
417
  className: "".concat(blockClass, "__close-button"),
405
418
  onClick: onRequestClose,
406
419
  ref: sidePanelCloseRef
407
- }), subtitle && /*#__PURE__*/React.createElement("p", {
420
+ })), subtitle && /*#__PURE__*/React.createElement("p", {
408
421
  className: cx("".concat(blockClass, "__subtitle-text"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "__subtitle-text-no-animation"), !animateTitle), _defineProperty(_cx2, "".concat(blockClass, "__subtitle-text-no-animation-no-action-toolbar"), !animateTitle && (!actionToolbarButtons || !actionToolbarButtons.length)), _defineProperty(_cx2, "".concat(blockClass, "__subtitle-text-is-animating"), !animationComplete && animateTitle), _defineProperty(_cx2, "".concat(blockClass, "__subtitle-without-title"), !title), _cx2))
409
422
  }, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/React.createElement("div", {
410
423
  className: cx("".concat(blockClass, "__action-toolbar"), _defineProperty({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
@@ -448,7 +461,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
448
461
  var contentRef = ref || sidePanelRef;
449
462
  useResizeObserver(contentRef, handleResize);
450
463
  return /*#__PURE__*/React.createElement(AnimatePresence, null, open && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(motion.div, _extends({}, getDevtoolsProps(componentName), rest, {
451
- id: "".concat(blockClass, "-outer"),
464
+ id: id,
452
465
  className: mainPanelClassNames,
453
466
  onBlur: handleBlur,
454
467
  ref: contentRef,
@@ -556,6 +569,10 @@ SidePanel.propTypes = {
556
569
  * Sets the current step of the side panel
557
570
  */
558
571
  currentStep: PropTypes.number,
572
+ /**
573
+ * Unique identifier
574
+ */
575
+ id: PropTypes.string,
559
576
  /**
560
577
  * Determines whether the side panel should render with an overlay
561
578
  */
@@ -615,6 +632,10 @@ SidePanel.propTypes = {
615
632
  * Determines if this panel slides in
616
633
  */
617
634
  slideIn: PropTypes.bool,
635
+ /**
636
+ * Provide a `Slug` component to be rendered inside the `SidePanel` component
637
+ */
638
+ slug: PropTypes.node,
618
639
  /**
619
640
  * Sets the subtitle text
620
641
  */
@@ -2,13 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags"],
5
+ var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset"],
6
6
  _excluded2 = ["label", "id"],
7
7
  _excluded3 = ["label"];
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
10
  //
11
- // Copyright IBM Corp. 2020, 2022
11
+ // Copyright IBM Corp. 2020, 2023
12
12
  //
13
13
  // This source code is licensed under the Apache-2.0 license found in the
14
14
  // LICENSE file in the root directory of this source tree.
@@ -31,6 +31,7 @@ var allTagsModalSearchThreshold = 10;
31
31
  // Default values for props
32
32
  var defaults = {
33
33
  align: 'start',
34
+ measurementOffset: 0,
34
35
  overflowAlign: 'bottom',
35
36
  overflowType: 'default'
36
37
  };
@@ -51,6 +52,9 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
51
52
  allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
52
53
  showAllTagsLabel = _ref.showAllTagsLabel,
53
54
  tags = _ref.tags,
55
+ containingElementRef = _ref.containingElementRef,
56
+ _ref$measurementOffse = _ref.measurementOffset,
57
+ measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
54
58
  rest = _objectWithoutProperties(_ref, _excluded);
55
59
  var _useState = useState(3),
56
60
  _useState2 = _slicedToArray(_useState, 2),
@@ -141,7 +145,9 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
141
145
  // how many will fit?
142
146
  var willFit = 0;
143
147
  if (sizingTags.length > 0) {
144
- var spaceAvailable = tagSetRef.current.offsetWidth;
148
+ var optionalContainingElement = containingElementRef === null || containingElementRef === void 0 ? void 0 : containingElementRef.current;
149
+ var measurementOffsetValue = typeof measurementOffset === 'number' ? measurementOffset : 0;
150
+ var spaceAvailable = optionalContainingElement ? optionalContainingElement.offsetWidth - measurementOffsetValue : tagSetRef.current.offsetWidth;
145
151
  for (var i in sizingTags) {
146
152
  var _sizingTags$i;
147
153
  var tagWidth = ((_sizingTags$i = sizingTags[i]) === null || _sizingTags$i === void 0 ? void 0 : _sizingTags$i.offsetWidth) || 0;
@@ -165,7 +171,7 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
165
171
  } else {
166
172
  setDisplayCount(maxVisible ? Math.min(willFit, maxVisible) : willFit);
167
173
  }
168
- }, [maxVisible, multiline, sizingTags, tagSetRef]);
174
+ }, [maxVisible, multiline, sizingTags, tagSetRef, measurementOffset, containingElementRef]);
169
175
  useEffect(function () {
170
176
  checkFullyVisibleTags();
171
177
  }, [checkFullyVisibleTags, maxVisible, multiline, sizingTags]);
@@ -187,7 +193,8 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
187
193
  setShowAllModalOpen(false);
188
194
  };
189
195
  useResizeObserver(sizingContainerRef, handleSizerTagsResize);
190
- useResizeObserver(tagSetRef, handleResize);
196
+ var resizeOption = containingElementRef ? containingElementRef : tagSetRef;
197
+ useResizeObserver(resizeOption, handleResize);
191
198
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
192
199
  className: cx([blockClass, className]),
193
200
  ref: tagSetRef
@@ -265,10 +272,20 @@ TagSet.propTypes = {
265
272
  * className
266
273
  */
267
274
  className: PropTypes.string,
275
+ /**
276
+ * Optional ref for custom resize container to measure available space
277
+ * Default will measure the available space of the TagSet container itself.
278
+ */
279
+ containingElementRef: PropTypes.object,
268
280
  /**
269
281
  * maximum visible tags
270
282
  */
271
283
  maxVisible: PropTypes.number,
284
+ /**
285
+ * Specify offset amount for measure available space, only used when `containingElementSelector`
286
+ * is also provided
287
+ */
288
+ measurementOffset: PropTypes.number,
272
289
  /**
273
290
  * display tags in multiple lines
274
291
  */
@@ -23,7 +23,7 @@ import { pkg } from '../../settings';
23
23
 
24
24
  // Carbon and package components we use.
25
25
  import { Close, Help } from '@carbon/react/icons';
26
- import { Button, OverflowMenu, OverflowMenuItem } from '@carbon/react';
26
+ import { Button, OverflowMenu, OverflowMenuItem, Theme } from '@carbon/react';
27
27
  import { moderate02 } from '@carbon/motion';
28
28
  import { useWebTerminal } from './hooks';
29
29
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
@@ -158,9 +158,11 @@ export var WebTerminal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
158
158
  onAnimationEnd: function onAnimationEnd(event) {
159
159
  return event.stopPropagation();
160
160
  }
161
- })), /*#__PURE__*/React.createElement("div", {
161
+ })), /*#__PURE__*/React.createElement(Theme, {
162
+ theme: "g100"
163
+ }, /*#__PURE__*/React.createElement("div", {
162
164
  className: "".concat(blockClass, "__body")
163
- }, children)) : null;
165
+ }, children))) : null;
164
166
  });
165
167
 
166
168
  // Return a placeholder if not released and not enabled by feature flag
@@ -66,7 +66,7 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
66
66
  useEffect(function () {
67
67
  var onUnmount = function onUnmount() {
68
68
  if (componentName !== 'CreateFullPage') {
69
- setCurrentStep(0);
69
+ setCurrentStep(1);
70
70
  }
71
71
  setIsSubmitting(false);
72
72
  onClose();
@@ -73,15 +73,18 @@ var defaults = {
73
73
 
74
74
  // Novice to pro components not yet reviewed and released:
75
75
  Checklist: false,
76
- InlineTip: false
76
+ Guidebanner: false,
77
+ GuidebannerElement: false,
78
+ GuidebannerElementButton: false,
79
+ GuidebannerElementLink: false,
80
+ InlineTip: false,
81
+ NonLinearReading: false
77
82
  },
78
83
  // feature level flags
79
84
  feature: {
80
85
  'default-portal-target-body': true,
81
86
  'Datagrid.useInlineEdit': false,
82
87
  'Datagrid.useEditableCell': false,
83
- 'Datagrid.useExpandedRow': false,
84
- 'Datagrid.useNestedRows': false,
85
88
  'Datagrid.useFiltering': false,
86
89
  'Datagrid.useCustomizeColumns': false,
87
90
  'ExampleComponent.secondaryIcon': false,