@carbon/ibm-products 2.33.0 → 2.35.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +31990 -32061
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +38 -17
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +636 -24096
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +2342 -17830
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +38 -2
- package/es/components/ActionSet/ActionSet.js +3 -5
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/es/components/ConditionBuilder/index.d.ts +1 -0
- package/es/components/CreateFullPage/CreateFullPage.js +3 -19
- package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
- package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/es/components/Datagrid/useEditableCell.js +15 -0
- package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/es/components/DelimitedList/DelimitedList.js +0 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/es/components/EditInPlace/EditInPlace.js +10 -6
- package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/es/components/EditSidePanel/EditSidePanel.js +8 -10
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/es/components/ExportModal/ExportModal.d.ts +110 -2
- package/es/components/ExportModal/ExportModal.js +10 -4
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
- package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
- package/es/components/FilterPanel/index.d.ts +5 -0
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/es/components/ImportModal/ImportModal.d.ts +136 -2
- package/es/components/ImportModal/ImportModal.js +3 -2
- package/es/components/InlineTip/InlineTip.d.ts +90 -2
- package/es/components/InlineTip/InlineTip.js +3 -2
- package/es/components/Nav/Nav.js +1 -1
- package/es/components/Nav/NavList.js +7 -7
- package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/es/components/OptionsTile/OptionsTile.js +9 -20
- package/es/components/PageHeader/PageHeader.js +3 -3
- package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +4 -3
- package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/es/components/RemoveModal/RemoveModal.js +1 -0
- package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/es/components/ScrollGradient/ScrollGradient.js +156 -0
- package/es/components/ScrollGradient/constants.d.ts +15 -0
- package/es/components/ScrollGradient/constants.js +121 -0
- package/es/components/ScrollGradient/index.d.ts +1 -0
- package/es/components/SidePanel/SidePanel.d.ts +144 -2
- package/es/components/SidePanel/SidePanel.js +100 -75
- package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/es/components/StatusIcon/StatusIcon.js +97 -95
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/es/components/TagOverflow/TagOverflow.js +209 -0
- package/es/components/TagOverflow/constants.d.ts +14 -0
- package/es/components/TagOverflow/constants.js +30 -0
- package/es/components/TagOverflow/index.d.ts +1 -0
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/es/components/Toolbar/Toolbar.d.ts +23 -5
- package/es/components/Toolbar/Toolbar.js +30 -26
- package/es/components/TruncatedList/TruncatedList.js +5 -3
- package/es/components/UserAvatar/UserAvatar.js +7 -4
- package/es/components/index.d.ts +5 -2
- package/es/global/js/package-settings.d.ts +8 -0
- package/es/global/js/package-settings.js +8 -0
- package/es/index.js +9 -0
- package/es/settings.d.ts +8 -0
- package/lib/components/ActionSet/ActionSet.d.ts +38 -2
- package/lib/components/ActionSet/ActionSet.js +3 -5
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
- package/lib/components/ConditionBuilder/index.d.ts +1 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
- package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
- package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
- package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
- package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
- package/lib/components/Datagrid/useEditableCell.js +19 -0
- package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
- package/lib/components/DelimitedList/DelimitedList.js +0 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
- package/lib/components/EditInPlace/EditInPlace.js +10 -6
- package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
- package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
- package/lib/components/ExportModal/ExportModal.d.ts +110 -2
- package/lib/components/ExportModal/ExportModal.js +10 -4
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
- package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
- package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
- package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
- package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
- package/lib/components/FilterPanel/index.d.ts +5 -0
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
- package/lib/components/ImportModal/ImportModal.d.ts +136 -2
- package/lib/components/ImportModal/ImportModal.js +3 -2
- package/lib/components/InlineTip/InlineTip.d.ts +90 -2
- package/lib/components/InlineTip/InlineTip.js +3 -2
- package/lib/components/Nav/Nav.js +1 -1
- package/lib/components/Nav/NavList.js +7 -7
- package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
- package/lib/components/OptionsTile/OptionsTile.js +9 -20
- package/lib/components/PageHeader/PageHeader.js +3 -3
- package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
- package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
- package/lib/components/RemoveModal/RemoveModal.js +1 -0
- package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
- package/lib/components/ScrollGradient/constants.d.ts +15 -0
- package/lib/components/ScrollGradient/constants.js +128 -0
- package/lib/components/ScrollGradient/index.d.ts +1 -0
- package/lib/components/SidePanel/SidePanel.d.ts +144 -2
- package/lib/components/SidePanel/SidePanel.js +100 -75
- package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
- package/lib/components/StatusIcon/StatusIcon.js +97 -95
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
- package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
- package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/lib/components/TagOverflow/TagOverflow.js +216 -0
- package/lib/components/TagOverflow/constants.d.ts +14 -0
- package/lib/components/TagOverflow/constants.js +34 -0
- package/lib/components/TagOverflow/index.d.ts +1 -0
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
- package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
- package/lib/components/Toolbar/Toolbar.d.ts +23 -5
- package/lib/components/Toolbar/Toolbar.js +30 -26
- package/lib/components/TruncatedList/TruncatedList.js +5 -3
- package/lib/components/UserAvatar/UserAvatar.js +7 -4
- package/lib/components/index.d.ts +5 -2
- package/lib/global/js/package-settings.d.ts +8 -0
- package/lib/global/js/package-settings.js +8 -0
- package/lib/index.js +42 -0
- package/lib/settings.d.ts +8 -0
- package/package.json +3 -3
- package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
- package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
- package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
- package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
- package/scss/components/ConditionBuilder/_index.scss +8 -0
- package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
- package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
- package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
- package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +54 -0
- package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +60 -0
- package/scss/components/FilterPanel/_filter-panel-checkbox.scss +24 -3
- package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
- package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
- package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
- package/scss/components/FilterPanel/_filter-panel.scss +2 -0
- package/scss/components/FilterPanel/_index-with-carbon.scss +5 -0
- package/scss/components/FilterPanel/_index.scss +5 -0
- package/scss/components/Guidebanner/_guidebanner.scss +1 -1
- package/scss/components/InlineTip/_inline-tip.scss +1 -1
- package/scss/components/ProductiveCard/_productive-card.scss +13 -0
- package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
- package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
- package/scss/components/ScrollGradient/_index.scss +8 -0
- package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
- package/scss/components/SidePanel/_side-panel.scss +9 -9
- package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
- package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
- package/scss/components/TagOverflow/_index.scss +8 -0
- package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
- package/scss/components/Tearsheet/_tearsheet.scss +10 -0
- package/scss/components/UserAvatar/_user-avatar.scss +38 -4
- package/scss/components/_index-with-carbon.scss +3 -0
- package/scss/components/_index.scss +3 -0
@@ -0,0 +1,99 @@
|
|
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
|
+
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
|
+
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
24
|
+
|
25
|
+
var _excluded = ["children", "className", "searchProps"];
|
26
|
+
|
27
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
28
|
+
var blockClass = "".concat(settings.pkg.prefix, "--filter-panel-search");
|
29
|
+
var componentName = 'FilterPanelSearch';
|
30
|
+
var defaults = {
|
31
|
+
searchProps: {}
|
32
|
+
};
|
33
|
+
|
34
|
+
/**
|
35
|
+
* An input field and container to show search results.
|
36
|
+
*/
|
37
|
+
exports.FilterPanelSearch = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
38
|
+
var children = _ref.children,
|
39
|
+
className = _ref.className,
|
40
|
+
_ref$searchProps = _ref.searchProps,
|
41
|
+
searchProps = _ref$searchProps === void 0 ? defaults.searchProps : _ref$searchProps,
|
42
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
43
|
+
var _useState = React.useState(false),
|
44
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
45
|
+
resultsVisible = _useState2[0],
|
46
|
+
setResultsVisible = _useState2[1];
|
47
|
+
var timer;
|
48
|
+
|
49
|
+
// Hide results with a delay.
|
50
|
+
// Gives enough time for "show" to trigger earlier.
|
51
|
+
var hideResults = function hideResults() {
|
52
|
+
clearTimeout(timer);
|
53
|
+
timer = setTimeout(function () {
|
54
|
+
setResultsVisible(false);
|
55
|
+
}, 300);
|
56
|
+
};
|
57
|
+
|
58
|
+
// Show results immediately.
|
59
|
+
var showResults = function showResults() {
|
60
|
+
clearTimeout(timer);
|
61
|
+
setResultsVisible(true);
|
62
|
+
};
|
63
|
+
|
64
|
+
// On unmount, clear the timer.
|
65
|
+
React.useEffect(function () {
|
66
|
+
return clearTimeout(timer);
|
67
|
+
}, [timer]);
|
68
|
+
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
69
|
+
className: cx__default["default"](blockClass, "".concat(blockClass, "__container"), className),
|
70
|
+
onBlur: hideResults,
|
71
|
+
onFocus: showResults,
|
72
|
+
ref: ref
|
73
|
+
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(react.Search, _rollupPluginBabelHelpers["extends"]({
|
74
|
+
className: "".concat(blockClass, "__input")
|
75
|
+
}, searchProps)), resultsVisible && !!children && /*#__PURE__*/React__default["default"].createElement("div", {
|
76
|
+
className: "".concat(blockClass, "__results")
|
77
|
+
}, children));
|
78
|
+
});
|
79
|
+
|
80
|
+
// Return a placeholder if not released and not enabled by feature flag
|
81
|
+
exports.FilterPanelSearch = settings.pkg.checkComponentEnabled(exports.FilterPanelSearch, componentName);
|
82
|
+
exports.FilterPanelSearch.displayName = componentName;
|
83
|
+
exports.FilterPanelSearch.propTypes = {
|
84
|
+
/**
|
85
|
+
* Provide the contents of the FilterPanelSearch.
|
86
|
+
*/
|
87
|
+
children: index["default"].node,
|
88
|
+
/**
|
89
|
+
* Optional class to be applied to the containing node.
|
90
|
+
*/
|
91
|
+
className: index["default"].string,
|
92
|
+
/**
|
93
|
+
* Props specific to the internal `Search` component.
|
94
|
+
*/
|
95
|
+
searchProps: index["default"].shape({
|
96
|
+
/** The label text for the Search icon. */
|
97
|
+
labelText: index["default"].string.isRequired
|
98
|
+
}).isRequired
|
99
|
+
};
|
@@ -1,3 +1,8 @@
|
|
1
1
|
export { FilterPanel } from "./FilterPanel";
|
2
|
+
export { FilterPanelAccordion } from "./FilterPanelAccordion/FilterPanelAccordion";
|
3
|
+
export { FilterPanelAccordionItem } from "./FilterPanelAccordionItem/FilterPanelAccordionItem";
|
2
4
|
export { FilterPanelCheckbox } from "./FilterPanelCheckbox/FilterPanelCheckbox";
|
5
|
+
export { FilterPanelCheckboxWithOverflow } from "./FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow";
|
6
|
+
export { FilterPanelGroup } from "./FilterPanelGroup/FilterPanelGroup";
|
3
7
|
export { FilterPanelLabel } from "./FilterPanelLabel/FilterPanelLabel";
|
8
|
+
export { FilterPanelSearch } from "./FilterPanelSearch/FilterPanelSearch";
|
@@ -1,7 +1,45 @@
|
|
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, { PropsWithChildren } from 'react';
|
8
|
+
interface HTTPError403Props extends PropsWithChildren {
|
9
|
+
/**
|
10
|
+
* Provide an optional class to be applied to the containing node
|
11
|
+
*/
|
12
|
+
className?: string;
|
13
|
+
/**
|
14
|
+
* String that will provide the description for the HTTP error code
|
15
|
+
*/
|
16
|
+
description: string;
|
17
|
+
/**
|
18
|
+
* String that will describe the error that occurred
|
19
|
+
*/
|
20
|
+
errorCodeLabel: string;
|
21
|
+
/**
|
22
|
+
* Links that will display for extra context when receiving particular errors
|
23
|
+
*/
|
24
|
+
links: Array<{
|
25
|
+
/**
|
26
|
+
* The text to display for the link
|
27
|
+
*/
|
28
|
+
text: string;
|
29
|
+
/**
|
30
|
+
* The link's destination
|
31
|
+
*/
|
32
|
+
href: string;
|
33
|
+
}>;
|
34
|
+
/**
|
35
|
+
* This will be for the main title of the HTTP error component
|
36
|
+
*/
|
37
|
+
title: string;
|
38
|
+
}
|
1
39
|
/**
|
2
40
|
* HTTP errors are used in an attempt to access something that isn’t available or
|
3
41
|
the user doesn’t have permission for. This HTTPError component is generic so you
|
4
42
|
can use it when you receive an error code that isn't provided.
|
5
43
|
*/
|
6
|
-
export let HTTPError403: React.ForwardRefExoticComponent<React.RefAttributes<
|
7
|
-
|
44
|
+
export declare let HTTPError403: React.ForwardRefExoticComponent<HTTPError403Props & React.RefAttributes<HTMLDivElement>>;
|
45
|
+
export {};
|
@@ -28,7 +28,6 @@ var _excluded = ["className", "description", "errorCodeLabel", "links", "title"]
|
|
28
28
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
29
29
|
var blockClass = "".concat(settings.pkg.prefix, "--http-errors");
|
30
30
|
var componentName = 'HTTPError403';
|
31
|
-
|
32
31
|
/**
|
33
32
|
* HTTP errors are used in an attempt to access something that isn’t available or
|
34
33
|
the user doesn’t have permission for. This HTTPError component is generic so you
|
@@ -80,6 +79,7 @@ exports.HTTPError403.propTypes = {
|
|
80
79
|
/**
|
81
80
|
* Links that will display for extra context when receiving particular errors
|
82
81
|
*/
|
82
|
+
/**@ts-ignore*/
|
83
83
|
links: index.propTypesExports.arrayOf(index.propTypesExports.shape({
|
84
84
|
/**
|
85
85
|
* The text to display for the link
|
@@ -1,7 +1,45 @@
|
|
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, { PropsWithChildren } from 'react';
|
8
|
+
interface HTTPError404Props extends PropsWithChildren {
|
9
|
+
/**
|
10
|
+
* Provide an optional class to be applied to the containing node
|
11
|
+
*/
|
12
|
+
className?: string;
|
13
|
+
/**
|
14
|
+
* String that will provide the description for the HTTP error code
|
15
|
+
*/
|
16
|
+
description: string;
|
17
|
+
/**
|
18
|
+
* String that will describe the error that occurred
|
19
|
+
*/
|
20
|
+
errorCodeLabel: string;
|
21
|
+
/**
|
22
|
+
* Links that will display for extra context when receiving particular errors
|
23
|
+
*/
|
24
|
+
links: Array<{
|
25
|
+
/**
|
26
|
+
* The text to display for the link
|
27
|
+
*/
|
28
|
+
text: string;
|
29
|
+
/**
|
30
|
+
* The link's destination
|
31
|
+
*/
|
32
|
+
href: string;
|
33
|
+
}>;
|
34
|
+
/**
|
35
|
+
* This will be for the main title of the HTTP error component
|
36
|
+
*/
|
37
|
+
title: string;
|
38
|
+
}
|
1
39
|
/**
|
2
40
|
* HTTP errors are used in an attempt to access something that isn’t available or
|
3
41
|
the user doesn’t have permission for. This HTTPError component is generic so you
|
4
42
|
can use it when you receive an error code that isn't provided.
|
5
43
|
*/
|
6
|
-
export let HTTPError404: React.ForwardRefExoticComponent<React.RefAttributes<
|
7
|
-
|
44
|
+
export declare let HTTPError404: React.ForwardRefExoticComponent<HTTPError404Props & React.RefAttributes<HTMLDivElement>>;
|
45
|
+
export {};
|
@@ -28,7 +28,6 @@ var _excluded = ["className", "description", "errorCodeLabel", "links", "title"]
|
|
28
28
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
29
29
|
var blockClass = "".concat(settings.pkg.prefix, "--http-errors");
|
30
30
|
var componentName = 'HTTPError404';
|
31
|
-
|
32
31
|
/**
|
33
32
|
* HTTP errors are used in an attempt to access something that isn’t available or
|
34
33
|
the user doesn’t have permission for. This HTTPError component is generic so you
|
@@ -80,6 +79,7 @@ exports.HTTPError404.propTypes = {
|
|
80
79
|
/**
|
81
80
|
* Links that will display for extra context when receiving particular errors
|
82
81
|
*/
|
82
|
+
/**@ts-ignore */
|
83
83
|
links: index.propTypesExports.arrayOf(index.propTypesExports.shape({
|
84
84
|
/**
|
85
85
|
* The text to display for the link
|
@@ -1,2 +1,136 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
import React, { ReactNode } from 'react';
|
8
|
+
type FileType = {
|
9
|
+
fetchError?: undefined | boolean;
|
10
|
+
fileData?: File;
|
11
|
+
fileSize?: number;
|
12
|
+
iconDescription?: string;
|
13
|
+
invalidFileType?: boolean;
|
14
|
+
name: string;
|
15
|
+
status?: string;
|
16
|
+
uuid?: string;
|
17
|
+
invalid?: boolean;
|
18
|
+
errorBody?: string;
|
19
|
+
errorSubject?: string;
|
20
|
+
};
|
21
|
+
interface ImportModalProps {
|
22
|
+
/**
|
23
|
+
* Specifies the file types that are valid for importing
|
24
|
+
*/
|
25
|
+
accept?: string[];
|
26
|
+
/**
|
27
|
+
* Optional class name
|
28
|
+
*/
|
29
|
+
className?: string;
|
30
|
+
/**
|
31
|
+
* The default message shown for an import error
|
32
|
+
*/
|
33
|
+
defaultErrorBody: string;
|
34
|
+
/**
|
35
|
+
* The default header that is displayed to show an error message
|
36
|
+
*/
|
37
|
+
defaultErrorHeader: string;
|
38
|
+
/**
|
39
|
+
* Content that is displayed inside the modal
|
40
|
+
*/
|
41
|
+
description?: string;
|
42
|
+
/**
|
43
|
+
* Optional error body to display specifically for a fetch error
|
44
|
+
*/
|
45
|
+
fetchErrorBody?: string;
|
46
|
+
/**
|
47
|
+
* Optional error header to display specifically for a fetch error
|
48
|
+
*/
|
49
|
+
fetchErrorHeader?: string;
|
50
|
+
/**
|
51
|
+
* Header for the drag and drop box
|
52
|
+
*/
|
53
|
+
fileDropHeader?: string;
|
54
|
+
/**
|
55
|
+
* Label for the drag and drop box
|
56
|
+
*/
|
57
|
+
fileDropLabel?: string;
|
58
|
+
/**
|
59
|
+
* Label that appears when a file is uploaded to show number of files (1 / 1)
|
60
|
+
*/
|
61
|
+
fileUploadLabel?: string;
|
62
|
+
/**
|
63
|
+
* Button icon for import by url button
|
64
|
+
*/
|
65
|
+
inputButtonIcon?: boolean;
|
66
|
+
/**
|
67
|
+
* Button text for import by url button
|
68
|
+
*/
|
69
|
+
inputButtonText: string;
|
70
|
+
/**
|
71
|
+
* ID for text input
|
72
|
+
*/
|
73
|
+
inputId?: string;
|
74
|
+
/**
|
75
|
+
* Header to display above import by url
|
76
|
+
*/
|
77
|
+
inputLabel?: string;
|
78
|
+
/**
|
79
|
+
* Placeholder for text input
|
80
|
+
*/
|
81
|
+
inputPlaceholder?: string;
|
82
|
+
/**
|
83
|
+
* Optional error message to display specifically for a invalid file type error
|
84
|
+
*/
|
85
|
+
invalidFileTypeErrorBody?: string;
|
86
|
+
/**
|
87
|
+
* Optional error header to display specifically for a invalid file type error
|
88
|
+
*/
|
89
|
+
invalidFileTypeErrorHeader?: string;
|
90
|
+
/**
|
91
|
+
* Description for delete file icon
|
92
|
+
*/
|
93
|
+
invalidIconDescription?: string;
|
94
|
+
/**
|
95
|
+
* File size limit in bytes
|
96
|
+
*/
|
97
|
+
maxFileSize?: number;
|
98
|
+
/**
|
99
|
+
* Optional error message to display specifically for a max file size error
|
100
|
+
*/
|
101
|
+
maxFileSizeErrorBody?: string;
|
102
|
+
/**
|
103
|
+
* Optional error header to display specifically for a max file size error
|
104
|
+
*/
|
105
|
+
maxFileSizeErrorHeader?: string;
|
106
|
+
/**
|
107
|
+
* Specify a handler for closing modal
|
108
|
+
*/
|
109
|
+
onClose?(): void;
|
110
|
+
/**
|
111
|
+
* Specify a handler for "submitting" modal. Access the imported file via `file => {}`
|
112
|
+
*/
|
113
|
+
onRequestSubmit(files: FileType[]): void;
|
114
|
+
/**
|
115
|
+
* Specify whether the Modal is currently open
|
116
|
+
*/
|
117
|
+
open: boolean;
|
118
|
+
/**
|
119
|
+
* The DOM node the tearsheet should be rendered within. Defaults to document.body.
|
120
|
+
*/
|
121
|
+
portalTarget?: ReactNode;
|
122
|
+
/**
|
123
|
+
* Specify the text for the primary button
|
124
|
+
*/
|
125
|
+
primaryButtonText: string;
|
126
|
+
/**
|
127
|
+
* Specify the text for the secondary button
|
128
|
+
*/
|
129
|
+
secondaryButtonText: string;
|
130
|
+
/**
|
131
|
+
* The text displayed at the top of the modal
|
132
|
+
*/
|
133
|
+
title: string;
|
134
|
+
}
|
135
|
+
export declare let ImportModal: React.FC<ImportModalProps>;
|
136
|
+
export {};
|
@@ -85,6 +85,7 @@ exports.ImportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
85
85
|
};
|
86
86
|
var updateFiles = function updateFiles(newFiles) {
|
87
87
|
var updatedFiles = newFiles.map(function (file) {
|
88
|
+
var _newFile$fileSize;
|
88
89
|
var newFile = {
|
89
90
|
uuid: file.uuid || uuidv4["default"](),
|
90
91
|
status: 'edit',
|
@@ -103,7 +104,7 @@ exports.ImportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
103
104
|
newFile.errorBody = invalidFileTypeErrorBody || defaultErrorBody;
|
104
105
|
newFile.errorSubject = invalidFileTypeErrorHeader || defaultErrorHeader;
|
105
106
|
newFile.invalid = true;
|
106
|
-
} else if (maxFileSize && newFile.fileSize > maxFileSize) {
|
107
|
+
} else if (maxFileSize && ((_newFile$fileSize = newFile === null || newFile === void 0 ? void 0 : newFile.fileSize) !== null && _newFile$fileSize !== void 0 ? _newFile$fileSize : 0) > maxFileSize) {
|
107
108
|
newFile.errorBody = maxFileSizeErrorBody || defaultErrorBody;
|
108
109
|
newFile.errorSubject = maxFileSizeErrorHeader || defaultErrorHeader;
|
109
110
|
newFile.invalid = true;
|
@@ -136,7 +137,7 @@ exports.ImportModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
136
137
|
_context.next = 10;
|
137
138
|
break;
|
138
139
|
}
|
139
|
-
throw new Error(response.status);
|
140
|
+
throw new Error("".concat(response.status));
|
140
141
|
case 10:
|
141
142
|
_context.next = 12;
|
142
143
|
return response.blob();
|
@@ -1,7 +1,95 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import React, { ReactNode } from 'react';
|
8
|
+
type MediaType = {
|
9
|
+
render?: () => ReactNode;
|
10
|
+
filePaths?: string[];
|
11
|
+
};
|
12
|
+
interface InlineTipProps {
|
13
|
+
/**
|
14
|
+
* Optional "call to action" ghost button or link that can appear
|
15
|
+
* directly below the content. This component comes with pre-styled
|
16
|
+
* elements available to use: `InlineTipLink` and `InlineTipButton`.
|
17
|
+
*/
|
18
|
+
action?: ReactNode;
|
19
|
+
/**
|
20
|
+
* Provide the contents of the InlineTip.
|
21
|
+
*/
|
22
|
+
children: ReactNode;
|
23
|
+
/**
|
24
|
+
* Provide an optional class to be applied to the containing node.
|
25
|
+
*/
|
26
|
+
className?: string;
|
27
|
+
/**
|
28
|
+
* Tooltip text and aria label for the Close button icon.
|
29
|
+
*/
|
30
|
+
closeIconDescription?: string;
|
31
|
+
/**
|
32
|
+
* The label for the collapse button.
|
33
|
+
* This button is not visible if `media` is specified.
|
34
|
+
*/
|
35
|
+
collapseButtonLabel?: string;
|
36
|
+
/**
|
37
|
+
* If set to `true`, it will truncate the body text to
|
38
|
+
* one line and expose an expand/collapse button toggle.
|
39
|
+
*
|
40
|
+
* This feature is disabled if `media` is specified.
|
41
|
+
*/
|
42
|
+
collapsible?: boolean;
|
43
|
+
/**
|
44
|
+
* The label for the expand button.
|
45
|
+
* This button is not visible if `media` is specified.
|
46
|
+
*/
|
47
|
+
expandButtonLabel?: string;
|
48
|
+
/**
|
49
|
+
* The object describing an image in one of two shapes.
|
50
|
+
* - If a single media element is required, use `{render}`.
|
51
|
+
* - If a stepped animation is required, use `{filePaths}`.
|
52
|
+
*
|
53
|
+
* Enabling `media` disables the `collapsible` feature.
|
54
|
+
*/
|
55
|
+
media: MediaType;
|
56
|
+
/**
|
57
|
+
* Set to `true` to arrange the information in a format
|
58
|
+
* that is easier to read in a limited space.
|
59
|
+
*/
|
60
|
+
narrow?: boolean;
|
61
|
+
/**
|
62
|
+
* Function to call when the tertiary button is clicked.
|
63
|
+
*/
|
64
|
+
onClick?: () => void;
|
65
|
+
/**
|
66
|
+
* Function to call when the InlineTip is closed via the "X" button.
|
67
|
+
*/
|
68
|
+
onClose?: () => void;
|
69
|
+
/**
|
70
|
+
* Defining the label will show a the tertiary button with the crossroads icon.
|
71
|
+
* You will still need to define the `onClose` method to trigger a callback.
|
72
|
+
*/
|
73
|
+
tertiaryButtonLabel?: string;
|
74
|
+
/**
|
75
|
+
* The title of the InlineTip.
|
76
|
+
*/
|
77
|
+
title: string;
|
78
|
+
/**
|
79
|
+
* If true, insert 1 rem of "space" on the left of the component.
|
80
|
+
* This will allow the component's content to line up with other
|
81
|
+
* content on the page under special circumstances.
|
82
|
+
*
|
83
|
+
* This will only be applied when `narrow` is false.
|
84
|
+
*/
|
85
|
+
withLeftGutter?: boolean;
|
86
|
+
}
|
1
87
|
/**
|
2
88
|
* Inline tips are messages embedded within other components that
|
3
89
|
* provide an ambient way to deliver learning content without
|
4
90
|
* distracting the user from their flow.
|
5
91
|
*/
|
6
|
-
export let InlineTip: React.ForwardRefExoticComponent<
|
7
|
-
|
92
|
+
export declare let InlineTip: React.ForwardRefExoticComponent<InlineTipProps & {
|
93
|
+
children?: React.ReactNode;
|
94
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
95
|
+
export {};
|
@@ -44,9 +44,9 @@ var defaults = {
|
|
44
44
|
narrow: false,
|
45
45
|
withLeftGutter: false,
|
46
46
|
onClick: function onClick() {},
|
47
|
-
onClose: function onClose() {}
|
47
|
+
onClose: function onClose() {},
|
48
|
+
title: 'Use case-specific heading'
|
48
49
|
};
|
49
|
-
|
50
50
|
/**
|
51
51
|
* Inline tips are messages embedded within other components that
|
52
52
|
* provide an ambient way to deliver learning content without
|
@@ -196,6 +196,7 @@ exports.InlineTip.propTypes = {
|
|
196
196
|
*
|
197
197
|
* Enabling `media` disables the `collapsible` feature.
|
198
198
|
*/
|
199
|
+
/**@ts-ignore*/
|
199
200
|
media: index["default"].oneOfType([index["default"].shape({
|
200
201
|
render: index["default"].func
|
201
202
|
}), index["default"].shape({
|
@@ -111,7 +111,7 @@ exports.Nav = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
111
111
|
*/
|
112
112
|
var handleListClick = function handleListClick(id) {
|
113
113
|
Object.keys(navigationLists.current).forEach(function (key) {
|
114
|
-
if (key !== id && !navigationLists.current[key].
|
114
|
+
if (key !== id && !navigationLists.current[key].isExpandedOnPageLoad) {
|
115
115
|
navigationLists.current[key].close();
|
116
116
|
}
|
117
117
|
});
|
@@ -31,7 +31,7 @@ var defaults = {
|
|
31
31
|
className: '',
|
32
32
|
children: null,
|
33
33
|
id: '',
|
34
|
-
|
34
|
+
isExpandedOnPageLoad: false,
|
35
35
|
onItemClick: function onItemClick() {},
|
36
36
|
onListClick: function onListClick() {},
|
37
37
|
tabIndex: 0,
|
@@ -50,8 +50,8 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
50
50
|
icon = _ref$icon === void 0 ? defaults.icon : _ref$icon,
|
51
51
|
_ref$id = _ref.id,
|
52
52
|
id = _ref$id === void 0 ? defaults.id : _ref$id,
|
53
|
-
_ref$isExpandedOnPage = _ref.
|
54
|
-
|
53
|
+
_ref$isExpandedOnPage = _ref.isExpandedOnPageLoad,
|
54
|
+
isExpandedOnPageLoad = _ref$isExpandedOnPage === void 0 ? defaults.isExpandedOnPageLoad : _ref$isExpandedOnPage,
|
55
55
|
_ref$navigationItemTi = _ref.navigationItemTitle,
|
56
56
|
navigationItemTitle = _ref$navigationItemTi === void 0 ? defaults.navigationItemTitle : _ref$navigationItemTi,
|
57
57
|
_ref$onItemClick = _ref.onItemClick,
|
@@ -62,7 +62,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
62
62
|
tabIndex = _ref$tabIndex === void 0 ? defaults.tabIndex : _ref$tabIndex,
|
63
63
|
_ref$title = _ref.title,
|
64
64
|
title = _ref$title === void 0 ? defaults.title : _ref$title;
|
65
|
-
var _useState = React.useState(
|
65
|
+
var _useState = React.useState(isExpandedOnPageLoad),
|
66
66
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
67
67
|
open = _useState2[0],
|
68
68
|
setOpen = _useState2[1];
|
@@ -74,7 +74,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
74
74
|
var childProps = _ref3.props;
|
75
75
|
return childProps.href;
|
76
76
|
});
|
77
|
-
setOpen(hrefs.includes(activeHref) ||
|
77
|
+
setOpen(hrefs.includes(activeHref) || isExpandedOnPageLoad);
|
78
78
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
79
79
|
}, []);
|
80
80
|
|
@@ -108,7 +108,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
|
|
108
108
|
React.useImperativeHandle(ref, function () {
|
109
109
|
return {
|
110
110
|
close: close,
|
111
|
-
|
111
|
+
isExpandedOnPageLoad: isExpandedOnPageLoad
|
112
112
|
};
|
113
113
|
});
|
114
114
|
var newChildren = React__default["default"].Children.map(children, function (child, index) {
|
@@ -159,7 +159,7 @@ NavList.propTypes = {
|
|
159
159
|
/** @type {string} ID of a list. */
|
160
160
|
id: index.propTypesExports.string,
|
161
161
|
/** @type {boolean} State of a list. */
|
162
|
-
|
162
|
+
isExpandedOnPageLoad: index.propTypesExports.bool,
|
163
163
|
/** @type {boolean} Title of nav. */
|
164
164
|
navigationItemTitle: index.propTypesExports.string,
|
165
165
|
/** @type {Function} Click handler for an item. */
|
@@ -326,7 +326,7 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
|
|
326
326
|
id: blockClass,
|
327
327
|
className: cx__default["default"](blockClass, className, "".concat(blockClass, "__container")),
|
328
328
|
style: {
|
329
|
-
animation: !reducedMotion.matches ? "".concat(open ? 'fade-in 250ms' : 'fade-out 250ms') : null
|
329
|
+
animation: !reducedMotion.matches ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : null
|
330
330
|
},
|
331
331
|
onAnimationEnd: onAnimationEnd,
|
332
332
|
ref: ref || notificationPanelRef
|
@@ -1,5 +1,79 @@
|
|
1
1
|
/**
|
2
|
-
*
|
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.
|
3
6
|
*/
|
4
|
-
|
5
|
-
|
7
|
+
import React, { ReactNode } from 'react';
|
8
|
+
interface OptionsTileProps {
|
9
|
+
/**
|
10
|
+
* Provide content to render as expandable OptionsTile. If no children
|
11
|
+
* are present, the OptionsTile will render as its variant.
|
12
|
+
*/
|
13
|
+
children?: ReactNode;
|
14
|
+
/**
|
15
|
+
* Provide an optional class to be applied to the containing node.
|
16
|
+
*/
|
17
|
+
className?: string;
|
18
|
+
/**
|
19
|
+
* Whether the toggle is enabled or disabled. If nothing is passed,
|
20
|
+
* no toggle will be rendered.
|
21
|
+
*/
|
22
|
+
enabled?: boolean;
|
23
|
+
/**
|
24
|
+
* Whether the OptionsTile is in invalid validation state.
|
25
|
+
*/
|
26
|
+
invalid?: boolean;
|
27
|
+
/**
|
28
|
+
* Provide a text explaining why the OptionsTile is in invalid state.
|
29
|
+
*/
|
30
|
+
invalidText?: string;
|
31
|
+
/**
|
32
|
+
* Whether the OptionsTile is in locked validation state.
|
33
|
+
*/
|
34
|
+
locked?: boolean;
|
35
|
+
/**
|
36
|
+
* Provide a text explaining why the OptionsTile is in locked state.
|
37
|
+
*/
|
38
|
+
lockedText?: string;
|
39
|
+
/**
|
40
|
+
* Provide a function which will be called each time the user
|
41
|
+
* toggles the open state of the OptionsTile.
|
42
|
+
*/
|
43
|
+
onChange?: (value: boolean) => void;
|
44
|
+
/**
|
45
|
+
* Provide a function which will be called each time the user
|
46
|
+
* interacts with the toggle.
|
47
|
+
*/
|
48
|
+
onToggle: (value: boolean) => void;
|
49
|
+
/**
|
50
|
+
* Whether the OptionsTile is in open state.
|
51
|
+
*/
|
52
|
+
open?: boolean;
|
53
|
+
/**
|
54
|
+
* Define the size of the OptionsTile.
|
55
|
+
*/
|
56
|
+
size: 'lg' | 'xl';
|
57
|
+
/**
|
58
|
+
* Optionally provide a text summarizing the current state of the content.
|
59
|
+
*/
|
60
|
+
summary?: string;
|
61
|
+
/**
|
62
|
+
* Provide the title for this OptionsTile.
|
63
|
+
*/
|
64
|
+
title: string;
|
65
|
+
/**
|
66
|
+
* Optionally provide an id which should be used for the title.
|
67
|
+
*/
|
68
|
+
titleId?: string;
|
69
|
+
/**
|
70
|
+
* Whether the OptionsTile is in warning validation state.
|
71
|
+
*/
|
72
|
+
warn?: boolean;
|
73
|
+
/**
|
74
|
+
* Provide a text explaining why the OptionsTile is in warning state.
|
75
|
+
*/
|
76
|
+
warnText?: string;
|
77
|
+
}
|
78
|
+
export declare let OptionsTile: React.ForwardRefExoticComponent<OptionsTileProps & React.RefAttributes<HTMLDivElement>>;
|
79
|
+
export {};
|