@carbon/ibm-products 2.15.2 → 2.17.0-alpha.8

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 (149) hide show
  1. package/css/config-dev.css +3 -0
  2. package/css/config-dev.css.map +1 -0
  3. package/css/index-full-carbon.css +195 -1
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +1852 -38
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +195 -1
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +5 -1
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/Datagrid/Datagrid/DatagridContent.js +12 -9
  20. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -3
  21. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +36 -22
  22. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -11
  23. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +7 -3
  24. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +24 -13
  25. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +2 -2
  26. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +50 -14
  27. package/es/components/Datagrid/Datagrid.docs-page.js +4 -4
  28. package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +1 -1
  29. package/es/components/Datagrid/useActionsColumn.js +1 -4
  30. package/es/components/Datagrid/useDatagrid.js +5 -1
  31. package/es/components/Datagrid/useFlexResize.js +19 -9
  32. package/es/components/Datagrid/useInfiniteScroll.js +1 -5
  33. package/es/components/Datagrid/useOnRowClick.js +6 -7
  34. package/es/components/Datagrid/useSelectRows.js +8 -5
  35. package/es/components/Datagrid/useSortableColumns.js +5 -7
  36. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +2 -1
  37. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +2 -1
  38. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +2 -1
  39. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +2 -1
  40. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +2 -1
  41. package/es/components/EmptyStates/assets/ErrorIllustration.js +5 -3
  42. package/es/components/EmptyStates/assets/NoDataIllustration.js +5 -3
  43. package/es/components/EmptyStates/assets/NoTagsIllustration.js +5 -3
  44. package/es/components/EmptyStates/assets/NotFoundIllustration.js +5 -3
  45. package/es/components/EmptyStates/assets/NotificationsIllustration.js +5 -3
  46. package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +5 -3
  47. package/es/components/InlineTip/InlineTip.docs-page.js +13 -0
  48. package/es/components/InlineTip/InlineTip.js +217 -0
  49. package/es/components/InlineTip/InlineTipButton.js +53 -0
  50. package/es/components/InlineTip/InlineTipLink.js +57 -0
  51. package/es/components/InlineTip/index.js +10 -0
  52. package/es/components/InlineTip/utils.js +36 -0
  53. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.docs-page.js +11 -0
  54. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +140 -0
  55. package/es/components/SteppedAnimatedMedia/assets/index.js +4 -0
  56. package/es/components/SteppedAnimatedMedia/index.js +8 -0
  57. package/es/global/js/package-settings.js +3 -4
  58. package/lib/components/Datagrid/Datagrid/DatagridContent.js +12 -9
  59. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +3 -3
  60. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +41 -29
  61. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +11 -11
  62. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +7 -3
  63. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +23 -12
  64. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +2 -2
  65. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +51 -15
  66. package/lib/components/Datagrid/Datagrid.docs-page.js +4 -4
  67. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +1 -1
  68. package/lib/components/Datagrid/useActionsColumn.js +1 -7
  69. package/lib/components/Datagrid/useDatagrid.js +5 -1
  70. package/lib/components/Datagrid/useFlexResize.js +19 -9
  71. package/lib/components/Datagrid/useInfiniteScroll.js +0 -4
  72. package/lib/components/Datagrid/useOnRowClick.js +6 -7
  73. package/lib/components/Datagrid/useSelectRows.js +8 -5
  74. package/lib/components/Datagrid/useSortableColumns.js +5 -7
  75. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +2 -1
  76. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +2 -1
  77. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +2 -1
  78. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +2 -1
  79. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +2 -1
  80. package/lib/components/EmptyStates/assets/ErrorIllustration.js +5 -3
  81. package/lib/components/EmptyStates/assets/NoDataIllustration.js +5 -3
  82. package/lib/components/EmptyStates/assets/NoTagsIllustration.js +5 -3
  83. package/lib/components/EmptyStates/assets/NotFoundIllustration.js +5 -3
  84. package/lib/components/EmptyStates/assets/NotificationsIllustration.js +5 -3
  85. package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +5 -3
  86. package/lib/components/InlineTip/InlineTip.docs-page.js +23 -0
  87. package/lib/components/InlineTip/InlineTip.js +224 -0
  88. package/lib/components/InlineTip/InlineTipButton.js +57 -0
  89. package/lib/components/InlineTip/InlineTipLink.js +61 -0
  90. package/lib/components/InlineTip/index.js +26 -0
  91. package/lib/components/InlineTip/utils.js +43 -0
  92. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.docs-page.js +21 -0
  93. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +148 -0
  94. package/lib/components/SteppedAnimatedMedia/assets/index.js +9 -0
  95. package/lib/components/SteppedAnimatedMedia/index.js +12 -0
  96. package/lib/global/js/package-settings.js +3 -4
  97. package/package.json +6 -7
  98. package/scss/components/Datagrid/styles/_datagrid.scss +5 -0
  99. package/scss/components/{TooltipTrigger/_storybook-styles.scss → InlineTip/_index.scss} +2 -0
  100. package/scss/components/InlineTip/_inline-tip.scss +229 -0
  101. package/scss/components/SidePanel/_side-panel.scss +1 -4
  102. package/scss/components/_index-released-only-with-carbon.scss +1 -0
  103. package/scss/components/_index-released-only.scss +1 -0
  104. package/scss/components/_index.scss +1 -0
  105. package/scss/config-dev.scss +3 -0
  106. package/scss/components/APIKeyModal/_storybook-styles.scss +0 -35
  107. package/scss/components/AboutModal/_storybook-styles.scss +0 -29
  108. package/scss/components/ActionBar/_storybook-styles.scss +0 -8
  109. package/scss/components/ActionSet/_storybook-styles.scss +0 -36
  110. package/scss/components/AddSelect/_storybook-styles.scss +0 -6
  111. package/scss/components/BreadcrumbWithOverflow/_storybook-styles.scss +0 -8
  112. package/scss/components/ButtonMenu/_storybook-styles.scss +0 -6
  113. package/scss/components/ButtonSetWithOverflow/_storybook-styles.scss +0 -8
  114. package/scss/components/Card/_storybook-styles.scss +0 -12
  115. package/scss/components/Cascade/_storybook-styles.scss +0 -34
  116. package/scss/components/Checklist/_storybook-styles.scss +0 -13
  117. package/scss/components/CreateFullPage/_storybook-styles.scss +0 -67
  118. package/scss/components/CreateModal/_storybook-styles.scss +0 -54
  119. package/scss/components/CreateSidePanel/_storybook-styles.scss +0 -32
  120. package/scss/components/CreateTearsheet/_storybook-styles.scss +0 -56
  121. package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -27
  122. package/scss/components/DataSpreadsheet/_storybook-styles.scss +0 -17
  123. package/scss/components/Datagrid/_storybook-styles.scss +0 -157
  124. package/scss/components/EditFullPage/_storybook-styles.scss +0 -10
  125. package/scss/components/EditInPlace/_storybook-styles.scss +0 -15
  126. package/scss/components/EditSidePanel/_storybook-styles.scss +0 -32
  127. package/scss/components/EditTearsheet/_storybook-styles.scss +0 -59
  128. package/scss/components/EditTearsheetNarrow/_storybook-styles.scss +0 -10
  129. package/scss/components/EditUpdateCards/_storybook-styles.scss +0 -55
  130. package/scss/components/EmptyStates/_storybook-styles.scss +0 -6
  131. package/scss/components/ExampleComponent/_storybook-styles.scss +0 -6
  132. package/scss/components/ExportModal/_storybook-styles.scss +0 -6
  133. package/scss/components/ExpressiveCard/_storybook-styles.scss +0 -26
  134. package/scss/components/FilterSummary/_storybook-styles.scss +0 -16
  135. package/scss/components/ImportModal/_storybook-styles.scss +0 -6
  136. package/scss/components/MultiAddSelect/_storybook-styles.scss +0 -6
  137. package/scss/components/NotificationsPanel/_storybook-styles.scss +0 -23
  138. package/scss/components/OptionsTile/_storybook-styles.scss +0 -29
  139. package/scss/components/PageHeader/_storybook-styles.scss +0 -90
  140. package/scss/components/ProductiveCard/_storybook-styles.scss +0 -23
  141. package/scss/components/RemoveModal/_storybook-styles.scss +0 -6
  142. package/scss/components/Saving/_storybook-styles.scss +0 -12
  143. package/scss/components/SidePanel/_storybook-styles.scss +0 -52
  144. package/scss/components/SingleAddSelect/_storybook-styles.scss +0 -6
  145. package/scss/components/StatusIcon/_storybook-styles.scss +0 -6
  146. package/scss/components/TagSet/_storybook-styles.scss +0 -8
  147. package/scss/components/Tearsheet/_storybook-styles.scss +0 -25
  148. package/scss/components/UserProfileImage/_storybook.scss +0 -6
  149. package/scss/components/WebTerminal/_storybook-styles.scss +0 -46
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./InlineTip.stories"));
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ blocks: [{
17
+ story: stories.inlineTip
18
+ }, {
19
+ story: stories.inlineTipNarrow
20
+ }]
21
+ });
22
+ };
23
+ var _default = exports.default = DocsPage;
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.InlineTip = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _icons = require("@carbon/react/icons");
14
+ var _react2 = require("@carbon/react");
15
+ var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _classnames = _interopRequireDefault(require("classnames"));
17
+ var _utils = require("./utils");
18
+ var _SteppedAnimatedMedia = require("../SteppedAnimatedMedia");
19
+ var _devtools = require("../../global/js/utils/devtools");
20
+ var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
21
+ var _settings = require("../../settings");
22
+ var _excluded = ["children", "className", "closeIconDescription", "collapsible", "collapseButtonLabel", "expandButtonLabel", "narrow", "onClick", "onClose", "tertiaryButtonLabel", "action", "title", "media"];
23
+ /**
24
+ * Copyright IBM Corp. 2023, 2023
25
+ *
26
+ * This source code is licensed under the Apache-2.0 license found in the
27
+ * LICENSE file in the root directory of this source tree.
28
+ */
29
+ // Import portions of React that are needed.
30
+ // Other standard imports.
31
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
32
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
33
+ // The block part of our conventional BEM class names (blockClass__E--M).
34
+ var blockClass = "".concat(_settings.pkg.prefix, "--inline-tip");
35
+ var componentName = 'InlineTip';
36
+
37
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
38
+
39
+ // Default values for props
40
+ var defaults = {
41
+ closeIconDescription: 'Close',
42
+ collapsible: false,
43
+ collapseButtonLabel: 'Read less',
44
+ expandButtonLabel: 'Read more',
45
+ narrow: false,
46
+ onClick: function onClick() {},
47
+ onClose: function onClose() {}
48
+ };
49
+
50
+ /**
51
+ * Inline tips are messages embedded within other components that
52
+ * provide an ambient way to deliver learning content without
53
+ * distracting the user from their flow.
54
+ */
55
+ var InlineTip = exports.InlineTip = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
56
+ var children = _ref.children,
57
+ className = _ref.className,
58
+ _ref$closeIconDescrip = _ref.closeIconDescription,
59
+ closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
60
+ _ref$collapsible = _ref.collapsible,
61
+ collapsible = _ref$collapsible === void 0 ? defaults.collapsible : _ref$collapsible,
62
+ _ref$collapseButtonLa = _ref.collapseButtonLabel,
63
+ collapseButtonLabel = _ref$collapseButtonLa === void 0 ? defaults.collapseButtonLabel : _ref$collapseButtonLa,
64
+ _ref$expandButtonLabe = _ref.expandButtonLabel,
65
+ expandButtonLabel = _ref$expandButtonLabe === void 0 ? defaults.expandButtonLabel : _ref$expandButtonLabe,
66
+ _ref$narrow = _ref.narrow,
67
+ narrow = _ref$narrow === void 0 ? defaults.narrow : _ref$narrow,
68
+ onClick = _ref.onClick,
69
+ onClose = _ref.onClose,
70
+ tertiaryButtonLabel = _ref.tertiaryButtonLabel,
71
+ action = _ref.action,
72
+ _ref$title = _ref.title,
73
+ title = _ref$title === void 0 ? defaults.title : _ref$title,
74
+ media = _ref.media,
75
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
76
+ var _useState = (0, _react.useState)(collapsible),
77
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
78
+ isCollapsed = _useState2[0],
79
+ setIsCollapsed = _useState2[1];
80
+ var labelId = (0, _react.useRef)((0, _uuidv.default)()).current;
81
+ var previewText = (0, _react.useMemo)(function () {
82
+ return (0, _utils.getComponentText)(_react.default.Children.toArray(children));
83
+ }, [children]);
84
+ var childrenToRender = children;
85
+ if (!media && collapsible && isCollapsed) {
86
+ childrenToRender = /*#__PURE__*/_react.default.createElement("p", {
87
+ className: "".concat(blockClass, "__preview-text")
88
+ }, previewText);
89
+ }
90
+
91
+ // If `collapsible` is changed after initial render...
92
+ (0, _react.useEffect)(function () {
93
+ setIsCollapsed(collapsible);
94
+ }, [collapsible]);
95
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
96
+ "aria-labelledby": labelId,
97
+ className: (0, _classnames.default)(blockClass, className, [collapsible ? "".concat(blockClass, "__collapsible") : null], [isCollapsed ? "".concat(blockClass, "__collapsible-collapsed") : null], [narrow ? "".concat(blockClass, "__narrow") : "".concat(blockClass, "__wide")], [media ? "".concat(blockClass, "__has-media") : null]),
98
+ ref: ref,
99
+ role: "complementary"
100
+ }, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement("div", {
101
+ className: "".concat(blockClass, "__close-icon-wrapper")
102
+ }, /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
103
+ className: "".concat(blockClass, "__close-icon"),
104
+ kind: "ghost",
105
+ label: closeIconDescription,
106
+ onClick: onClose,
107
+ size: "lg"
108
+ }, /*#__PURE__*/_react.default.createElement(_icons.Close, {
109
+ size: 16
110
+ }))), (!media && narrow || !narrow) && /*#__PURE__*/_react.default.createElement("div", {
111
+ className: "".concat(blockClass, "__icon-idea"),
112
+ tabIndex: -1
113
+ }, /*#__PURE__*/_react.default.createElement(_icons.Idea, {
114
+ size: 16
115
+ })), /*#__PURE__*/_react.default.createElement("div", {
116
+ className: "".concat(blockClass, "__content")
117
+ }, /*#__PURE__*/_react.default.createElement("h6", {
118
+ id: labelId,
119
+ className: "".concat(blockClass, "__title")
120
+ }, title), /*#__PURE__*/_react.default.createElement("section", {
121
+ className: "".concat(blockClass, "__body")
122
+ }, childrenToRender, action && (!collapsible || collapsible && !isCollapsed) && /*#__PURE__*/_react.default.createElement("div", {
123
+ className: "".concat(blockClass, "__secondary-btn")
124
+ }, action)), (collapsible || tertiaryButtonLabel) && /*#__PURE__*/_react.default.createElement("footer", {
125
+ className: "".concat(blockClass, "__footer")
126
+ }, collapsible && !media && /*#__PURE__*/_react.default.createElement(_react2.Button, {
127
+ className: "".concat(blockClass, "__toggle-btn"),
128
+ kind: "ghost",
129
+ size: "md",
130
+ onClick: function onClick() {
131
+ setIsCollapsed(function (prevState) {
132
+ return !prevState;
133
+ });
134
+ }
135
+ }, isCollapsed ? expandButtonLabel : collapseButtonLabel), tertiaryButtonLabel && /*#__PURE__*/_react.default.createElement(_react2.Button, {
136
+ className: "".concat(blockClass, "__close-btn"),
137
+ size: "md",
138
+ onClick: onClick,
139
+ kind: "tertiary",
140
+ renderIcon: function renderIcon() {
141
+ return /*#__PURE__*/_react.default.createElement(_icons.Crossroads, {
142
+ size: 16
143
+ });
144
+ }
145
+ }, tertiaryButtonLabel))), media && (media.render ? /*#__PURE__*/_react.default.createElement("div", {
146
+ className: "".concat(blockClass, "__media")
147
+ }, media.render()) : /*#__PURE__*/_react.default.createElement(_SteppedAnimatedMedia.SteppedAnimatedMedia, {
148
+ className: "".concat(blockClass, "__media"),
149
+ filePaths: media.filePaths
150
+ })));
151
+ });
152
+ exports.InlineTip = InlineTip = _settings.pkg.checkComponentEnabled(InlineTip, componentName);
153
+ InlineTip.displayName = componentName;
154
+ InlineTip.propTypes = {
155
+ /**
156
+ * Optional "call to action" ghost button or link that can appear
157
+ * directly below the content. This component comes with pre-styled
158
+ * elements available to use: `InlineTipLink` and `InlineTipButton`.
159
+ */
160
+ action: _propTypes.default.node,
161
+ /**
162
+ * Provide the contents of the InlineTip.
163
+ */
164
+ children: _propTypes.default.node.isRequired,
165
+ /**
166
+ * Provide an optional class to be applied to the containing node.
167
+ */
168
+ className: _propTypes.default.string,
169
+ /**
170
+ * Tooltip text and aria label for the Close button icon.
171
+ */
172
+ closeIconDescription: _propTypes.default.string,
173
+ /**
174
+ * The label for the collapse button.
175
+ * This button is not visible if `media` is specified.
176
+ */
177
+ collapseButtonLabel: _propTypes.default.string,
178
+ /**
179
+ * If set to `true`, it will truncate the body text to
180
+ * one line and expose an expand/collapse button toggle.
181
+ *
182
+ * This feature is disabled if `media` is specified.
183
+ */
184
+ collapsible: _propTypes.default.bool,
185
+ /**
186
+ * The label for the expand button.
187
+ * This button is not visible if `media` is specified.
188
+ */
189
+ expandButtonLabel: _propTypes.default.string,
190
+ /**
191
+ * The object describing an image in one of two shapes.
192
+ * - If a single media element is required, use `{render}`.
193
+ * - If a stepped animation is required, use `{filePaths}`.
194
+ *
195
+ * Enabling `media` disables the `collapsible` feature.
196
+ */
197
+ media: _propTypes.default.oneOfType([_propTypes.default.shape({
198
+ render: _propTypes.default.func
199
+ }), _propTypes.default.shape({
200
+ filePaths: _propTypes.default.string
201
+ })]),
202
+ /**
203
+ * Set to `true` to arrange the information in a format
204
+ * that is easier to read in a limited space.
205
+ */
206
+ narrow: _propTypes.default.bool,
207
+ /**
208
+ * Function to call when the tertiary button is clicked.
209
+ */
210
+ onClick: _propTypes.default.func,
211
+ /**
212
+ * Function to call when the InlineTip is closed via the "X" button.
213
+ */
214
+ onClose: _propTypes.default.func,
215
+ /**
216
+ * Defining the label will show a the tertiary button with the crossroads icon.
217
+ * You will still need to define the `onClose` method to trigger a callback.
218
+ */
219
+ tertiaryButtonLabel: _propTypes.default.string,
220
+ /**
221
+ * The title of the InlineTip.
222
+ */
223
+ title: _propTypes.default.string.isRequired
224
+ };
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.InlineTipButton = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _react2 = require("@carbon/react");
14
+ var _devtools = require("../../global/js/utils/devtools");
15
+ var _settings = require("../../settings");
16
+ var _excluded = ["children", "className"];
17
+ /**
18
+ * Copyright IBM Corp. 2023, 2023
19
+ *
20
+ * This source code is licensed under the Apache-2.0 license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+ // Import portions of React that are needed.
24
+ // Other standard imports.
25
+ // The block part of our conventional BEM class names (blockClass__E--M).
26
+ var blockClass = "".concat(_settings.pkg.prefix, "--inline-tip__button");
27
+ var componentName = 'InlineTipButton';
28
+
29
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
30
+
31
+ /**
32
+ * This is a standard Carbon button, styled specifically for use inside InlineTip.
33
+ */
34
+ var InlineTipButton = exports.InlineTipButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
35
+ var children = _ref.children,
36
+ className = _ref.className,
37
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
38
+ return /*#__PURE__*/_react.default.createElement(_react2.Button, (0, _extends2.default)({}, rest, {
39
+ className: (0, _classnames.default)(blockClass, className),
40
+ ref: ref
41
+ }, (0, _devtools.getDevtoolsProps)(componentName), {
42
+ size: "md",
43
+ kind: "ghost"
44
+ }), children);
45
+ });
46
+ InlineTipButton.propTypes = {
47
+ /**
48
+ * Provide the contents of the InlineTipButton.
49
+ */
50
+ children: _propTypes.default.node.isRequired,
51
+ /**
52
+ * Provide an optional class to be applied to the containing node.
53
+ */
54
+ className: _propTypes.default.string
55
+
56
+ /* TODO: add types and DocGen for all props. */
57
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.InlineTipLink = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+ var _icons = require("@carbon/react/icons");
14
+ var _react2 = require("@carbon/react");
15
+ var _devtools = require("../../global/js/utils/devtools");
16
+ var _settings = require("../../settings");
17
+ var _excluded = ["children", "className"];
18
+ /**
19
+ * Copyright IBM Corp. 2023, 2023
20
+ *
21
+ * This source code is licensed under the Apache-2.0 license found in the
22
+ * LICENSE file in the root directory of this source tree.
23
+ */
24
+ // Import portions of React that are needed.
25
+ // Other standard imports.
26
+ // The block part of our conventional BEM class names (blockClass__E--M).
27
+ var blockClass = "".concat(_settings.pkg.prefix, "--inline-tip__link");
28
+ var componentName = 'InlineTipLink';
29
+
30
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
31
+
32
+ /**
33
+ * This is a standard Carbon link, styled specifically for use inside InlineTip.
34
+ */
35
+ var InlineTipLink = exports.InlineTipLink = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
36
+ var children = _ref.children,
37
+ className = _ref.className,
38
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
39
+ return /*#__PURE__*/_react.default.createElement(_react2.Link, (0, _extends2.default)({}, rest, {
40
+ className: (0, _classnames.default)(blockClass, className),
41
+ ref: ref
42
+ }, (0, _devtools.getDevtoolsProps)(componentName), {
43
+ renderIcon: function renderIcon() {
44
+ return /*#__PURE__*/_react.default.createElement(_icons.Launch, {
45
+ size: 16
46
+ });
47
+ }
48
+ }), children);
49
+ });
50
+ InlineTipLink.propTypes = {
51
+ /**
52
+ * Provide the contents of the InlineTipLink.
53
+ */
54
+ children: _propTypes.default.node.isRequired,
55
+ /**
56
+ * Provide an optional class to be applied to the containing node.
57
+ */
58
+ className: _propTypes.default.string
59
+
60
+ /* TODO: add types and DocGen for all props. */
61
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "InlineTip", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _InlineTip.InlineTip;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "InlineTipButton", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _InlineTipButton.InlineTipButton;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "InlineTipLink", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _InlineTipLink.InlineTipLink;
22
+ }
23
+ });
24
+ var _InlineTip = require("./InlineTip");
25
+ var _InlineTipButton = require("./InlineTipButton");
26
+ var _InlineTipLink = require("./InlineTipLink");
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getComponentText = void 0;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ /**
10
+ * Copyright IBM Corp. 2023, 2023
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+
16
+ var getComponentText = exports.getComponentText = function getComponentText(reactNode) {
17
+ var _reactNode$props;
18
+ var tmpChildren = (reactNode === null || reactNode === void 0 || (_reactNode$props = reactNode.props) === null || _reactNode$props === void 0 ? void 0 : _reactNode$props.children) || undefined;
19
+ if (Array.isArray(reactNode)) {
20
+ var joinedNodes = [];
21
+ reactNode.forEach(function (node) {
22
+ if ((0, _typeof2.default)(node) === 'object') {
23
+ joinedNodes.push(getComponentText(node));
24
+ } else if (typeof node === 'string') {
25
+ joinedNodes.push(node);
26
+ }
27
+ });
28
+ return joinedNodes.join(' ');
29
+ }
30
+ if (tmpChildren === undefined) {
31
+ if (typeof reactNode === 'string') {
32
+ return reactNode;
33
+ } else {
34
+ return ' ';
35
+ }
36
+ }
37
+ if ((0, _typeof2.default)(tmpChildren) === 'object') {
38
+ return getComponentText(reactNode.props.children);
39
+ }
40
+ if (typeof tmpChildren === 'string') {
41
+ return reactNode.props.children;
42
+ }
43
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
11
+ var stories = _interopRequireWildcard(require("./SteppedAnimatedMedia.stories"));
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ var DocsPage = function DocsPage() {
15
+ return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
16
+ blocks: [{
17
+ story: stories.steppedAnimatedMedia
18
+ }]
19
+ });
20
+ };
21
+ var _default = exports.default = DocsPage;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SteppedAnimatedMedia = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
14
+ var _react = _interopRequireWildcard(require("react"));
15
+ var _lottieWeb = _interopRequireDefault(require("lottie-web"));
16
+ var _clamp = _interopRequireDefault(require("lodash/clamp"));
17
+ var _propTypes = _interopRequireDefault(require("prop-types"));
18
+ var _classnames = _interopRequireDefault(require("classnames"));
19
+ var _devtools = require("../../global/js/utils/devtools");
20
+ var _settings = require("../../settings");
21
+ var _excluded = ["className", "playStep", "filePaths"];
22
+ /**
23
+ * Copyright IBM Corp. 2023, 2023
24
+ *
25
+ * This source code is licensed under the Apache-2.0 license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */
28
+ // Import portions of React that are needed.
29
+ // Other standard imports.
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
+ // The block part of our conventional BEM class names (blockClass__E--M).
33
+ var blockClass = "".concat(_settings.pkg.prefix, "--stepped-animated-media");
34
+ var componentName = 'SteppedAnimatedMedia';
35
+
36
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
+
38
+ // Default values for props
39
+ var defaults = {
40
+ playStep: 0
41
+ };
42
+
43
+ /**
44
+ * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
45
+ */
46
+ var SteppedAnimatedMedia = exports.SteppedAnimatedMedia = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
47
+ var className = _ref.className,
48
+ _ref$playStep = _ref.playStep,
49
+ playStep = _ref$playStep === void 0 ? defaults.playStep : _ref$playStep,
50
+ filePaths = _ref.filePaths,
51
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
52
+ var _useState = (0, _react.useState)([]),
53
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
54
+ jsonData = _useState2[0],
55
+ setJsonData = _useState2[1];
56
+ var animRef = (0, _react.useRef)();
57
+ var backupRef = (0, _react.useRef)();
58
+ var localRef = ref !== null && ref !== void 0 ? ref : backupRef;
59
+ // load animation source
60
+ (0, _react.useEffect)(function () {
61
+ var isJsonFile = function isJsonFile(filePath) {
62
+ return filePath.includes('.json');
63
+ };
64
+ function loadArtifact() {
65
+ return _loadArtifact.apply(this, arguments);
66
+ }
67
+ function _loadArtifact() {
68
+ _loadArtifact = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
69
+ var allJsonArtifacts, rawResponse, jsonResponse, fileData;
70
+ return _regenerator.default.wrap(function _callee$(_context) {
71
+ while (1) switch (_context.prev = _context.next) {
72
+ case 0:
73
+ if (!(filePaths && filePaths.every(isJsonFile))) {
74
+ _context.next = 10;
75
+ break;
76
+ }
77
+ allJsonArtifacts = filePaths.map(function (el) {
78
+ return fetch(el);
79
+ });
80
+ _context.next = 4;
81
+ return Promise.all(allJsonArtifacts);
82
+ case 4:
83
+ rawResponse = _context.sent;
84
+ jsonResponse = rawResponse.map(function (el) {
85
+ return el.json();
86
+ });
87
+ _context.next = 8;
88
+ return Promise.all(jsonResponse);
89
+ case 8:
90
+ fileData = _context.sent;
91
+ setJsonData(fileData);
92
+ case 10:
93
+ case "end":
94
+ return _context.stop();
95
+ }
96
+ }, _callee);
97
+ }));
98
+ return _loadArtifact.apply(this, arguments);
99
+ }
100
+ loadArtifact();
101
+ }, [filePaths]);
102
+ (0, _react.useEffect)(function () {
103
+ var _window;
104
+ var prefersReducedMotion = (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : true;
105
+ if (localRef.current) {
106
+ var _animRef$current, _animRef$current2, _animRef$current3;
107
+ (_animRef$current = animRef.current) === null || _animRef$current === void 0 || _animRef$current.destroy();
108
+ animRef.current = _lottieWeb.default.loadAnimation({
109
+ container: localRef.current,
110
+ renderer: 'svg',
111
+ animationData: jsonData[(0, _clamp.default)(playStep, 0, jsonData.length - 1)],
112
+ loop: false,
113
+ autoplay: false,
114
+ rendererSettings: {
115
+ preserveAspectRatio: 'xMidYMid slice'
116
+ }
117
+ });
118
+ prefersReducedMotion ? (_animRef$current2 = animRef.current) === null || _animRef$current2 === void 0 ? void 0 : _animRef$current2.goToAndStop(0) : (_animRef$current3 = animRef.current) === null || _animRef$current3 === void 0 ? void 0 : _animRef$current3.goToAndPlay(0);
119
+ }
120
+ return function () {
121
+ var _animRef$current4;
122
+ return (_animRef$current4 = animRef.current) === null || _animRef$current4 === void 0 ? void 0 : _animRef$current4.destroy();
123
+ };
124
+ }, [jsonData, localRef, playStep]);
125
+ if (!jsonData) {
126
+ return null;
127
+ }
128
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
129
+ className: (0, _classnames.default)(blockClass, className),
130
+ role: "img",
131
+ ref: localRef
132
+ }, (0, _devtools.getDevtoolsProps)(componentName)));
133
+ });
134
+ SteppedAnimatedMedia.displayName = componentName;
135
+ SteppedAnimatedMedia.propTypes = {
136
+ /**
137
+ * Optional class name for this component.
138
+ */
139
+ className: _propTypes.default.string,
140
+ /**
141
+ * The file path(s) to json formatted Lottie animation files.
142
+ */
143
+ filePaths: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
144
+ /**
145
+ * Which animation step from the filePaths array to play.
146
+ */
147
+ playStep: _propTypes.default.number
148
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HowACaseIsCreated3 = exports.HowACaseIsCreated2 = exports.HowACaseIsCreated1 = void 0;
7
+ var HowACaseIsCreated1 = exports.HowACaseIsCreated1 = new URL('./illustrations/how-a-case-is-created-1', import.meta.url).pathname;
8
+ var HowACaseIsCreated2 = exports.HowACaseIsCreated2 = new URL('./illustrations/how-a-case-is-created-2', import.meta.url).pathname;
9
+ var HowACaseIsCreated3 = exports.HowACaseIsCreated3 = new URL('./illustrations/how-a-case-is-created-3', import.meta.url).pathname;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "SteppedAnimatedMedia", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _SteppedAnimatedMedia.SteppedAnimatedMedia;
10
+ }
11
+ });
12
+ var _SteppedAnimatedMedia = require("./SteppedAnimatedMedia");
@@ -30,6 +30,7 @@ var defaults = {
30
30
  CreateTearsheet: true,
31
31
  CreateTearsheetStep: true,
32
32
  CreateTearsheetDivider: true,
33
+ Datagrid: true,
33
34
  EditInPlace: true,
34
35
  EmptyState: true,
35
36
  ErrorEmptyState: true,
@@ -68,7 +69,6 @@ var defaults = {
68
69
  EditSidePanel: false,
69
70
  CancelableTextEdit: false,
70
71
  DataSpreadsheet: false,
71
- Datagrid: false,
72
72
  EditTearsheet: false,
73
73
  EditTearsheetForm: false,
74
74
  EditTearsheetNarrow: false,
@@ -77,17 +77,16 @@ var defaults = {
77
77
  /* new component flags here - comment used by generate CLI */
78
78
 
79
79
  // Novice to pro components not yet reviewed and released:
80
- Checklist: false
80
+ Checklist: false,
81
+ InlineTip: false
81
82
  },
82
83
  // feature level flags
83
84
  feature: {
84
85
  'default-portal-target-body': true,
85
- 'Datagrid.useInfiniteScroll': false,
86
86
  'Datagrid.useInlineEdit': false,
87
87
  'Datagrid.useEditableCell': false,
88
88
  'Datagrid.useExpandedRow': false,
89
89
  'Datagrid.useNestedRows': false,
90
- 'Datagrid.useActionsColumn': false,
91
90
  'Datagrid.useFiltering': false,
92
91
  'Datagrid.useCustomizeColumns': false,
93
92
  'ExampleComponent.secondaryIcon': false,