@carbon/ibm-products 2.33.0 → 2.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. package/css/index-full-carbon.css +303 -11
  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.css +303 -11
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +303 -11
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  14. package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
  15. package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  16. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  17. package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  18. package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
  19. package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  20. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  21. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  22. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  23. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
  24. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  25. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  26. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  27. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  28. package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  29. package/es/components/EditSidePanel/EditSidePanel.js +8 -10
  30. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  31. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
  32. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  33. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
  34. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +3 -1
  35. package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  36. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  37. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
  38. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  39. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
  40. package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  41. package/es/components/FilterPanel/index.d.ts +4 -0
  42. package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
  43. package/es/components/OptionsTile/OptionsTile.js +9 -20
  44. package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
  45. package/es/components/RemoveModal/RemoveModal.js +1 -0
  46. package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  47. package/es/components/ScrollGradient/ScrollGradient.js +156 -0
  48. package/es/components/ScrollGradient/constants.d.ts +15 -0
  49. package/es/components/ScrollGradient/constants.js +121 -0
  50. package/es/components/ScrollGradient/index.d.ts +1 -0
  51. package/es/components/SidePanel/SidePanel.d.ts +144 -2
  52. package/es/components/SidePanel/SidePanel.js +57 -48
  53. package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
  54. package/es/components/StatusIcon/StatusIcon.js +97 -95
  55. package/es/components/TruncatedList/TruncatedList.js +5 -3
  56. package/es/components/UserAvatar/UserAvatar.js +3 -2
  57. package/es/components/index.d.ts +2 -1
  58. package/es/global/js/package-settings.d.ts +5 -0
  59. package/es/global/js/package-settings.js +5 -0
  60. package/es/index.js +5 -0
  61. package/es/settings.d.ts +5 -0
  62. package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  63. package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
  64. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  65. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  66. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  67. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
  68. package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  69. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  70. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  71. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  72. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  73. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  74. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  75. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  76. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  77. package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  78. package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
  79. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  80. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
  81. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  82. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
  83. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +3 -1
  84. package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  85. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  86. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
  87. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  88. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
  89. package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  90. package/lib/components/FilterPanel/index.d.ts +4 -0
  91. package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
  92. package/lib/components/OptionsTile/OptionsTile.js +9 -20
  93. package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
  94. package/lib/components/RemoveModal/RemoveModal.js +1 -0
  95. package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  96. package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
  97. package/lib/components/ScrollGradient/constants.d.ts +15 -0
  98. package/lib/components/ScrollGradient/constants.js +128 -0
  99. package/lib/components/ScrollGradient/index.d.ts +1 -0
  100. package/lib/components/SidePanel/SidePanel.d.ts +144 -2
  101. package/lib/components/SidePanel/SidePanel.js +57 -48
  102. package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
  103. package/lib/components/StatusIcon/StatusIcon.js +97 -95
  104. package/lib/components/TruncatedList/TruncatedList.js +5 -3
  105. package/lib/components/UserAvatar/UserAvatar.js +3 -2
  106. package/lib/components/index.d.ts +2 -1
  107. package/lib/global/js/package-settings.d.ts +5 -0
  108. package/lib/global/js/package-settings.js +5 -0
  109. package/lib/index.js +25 -0
  110. package/lib/settings.d.ts +5 -0
  111. package/package.json +3 -3
  112. package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +56 -0
  113. package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
  114. package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +62 -0
  115. package/scss/components/FilterPanel/_filter-panel-checkbox.scss +25 -3
  116. package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
  117. package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
  118. package/scss/components/FilterPanel/_filter-panel.scss +2 -0
  119. package/scss/components/FilterPanel/_index-with-carbon.scss +4 -0
  120. package/scss/components/FilterPanel/_index.scss +4 -0
  121. package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
  122. package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
  123. package/scss/components/ScrollGradient/_index.scss +8 -0
  124. package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
  125. package/scss/components/UserAvatar/_user-avatar.scss +37 -4
  126. package/scss/components/_index-with-carbon.scss +1 -0
  127. package/scss/components/_index.scss +1 -0
@@ -29,7 +29,9 @@ var DatagridRefBody = function DatagridRefBody(datagridState) {
29
29
  var getTableBodyProps = datagridState.getTableBodyProps,
30
30
  rows = datagridState.rows,
31
31
  prepareRow = datagridState.prepareRow;
32
- return /*#__PURE__*/React__default["default"].createElement("tbody", _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps(), {
32
+ return /*#__PURE__*/React__default["default"].createElement("tbody", _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps({
33
+ role: undefined
34
+ }), {
33
35
  className: cx__default["default"]("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
34
36
  }), rows.map(function (row) {
35
37
  prepareRow(row);
@@ -25,7 +25,10 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
25
25
  var getTableBodyProps = datagridState.getTableBodyProps,
26
26
  rows = datagridState.rows,
27
27
  prepareRow = datagridState.prepareRow;
28
- return /*#__PURE__*/React__default["default"].createElement(react.TableBody, _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps(), {
28
+ return /*#__PURE__*/React__default["default"].createElement(react.TableBody, _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps({
29
+ role: undefined
30
+ }), {
31
+ "aria-live": null,
29
32
  className: cx__default["default"]("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
30
33
  }), rows.map(function (row) {
31
34
  prepareRow(row);
@@ -85,7 +85,11 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
85
85
  width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
86
86
  overflow: 'hidden'
87
87
  }
88
- }, /*#__PURE__*/React__default["default"].createElement(DatagridHead["default"], datagridState)), /*#__PURE__*/React__default["default"].createElement(react.TableBody, getTableBodyProps(), /*#__PURE__*/React__default["default"].createElement(reactWindow.VariableSizeList, {
88
+ }, /*#__PURE__*/React__default["default"].createElement(DatagridHead["default"], datagridState)), /*#__PURE__*/React__default["default"].createElement(react.TableBody, _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps({
89
+ role: undefined
90
+ }), {
91
+ "aria-live": null
92
+ }), /*#__PURE__*/React__default["default"].createElement(reactWindow.VariableSizeList, {
89
93
  height: virtualHeight || tableHeight,
90
94
  itemCount: visibleRows.length,
91
95
  itemSize: function itemSize(index) {
@@ -1,5 +1,5 @@
1
1
  export default Columns;
2
- declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, customizeTearsheetHeadingLabel }: {
2
+ declare function Columns({ getVisibleColumnsCount, filterString, columns, setColumnsObject, onSelectColumn, assistiveTextInstructionsLabel, assistiveTextDisabledInstructionsLabel, selectAllLabel, customizeTearsheetHeadingLabel, }: {
3
3
  getVisibleColumnsCount: any;
4
4
  filterString: any;
5
5
  columns: any;
@@ -162,6 +162,10 @@ var InlineEditCell = function InlineEditCell(_ref) {
162
162
  if (type === 'number') {
163
163
  numberInputRef.current.focus();
164
164
  }
165
+ if (type === 'selection') {
166
+ var _dropdownRef$current;
167
+ dropdownRef === null || dropdownRef === void 0 || (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 || _dropdownRef$current.focus();
168
+ }
165
169
  }
166
170
  }, [inEditMode, type]);
167
171
 
@@ -1,8 +1,9 @@
1
- export function handleGridKeyPress({ event, dispatch, state, instance, keysPressedList, usingMac, }: {
1
+ export function handleGridKeyPress({ event, dispatch, state, instance, keysPressedList, usingMac, ref, }: {
2
2
  event: any;
3
3
  dispatch: any;
4
4
  state: any;
5
5
  instance: any;
6
6
  keysPressedList: any;
7
7
  usingMac: any;
8
+ ref: any;
8
9
  }): void;
@@ -21,7 +21,8 @@ var handleGridKeyPress = function handleGridKeyPress(_ref) {
21
21
  state = _ref.state,
22
22
  instance = _ref.instance,
23
23
  keysPressedList = _ref.keysPressedList,
24
- usingMac = _ref.usingMac;
24
+ usingMac = _ref.usingMac,
25
+ ref = _ref.ref;
25
26
  var key = event.key;
26
27
  var gridActive = state.gridActive,
27
28
  activeCellId = state.activeCellId,
@@ -58,8 +59,8 @@ var handleGridKeyPress = function handleGridKeyPress(_ref) {
58
59
 
59
60
  // Checks if the dropdown menu is open
60
61
  var dropdownIsActive = function dropdownIsActive() {
61
- var focusedElementRole = document.activeElement.getAttribute('role');
62
- if (focusedElementRole === 'listbox' && document.activeElement.classList.contains("".concat(settings.carbon.prefix, "--list-box__menu"))) {
62
+ var selectedDropdown = ref === null || ref === void 0 ? void 0 : ref.current.querySelector("\n #".concat(instance.tableId, " .").concat(blockClass, "__table-with-inline-edit [data-cell-id=\"").concat(activeCellId, "\"] button[role='combobox']\n "));
63
+ if (selectedDropdown) {
63
64
  // Prevents arrow keys from scrolling any other content when dropdown menu is open
64
65
  event.preventDefault();
65
66
  return true;
@@ -1,5 +1,95 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2021
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
+ import React, { ReactNode } from 'react';
8
+ import '../../global/js/utils/props-helper';
9
+ interface EditSidePanelProps {
10
+ /**
11
+ * Sets the body content of the create side panel
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Specifies a boolean for disabling or enabling the primary button. This is important for form validation
20
+ * Returning `true` prevents the primary button from being clicked until required fields are completed.
21
+ */
22
+ disableSubmit?: boolean;
23
+ /**
24
+ * Specifies an optional field that provides a additional context for a form
25
+ */
26
+ formDescription?: ReactNode;
27
+ /**
28
+ * Specifies a required field that provides a title for a form
29
+ */
30
+ formTitle: ReactNode;
31
+ /**
32
+ * Unique identifier
33
+ */
34
+ id?: string;
35
+ /**
36
+ * Specifies an optional handler which is called when the CreateSidePanel
37
+ * is closed.
38
+ */
39
+ onRequestClose?: () => void;
40
+ /**
41
+ * Specifies an optional handler which is called when the CreateSidePanel
42
+ * primary button is pressed.
43
+ */
44
+ onRequestSubmit?: () => void;
45
+ /**
46
+ * Specifies whether the CreateSidePanel is open or not.
47
+ */
48
+ open: boolean;
49
+ /**
50
+ * Determines if the side panel is on the right or left
51
+ */
52
+ placement?: 'left' | 'right';
53
+ /**
54
+ * Specifies the primary button's text in the modal.
55
+ */
56
+ primaryButtonText: string;
57
+ /**
58
+ * Specifies the secondary button's text in the modal.
59
+ */
60
+ secondaryButtonText: string;
61
+ /**
62
+ * This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
63
+ * This prop is required when using the `slideIn` variant of the side panel.
64
+ */
65
+ selectorPageContent?: string;
66
+ /**
67
+ * Specifies which DOM element in the form should be focused.
68
+ */
69
+ selectorPrimaryFocus?: string;
70
+ /**
71
+ * Sets the size of the side panel
72
+ */
73
+ size?: 'xs' | 'sm' | 'md' | 'lg' | '2xl';
74
+ /**
75
+ * Specifies which DOM element in the form should be focused.
76
+ */
77
+ slideIn?: boolean;
78
+ /**
79
+ * **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
80
+ */
81
+ slug?: ReactNode;
82
+ /**
83
+ * The subtitle of the CreateSidePanel is optional and serves to provide more information about the modal.
84
+ */
85
+ subtitle?: ReactNode;
86
+ /**
87
+ * The title of the CreateSidePanel is usually the product or service name.
88
+ */
89
+ title: string;
90
+ }
1
91
  /**
2
92
  * Use with medium complexity edits if the user needs page context.
3
93
  */
4
- export let EditSidePanel: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
- import React from 'react';
94
+ export declare let EditSidePanel: React.ForwardRefExoticComponent<EditSidePanelProps & React.RefAttributes<HTMLDivElement>>;
95
+ export {};
@@ -33,12 +33,6 @@ var componentName = 'EditSidePanel';
33
33
 
34
34
  // NOTE: the component SCSS is not imported here: it is rolled up separately.
35
35
 
36
- // Default values for props
37
- var defaults = {
38
- placement: 'right',
39
- size: 'md'
40
- };
41
-
42
36
  /**
43
37
  * Use with medium complexity edits if the user needs page context.
44
38
  */
@@ -53,13 +47,13 @@ exports.EditSidePanel = /*#__PURE__*/React__default["default"].forwardRef(functi
53
47
  onRequestSubmit = _ref.onRequestSubmit,
54
48
  open = _ref.open,
55
49
  _ref$placement = _ref.placement,
56
- placement = _ref$placement === void 0 ? defaults.placement : _ref$placement,
50
+ placement = _ref$placement === void 0 ? 'right' : _ref$placement,
57
51
  primaryButtonText = _ref.primaryButtonText,
58
52
  secondaryButtonText = _ref.secondaryButtonText,
59
53
  selectorPrimaryFocus = _ref.selectorPrimaryFocus,
60
54
  selectorPageContent = _ref.selectorPageContent,
61
55
  _ref$size = _ref.size,
62
- size = _ref$size === void 0 ? defaults.size : _ref$size,
56
+ size = _ref$size === void 0 ? 'md' : _ref$size,
63
57
  slideIn = _ref.slideIn,
64
58
  subtitle = _ref.subtitle,
65
59
  title = _ref.title,
@@ -68,7 +62,7 @@ exports.EditSidePanel = /*#__PURE__*/React__default["default"].forwardRef(functi
68
62
  label: primaryButtonText,
69
63
  onClick: function onClick(event) {
70
64
  event.preventDefault();
71
- onRequestSubmit();
65
+ onRequestSubmit && onRequestSubmit();
72
66
  },
73
67
  kind: 'primary',
74
68
  disabled: disableSubmit,
@@ -121,6 +115,7 @@ exports.EditSidePanel.propTypes = {
121
115
  /**
122
116
  * Sets the body content of the create side panel
123
117
  */
118
+ /**@ts-ignore*/
124
119
  children: index["default"].oneOfType([index["default"].arrayOf(index["default"].node), index["default"].node]).isRequired,
125
120
  /**
126
121
  * Provide an optional class to be applied to the containing node.
@@ -156,7 +151,7 @@ exports.EditSidePanel.propTypes = {
156
151
  /**
157
152
  * Specifies whether the CreateSidePanel is open or not.
158
153
  */
159
- open: index["default"].bool,
154
+ open: index["default"].bool.isRequired,
160
155
  /**
161
156
  * Determines if the side panel is on the right or left
162
157
  */
@@ -173,6 +168,7 @@ exports.EditSidePanel.propTypes = {
173
168
  * This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
174
169
  * This prop is required when using the `slideIn` variant of the side panel.
175
170
  */
171
+ /**@ts-ignore*/
176
172
  selectorPageContent: index["default"].string.isRequired.if(function (_ref2) {
177
173
  var slideIn = _ref2.slideIn;
178
174
  return slideIn;
@@ -180,6 +176,7 @@ exports.EditSidePanel.propTypes = {
180
176
  /**
181
177
  * Specifies which DOM element in the form should be focused.
182
178
  */
179
+ /**@ts-ignore*/
183
180
  selectorPrimaryFocus: index["default"].node.isRequired,
184
181
  /**
185
182
  * Sets the size of the side panel
@@ -200,5 +197,6 @@ exports.EditSidePanel.propTypes = {
200
197
  /**
201
198
  * The title of the CreateSidePanel is usually the product or service name.
202
199
  */
200
+ /**@ts-ignore*/
203
201
  title: index["default"].node.isRequired
204
202
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A container with a label and optional count.
3
+ */
4
+ export let FilterPanelAccordion: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ import React from 'react';
@@ -0,0 +1,90 @@
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
+ var cx = require('classnames');
16
+ var react = require('@carbon/react');
17
+ var devtools = require('../../../global/js/utils/devtools.js');
18
+ var settings = require('../../../settings.js');
19
+ var FilterPanelGroup = require('../FilterPanelGroup/FilterPanelGroup.js');
20
+
21
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
+
23
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
+
26
+ var _excluded = ["accordionProps", "children", "className", "count", "labelText", "title"],
27
+ _excluded2 = ["align"];
28
+
29
+ // The block part of our conventional BEM class names (blockClass__E--M).
30
+ var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-accordion");
31
+ var componentName = 'FilterPanelAccordion';
32
+ var defaults = {
33
+ accordionProps: {}
34
+ };
35
+
36
+ /**
37
+ * A container with a label and optional count.
38
+ */
39
+ exports.FilterPanelAccordion = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
40
+ var _ref$accordionProps = _ref.accordionProps,
41
+ accordionProps = _ref$accordionProps === void 0 ? defaults.accordionProps : _ref$accordionProps,
42
+ children = _ref.children,
43
+ className = _ref.className,
44
+ count = _ref.count,
45
+ labelText = _ref.labelText,
46
+ title = _ref.title,
47
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
48
+ var align = accordionProps.align,
49
+ otherAccordionProps = _rollupPluginBabelHelpers.objectWithoutProperties(accordionProps, _excluded2);
50
+ return /*#__PURE__*/React__default["default"].createElement(FilterPanelGroup.FilterPanelGroup, _rollupPluginBabelHelpers["extends"]({}, rest, {
51
+ className: cx__default["default"](blockClass, className),
52
+ count: count,
53
+ labelText: labelText,
54
+ ref: ref,
55
+ title: title
56
+ }, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(react.Accordion, _rollupPluginBabelHelpers["extends"]({}, otherAccordionProps, {
57
+ align: align || 'start',
58
+ className: "".concat(blockClass, "__list")
59
+ }), children));
60
+ });
61
+
62
+ // Return a placeholder if not released and not enabled by feature flag
63
+ exports.FilterPanelAccordion = settings.pkg.checkComponentEnabled(exports.FilterPanelAccordion, componentName);
64
+ exports.FilterPanelAccordion.displayName = componentName;
65
+ exports.FilterPanelAccordion.propTypes = {
66
+ /**
67
+ * Props specific to the internal `Accordion`.
68
+ */
69
+ accordionProps: index["default"].shape({}),
70
+ /**
71
+ * Provide the contents of the FilterPanelAccordion.
72
+ */
73
+ children: index["default"].node.isRequired,
74
+ /**
75
+ * Optional class to be applied to the containing node.
76
+ */
77
+ className: index["default"].string,
78
+ /**
79
+ * Number to be displayed with the label.
80
+ */
81
+ count: index["default"].oneOfType([index["default"].number, index["default"].string]),
82
+ /**
83
+ * The label for the component.
84
+ */
85
+ labelText: index["default"].node.isRequired,
86
+ /**
87
+ * Optional title attribute for the label.
88
+ */
89
+ title: index["default"].string
90
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A container with a label and optional count.
3
+ */
4
+ export let FilterPanelAccordionItem: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ import React from 'react';
@@ -0,0 +1,101 @@
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
+ var cx = require('classnames');
16
+ var react = require('@carbon/react');
17
+ var devtools = require('../../../global/js/utils/devtools.js');
18
+ var settings = require('../../../settings.js');
19
+ var FilterPanelLabel = require('../FilterPanelLabel/FilterPanelLabel.js');
20
+ var TruncatedList = require('../../TruncatedList/TruncatedList.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 = ["accordionItemProps", "truncatedListProps", "children", "className", "count", "labelText", "title"];
28
+
29
+ // The block part of our conventional BEM class names (blockClass__E--M).
30
+ var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-accordion-item");
31
+ var componentName = 'FilterPanelAccordionItem';
32
+ var defaults = {
33
+ accordionItemProps: {},
34
+ truncatedListProps: {}
35
+ };
36
+
37
+ /**
38
+ * A container with a label and optional count.
39
+ */
40
+ exports.FilterPanelAccordionItem = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
41
+ var _ref$accordionItemPro = _ref.accordionItemProps,
42
+ accordionItemProps = _ref$accordionItemPro === void 0 ? defaults.accordionItemProps : _ref$accordionItemPro,
43
+ _ref$truncatedListPro = _ref.truncatedListProps,
44
+ truncatedListProps = _ref$truncatedListPro === void 0 ? defaults.truncatedListProps : _ref$truncatedListPro,
45
+ children = _ref.children,
46
+ className = _ref.className,
47
+ count = _ref.count,
48
+ labelText = _ref.labelText,
49
+ title = _ref.title,
50
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
51
+ return /*#__PURE__*/React__default["default"].createElement(react.AccordionItem, _rollupPluginBabelHelpers["extends"]({}, accordionItemProps, {
52
+ className: cx__default["default"](blockClass, className),
53
+ ref: ref,
54
+ title: /*#__PURE__*/React__default["default"].createElement(FilterPanelLabel.FilterPanelLabel, _rollupPluginBabelHelpers["extends"]({}, rest, {
55
+ count: count,
56
+ labelText: labelText,
57
+ title: title
58
+ }))
59
+ }, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(TruncatedList.TruncatedList, _rollupPluginBabelHelpers["extends"]({}, truncatedListProps, {
60
+ className: "".concat(blockClass, "__list")
61
+ }), React.Children.map(children, function (child) {
62
+ return /*#__PURE__*/React__default["default"].createElement(react.ListItem, {
63
+ className: "".concat(blockClass, "__list-item"),
64
+ key: child.key
65
+ }, child);
66
+ })));
67
+ });
68
+
69
+ // Return a placeholder if not released and not enabled by feature flag
70
+ exports.FilterPanelAccordionItem = settings.pkg.checkComponentEnabled(exports.FilterPanelAccordionItem, componentName);
71
+ exports.FilterPanelAccordionItem.displayName = componentName;
72
+ exports.FilterPanelAccordionItem.propTypes = {
73
+ /**
74
+ * Props specific to the internal `AccordionItem`.
75
+ */
76
+ accordionItemProps: index["default"].shape({}),
77
+ /**
78
+ * Provide the contents of the FilterPanelAccordionItem.
79
+ */
80
+ children: index["default"].node.isRequired,
81
+ /**
82
+ * Optional class to be applied to the containing node.
83
+ */
84
+ className: index["default"].string,
85
+ /**
86
+ * Number to be displayed with the label.
87
+ */
88
+ count: index["default"].oneOfType([index["default"].number, index["default"].string]),
89
+ /**
90
+ * The label for the component.
91
+ */
92
+ labelText: index["default"].node.isRequired,
93
+ /**
94
+ * Optional title attribute for the label.
95
+ */
96
+ title: index["default"].string,
97
+ /**
98
+ * Props specific to the internal `TruncatedList`.
99
+ */
100
+ truncatedListProps: index["default"].shape({})
101
+ };
@@ -23,7 +23,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
23
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
25
 
26
- var _excluded = ["className", "count", "labelText", "title"];
26
+ var _excluded = ["className", "count", "id", "labelText", "title"];
27
27
 
28
28
  // The block part of our conventional BEM class names (blockClass__E--M).
29
29
  var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-checkbox");
@@ -35,11 +35,13 @@ var componentName = 'FilterPanelCheckbox';
35
35
  exports.FilterPanelCheckbox = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
36
36
  var className = _ref.className,
37
37
  count = _ref.count,
38
+ id = _ref.id,
38
39
  labelText = _ref.labelText,
39
40
  title = _ref.title,
40
41
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
41
42
  return /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, rest, {
42
43
  className: cx__default["default"](blockClass, className),
44
+ id: id,
43
45
  labelText: /*#__PURE__*/React__default["default"].createElement(FilterPanelLabel.FilterPanelLabel, {
44
46
  count: count,
45
47
  labelText: labelText,
@@ -0,0 +1 @@
1
+ export { FilterPanelCheckbox } from "./FilterPanelCheckbox";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Provides a filter panel checkbox with an overflow menu.
3
+ *
4
+ * This component's props refer to the Carbon Checkbox,
5
+ * just like FilterPanelCheckbox.
6
+ *
7
+ * Use `overflowMenuProps` for properties specific to the OverflowMenu.
8
+ */
9
+ export let FilterPanelCheckboxWithOverflow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
10
+ import React from 'react';