@carbon/ibm-products 2.43.2-canary.1 → 2.43.2-canary.101
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +429 -143
- 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 +219 -9
- 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 +249 -105
- 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 +350 -129
- 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/ActionBar/ActionBarItem.js +1 -1
- package/es/components/Coachmark/Coachmark.d.ts +6 -1
- package/es/components/Coachmark/Coachmark.js +47 -11
- package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +76 -55
- package/es/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +154 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +29 -13
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +30 -8
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +14 -9
- package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +75 -62
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +98 -40
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +71 -38
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +22 -9
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +121 -40
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +45 -19
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -40
- package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +6 -4
- package/es/components/ConditionBuilder/utils/util.js +42 -17
- package/es/components/CreateFullPage/CreateFullPage.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +140 -54
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
- package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
- package/es/components/DataSpreadsheet/types/index.d.ts +2 -1
- package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +54 -17
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +75 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/es/components/Datagrid/types/index.d.ts +61 -9
- package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/es/components/Datagrid/useActionsColumn.js +7 -6
- package/es/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
- package/es/components/Datagrid/useColumnCenterAlign.js +1 -1
- package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/es/components/Datagrid/useColumnRightAlign.js +4 -3
- package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/es/components/Datagrid/useCustomizeColumns.js +4 -3
- package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/es/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/es/components/Datagrid/useDisableSelectRows.js +27 -22
- package/es/components/Datagrid/useInlineEdit.d.ts +8 -1
- package/es/components/Datagrid/useInlineEdit.js +13 -3
- package/es/components/Datagrid/useNestedRowExpander.js +1 -3
- package/es/components/Datagrid/useNestedRows.js +32 -13
- package/es/components/Datagrid/useRowExpander.js +1 -3
- package/es/components/Datagrid/useSelectRows.js +2 -1
- package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/es/components/Datagrid/useStickyColumn.js +12 -9
- package/es/components/Decorator/Decorator.js +2 -1
- package/es/components/DecoratorBase/DecoratorBase.js +3 -5
- package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/es/components/DecoratorLink/DecoratorLink.js +2 -1
- package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/es/components/EditInPlace/EditInPlace.js +21 -10
- package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/es/components/EditTearsheet/EditTearsheet.js +44 -10
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/es/components/EmptyStates/EmptyStateV2.js +2 -1
- package/es/components/FullPageError/FullPageError.d.ts +36 -2
- package/es/components/FullPageError/FullPageError.js +0 -3
- package/es/components/GetStartedCard/GetStartedCard.d.ts +61 -2
- package/es/components/GetStartedCard/GetStartedCard.js +9 -8
- package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/es/components/Nav/NavItem.js +12 -3
- package/es/components/OptionsTile/OptionsTile.js +11 -6
- package/es/components/PageHeader/PageHeader.js +1 -0
- package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/es/components/RemoveModal/RemoveModal.js +7 -1
- package/es/components/SearchBar/SearchBar.d.ts +1 -1
- package/es/components/SearchBar/SearchBar.js +2 -2
- package/es/components/SidePanel/SidePanel.js +17 -21
- package/es/components/SidePanel/motion/variants.d.ts +4 -6
- package/es/components/SidePanel/motion/variants.js +10 -11
- package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
- package/es/components/StringFormatter/StringFormatter.js +14 -3
- package/es/components/StringFormatter/utils/enums.d.ts +20 -1
- package/es/components/StringFormatter/utils/enums.js +22 -2
- package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/es/components/TagOverflow/TagOverflow.js +47 -64
- package/es/components/TagOverflow/TagOverflowModal.js +4 -6
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
- package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/es/components/Tearsheet/Tearsheet.js +9 -1
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/es/components/Tearsheet/TearsheetShell.js +28 -7
- package/es/components/Toolbar/ToolbarButton.js +1 -1
- package/es/components/WebTerminal/WebTerminal.js +10 -12
- package/es/components/index.d.ts +1 -1
- package/es/global/js/hooks/useFocus.d.ts +1 -0
- package/es/global/js/hooks/useFocus.js +5 -2
- package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
- package/es/global/js/package-settings.d.ts +1 -1
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +1 -0
- package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
- package/es/settings.d.ts +1 -1
- package/lib/components/ActionBar/ActionBarItem.js +1 -1
- package/lib/components/Coachmark/Coachmark.d.ts +6 -1
- package/lib/components/Coachmark/Coachmark.js +46 -10
- package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +74 -53
- package/lib/components/ConditionBuilder/ConditionBuilder.js +82 -25
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +163 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +28 -11
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +29 -7
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +12 -7
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -13
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +73 -60
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +13 -7
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +31 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -36
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +6 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +96 -38
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +68 -35
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +21 -8
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +118 -37
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +44 -17
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +2 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +137 -39
- package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +6 -4
- package/lib/components/ConditionBuilder/utils/util.js +44 -16
- package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +26 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +140 -54
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +25 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +50 -9
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +16 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +32 -8
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.d.ts +3 -1
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +15 -3
- package/lib/components/DataSpreadsheet/types/index.d.ts +2 -1
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
- package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
- package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -6
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +53 -16
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
- package/lib/components/Datagrid/types/index.d.ts +61 -9
- package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
- package/lib/components/Datagrid/useActionsColumn.js +7 -6
- package/lib/components/Datagrid/useColumnCenterAlign.d.ts +8 -1
- package/lib/components/Datagrid/useColumnCenterAlign.js +1 -1
- package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
- package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
- package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
- package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
- package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
- package/lib/components/Datagrid/useInlineEdit.d.ts +8 -1
- package/lib/components/Datagrid/useInlineEdit.js +13 -3
- package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
- package/lib/components/Datagrid/useNestedRows.js +32 -13
- package/lib/components/Datagrid/useRowExpander.js +1 -3
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
- package/lib/components/Datagrid/useStickyColumn.js +12 -9
- package/lib/components/Decorator/Decorator.js +2 -1
- package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
- package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
- package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
- package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
- package/lib/components/EditInPlace/EditInPlace.js +21 -10
- package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
- package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
- package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
- package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
- package/lib/components/EmptyStates/EmptyStateV2.js +2 -1
- package/lib/components/FullPageError/FullPageError.d.ts +36 -2
- package/lib/components/FullPageError/FullPageError.js +0 -3
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +61 -2
- package/lib/components/GetStartedCard/GetStartedCard.js +8 -7
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
- package/lib/components/Nav/NavItem.js +10 -1
- package/lib/components/OptionsTile/OptionsTile.js +11 -6
- package/lib/components/PageHeader/PageHeader.js +1 -0
- package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
- package/lib/components/RemoveModal/RemoveModal.js +7 -1
- package/lib/components/SearchBar/SearchBar.d.ts +1 -1
- package/lib/components/SearchBar/SearchBar.js +2 -2
- package/lib/components/SidePanel/SidePanel.js +16 -20
- package/lib/components/SidePanel/motion/variants.d.ts +4 -6
- package/lib/components/SidePanel/motion/variants.js +10 -11
- package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
- package/lib/components/StringFormatter/StringFormatter.js +13 -2
- package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
- package/lib/components/StringFormatter/utils/enums.js +23 -1
- package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
- package/lib/components/TagOverflow/TagOverflow.js +46 -63
- package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
- package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
- package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
- package/lib/components/Tearsheet/Tearsheet.js +9 -1
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
- package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
- package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
- package/lib/components/Tearsheet/TearsheetShell.js +26 -5
- package/lib/components/Toolbar/ToolbarButton.js +1 -1
- package/lib/components/WebTerminal/WebTerminal.js +10 -12
- package/lib/components/index.d.ts +1 -1
- package/lib/global/js/hooks/useFocus.d.ts +1 -0
- package/lib/global/js/hooks/useFocus.js +5 -1
- package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
- package/lib/global/js/package-settings.d.ts +1 -1
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -0
- package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
- package/lib/settings.d.ts +1 -1
- package/package.json +9 -8
- package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
- package/scss/components/Coachmark/_coachmark.scss +5 -4
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +5 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +20 -3
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +32 -3
- package/scss/components/CreateModal/_create-modal.scss +0 -4
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +17 -2
- package/scss/components/Datagrid/_datagrid.scss +0 -4
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
- package/scss/components/HTTPErrors/_http-errors.scss +77 -0
- package/scss/components/OptionsTile/_options-tile.scss +6 -6
- package/scss/components/SidePanel/_side-panel.scss +1 -1
- package/scss/components/StatusIcon/_status-icon.scss +4 -4
- package/scss/components/StringFormatter/_string-formatter.scss +2 -2
- package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +32 -19
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
- package/es/global/js/utils/window.d.ts +0 -2
- package/es/global/js/utils/window.js +0 -12
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
- package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
- package/lib/global/js/utils/window.d.ts +0 -2
- package/lib/global/js/utils/window.js +0 -16
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useRef, useState, useCallback, useEffect } from 'react';
|
9
|
+
import React__default, { forwardRef, useRef, useState, useCallback, useEffect, createElement } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
@@ -18,52 +18,36 @@ import { useResizeObserver } from '../../global/js/hooks/useResizeObserver.js';
|
|
18
18
|
import { TagOverflowPopover } from './TagOverflowPopover.js';
|
19
19
|
import { TagOverflowModal } from './TagOverflowModal.js';
|
20
20
|
|
21
|
-
var _excluded = ["
|
21
|
+
var _excluded = ["align", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTarget", "allTagsModalTitle", "className", "containingElementRef", "items", "maxVisible", "measurementOffset", "multiline", "overflowAlign", "overflowClassName", "overflowType", "onOverflowTagChange", "showAllTagsLabel", "tagComponent"],
|
22
22
|
_excluded2 = ["className", "id"],
|
23
23
|
_excluded3 = ["tagType"],
|
24
24
|
_excluded4 = ["id", "label", "tagType", "onClose"];
|
25
25
|
var blockClass = "".concat(pkg.prefix, "--tag-overflow");
|
26
26
|
var componentName = 'TagOverflow';
|
27
27
|
var allTagsModalSearchThreshold = 10;
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
showAllTagsLabel =
|
49
|
-
|
50
|
-
|
51
|
-
allTagsModalTarget = _ref.allTagsModalTarget,
|
52
|
-
allTagsModalTitle = _ref.allTagsModalTitle,
|
53
|
-
className = _ref.className,
|
54
|
-
containingElementRef = _ref.containingElementRef,
|
55
|
-
_ref$measurementOffse = _ref.measurementOffset,
|
56
|
-
measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
|
57
|
-
maxVisible = _ref.maxVisible,
|
58
|
-
multiline = _ref.multiline,
|
59
|
-
_ref$overflowAlign = _ref.overflowAlign,
|
60
|
-
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
61
|
-
overflowClassName = _ref.overflowClassName,
|
62
|
-
_ref$overflowType = _ref.overflowType,
|
63
|
-
overflowType = _ref$overflowType === void 0 ? defaults.overflowType : _ref$overflowType,
|
64
|
-
_ref$onOverflowTagCha = _ref.onOverflowTagChange,
|
65
|
-
onOverflowTagChange = _ref$onOverflowTagCha === void 0 ? defaults.onOverflowTagChange : _ref$onOverflowTagCha,
|
66
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
28
|
+
var TagOverflow = /*#__PURE__*/forwardRef(function (props, ref) {
|
29
|
+
var _props$align = props.align,
|
30
|
+
align = _props$align === void 0 ? 'start' : _props$align,
|
31
|
+
allTagsModalSearchLabel = props.allTagsModalSearchLabel,
|
32
|
+
allTagsModalSearchPlaceholderText = props.allTagsModalSearchPlaceholderText,
|
33
|
+
allTagsModalTarget = props.allTagsModalTarget,
|
34
|
+
allTagsModalTitle = props.allTagsModalTitle,
|
35
|
+
className = props.className,
|
36
|
+
containingElementRef = props.containingElementRef,
|
37
|
+
items = props.items,
|
38
|
+
maxVisible = props.maxVisible,
|
39
|
+
_props$measurementOff = props.measurementOffset,
|
40
|
+
measurementOffset = _props$measurementOff === void 0 ? 0 : _props$measurementOff,
|
41
|
+
multiline = props.multiline,
|
42
|
+
_props$overflowAlign = props.overflowAlign,
|
43
|
+
overflowAlign = _props$overflowAlign === void 0 ? 'bottom' : _props$overflowAlign,
|
44
|
+
overflowClassName = props.overflowClassName,
|
45
|
+
_props$overflowType = props.overflowType,
|
46
|
+
overflowType = _props$overflowType === void 0 ? 'default' : _props$overflowType,
|
47
|
+
onOverflowTagChange = props.onOverflowTagChange,
|
48
|
+
showAllTagsLabel = props.showAllTagsLabel,
|
49
|
+
tagComponent = props.tagComponent,
|
50
|
+
rest = _objectWithoutProperties(props, _excluded);
|
67
51
|
var localContainerRef = useRef(null);
|
68
52
|
var containerRef = ref || localContainerRef;
|
69
53
|
var itemRefs = useRef(null);
|
@@ -100,7 +84,9 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
100
84
|
setShowAllModalOpen(false);
|
101
85
|
};
|
102
86
|
var handleResize = function handleResize() {
|
103
|
-
|
87
|
+
if (typeof resizeElm !== 'function' && resizeElm.current) {
|
88
|
+
setContainerWidth(resizeElm.current.offsetWidth);
|
89
|
+
}
|
104
90
|
};
|
105
91
|
useResizeObserver(resizeElm, handleResize);
|
106
92
|
var getMap = function getMap() {
|
@@ -116,7 +102,6 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
116
102
|
}
|
117
103
|
};
|
118
104
|
var getVisibleItems = useCallback(function () {
|
119
|
-
var _overflowRef$current;
|
120
105
|
if (!itemRefs.current) {
|
121
106
|
return items;
|
122
107
|
}
|
@@ -128,13 +113,13 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
128
113
|
var optionalContainingElement = containingElementRef === null || containingElementRef === void 0 ? void 0 : containingElementRef.current;
|
129
114
|
var measurementOffsetValue = typeof measurementOffset === 'number' ? measurementOffset : 0;
|
130
115
|
var spaceAvailable = optionalContainingElement ? optionalContainingElement.offsetWidth - measurementOffsetValue : containerWidth;
|
131
|
-
var overflowContainerWidth =
|
116
|
+
var overflowContainerWidth = overflowRef && overflowRef.current && overflowRef.current.offsetWidth > overflowIndicatorWidth ? overflowRef.current.offsetWidth : overflowIndicatorWidth;
|
132
117
|
var maxWidth = spaceAvailable - overflowContainerWidth;
|
133
118
|
var childrenWidth = 0;
|
134
119
|
var maxReached = false;
|
135
120
|
return items.reduce(function (prev, cur) {
|
136
121
|
if (!maxReached) {
|
137
|
-
var itemWidth = map.get(cur.id) + itemOffset;
|
122
|
+
var itemWidth = (map ? Number(map.get(cur.id)) : 0) + itemOffset;
|
138
123
|
var fits = itemWidth + childrenWidth < maxWidth;
|
139
124
|
if (fits) {
|
140
125
|
childrenWidth += itemWidth;
|
@@ -145,12 +130,13 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
145
130
|
}
|
146
131
|
return prev;
|
147
132
|
}, []);
|
148
|
-
}, [
|
149
|
-
var getCustomComponent = function getCustomComponent(item) {
|
133
|
+
}, [containerWidth, containingElementRef, items, maxVisible, measurementOffset, multiline]);
|
134
|
+
var getCustomComponent = function getCustomComponent(item, tagComponent) {
|
150
135
|
var className = item.className,
|
151
136
|
id = item.id,
|
152
137
|
other = _objectWithoutProperties(item, _excluded2);
|
153
|
-
return /*#__PURE__*/
|
138
|
+
return /*#__PURE__*/createElement(tagComponent, _objectSpread2(_objectSpread2({}, other), {}, {
|
139
|
+
key: id,
|
154
140
|
className: cx("".concat(blockClass, "__item"), className),
|
155
141
|
ref: function ref(node) {
|
156
142
|
return itemRefHandler(id, node);
|
@@ -164,9 +150,9 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
164
150
|
visibleItemsArr = (_visibleItemsArr = visibleItemsArr) === null || _visibleItemsArr === void 0 ? void 0 : _visibleItemsArr.slice(0, maxVisible);
|
165
151
|
}
|
166
152
|
var hiddenItems = items === null || items === void 0 ? void 0 : items.slice(visibleItemsArr.length);
|
167
|
-
var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (
|
168
|
-
var tagType =
|
169
|
-
other = _objectWithoutProperties(
|
153
|
+
var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (_ref) {
|
154
|
+
var tagType = _ref.tagType,
|
155
|
+
other = _objectWithoutProperties(_ref, _excluded3);
|
170
156
|
return _objectSpread2({
|
171
157
|
type: tagType
|
172
158
|
}, other);
|
@@ -174,10 +160,10 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
174
160
|
setVisibleItems(visibleItemsArr);
|
175
161
|
setOverflowItems(overflowItemsArr);
|
176
162
|
onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(overflowItemsArr);
|
177
|
-
}, [
|
163
|
+
}, [getVisibleItems, items, maxVisible, onOverflowTagChange]);
|
178
164
|
var handleTagOnClose = useCallback(function (onClose, index) {
|
179
165
|
onClose === null || onClose === void 0 || onClose();
|
180
|
-
if (index <= visibleItems.length - 1) {
|
166
|
+
if (index <= (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) - 1) {
|
181
167
|
setPopoverOpen(false);
|
182
168
|
}
|
183
169
|
}, [visibleItems]);
|
@@ -185,10 +171,10 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
185
171
|
className: cx(blockClass, className, "".concat(blockClass, "--align-").concat(align), _defineProperty({}, "".concat(blockClass, "--multiline"), multiline)),
|
186
172
|
ref: containerRef,
|
187
173
|
role: "main"
|
188
|
-
}, getDevtoolsProps(componentName)), visibleItems.length > 0 && visibleItems.map(function (item, index) {
|
174
|
+
}, getDevtoolsProps(componentName)), (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0 && visibleItems.map(function (item, index) {
|
189
175
|
// Render custom components
|
190
176
|
if (tagComponent) {
|
191
|
-
return getCustomComponent(item);
|
177
|
+
return getCustomComponent(item, tagComponent);
|
192
178
|
} else {
|
193
179
|
var id = item.id,
|
194
180
|
label = item.label,
|
@@ -215,7 +201,7 @@ var TagOverflow = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
215
201
|
}), /*#__PURE__*/React__default.createElement("span", {
|
216
202
|
className: "".concat(blockClass, "__indicator"),
|
217
203
|
ref: overflowRef
|
218
|
-
}, overflowItems.length > 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TagOverflowPopover, {
|
204
|
+
}, (overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length) > 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TagOverflowPopover, {
|
219
205
|
allTagsModalSearchThreshold: allTagsModalSearchThreshold,
|
220
206
|
className: overflowClassName,
|
221
207
|
onShowAllClick: handleShowAllClick,
|
@@ -251,9 +237,9 @@ var tagTypes = Object.keys(TYPES);
|
|
251
237
|
* The strings shown in the showAllModal are only shown if we have more than allTagsModalSearchLThreshold
|
252
238
|
* @returns null if no problems
|
253
239
|
*/
|
254
|
-
var string_required_if_more_than_10_tags = isRequiredIf(PropTypes.string, function (
|
255
|
-
var items =
|
256
|
-
return items
|
240
|
+
var string_required_if_more_than_10_tags = isRequiredIf(PropTypes.string, function (_ref2) {
|
241
|
+
var items = _ref2.items;
|
242
|
+
return (items === null || items === void 0 ? void 0 : items.length) > allTagsModalSearchThreshold;
|
257
243
|
});
|
258
244
|
|
259
245
|
// The types and DocGen commentary for the component props,
|
@@ -284,11 +270,6 @@ TagOverflow.propTypes = {
|
|
284
270
|
* Provide an optional class to be applied to the containing node.
|
285
271
|
*/
|
286
272
|
className: PropTypes.string,
|
287
|
-
/**
|
288
|
-
* Optional ref for custom resize container to measure available space
|
289
|
-
* Default will measure the available space of the TagSet container itself.
|
290
|
-
*/
|
291
|
-
containingElementRef: PropTypes.object,
|
292
273
|
/**
|
293
274
|
* The items to be shown in the TagOverflow. Each item is specified as an object with properties:
|
294
275
|
* **label**\* (required) to supply the content,
|
@@ -299,6 +280,7 @@ TagOverflow.propTypes = {
|
|
299
280
|
* If you want to render a custom component, pass it as tagComponent prop and
|
300
281
|
* then pass the props required for your custom component as the properties of item object
|
301
282
|
*/
|
283
|
+
//@ts-ignore
|
302
284
|
items: PropTypes.arrayOf(PropTypes.shape({
|
303
285
|
id: PropTypes.string.isRequired,
|
304
286
|
label: PropTypes.string.isRequired,
|
@@ -342,6 +324,7 @@ TagOverflow.propTypes = {
|
|
342
324
|
/** Component definition of the items to be rendered inside TagOverflow.
|
343
325
|
* If this is not passed, items will be rendered as Tag component
|
344
326
|
*/
|
327
|
+
//@ts-ignore
|
345
328
|
tagComponent: PropTypes.elementType
|
346
329
|
};
|
347
330
|
|
@@ -14,8 +14,7 @@ import { pkg } from '../../settings.js';
|
|
14
14
|
import { prepareProps } from '../../global/js/utils/props-helper.js';
|
15
15
|
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
16
16
|
|
17
|
-
var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"]
|
18
|
-
_excluded2 = ["label", "id", "filter"];
|
17
|
+
var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"];
|
19
18
|
var componentName = 'TagOverflowModal';
|
20
19
|
var blockClass = "".concat(pkg.prefix, "--tag-overflow-modal");
|
21
20
|
|
@@ -77,13 +76,12 @@ var TagOverflowModal = function TagOverflowModal(_ref) {
|
|
77
76
|
}, getFilteredItems().map(function (_ref2) {
|
78
77
|
var label = _ref2.label,
|
79
78
|
id = _ref2.id,
|
80
|
-
filter = _ref2.filter
|
81
|
-
other = _objectWithoutProperties(_ref2, _excluded2);
|
79
|
+
filter = _ref2.filter;
|
82
80
|
var isFilterable = overflowType === 'tag' ? filter : false;
|
83
|
-
return /*#__PURE__*/React__default.createElement(Tag,
|
81
|
+
return /*#__PURE__*/React__default.createElement(Tag, {
|
84
82
|
key: id,
|
85
83
|
filter: isFilterable
|
86
|
-
}
|
84
|
+
}, label);
|
87
85
|
})), /*#__PURE__*/React__default.createElement("div", {
|
88
86
|
className: "".concat(blockClass, "__fade")
|
89
87
|
})));
|
@@ -1,2 +1,14 @@
|
|
1
|
-
export const TagOverflowPopover: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
2
1
|
import React from 'react';
|
2
|
+
import { TagOverflowItem } from './TagOverflow';
|
3
|
+
export interface Props {
|
4
|
+
allTagsModalSearchThreshold?: number;
|
5
|
+
className?: string;
|
6
|
+
onShowAllClick: () => void;
|
7
|
+
overflowAlign?: string;
|
8
|
+
overflowTags: TagOverflowItem[];
|
9
|
+
overflowType?: string;
|
10
|
+
popoverOpen?: boolean;
|
11
|
+
setPopoverOpen?: (x: boolean) => void;
|
12
|
+
showAllTagsLabel?: string;
|
13
|
+
}
|
14
|
+
export declare const TagOverflowPopover: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useRef } from 'react';
|
9
|
+
import React__default, { forwardRef, useRef } from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
12
12
|
import { Popover, Tag, PopoverContent, Link } from '@carbon/react';
|
@@ -17,52 +17,48 @@ var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "
|
|
17
17
|
_excluded2 = ["label", "id", "tagType", "filter", "onClose"];
|
18
18
|
var componentName = 'TagOverflowPopover';
|
19
19
|
var blockClass = "".concat(pkg.prefix, "--tag-overflow-popover");
|
20
|
-
|
21
|
-
|
22
|
-
var
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
overflowTags = _ref.overflowTags,
|
34
|
-
overflowType = _ref.overflowType,
|
35
|
-
showAllTagsLabel = _ref.showAllTagsLabel,
|
36
|
-
popoverOpen = _ref.popoverOpen,
|
37
|
-
setPopoverOpen = _ref.setPopoverOpen,
|
38
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
39
|
-
var localRef = useRef();
|
20
|
+
var TagOverflowPopover = /*#__PURE__*/forwardRef(function (props, ref) {
|
21
|
+
var _overflowTags$length;
|
22
|
+
var allTagsModalSearchThreshold = props.allTagsModalSearchThreshold,
|
23
|
+
className = props.className,
|
24
|
+
onShowAllClick = props.onShowAllClick,
|
25
|
+
overflowAlign = props.overflowAlign,
|
26
|
+
overflowTags = props.overflowTags,
|
27
|
+
overflowType = props.overflowType,
|
28
|
+
showAllTagsLabel = props.showAllTagsLabel,
|
29
|
+
popoverOpen = props.popoverOpen,
|
30
|
+
setPopoverOpen = props.setPopoverOpen,
|
31
|
+
rest = _objectWithoutProperties(props, _excluded);
|
32
|
+
var localRef = useRef(null);
|
40
33
|
var overflowTagContent = useRef(null);
|
41
34
|
useClickOutside(ref || localRef, function () {
|
42
35
|
if (popoverOpen) {
|
43
|
-
setPopoverOpen(false);
|
36
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
44
37
|
}
|
45
38
|
});
|
46
39
|
var handleShowAllTagsClick = function handleShowAllTagsClick(evt) {
|
47
40
|
evt.stopPropagation();
|
48
41
|
evt.preventDefault();
|
49
|
-
setPopoverOpen(false);
|
50
|
-
onShowAllClick();
|
42
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
43
|
+
onShowAllClick === null || onShowAllClick === void 0 || onShowAllClick();
|
51
44
|
};
|
52
|
-
var handleEscKeyPress = function handleEscKeyPress(
|
53
|
-
var key =
|
45
|
+
var handleEscKeyPress = function handleEscKeyPress(evt) {
|
46
|
+
var key = evt.key;
|
54
47
|
if (key === 'Escape') {
|
55
|
-
setPopoverOpen(false);
|
48
|
+
setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
|
56
49
|
}
|
57
50
|
};
|
58
51
|
var getOverflowPopoverItems = function getOverflowPopoverItems() {
|
59
|
-
|
60
|
-
|
52
|
+
var thresh = allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0;
|
53
|
+
return overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.filter(function (_, index) {
|
54
|
+
return (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) > thresh ? index < thresh : index <= thresh;
|
61
55
|
});
|
62
56
|
};
|
57
|
+
var visibleItems = getOverflowPopoverItems();
|
58
|
+
var hasItems = (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0;
|
63
59
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
64
|
-
"aria-hidden": overflowTags.length === 0,
|
65
|
-
className: cx(blockClass, _defineProperty({}, "".concat(blockClass, "--hidden"), overflowTags.length === 0)),
|
60
|
+
"aria-hidden": (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0,
|
61
|
+
className: cx(blockClass, _defineProperty({}, "".concat(blockClass, "--hidden"), (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0)),
|
66
62
|
ref: ref || localRef
|
67
63
|
}), /*#__PURE__*/React__default.createElement(Popover, {
|
68
64
|
align: overflowAlign,
|
@@ -73,21 +69,21 @@ var TagOverflowPopover = /*#__PURE__*/React__default.forwardRef(function (_ref,
|
|
73
69
|
open: popoverOpen
|
74
70
|
}, /*#__PURE__*/React__default.createElement(Tag, {
|
75
71
|
onClick: function onClick() {
|
76
|
-
return setPopoverOpen(!popoverOpen);
|
72
|
+
return setPopoverOpen === null || setPopoverOpen === void 0 ? void 0 : setPopoverOpen(!popoverOpen);
|
77
73
|
},
|
78
74
|
className: cx("".concat(blockClass, "__trigger"))
|
79
|
-
}, "+", overflowTags.length), /*#__PURE__*/React__default.createElement(PopoverContent, null, /*#__PURE__*/React__default.createElement("div", {
|
75
|
+
}, "+", overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length), /*#__PURE__*/React__default.createElement(PopoverContent, null, /*#__PURE__*/React__default.createElement("div", {
|
80
76
|
ref: overflowTagContent,
|
81
77
|
className: "".concat(blockClass, "__content")
|
82
78
|
}, /*#__PURE__*/React__default.createElement("ul", {
|
83
79
|
className: "".concat(blockClass, "__tag-list")
|
84
|
-
},
|
85
|
-
var label =
|
86
|
-
id =
|
87
|
-
tagType =
|
88
|
-
filter =
|
89
|
-
_onClose =
|
90
|
-
other = _objectWithoutProperties(
|
80
|
+
}, hasItems && visibleItems.map(function (_ref) {
|
81
|
+
var label = _ref.label,
|
82
|
+
id = _ref.id,
|
83
|
+
tagType = _ref.tagType,
|
84
|
+
filter = _ref.filter,
|
85
|
+
_onClose = _ref.onClose,
|
86
|
+
other = _objectWithoutProperties(_ref, _excluded2);
|
91
87
|
var typeValue = overflowType === 'tag' ? 'high-contrast' : tagType;
|
92
88
|
var isFilterable = overflowType === 'tag' ? filter : false;
|
93
89
|
return /*#__PURE__*/React__default.createElement("li", {
|
@@ -100,7 +96,7 @@ var TagOverflowPopover = /*#__PURE__*/React__default.forwardRef(function (_ref,
|
|
100
96
|
type: typeValue,
|
101
97
|
filter: isFilterable
|
102
98
|
}), label) : label);
|
103
|
-
})), overflowTags.length > allTagsModalSearchThreshold && /*#__PURE__*/React__default.createElement(Link, {
|
99
|
+
})), ((_overflowTags$length = overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) !== null && _overflowTags$length !== void 0 ? _overflowTags$length : 0) > (allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0) && /*#__PURE__*/React__default.createElement(Link, {
|
104
100
|
className: "".concat(blockClass, "__show-all-tags-link"),
|
105
101
|
href: "",
|
106
102
|
onClick: handleShowAllTagsClick,
|
@@ -128,6 +124,7 @@ TagOverflowPopover.propTypes = {
|
|
128
124
|
/**
|
129
125
|
* tags shown in overflow
|
130
126
|
*/
|
127
|
+
//@ts-ignore
|
131
128
|
overflowTags: PropTypes.arrayOf(PropTypes.object).isRequired,
|
132
129
|
/**
|
133
130
|
* Type of rendering displayed inside of the tag overflow component
|
@@ -99,9 +99,16 @@ interface TearsheetProps extends PropsWithChildren {
|
|
99
99
|
*/
|
100
100
|
portalTarget: ReactNode;
|
101
101
|
/**
|
102
|
-
* Specify a CSS selector that matches the DOM element that should be
|
102
|
+
* Specify a CSS selector that matches the DOM element that should be
|
103
|
+
* focused when the Modal opens.
|
103
104
|
*/
|
104
105
|
selectorPrimaryFocus?: string;
|
106
|
+
/**
|
107
|
+
* Specify the CSS selectors that match the floating menus.
|
108
|
+
*
|
109
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
110
|
+
*/
|
111
|
+
selectorsFloatingMenus?: string[];
|
105
112
|
/**
|
106
113
|
* The main title of the tearsheet, displayed in the header area.
|
107
114
|
*/
|
@@ -190,9 +190,17 @@ Tearsheet.propTypes = _objectSpread2({
|
|
190
190
|
/**@ts-ignore */
|
191
191
|
portalTarget: portalType,
|
192
192
|
/**
|
193
|
-
* Specify a CSS selector that matches the DOM element that should be
|
193
|
+
* Specify a CSS selector that matches the DOM element that should be
|
194
|
+
* focused when the Modal opens.
|
194
195
|
*/
|
195
196
|
selectorPrimaryFocus: PropTypes.string,
|
197
|
+
/**
|
198
|
+
* Specify the CSS selectors that match the floating menus.
|
199
|
+
*
|
200
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
201
|
+
*/
|
202
|
+
/**@ts-ignore*/
|
203
|
+
selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
|
196
204
|
/**
|
197
205
|
* The main title of the tearsheet, displayed in the header area.
|
198
206
|
*/
|
@@ -64,6 +64,17 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
|
|
64
64
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
65
65
|
*/
|
66
66
|
portalTarget?: ReactNode;
|
67
|
+
/**
|
68
|
+
* Specify a CSS selector that matches the DOM element that should be
|
69
|
+
* focused when the Modal opens.
|
70
|
+
*/
|
71
|
+
selectorPrimaryFocus?: string;
|
72
|
+
/**
|
73
|
+
* Specify the CSS selectors that match the floating menus.
|
74
|
+
*
|
75
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
76
|
+
*/
|
77
|
+
selectorsFloatingMenus?: string[];
|
67
78
|
/**
|
68
79
|
* The main title of the tearsheet, displayed in the header area.
|
69
80
|
*/
|
@@ -148,6 +148,18 @@ TearsheetNarrow.propTypes = _objectSpread2({
|
|
148
148
|
*/
|
149
149
|
/**@ts-ignore */
|
150
150
|
portalTarget: portalType,
|
151
|
+
/**
|
152
|
+
* Specify a CSS selector that matches the DOM element that should be
|
153
|
+
* focused when the Modal opens.
|
154
|
+
*/
|
155
|
+
selectorPrimaryFocus: PropTypes.string,
|
156
|
+
/**
|
157
|
+
* Specify the CSS selectors that match the floating menus.
|
158
|
+
*
|
159
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
160
|
+
*/
|
161
|
+
/**@ts-ignore*/
|
162
|
+
selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
|
151
163
|
/**
|
152
164
|
* The main title of the tearsheet, displayed in the header area.
|
153
165
|
*/
|
@@ -9,7 +9,7 @@ import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
10
10
|
import { type ButtonProps } from '@carbon/react';
|
11
11
|
interface TearsheetShellProps extends PropsWithChildren {
|
12
|
-
actions?: ButtonProps[];
|
12
|
+
actions?: ButtonProps<any>[];
|
13
13
|
ariaLabel?: string;
|
14
14
|
/**
|
15
15
|
* An optional class or classes to be added to the outermost element.
|
@@ -81,7 +81,17 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
81
81
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
82
82
|
*/
|
83
83
|
portalTarget?: ReactNode;
|
84
|
+
/**
|
85
|
+
* Specify a CSS selector that matches the DOM element that should be
|
86
|
+
* focused when the Modal opens.
|
87
|
+
*/
|
84
88
|
selectorPrimaryFocus?: string;
|
89
|
+
/**
|
90
|
+
* Specify the CSS selectors that match the floating menus.
|
91
|
+
*
|
92
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
93
|
+
*/
|
94
|
+
selectorsFloatingMenus?: string[];
|
85
95
|
/**
|
86
96
|
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
87
97
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useRef, useState, useEffect } from 'react';
|
10
10
|
import { useResizeObserver } from '../../global/js/hooks/useResizeObserver.js';
|
11
11
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
@@ -16,11 +16,11 @@ import { getNodeTextContent } from '../../global/js/utils/getNodeTextContent.js'
|
|
16
16
|
import { Button, usePrefix, ComposedModal, ModalHeader, Layer } from '@carbon/react';
|
17
17
|
import { Wrap } from '../../global/js/utils/Wrap.js';
|
18
18
|
import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
19
|
-
import { useFocus } from '../../global/js/hooks/useFocus.js';
|
19
|
+
import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
|
20
20
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
21
21
|
import { ActionSet } from '../ActionSet/ActionSet.js';
|
22
22
|
|
23
|
-
var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
23
|
+
var _excluded = ["actions", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
24
24
|
|
25
25
|
// The block part of our conventional BEM class names (bc__E--M).
|
26
26
|
var bc = "".concat(pkg.prefix, "--tearsheet");
|
@@ -79,6 +79,8 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
79
79
|
open = _ref.open,
|
80
80
|
portalTargetIn = _ref.portalTarget,
|
81
81
|
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
82
|
+
_ref$selectorsFloatin = _ref.selectorsFloatingMenus,
|
83
|
+
selectorsFloatingMenus = _ref$selectorsFloatin === void 0 ? [] : _ref$selectorsFloatin,
|
82
84
|
size = _ref.size,
|
83
85
|
slug = _ref.slug,
|
84
86
|
title = _ref.title,
|
@@ -138,7 +140,8 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
138
140
|
// Callback to give the tearsheet the opportunity to claim focus
|
139
141
|
handleStackChange.claimFocus = function () {
|
140
142
|
if (selectorPrimaryFocus) {
|
141
|
-
|
143
|
+
var _getSpecificElement;
|
144
|
+
return (_getSpecificElement = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) === null || _getSpecificElement === void 0 ? void 0 : _getSpecificElement.focus();
|
142
145
|
}
|
143
146
|
firstElement === null || firstElement === void 0 || firstElement.focus();
|
144
147
|
};
|
@@ -164,10 +167,13 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
164
167
|
useEffect(function () {
|
165
168
|
if (open && position !== depth) {
|
166
169
|
setTimeout(function () {
|
170
|
+
if (selectorPrimaryFocus) {
|
171
|
+
return specifiedElement === null || specifiedElement === void 0 ? void 0 : specifiedElement.focus();
|
172
|
+
}
|
167
173
|
firstElement === null || firstElement === void 0 || firstElement.focus();
|
168
174
|
}, 0);
|
169
175
|
}
|
170
|
-
}, [position, depth, firstElement, open]);
|
176
|
+
}, [position, depth, firstElement, open, specifiedElement, selectorPrimaryFocus]);
|
171
177
|
useEffect(function () {
|
172
178
|
var notify = function notify() {
|
173
179
|
return stack.all.forEach(function (handler) {
|
@@ -249,7 +255,7 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
249
255
|
onKeyDown: keyDownListener,
|
250
256
|
preventCloseOnClickOutside: !isPassive,
|
251
257
|
ref: modalRef,
|
252
|
-
selectorsFloatingMenus: [".".concat(carbonPrefix, "--overflow-menu-options"), ".".concat(carbonPrefix, "--tooltip"), '.flatpickr-calendar', ".".concat(bc, "__container")],
|
258
|
+
selectorsFloatingMenus: [".".concat(carbonPrefix, "--overflow-menu-options"), ".".concat(carbonPrefix, "--tooltip"), '.flatpickr-calendar', ".".concat(bc, "__container")].concat(_toConsumableArray(selectorsFloatingMenus)),
|
253
259
|
size: "sm"
|
254
260
|
}), includeHeader && /*#__PURE__*/React__default.createElement(ModalHeader, {
|
255
261
|
className: cx("".concat(bc, "__header"), _defineProperty(_defineProperty({}, "".concat(bc, "__header--with-close-icon"), effectiveHasCloseIcon), "".concat(bc, "__header--with-nav"), navigation)),
|
@@ -311,7 +317,9 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
311
317
|
// The display name of the component, used by React. Note that displayName
|
312
318
|
// is used in preference to relying on function.name.
|
313
319
|
TearsheetShell.displayName = componentName;
|
314
|
-
var portalType = typeof Element === 'undefined' ? PropTypes.object :
|
320
|
+
var portalType = typeof Element === 'undefined' ? PropTypes.object :
|
321
|
+
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
322
|
+
PropTypes.instanceOf(Element);
|
315
323
|
var deprecatedProps = {
|
316
324
|
/**
|
317
325
|
* **Deprecated**
|
@@ -354,6 +362,7 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
354
362
|
label: PropTypes.string,
|
355
363
|
loading: PropTypes.bool,
|
356
364
|
// we duplicate this Button prop to improve the DocGen here
|
365
|
+
/**@ts-ignore*/
|
357
366
|
onClick: Button.propTypes.onClick
|
358
367
|
}))),
|
359
368
|
/**
|
@@ -445,6 +454,18 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
445
454
|
*/
|
446
455
|
/**@ts-ignore*/
|
447
456
|
portalTarget: portalType,
|
457
|
+
/**
|
458
|
+
* Specify a CSS selector that matches the DOM element that should be
|
459
|
+
* focused when the Modal opens.
|
460
|
+
*/
|
461
|
+
selectorPrimaryFocus: PropTypes.string,
|
462
|
+
/**
|
463
|
+
* Specify the CSS selectors that match the floating menus.
|
464
|
+
*
|
465
|
+
* See https://react.carbondesignsystem.com/?path=/docs/components-composedmodal--overview#focus-management
|
466
|
+
*/
|
467
|
+
/**@ts-ignore*/
|
468
|
+
selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
|
448
469
|
/**
|
449
470
|
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
450
471
|
*/
|
@@ -28,7 +28,7 @@ var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
28
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
29
29
|
var Icon = renderIcon;
|
30
30
|
return /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
31
|
-
align: (
|
31
|
+
align: (_useContext = useContext(ToolbarContext)) !== null && _useContext !== void 0 && _useContext.vertical ? 'right' : 'top'
|
32
32
|
}, rest, {
|
33
33
|
label: iconDescription,
|
34
34
|
ref: ref,
|