@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 {};
@@ -27,9 +27,6 @@ var _excluded = ["className", "disabled", "kind", "label", "loading", "isExpress
27
27
  _excluded2 = ["actions", "buttonSize", "className", "size"];
28
28
  var blockClass = "".concat(settings.pkg.prefix, "--action-set");
29
29
  var componentName = 'ActionSet';
30
-
31
- // NOTE: the component SCSS is not imported here: it is rolled up separately.
32
-
33
30
  var ActionSetButton = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
34
31
  var className = _ref.className,
35
32
  disabled = _ref.disabled,
@@ -62,7 +59,6 @@ var willStack = function willStack(size, numberOfActions) {
62
59
  var defaults = {
63
60
  size: 'md'
64
61
  };
65
-
66
62
  /**
67
63
  * An ActionSet presents a set of action buttons, constructed from bundles
68
64
  * of prop values and applying some layout rules. When the size is 'sm'
@@ -133,6 +129,7 @@ ActionSet.displayName = componentName;
133
129
  * @returns null if the actions meet the requirements, or an Error object with
134
130
  * an explanatory message.
135
131
  */
132
+ /**@ts-ignore*/
136
133
  ActionSet.validateActions = function (sizeFn) {
137
134
  return function (props, propName, componentName, location, propFullName) {
138
135
  var name = propFullName || propName;
@@ -175,7 +172,8 @@ ActionSet.propTypes = {
175
172
  *
176
173
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
177
174
  */
178
- actions: propsHelper.allPropTypes([ActionSet.validateActions(), index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, react.Button.propTypes), {}, {
175
+ actions: propsHelper.allPropTypes([/**@ts-ignore*/
176
+ ActionSet.validateActions(), index["default"].arrayOf(index["default"].shape(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, react.Button.propTypes), {}, {
179
177
  kind: index["default"].oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
180
178
  label: index["default"].string,
181
179
  loading: index["default"].bool,
@@ -94,7 +94,7 @@ exports.CoachmarkFixed = /*#__PURE__*/React__default["default"].forwardRef(funct
94
94
  }
95
95
  }, [prefersReducedMotion.matches]);
96
96
  var handleTransitionEnd = function handleTransitionEnd(e) {
97
- console.log('Hererrrrrreee at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
97
+ console.log('Here at transition end... ', e.propertyName === 'transform' && !fixedIsVisible);
98
98
  if (e.propertyName === 'transform' && !fixedIsVisible) {
99
99
  setIsOpen(false);
100
100
  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,132 @@
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
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var react = require('@carbon/react');
15
+ var index = require('../../node_modules/prop-types/index.js');
16
+ var cx = require('classnames');
17
+ var devtools = require('../../global/js/utils/devtools.js');
18
+ var settings = require('../../settings.js');
19
+ var ConditionBuilderContent = require('./ConditionBuilderContent/ConditionBuilderContent.js');
20
+ var DataTreeContext = require('./ConditionBuilderContext/DataTreeContext.js');
21
+
22
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
+
24
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
26
+
27
+ var _excluded = ["className", "inputConfig", "startConditionLabel", "popOverSearchThreshold"];
28
+
29
+ // Carbon and package components we use.
30
+ /* TODO: @import(s) of carbon components and other package components. */
31
+
32
+ // The block part of our conventional BEM class names (blockClass__E--M).
33
+ var blockClass = "".concat(settings.pkg.prefix, "--condition-builder");
34
+ var componentName = 'ConditionBuilder';
35
+
36
+ // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
+
38
+ // Default values can be included here and then assigned to the prop params,
39
+ // e.g. prop = defaults.prop,
40
+ // This gathers default values together neatly and ensures non-primitive
41
+ // values are initialized early to avoid react making unnecessary re-renders.
42
+ // Note that default values are not required for props that are 'required',
43
+ // nor for props where the component can apply undefined values reasonably.
44
+ // Default values should be provided when the component needs to make a choice
45
+ // or assumption when a prop is not supplied.
46
+
47
+ // Default values for props
48
+ // const defaults = {
49
+ // /* TODO: add defaults for relevant props if needed */
50
+ // };
51
+
52
+ /**
53
+ * TODO: A description of the component.
54
+ */
55
+
56
+ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
57
+ var className = _ref.className,
58
+ inputConfig = _ref.inputConfig,
59
+ startConditionLabel = _ref.startConditionLabel,
60
+ popOverSearchThreshold = _ref.popOverSearchThreshold,
61
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
62
+ return /*#__PURE__*/React__default["default"].createElement(DataTreeContext.ConditionBuilderProvider, {
63
+ inputConfig: inputConfig,
64
+ popOverSearchThreshold: popOverSearchThreshold
65
+ }, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
66
+ className: cx__default["default"](blockClass,
67
+ // Apply the block class to the main HTML element
68
+ className,
69
+ // Apply any supplied class names to the main HTML element.
70
+ // example: `${blockClass}__template-string-class-${kind}-n-${size}`,
71
+ {
72
+ // switched classes dependant on props or state
73
+ // example: [`${blockClass}__here-if-small`]: size === 'sm',
74
+ }),
75
+ ref: ref,
76
+ role: "main"
77
+ }, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(react.VStack, null, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContent["default"], {
78
+ startConditionLabel: startConditionLabel
79
+ }))));
80
+ });
81
+
82
+ // Return a placeholder if not released and not enabled by feature flag
83
+ exports.ConditionBuilder = settings.pkg.checkComponentEnabled(exports.ConditionBuilder, componentName);
84
+
85
+ // The display name of the component, used by React. Note that displayName
86
+ // is used in preference to relying on function.name.
87
+ exports.ConditionBuilder.displayName = componentName;
88
+
89
+ // The types and DocGen commentary for the component props,
90
+ // in alphabetical order (for consistency).
91
+ // See https://www.npmjs.com/package/prop-types#usage.
92
+ exports.ConditionBuilder.propTypes = {
93
+ /**
94
+ * Provide the contents of the ConditionBuilder.
95
+ */
96
+ //children: PropTypes.node.isRequired,
97
+
98
+ /**
99
+ * Provide an optional class to be applied to the containing node.
100
+ */
101
+ className: index["default"].string,
102
+ /**
103
+ * This is a mandatory prop that defines the input to the condition builder.
104
+
105
+ */
106
+ inputConfig: index["default"].shape({
107
+ properties: index["default"].arrayOf(index["default"].shape({
108
+ id: index["default"].string,
109
+ label: index["default"].string,
110
+ icon: index["default"].func,
111
+ type: index["default"].oneOf(['text', 'number', 'date', 'option']),
112
+ config: index["default"].shape({
113
+ options: index["default"].arrayOf(index["default"].shape({
114
+ id: index["default"].string,
115
+ label: index["default"].string,
116
+ icon: index["default"].func
117
+ })),
118
+ includeSearch: index["default"].bool
119
+ })
120
+ }))
121
+ }).isRequired,
122
+ /**
123
+ * Provide an mandatory numeric value that will be used to enable search option in the popovers with list.
124
+ */
125
+ popOverSearchThreshold: index["default"].number.isRequired,
126
+ /**
127
+ * Provide a label to the button that starts condition builder
128
+ */
129
+ startConditionLabel: index["default"].string.isRequired
130
+
131
+ /* TODO: add types and DocGen for all props. */
132
+ };
@@ -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,100 @@
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
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var settings = require('../../../settings.js');
15
+ var index = require('../../../node_modules/prop-types/index.js');
16
+ var react = require('@carbon/react');
17
+ var icons = require('@carbon/react/icons');
18
+ var DataTreeContext = require('../ConditionBuilderContext/DataTreeContext.js');
19
+
20
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
21
+
22
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+
24
+ var blockClass = "".concat(settings.pkg.prefix, "--condition-builder");
25
+ function ConditionBuilderContent(_ref) {
26
+ var _rootState$groups2;
27
+ var startConditionLabel = _ref.startConditionLabel;
28
+ var _useContext = React.useContext(DataTreeContext.ConditionBuilderContext),
29
+ rootState = _useContext.rootState,
30
+ setRootState = _useContext.setRootState;
31
+ var _useState = React.useState(true),
32
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
33
+ isConditionBuilderActive = _useState2[0],
34
+ setIsConditionBuilderActive = _useState2[1];
35
+ var conditionBuilderRef = React.useRef();
36
+ React.useEffect(function () {
37
+ var _rootState$groups;
38
+ if (rootState !== null && rootState !== void 0 && (_rootState$groups = rootState.groups) !== null && _rootState$groups !== void 0 && _rootState$groups.length) {
39
+ setIsConditionBuilderActive(false);
40
+ if (rootState.groups[0].conditions.length == 1 && rootState.groups[0].conditions[0].property == undefined) {
41
+ // when the add condition clicked to start the condition building, we by default open the popover of the first property
42
+ setTimeout(function () {
43
+ conditionBuilderRef.current.querySelector('.propertyField').click();
44
+ }, 0);
45
+ }
46
+ } else {
47
+ setIsConditionBuilderActive(true);
48
+ }
49
+ }, [rootState]);
50
+ var onStartConditionBuilder = function onStartConditionBuilder() {
51
+ //when add condition button is clicked.
52
+ setIsConditionBuilderActive(false);
53
+ setRootState(DataTreeContext.emptyState); //here we can set an empty skeleton object for an empty condition builder,
54
+ //or we can even pre-populate some existing builder and continue editing
55
+ };
56
+ return /*#__PURE__*/React__default["default"].createElement("div", {
57
+ ref: conditionBuilderRef,
58
+ className: "".concat(blockClass, "__content-container")
59
+ }, isConditionBuilderActive && /*#__PURE__*/React__default["default"].createElement(react.Button, {
60
+ className: "".concat(blockClass, "__condition-builder"),
61
+ renderIcon: function renderIcon(props) {
62
+ return /*#__PURE__*/React__default["default"].createElement(icons.Add, _rollupPluginBabelHelpers["extends"]({
63
+ size: 16
64
+ }, props));
65
+ },
66
+ iconDescription: startConditionLabel,
67
+ kind: "ghost",
68
+ size: "sm",
69
+ onClick: onStartConditionBuilder
70
+ }, startConditionLabel), rootState && (rootState === null || rootState === void 0 || (_rootState$groups2 = rootState.groups) === null || _rootState$groups2 === void 0 ? void 0 : _rootState$groups2.map(function () {
71
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, "conditionBuilder group renders here")
72
+ // <ConditionBuilderGroup
73
+ // state={eachGroup}
74
+ // onRemove={() => {
75
+ // onRemove(groupIndex);
76
+ // }}
77
+ // onChange={(updatedGroup) => {
78
+ // /**
79
+ // * This method is triggered from inner components. This will be called every time when any change is to be updated in the rootState.
80
+ // * This gets the updated group as argument.
81
+ // */
82
+ // setRootState({
83
+ // ...rootState,
84
+ // groups: rootState.groups.map((group, gIndex) =>
85
+ // groupIndex === gIndex ? updatedGroup : group
86
+ // ),
87
+ // });
88
+ // }}
89
+ //>
90
+ ;
91
+ })));
92
+ }
93
+ ConditionBuilderContent.propTypes = {
94
+ /**
95
+ * Provide a label to the button that starts condition builder
96
+ */
97
+ startConditionLabel: index["default"].string.isRequired
98
+ };
99
+
100
+ exports["default"] = ConditionBuilderContent;
@@ -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,98 @@
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
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var index = require('../../../node_modules/prop-types/index.js');
15
+
16
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
+
18
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
+
20
+ var emptyState = {
21
+ groups: [{
22
+ groupSeparateOperator: null,
23
+ groupOperator: 'and',
24
+ statement: 'if',
25
+ conditions: [{
26
+ property: undefined,
27
+ operator: '',
28
+ value: ''
29
+ }]
30
+ }]
31
+ };
32
+ var ConditionBuilderContext = /*#__PURE__*/React.createContext();
33
+
34
+ // const rootReducer=(state,action)=>{
35
+ // switch(action.type){
36
+ // case 'update':
37
+ // ;
38
+ // return {
39
+ // ...state,
40
+ // ...action.payload
41
+ // }
42
+ // break;
43
+ // default:
44
+ // return state;
45
+ // }
46
+
47
+ // }
48
+
49
+ var ConditionBuilderProvider = function ConditionBuilderProvider(props) {
50
+ var _useState = React.useState({
51
+ groups: []
52
+ }),
53
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
54
+ rootState = _useState2[0],
55
+ setRootState = _useState2[1];
56
+ return /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContext.Provider, {
57
+ value: {
58
+ rootState: rootState,
59
+ setRootState: setRootState,
60
+ inputConfig: props.inputConfig,
61
+ popOverSearchThreshold: props.popOverSearchThreshold
62
+ }
63
+ },
64
+ // eslint-disable-next-line react/prop-types
65
+ props.children);
66
+ };
67
+ ConditionBuilderProvider.propTypes = {
68
+ /**
69
+ * Provide the contents of the ConditionBuilder.
70
+ */
71
+ children: index["default"].node.isRequired,
72
+ /**
73
+ * This is a mandatory prop that defines the input to the condition builder.
74
+
75
+ */
76
+ inputConfig: index["default"].shape({
77
+ properties: index["default"].arrayOf(index["default"].shape({
78
+ id: index["default"].string,
79
+ label: index["default"].string,
80
+ icon: index["default"].func,
81
+ type: index["default"].oneOf(['text', 'number', 'date', 'option']),
82
+ config: index["default"].shape({
83
+ options: index["default"].arrayOf(index["default"].shape({
84
+ id: index["default"].string,
85
+ label: index["default"].string,
86
+ icon: index["default"].func
87
+ })),
88
+ includeSearch: index["default"].bool
89
+ })
90
+ }))
91
+ }).isRequired,
92
+ popOverSearchThreshold: index["default"].number.isRequired
93
+ /* TODO: add types and DocGen for all props. */
94
+ };
95
+
96
+ exports.ConditionBuilderContext = ConditionBuilderContext;
97
+ exports.ConditionBuilderProvider = ConditionBuilderProvider;
98
+ exports.emptyState = 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";
@@ -127,11 +127,6 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
127
127
  _useState22 = _rollupPluginBabelHelpers.slicedToArray(_useState21, 2),
128
128
  lastIncludedStep = _useState22[0],
129
129
  setLastIncludedStep = _useState22[1];
130
- var _useState23 = React.useState(0),
131
- _useState24 = _rollupPluginBabelHelpers.slicedToArray(_useState23, 2),
132
- headerHeight = _useState24[0],
133
- setHeaderHeight = _useState24[1];
134
- var headerRef = React.useRef(null);
135
130
  React.useEffect(function () {
136
131
  var firstItem = stepData.findIndex(function (item) {
137
132
  return item === null || item === void 0 ? void 0 : item.shouldIncludeStep;
@@ -148,13 +143,6 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
148
143
  setCurrentStep(Number(initialStep + numberOfHiddenSteps));
149
144
  }
150
145
  }, [stepData, firstIncludedStep, lastIncludedStep, initialStep]);
151
- React.useEffect(function () {
152
- var headerHeight = 0;
153
- if (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) {
154
- headerHeight = headerRef.current.getBoundingClientRect().height;
155
- }
156
- setHeaderHeight(headerHeight);
157
- }, [title, breadcrumbs]);
158
146
  useCreateComponentFocus.useCreateComponentFocus({
159
147
  previousState: previousState,
160
148
  currentStep: currentStep,
@@ -202,8 +190,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
202
190
  ref: ref,
203
191
  className: cx__default["default"](blockClass, className)
204
192
  }, devtools.getDevtoolsProps(componentName)), (title || (breadcrumbs === null || breadcrumbs === void 0 ? void 0 : breadcrumbs.length) > 0) && /*#__PURE__*/React__default["default"].createElement("div", {
205
- className: "".concat(blockClass, "__header"),
206
- ref: headerRef
193
+ className: "".concat(blockClass, "__header")
207
194
  }, /*#__PURE__*/React__default["default"].createElement(SimpleHeader.SimpleHeader, {
208
195
  title: title,
209
196
  breadcrumbs: breadcrumbs,
@@ -211,10 +198,7 @@ exports.CreateFullPage = /*#__PURE__*/React__default["default"].forwardRef(funct
211
198
  overflowAriaLabel: breadcrumbsOverflowAriaLabel,
212
199
  maxVisible: maxVisibleBreadcrumbs
213
200
  })), /*#__PURE__*/React__default["default"].createElement("div", {
214
- className: "".concat(blockClass, "__influencer-and-body-container"),
215
- style: {
216
- height: "calc(100vh - ".concat(headerHeight, "px)")
217
- }
201
+ className: "".concat(blockClass, "__influencer-and-body-container")
218
202
  }, /*#__PURE__*/React__default["default"].createElement("div", {
219
203
  className: "".concat(blockClass, "__influencer")
220
204
  }, /*#__PURE__*/React__default["default"].createElement(CreateInfluencer.CreateInfluencer, {
@@ -92,6 +92,24 @@ exports.CreateFullPageStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
92
92
  span: 50
93
93
  }; // Half.
94
94
 
95
+ var renderDescription = function renderDescription() {
96
+ if (description) {
97
+ var common = _rollupPluginBabelHelpers.objectSpread2({
98
+ children: description,
99
+ className: "".concat(blockClass, "-description")
100
+ }, span);
101
+ if (typeof description === 'string') {
102
+ return /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({}, common, {
103
+ as: "p"
104
+ }));
105
+ } else if ( /*#__PURE__*/React.isValidElement(description)) {
106
+ return /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({}, common, {
107
+ as: "div"
108
+ }));
109
+ }
110
+ }
111
+ return null;
112
+ };
95
113
  return stepsContext ? /*#__PURE__*/React__default["default"].createElement("section", _rollupPluginBabelHelpers["extends"]({}, rest, {
96
114
  className: cx__default["default"](blockClass, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.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))),
97
115
  ref: ref
@@ -101,10 +119,7 @@ exports.CreateFullPageStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
101
119
  }, span), title), subtitle && /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({
102
120
  className: "".concat(blockClass, "-subtitle"),
103
121
  as: "h6"
104
- }, span), subtitle), description && /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({
105
- className: "".concat(blockClass, "-description"),
106
- as: "p"
107
- }, span), description)))), hasFieldset ? /*#__PURE__*/React__default["default"].createElement(react.FormGroup, {
122
+ }, span), subtitle), renderDescription()))), hasFieldset ? /*#__PURE__*/React__default["default"].createElement(react.FormGroup, {
108
123
  legendText: fieldsetLegendText,
109
124
  className: "".concat(blockClass, "-fieldset")
110
125
  }, children) : children) : pconsole["default"].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"));
@@ -124,7 +139,7 @@ exports.CreateFullPageStep.propTypes = {
124
139
  /**
125
140
  * Sets an optional description on the progress step component
126
141
  */
127
- description: index["default"].string,
142
+ description: index["default"].node,
128
143
  /**
129
144
  * This will conditionally disable the submit button in the multi step CreateFullPage
130
145
  */