@carbon/ibm-products 2.34.0 → 2.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. package/css/index-full-carbon.css +31910 -32273
  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 +38 -17
  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 +568 -24320
  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 +2145 -17925
  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/ActionSet/ActionSet.d.ts +38 -2
  18. package/es/components/ActionSet/ActionSet.js +3 -5
  19. package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  20. package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  21. package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
  22. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  23. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
  24. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  25. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
  26. package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  27. package/es/components/ConditionBuilder/index.d.ts +1 -0
  28. package/es/components/CreateFullPage/CreateFullPage.js +3 -19
  29. package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
  30. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  31. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  32. package/es/components/Datagrid/useEditableCell.js +15 -0
  33. package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
  34. package/es/components/DelimitedList/DelimitedList.js +0 -1
  35. package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
  36. package/es/components/EditInPlace/EditInPlace.js +10 -6
  37. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  38. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  39. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  40. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  41. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  42. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  43. package/es/components/ExportModal/ExportModal.d.ts +110 -2
  44. package/es/components/ExportModal/ExportModal.js +10 -4
  45. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
  46. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
  47. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  48. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +5 -9
  49. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +1 -1
  50. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  51. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
  52. package/es/components/FilterPanel/index.d.ts +1 -0
  53. package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  54. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  55. package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  56. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  57. package/es/components/ImportModal/ImportModal.d.ts +136 -2
  58. package/es/components/ImportModal/ImportModal.js +3 -2
  59. package/es/components/InlineTip/InlineTip.d.ts +90 -2
  60. package/es/components/InlineTip/InlineTip.js +3 -2
  61. package/es/components/Nav/Nav.js +1 -1
  62. package/es/components/Nav/NavList.js +7 -7
  63. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  64. package/es/components/PageHeader/PageHeader.js +3 -3
  65. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  66. package/es/components/PageHeader/PageHeaderUtils.js +4 -3
  67. package/es/components/SidePanel/SidePanel.js +52 -36
  68. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  69. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  70. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  71. package/es/components/TagOverflow/TagOverflow.js +209 -0
  72. package/es/components/TagOverflow/constants.d.ts +14 -0
  73. package/es/components/TagOverflow/constants.js +30 -0
  74. package/es/components/TagOverflow/index.d.ts +1 -0
  75. package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  76. package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
  77. package/es/components/Toolbar/Toolbar.d.ts +23 -5
  78. package/es/components/Toolbar/Toolbar.js +30 -26
  79. package/es/components/UserAvatar/UserAvatar.js +4 -2
  80. package/es/components/index.d.ts +4 -2
  81. package/es/global/js/package-settings.d.ts +3 -0
  82. package/es/global/js/package-settings.js +3 -0
  83. package/es/index.js +4 -0
  84. package/es/settings.d.ts +3 -0
  85. package/lib/components/ActionSet/ActionSet.d.ts +38 -2
  86. package/lib/components/ActionSet/ActionSet.js +3 -5
  87. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  88. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  89. package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
  90. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  91. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
  92. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  93. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
  94. package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  95. package/lib/components/ConditionBuilder/index.d.ts +1 -0
  96. package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
  97. package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
  98. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  99. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  100. package/lib/components/Datagrid/useEditableCell.js +19 -0
  101. package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
  102. package/lib/components/DelimitedList/DelimitedList.js +0 -1
  103. package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
  104. package/lib/components/EditInPlace/EditInPlace.js +10 -6
  105. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  106. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  107. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  108. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  109. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  110. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  111. package/lib/components/ExportModal/ExportModal.d.ts +110 -2
  112. package/lib/components/ExportModal/ExportModal.js +10 -4
  113. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
  114. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
  115. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  116. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +5 -9
  117. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +1 -1
  118. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  119. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
  120. package/lib/components/FilterPanel/index.d.ts +1 -0
  121. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  122. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  123. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  124. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  125. package/lib/components/ImportModal/ImportModal.d.ts +136 -2
  126. package/lib/components/ImportModal/ImportModal.js +3 -2
  127. package/lib/components/InlineTip/InlineTip.d.ts +90 -2
  128. package/lib/components/InlineTip/InlineTip.js +3 -2
  129. package/lib/components/Nav/Nav.js +1 -1
  130. package/lib/components/Nav/NavList.js +7 -7
  131. package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
  132. package/lib/components/PageHeader/PageHeader.js +3 -3
  133. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  134. package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
  135. package/lib/components/SidePanel/SidePanel.js +52 -36
  136. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  137. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  138. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  139. package/lib/components/TagOverflow/TagOverflow.js +216 -0
  140. package/lib/components/TagOverflow/constants.d.ts +14 -0
  141. package/lib/components/TagOverflow/constants.js +34 -0
  142. package/lib/components/TagOverflow/index.d.ts +1 -0
  143. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  144. package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
  145. package/lib/components/Toolbar/Toolbar.d.ts +23 -5
  146. package/lib/components/Toolbar/Toolbar.js +30 -26
  147. package/lib/components/UserAvatar/UserAvatar.js +4 -2
  148. package/lib/components/index.d.ts +4 -2
  149. package/lib/global/js/package-settings.d.ts +3 -0
  150. package/lib/global/js/package-settings.js +3 -0
  151. package/lib/index.js +17 -0
  152. package/lib/settings.d.ts +3 -0
  153. package/package.json +3 -3
  154. package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
  155. package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
  156. package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
  157. package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
  158. package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
  159. package/scss/components/ConditionBuilder/_index.scss +8 -0
  160. package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
  161. package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
  162. package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
  163. package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +1 -3
  164. package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +0 -2
  165. package/scss/components/FilterPanel/_filter-panel-checkbox.scss +0 -1
  166. package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
  167. package/scss/components/FilterPanel/_index-with-carbon.scss +1 -0
  168. package/scss/components/FilterPanel/_index.scss +1 -0
  169. package/scss/components/Guidebanner/_guidebanner.scss +1 -1
  170. package/scss/components/InlineTip/_inline-tip.scss +1 -1
  171. package/scss/components/ProductiveCard/_productive-card.scss +13 -0
  172. package/scss/components/SidePanel/_side-panel.scss +9 -9
  173. package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
  174. package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
  175. package/scss/components/TagOverflow/_index.scss +8 -0
  176. package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
  177. package/scss/components/Tearsheet/_tearsheet.scss +10 -0
  178. package/scss/components/UserAvatar/_user-avatar.scss +1 -0
  179. package/scss/components/_index-with-carbon.scss +2 -0
  180. package/scss/components/_index.scss +2 -0
@@ -1,3 +1,39 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2024
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
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React from 'react';
9
+ import { ButtonProps } from '@carbon/react';
10
+ export declare const ButtonSizes: readonly ["sm", "md", "lg", "xl", "2xl"];
11
+ export type ButtonSize = (typeof ButtonSizes)[number];
12
+ interface ActionSetProps {
13
+ /**
14
+ * The action buttons to show. Each action is specified as an object
15
+ * representation of a Carbon button.
16
+ *
17
+ * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
18
+ */
19
+ actions: ButtonProps[];
20
+ /**
21
+ * The size of buttons to use for the actions. The allowed values are
22
+ * those for the size prop of carbon Button. If this prop is specified, all
23
+ * the buttons will be set to this size, overriding any 'size' values (if any)
24
+ * supplied in the actions array (if any).
25
+ */
26
+ buttonSize?: ButtonSize;
27
+ /**
28
+ * An optional class or classes to be added to the outermost element.
29
+ */
30
+ className?: string;
31
+ /**
32
+ * The size of the action set. Different button arrangements are used at
33
+ * different sizes, to make best use of the available space.
34
+ */
35
+ size?: ButtonSize;
36
+ }
1
37
  /**
2
38
  * An ActionSet presents a set of action buttons, constructed from bundles
3
39
  * of prop values and applying some layout rules. When the size is 'sm'
@@ -10,5 +46,5 @@
10
46
  * it appears at the left side. If there is a primary button it appears at the
11
47
  * right.
12
48
  */
13
- export const ActionSet: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
14
- import React from 'react';
49
+ export declare const ActionSet: React.ForwardRefExoticComponent<ActionSetProps & React.RefAttributes<HTMLDivElement>>;
50
+ export {};
@@ -18,9 +18,6 @@ var _excluded = ["className", "disabled", "kind", "label", "loading", "isExpress
18
18
  _excluded2 = ["actions", "buttonSize", "className", "size"];
19
19
  var blockClass = "".concat(pkg.prefix, "--action-set");
20
20
  var componentName = 'ActionSet';
21
-
22
- // NOTE: the component SCSS is not imported here: it is rolled up separately.
23
-
24
21
  var ActionSetButton = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
25
22
  var className = _ref.className,
26
23
  disabled = _ref.disabled,
@@ -53,7 +50,6 @@ var willStack = function willStack(size, numberOfActions) {
53
50
  var defaults = {
54
51
  size: 'md'
55
52
  };
56
-
57
53
  /**
58
54
  * An ActionSet presents a set of action buttons, constructed from bundles
59
55
  * of prop values and applying some layout rules. When the size is 'sm'
@@ -124,6 +120,7 @@ ActionSet.displayName = componentName;
124
120
  * @returns null if the actions meet the requirements, or an Error object with
125
121
  * an explanatory message.
126
122
  */
123
+ /**@ts-ignore*/
127
124
  ActionSet.validateActions = function (sizeFn) {
128
125
  return function (props, propName, componentName, location, propFullName) {
129
126
  var name = propFullName || propName;
@@ -166,7 +163,8 @@ ActionSet.propTypes = {
166
163
  *
167
164
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
168
165
  */
169
- actions: allPropTypes([ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
166
+ actions: allPropTypes([/**@ts-ignore*/
167
+ ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
170
168
  kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
171
169
  label: PropTypes.string,
172
170
  loading: PropTypes.bool,
@@ -85,7 +85,7 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
85
85
  }
86
86
  }, [prefersReducedMotion.matches]);
87
87
  var handleTransitionEnd = function handleTransitionEnd(e) {
88
- console.log('Hererrrrrreee at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
88
+ console.log('Here at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
89
89
  if (e.propertyName === 'transform' && !fixedIsVisible) {
90
90
  setIsOpen(false);
91
91
  onClose();
@@ -0,0 +1,5 @@
1
+ /**
2
+ * TODO: A description of the component.
3
+ */
4
+ export let ConditionBuilder: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ import React from 'react';
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default from 'react';
10
+ import { VStack } from '@carbon/react';
11
+ import PropTypes from '../../node_modules/prop-types/index.js';
12
+ import cx from 'classnames';
13
+ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
14
+ import { pkg } from '../../settings.js';
15
+ import ConditionBuilderContent from './ConditionBuilderContent/ConditionBuilderContent.js';
16
+ import { ConditionBuilderProvider } from './ConditionBuilderContext/DataTreeContext.js';
17
+
18
+ var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold"];
19
+
20
+ // Carbon and package components we use.
21
+ /* TODO: @import(s) of carbon components and other package components. */
22
+
23
+ // The block part of our conventional BEM class names (blockClass__E--M).
24
+ var blockClass = "".concat(pkg.prefix, "--condition-builder");
25
+ var componentName = 'ConditionBuilder';
26
+
27
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
28
+
29
+ // Default values can be included here and then assigned to the prop params,
30
+ // e.g. prop = defaults.prop,
31
+ // This gathers default values together neatly and ensures non-primitive
32
+ // values are initialized early to avoid react making unnecessary re-renders.
33
+ // Note that default values are not required for props that are 'required',
34
+ // nor for props where the component can apply undefined values reasonably.
35
+ // Default values should be provided when the component needs to make a choice
36
+ // or assumption when a prop is not supplied.
37
+
38
+ // Default values for props
39
+ // const defaults = {
40
+ // /* TODO: add defaults for relevant props if needed */
41
+ // };
42
+
43
+ /**
44
+ * TODO: A description of the component.
45
+ */
46
+
47
+ var ConditionBuilder = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
48
+ var className = _ref.className,
49
+ inputConfig = _ref.inputConfig,
50
+ startConditionLabel = _ref.startConditionLabel,
51
+ popOverSearchThreshold = _ref.popOverSearchThreshold,
52
+ rest = _objectWithoutProperties(_ref, _excluded);
53
+ return /*#__PURE__*/React__default.createElement(ConditionBuilderProvider, {
54
+ inputConfig: inputConfig,
55
+ popOverSearchThreshold: popOverSearchThreshold
56
+ }, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
57
+ className: cx(blockClass,
58
+ // Apply the block class to the main HTML element
59
+ className,
60
+ // Apply any supplied class names to the main HTML element.
61
+ // example: `${blockClass}__template-string-class-${kind}-n-${size}`,
62
+ {
63
+ // switched classes dependant on props or state
64
+ // example: [`${blockClass}__here-if-small`]: size === 'sm',
65
+ }),
66
+ ref: ref,
67
+ role: "main"
68
+ }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(VStack, null, /*#__PURE__*/React__default.createElement(ConditionBuilderContent, {
69
+ startConditionLabel: startConditionLabel
70
+ }))));
71
+ });
72
+
73
+ // Return a placeholder if not released and not enabled by feature flag
74
+ ConditionBuilder = pkg.checkComponentEnabled(ConditionBuilder, componentName);
75
+
76
+ // The display name of the component, used by React. Note that displayName
77
+ // is used in preference to relying on function.name.
78
+ ConditionBuilder.displayName = componentName;
79
+
80
+ // The types and DocGen commentary for the component props,
81
+ // in alphabetical order (for consistency).
82
+ // See https://www.npmjs.com/package/prop-types#usage.
83
+ ConditionBuilder.propTypes = {
84
+ /**
85
+ * Provide the contents of the ConditionBuilder.
86
+ */
87
+ //children: PropTypes.node.isRequired,
88
+
89
+ /**
90
+ * Provide an optional class to be applied to the containing node.
91
+ */
92
+ className: PropTypes.string,
93
+ /**
94
+ * This is a mandatory prop that defines the input to the condition builder.
95
+
96
+ */
97
+ inputConfig: PropTypes.shape({
98
+ properties: PropTypes.arrayOf(PropTypes.shape({
99
+ id: PropTypes.string,
100
+ label: PropTypes.string,
101
+ icon: PropTypes.func,
102
+ type: PropTypes.oneOf(['text', 'number', 'date', 'option']),
103
+ config: PropTypes.shape({
104
+ options: PropTypes.arrayOf(PropTypes.shape({
105
+ id: PropTypes.string,
106
+ label: PropTypes.string,
107
+ icon: PropTypes.func
108
+ })),
109
+ includeSearch: PropTypes.bool
110
+ })
111
+ }))
112
+ }).isRequired,
113
+ /**
114
+ * Provide an mandatory numeric value that will be used to enable search option in the popovers with list.
115
+ */
116
+ popOverSearchThreshold: PropTypes.number.isRequired,
117
+ /**
118
+ * Provide a label to the button that starts condition builder
119
+ */
120
+ startConditionLabel: PropTypes.string.isRequired
121
+
122
+ /* TODO: add types and DocGen for all props. */
123
+ };
124
+
125
+ export { ConditionBuilder };
@@ -0,0 +1,10 @@
1
+ export default ConditionBuilderContent;
2
+ declare function ConditionBuilderContent({ startConditionLabel }: {
3
+ startConditionLabel: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ declare namespace ConditionBuilderContent {
6
+ namespace propTypes {
7
+ let startConditionLabel: PropTypes.Validator<string>;
8
+ }
9
+ }
10
+ import PropTypes from 'prop-types';
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { slicedToArray as _slicedToArray, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { useContext, useState, useRef, useEffect } from 'react';
10
+ import { pkg } from '../../../settings.js';
11
+ import PropTypes from '../../../node_modules/prop-types/index.js';
12
+ import { Button } from '@carbon/react';
13
+ import { Add } from '@carbon/react/icons';
14
+ import { ConditionBuilderContext, emptyState } from '../ConditionBuilderContext/DataTreeContext.js';
15
+
16
+ var blockClass = "".concat(pkg.prefix, "--condition-builder");
17
+ function ConditionBuilderContent(_ref) {
18
+ var _rootState$groups2;
19
+ var startConditionLabel = _ref.startConditionLabel;
20
+ var _useContext = useContext(ConditionBuilderContext),
21
+ rootState = _useContext.rootState,
22
+ setRootState = _useContext.setRootState;
23
+ var _useState = useState(true),
24
+ _useState2 = _slicedToArray(_useState, 2),
25
+ isConditionBuilderActive = _useState2[0],
26
+ setIsConditionBuilderActive = _useState2[1];
27
+ var conditionBuilderRef = useRef();
28
+ useEffect(function () {
29
+ var _rootState$groups;
30
+ if (rootState !== null && rootState !== void 0 && (_rootState$groups = rootState.groups) !== null && _rootState$groups !== void 0 && _rootState$groups.length) {
31
+ setIsConditionBuilderActive(false);
32
+ if (rootState.groups[0].conditions.length == 1 && rootState.groups[0].conditions[0].property == undefined) {
33
+ // when the add condition clicked to start the condition building, we by default open the popover of the first property
34
+ setTimeout(function () {
35
+ conditionBuilderRef.current.querySelector('.propertyField').click();
36
+ }, 0);
37
+ }
38
+ } else {
39
+ setIsConditionBuilderActive(true);
40
+ }
41
+ }, [rootState]);
42
+ var onStartConditionBuilder = function onStartConditionBuilder() {
43
+ //when add condition button is clicked.
44
+ setIsConditionBuilderActive(false);
45
+ setRootState(emptyState); //here we can set an empty skeleton object for an empty condition builder,
46
+ //or we can even pre-populate some existing builder and continue editing
47
+ };
48
+ return /*#__PURE__*/React__default.createElement("div", {
49
+ ref: conditionBuilderRef,
50
+ className: "".concat(blockClass, "__content-container")
51
+ }, isConditionBuilderActive && /*#__PURE__*/React__default.createElement(Button, {
52
+ className: "".concat(blockClass, "__condition-builder"),
53
+ renderIcon: function renderIcon(props) {
54
+ return /*#__PURE__*/React__default.createElement(Add, _extends({
55
+ size: 16
56
+ }, props));
57
+ },
58
+ iconDescription: startConditionLabel,
59
+ kind: "ghost",
60
+ size: "sm",
61
+ onClick: onStartConditionBuilder
62
+ }, startConditionLabel), rootState && (rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.map(function () {
63
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "conditionBuilder group renders here")
64
+ // <ConditionBuilderGroup
65
+ // state={eachGroup}
66
+ // onRemove={() => {
67
+ // onRemove(groupIndex);
68
+ // }}
69
+ // onChange={(updatedGroup) => {
70
+ // /**
71
+ // * This method is triggered from inner components. This will be called every time when any change is to be updated in the rootState.
72
+ // * This gets the updated group as argument.
73
+ // */
74
+ // setRootState({
75
+ // ...rootState,
76
+ // groups: rootState.groups.map((group, gIndex) =>
77
+ // groupIndex === gIndex ? updatedGroup : group
78
+ // ),
79
+ // });
80
+ // }}
81
+ //>
82
+ ;
83
+ })));
84
+ }
85
+ ConditionBuilderContent.propTypes = {
86
+ /**
87
+ * Provide a label to the button that starts condition builder
88
+ */
89
+ startConditionLabel: PropTypes.string.isRequired
90
+ };
91
+
92
+ export { ConditionBuilderContent as default };
@@ -0,0 +1,38 @@
1
+ export namespace emptyState {
2
+ let groups: {
3
+ groupSeparateOperator: null;
4
+ groupOperator: string;
5
+ statement: string;
6
+ conditions: {
7
+ property: undefined;
8
+ operator: string;
9
+ value: string;
10
+ }[];
11
+ }[];
12
+ }
13
+ export const ConditionBuilderContext: React.Context<any>;
14
+ export function ConditionBuilderProvider(props: any): import("react/jsx-runtime").JSX.Element;
15
+ export namespace ConditionBuilderProvider {
16
+ namespace propTypes {
17
+ let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
18
+ let inputConfig: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
19
+ properties: PropTypes.Requireable<(PropTypes.InferProps<{
20
+ id: PropTypes.Requireable<string>;
21
+ label: PropTypes.Requireable<string>;
22
+ icon: PropTypes.Requireable<(...args: any[]) => any>;
23
+ type: PropTypes.Requireable<string>;
24
+ config: PropTypes.Requireable<PropTypes.InferProps<{
25
+ options: PropTypes.Requireable<(PropTypes.InferProps<{
26
+ id: PropTypes.Requireable<string>;
27
+ label: PropTypes.Requireable<string>;
28
+ icon: PropTypes.Requireable<(...args: any[]) => any>;
29
+ }> | null | undefined)[]>;
30
+ includeSearch: PropTypes.Requireable<boolean>;
31
+ }>>;
32
+ }> | null | undefined)[]>;
33
+ }>>>;
34
+ let popOverSearchThreshold: PropTypes.Validator<number>;
35
+ }
36
+ }
37
+ import React from 'react';
38
+ import PropTypes from 'prop-types';
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { useState, createContext } from 'react';
10
+ import PropTypes from '../../../node_modules/prop-types/index.js';
11
+
12
+ var emptyState = {
13
+ groups: [{
14
+ groupSeparateOperator: null,
15
+ groupOperator: 'and',
16
+ statement: 'if',
17
+ conditions: [{
18
+ property: undefined,
19
+ operator: '',
20
+ value: ''
21
+ }]
22
+ }]
23
+ };
24
+ var ConditionBuilderContext = /*#__PURE__*/createContext();
25
+
26
+ // const rootReducer=(state,action)=>{
27
+ // switch(action.type){
28
+ // case 'update':
29
+ // ;
30
+ // return {
31
+ // ...state,
32
+ // ...action.payload
33
+ // }
34
+ // break;
35
+ // default:
36
+ // return state;
37
+ // }
38
+
39
+ // }
40
+
41
+ var ConditionBuilderProvider = function ConditionBuilderProvider(props) {
42
+ var _useState = useState({
43
+ groups: []
44
+ }),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ rootState = _useState2[0],
47
+ setRootState = _useState2[1];
48
+ return /*#__PURE__*/React__default.createElement(ConditionBuilderContext.Provider, {
49
+ value: {
50
+ rootState: rootState,
51
+ setRootState: setRootState,
52
+ inputConfig: props.inputConfig,
53
+ popOverSearchThreshold: props.popOverSearchThreshold
54
+ }
55
+ },
56
+ // eslint-disable-next-line react/prop-types
57
+ props.children);
58
+ };
59
+ ConditionBuilderProvider.propTypes = {
60
+ /**
61
+ * Provide the contents of the ConditionBuilder.
62
+ */
63
+ children: PropTypes.node.isRequired,
64
+ /**
65
+ * This is a mandatory prop that defines the input to the condition builder.
66
+
67
+ */
68
+ inputConfig: PropTypes.shape({
69
+ properties: PropTypes.arrayOf(PropTypes.shape({
70
+ id: PropTypes.string,
71
+ label: PropTypes.string,
72
+ icon: PropTypes.func,
73
+ type: PropTypes.oneOf(['text', 'number', 'date', 'option']),
74
+ config: PropTypes.shape({
75
+ options: PropTypes.arrayOf(PropTypes.shape({
76
+ id: PropTypes.string,
77
+ label: PropTypes.string,
78
+ icon: PropTypes.func
79
+ })),
80
+ includeSearch: PropTypes.bool
81
+ })
82
+ }))
83
+ }).isRequired,
84
+ popOverSearchThreshold: PropTypes.number.isRequired
85
+ /* TODO: add types and DocGen for all props. */
86
+ };
87
+
88
+ export { ConditionBuilderContext, ConditionBuilderProvider, emptyState };
@@ -0,0 +1,58 @@
1
+ export declare const inputData: {
2
+ properties: ({
3
+ id: string;
4
+ label: string;
5
+ icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
6
+ type: string;
7
+ config: {
8
+ options: {
9
+ label: string;
10
+ id: string;
11
+ }[];
12
+ includeSearch?: undefined;
13
+ min?: undefined;
14
+ step?: undefined;
15
+ unit?: undefined;
16
+ };
17
+ } | {
18
+ id: string;
19
+ label: string;
20
+ icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
21
+ type: string;
22
+ config: {
23
+ options: {
24
+ label: string;
25
+ id: string;
26
+ icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
27
+ }[];
28
+ includeSearch: boolean;
29
+ min?: undefined;
30
+ step?: undefined;
31
+ unit?: undefined;
32
+ };
33
+ } | {
34
+ id: string;
35
+ label: string;
36
+ icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
37
+ type: string;
38
+ config: {
39
+ options?: undefined;
40
+ includeSearch?: undefined;
41
+ min?: undefined;
42
+ step?: undefined;
43
+ unit?: undefined;
44
+ };
45
+ } | {
46
+ id: string;
47
+ label: string;
48
+ icon: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType;
49
+ type: string;
50
+ config: {
51
+ min: number;
52
+ step: number;
53
+ unit: string;
54
+ options?: undefined;
55
+ includeSearch?: undefined;
56
+ };
57
+ })[];
58
+ };
@@ -0,0 +1 @@
1
+ export { ConditionBuilder } from "./ConditionBuilder";
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { useState, useRef, useEffect, createContext } from 'react';
9
+ import React__default, { useState, useEffect, createContext } from 'react';
10
10
  import PropTypes from '../../node_modules/prop-types/index.js';
11
11
  import cx from 'classnames';
12
12
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
@@ -118,11 +118,6 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
118
118
  _useState22 = _slicedToArray(_useState21, 2),
119
119
  lastIncludedStep = _useState22[0],
120
120
  setLastIncludedStep = _useState22[1];
121
- var _useState23 = useState(0),
122
- _useState24 = _slicedToArray(_useState23, 2),
123
- headerHeight = _useState24[0],
124
- setHeaderHeight = _useState24[1];
125
- var headerRef = useRef(null);
126
121
  useEffect(function () {
127
122
  var firstItem = stepData.findIndex(function (item) {
128
123
  return item === null || item === void 0 ? void 0 : item.shouldIncludeStep;
@@ -139,13 +134,6 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
139
134
  setCurrentStep(Number(initialStep + numberOfHiddenSteps));
140
135
  }
141
136
  }, [stepData, firstIncludedStep, lastIncludedStep, initialStep]);
142
- useEffect(function () {
143
- var headerHeight = 0;
144
- if (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) {
145
- headerHeight = headerRef.current.getBoundingClientRect().height;
146
- }
147
- setHeaderHeight(headerHeight);
148
- }, [title, breadcrumbs]);
149
137
  useCreateComponentFocus({
150
138
  previousState: previousState,
151
139
  currentStep: currentStep,
@@ -193,8 +181,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
193
181
  ref: ref,
194
182
  className: cx(blockClass, className)
195
183
  }, getDevtoolsProps(componentName)), (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) && /*#__PURE__*/React__default.createElement("div", {
196
- className: "".concat(blockClass, "__header"),
197
- ref: headerRef
184
+ className: "".concat(blockClass, "__header")
198
185
  }, /*#__PURE__*/React__default.createElement(SimpleHeader, {
199
186
  title: title,
200
187
  breadcrumbs: breadcrumbs,
@@ -202,10 +189,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
202
189
  overflowAriaLabel: breadcrumbsOverflowAriaLabel,
203
190
  maxVisible: maxVisibleBreadcrumbs
204
191
  })), /*#__PURE__*/React__default.createElement("div", {
205
- className: "".concat(blockClass, "__influencer-and-body-container"),
206
- style: {
207
- height: "calc(100vh - ".concat(headerHeight, "px)")
208
- }
192
+ className: "".concat(blockClass, "__influencer-and-body-container")
209
193
  }, /*#__PURE__*/React__default.createElement("div", {
210
194
  className: "".concat(blockClass, "__influencer")
211
195
  }, /*#__PURE__*/React__default.createElement(CreateInfluencer, {
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { forwardRef, useContext, useState, useEffect } from 'react';
8
+ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { forwardRef, useContext, useState, useEffect, isValidElement } from 'react';
10
10
  import PropTypes from '../../node_modules/prop-types/index.js';
11
11
  import cx from 'classnames';
12
12
  import { pkg } from '../../settings.js';
@@ -83,6 +83,24 @@ var CreateFullPageStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
83
83
  span: 50
84
84
  }; // Half.
85
85
 
86
+ var renderDescription = function renderDescription() {
87
+ if (description) {
88
+ var common = _objectSpread2({
89
+ children: description,
90
+ className: "".concat(blockClass, "-description")
91
+ }, span);
92
+ if (typeof description === 'string') {
93
+ return /*#__PURE__*/React__default.createElement(Column, _extends({}, common, {
94
+ as: "p"
95
+ }));
96
+ } else if ( /*#__PURE__*/isValidElement(description)) {
97
+ return /*#__PURE__*/React__default.createElement(Column, _extends({}, common, {
98
+ as: "div"
99
+ }));
100
+ }
101
+ }
102
+ return null;
103
+ };
86
104
  return stepsContext ? /*#__PURE__*/React__default.createElement("section", _extends({}, rest, {
87
105
  className: cx(blockClass, className, _defineProperty(_defineProperty({}, "".concat(blockClass, "__step--hidden-step"), stepNumber !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)), "".concat(blockClass, "__step--visible-step"), stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep))),
88
106
  ref: ref
@@ -92,10 +110,7 @@ var CreateFullPageStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
92
110
  }, span), title), subtitle && /*#__PURE__*/React__default.createElement(Column, _extends({
93
111
  className: "".concat(blockClass, "-subtitle"),
94
112
  as: "h6"
95
- }, span), subtitle), description && /*#__PURE__*/React__default.createElement(Column, _extends({
96
- className: "".concat(blockClass, "-description"),
97
- as: "p"
98
- }, span), description)))), hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
113
+ }, span), subtitle), renderDescription()))), hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
99
114
  legendText: fieldsetLegendText,
100
115
  className: "".concat(blockClass, "-fieldset")
101
116
  }, children) : children) : pconsole.warn("You have tried using a ".concat(componentName, " component outside of a CreateFullPage. This is not allowed. ").concat(componentName, "s should always be children of the CreateFullPage"));
@@ -115,7 +130,7 @@ CreateFullPageStep.propTypes = {
115
130
  /**
116
131
  * Sets an optional description on the progress step component
117
132
  */
118
- description: PropTypes.string,
133
+ description: PropTypes.node,
119
134
  /**
120
135
  * This will conditionally disable the submit button in the multi step CreateFullPage
121
136
  */