@carbon/ibm-products 2.0.0-rc.0 → 2.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/css/index-full-carbon.css +1223 -325
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +6 -8
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +792 -174
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +4 -8
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1109 -419
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +6 -8
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +1024 -274
- package/css/index.css.map +1 -1
- package/css/index.min.css +6 -8
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionBar/ActionBarOverflowItems.js +1 -0
- package/es/components/ActionSet/ActionSet.js +7 -3
- package/es/components/AddSelect/AddSelect.js +6 -6
- package/es/components/AddSelect/AddSelectBody.js +72 -31
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +12 -4
- package/es/components/AddSelect/AddSelectColumn.js +8 -8
- package/es/components/AddSelect/AddSelectFilter.js +10 -7
- package/es/components/AddSelect/AddSelectList.js +64 -29
- package/es/components/AddSelect/AddSelectMetaPanel.js +7 -1
- package/es/components/AddSelect/AddSelectSidebar.js +5 -2
- package/es/components/AddSelect/AddSelectSort.js +2 -2
- package/es/components/AddSelect/add-select-utils.js +9 -2
- package/es/components/AddSelect/hooks/useItemSort.js +6 -0
- package/es/components/AddSelect/hooks/useParentSelect.js +6 -0
- package/es/components/AddSelect/hooks/usePath.js +15 -1
- package/es/components/AddSelect/index.js +1 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -6
- package/es/components/Card/Card.js +16 -6
- package/es/components/Card/CardFooter.js +3 -1
- package/es/components/Card/CardHeader.js +20 -1
- package/es/components/ComboButton/ComboButton.js +1 -1
- package/es/components/CreateFullPage/CreateFullPage.js +4 -1
- package/es/components/CreateTearsheet/CreateTearsheet.js +8 -1
- package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +64 -11
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +40 -0
- package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
- package/es/components/Datagrid/Datagrid/DatagridContent.js +154 -0
- package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/es/components/Datagrid/Datagrid/DatagridRow.js +53 -6
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +142 -11
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +4 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +36 -10
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +62 -26
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +537 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
- package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
- package/es/components/Datagrid/index.js +3 -1
- package/es/components/Datagrid/useActionsColumn.js +53 -12
- package/es/components/Datagrid/useColumnOrder.js +8 -0
- package/es/components/Datagrid/useCustomizeColumns.js +5 -0
- package/es/components/Datagrid/useDefaultStringRenderer.js +4 -1
- package/es/components/Datagrid/useDisableSelectRows.js +6 -2
- package/es/components/Datagrid/useExpandedRow.js +0 -1
- package/es/components/Datagrid/useInfiniteScroll.js +5 -2
- package/es/components/Datagrid/useInlineEdit.js +71 -0
- package/es/components/Datagrid/useNestedRowExpander.js +47 -0
- package/es/components/Datagrid/useNestedRows.js +16 -4
- package/es/components/Datagrid/useRowExpander.js +12 -4
- package/es/components/Datagrid/useRowSize.js +17 -6
- package/es/components/Datagrid/useSelectAllToggle.js +17 -4
- package/es/components/Datagrid/useSelectRows.js +13 -3
- package/es/components/Datagrid/useSortableColumns.js +1 -1
- package/es/components/Datagrid/useStickyColumn.js +14 -0
- package/es/components/Datagrid/utils/DatagridActions.js +236 -0
- package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
- package/es/components/Datagrid/utils/Wrapper.js +21 -0
- package/es/components/Datagrid/utils/getArgTypes.js +89 -0
- package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
- package/es/components/Datagrid/utils/makeData.js +47 -2
- package/es/components/EditUpdateCards/EditUpdateCards.js +144 -0
- package/es/components/EditUpdateCards/index.js +7 -0
- package/es/components/ExportModal/ExportModal.js +1 -1
- package/es/components/ImportModal/ImportModal.js +3 -3
- package/es/components/InlineEdit/InlineEdit.js +28 -426
- package/es/components/InlineEditV1/InlineEditV1.js +447 -0
- package/es/components/InlineEditV1/index.js +7 -0
- package/es/components/InlineEditV2/InlineEditV2.js +289 -0
- package/es/components/InlineEditV2/index.js +7 -0
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
- package/es/components/MultiAddSelect/MultiAddSelect.js +14 -7
- package/es/components/MultiAddSelect/index.js +6 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
- package/es/components/OptionsTile/OptionsTile.js +29 -13
- package/es/components/PageHeader/PageHeader.js +4 -4
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/ProductiveCard/ProductiveCard.js +5 -0
- package/es/components/RemoveModal/RemoveModal.js +20 -3
- package/es/components/Saving/Saving.js +1 -1
- package/es/components/SidePanel/SidePanel.js +45 -52
- package/es/components/SidePanel/motion/variants.js +45 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +6 -0
- package/es/components/SingleAddSelect/index.js +6 -0
- package/es/components/StatusIcon/StatusIcon.js +1 -1
- package/es/components/UserProfileImage/UserProfileImage.js +1 -1
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/components/WebTerminal/WebTerminalContentWrapper.js +1 -1
- package/es/components/WebTerminal/hooks/index.js +6 -0
- package/es/components/WebTerminal/index.js +6 -0
- package/es/components/WebTerminal/preview-components/Navigation.js +7 -1
- package/es/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/es/components/WebTerminal/preview-components/index.js +7 -0
- package/es/components/index.js +3 -2
- package/es/global/js/hooks/index.js +2 -1
- package/es/global/js/hooks/useClickOutside.js +1 -1
- package/es/global/js/hooks/useControllableState.js +83 -0
- package/es/global/js/hooks/useResetCreateComponent.js +6 -2
- package/es/global/js/package-settings.js +7 -4
- package/es/global/js/utils/getBezierValues.js +20 -0
- package/es/global/js/utils/getNumberOfHiddenSteps.js +19 -0
- package/es/global/js/utils/motionConstants.js +45 -0
- package/es/global/js/utils/rangeWithCallback.js +13 -0
- package/es/global/js/utils/story-helper.js +5 -1
- package/es/global/js/utils/uuidv4.spec.js +4 -0
- package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
- package/lib/components/ActionBar/ActionBarOverflowItems.js +1 -0
- package/lib/components/ActionSet/ActionSet.js +7 -3
- package/lib/components/AddSelect/AddSelect.js +5 -6
- package/lib/components/AddSelect/AddSelectBody.js +67 -30
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +15 -4
- package/lib/components/AddSelect/AddSelectColumn.js +7 -7
- package/lib/components/AddSelect/AddSelectFilter.js +9 -6
- package/lib/components/AddSelect/AddSelectList.js +65 -30
- package/lib/components/AddSelect/AddSelectMetaPanel.js +8 -2
- package/lib/components/AddSelect/AddSelectSidebar.js +4 -1
- package/lib/components/AddSelect/AddSelectSort.js +5 -5
- package/lib/components/AddSelect/add-select-utils.js +9 -2
- package/lib/components/AddSelect/hooks/useItemSort.js +6 -0
- package/lib/components/AddSelect/hooks/useParentSelect.js +6 -0
- package/lib/components/AddSelect/hooks/usePath.js +9 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
- package/lib/components/Card/Card.js +16 -6
- package/lib/components/Card/CardFooter.js +3 -1
- package/lib/components/Card/CardHeader.js +21 -1
- package/lib/components/ComboButton/ComboButton.js +3 -3
- package/lib/components/CreateFullPage/CreateFullPage.js +4 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.js +9 -1
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +64 -10
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +51 -0
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
- package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +188 -0
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +63 -6
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +151 -9
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +5 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +48 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +60 -25
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +562 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
- package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
- package/lib/components/Datagrid/index.js +17 -1
- package/lib/components/Datagrid/useActionsColumn.js +53 -13
- package/lib/components/Datagrid/useColumnOrder.js +17 -0
- package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
- package/lib/components/Datagrid/useDefaultStringRenderer.js +5 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
- package/lib/components/Datagrid/useExpandedRow.js +0 -1
- package/lib/components/Datagrid/useInfiniteScroll.js +5 -2
- package/lib/components/Datagrid/useInlineEdit.js +85 -0
- package/lib/components/Datagrid/useNestedRowExpander.js +63 -0
- package/lib/components/Datagrid/useNestedRows.js +17 -4
- package/lib/components/Datagrid/useRowExpander.js +17 -5
- package/lib/components/Datagrid/useRowSize.js +18 -13
- package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
- package/lib/components/Datagrid/useSelectRows.js +13 -3
- package/lib/components/Datagrid/useSortableColumns.js +5 -5
- package/lib/components/Datagrid/useStickyColumn.js +14 -0
- package/lib/components/Datagrid/utils/DatagridActions.js +260 -0
- package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
- package/lib/components/Datagrid/utils/Wrapper.js +33 -0
- package/lib/components/Datagrid/utils/getArgTypes.js +97 -0
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
- package/lib/components/Datagrid/utils/makeData.js +48 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +152 -0
- package/lib/components/EditUpdateCards/index.js +13 -0
- package/lib/components/ExportModal/ExportModal.js +3 -3
- package/lib/components/ImportModal/ImportModal.js +4 -4
- package/lib/components/InlineEdit/InlineEdit.js +27 -426
- package/lib/components/InlineEditV1/InlineEditV1.js +464 -0
- package/lib/components/InlineEditV1/index.js +13 -0
- package/lib/components/InlineEditV2/InlineEditV2.js +309 -0
- package/lib/components/InlineEditV2/index.js +13 -0
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
- package/lib/components/MultiAddSelect/MultiAddSelect.js +14 -7
- package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
- package/lib/components/OptionsTile/OptionsTile.js +34 -17
- package/lib/components/PageHeader/PageHeader.js +5 -5
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
- package/lib/components/RemoveModal/RemoveModal.js +20 -3
- package/lib/components/Saving/Saving.js +5 -5
- package/lib/components/SidePanel/SidePanel.js +48 -53
- package/lib/components/SidePanel/motion/variants.js +55 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +6 -0
- package/lib/components/StatusIcon/StatusIcon.js +45 -45
- package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
- package/lib/components/WebTerminal/WebTerminal.js +3 -3
- package/lib/components/WebTerminal/hooks/index.js +6 -0
- package/lib/components/WebTerminal/preview-components/Navigation.js +10 -4
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +6 -0
- package/lib/components/index.js +21 -1
- package/lib/global/js/hooks/index.js +9 -1
- package/lib/global/js/hooks/useClickOutside.js +1 -1
- package/lib/global/js/hooks/useControllableState.js +94 -0
- package/lib/global/js/hooks/useResetCreateComponent.js +7 -2
- package/lib/global/js/package-settings.js +7 -4
- package/lib/global/js/utils/getBezierValues.js +29 -0
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +28 -0
- package/lib/global/js/utils/motionConstants.js +55 -0
- package/lib/global/js/utils/rangeWithCallback.js +22 -0
- package/lib/global/js/utils/story-helper.js +5 -1
- package/lib/global/js/utils/uuidv4.spec.js +4 -0
- package/package.json +18 -16
- package/scss/components/AboutModal/_about-modal.scss +2 -1
- package/scss/components/ActionSet/_action-set.scss +9 -4
- package/scss/components/AddSelect/_add-select.scss +132 -34
- package/scss/components/AddSelect/_index.scss +1 -1
- package/scss/components/AddSelect/_storybook-styles.scss +1 -1
- package/scss/components/Card/_card.scss +1 -0
- package/scss/components/Cascade/_cascade.scss +1 -1
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
- package/scss/components/Datagrid/_datagrid.scss +15 -0
- package/scss/components/Datagrid/_storybook-styles.scss +17 -5
- package/scss/components/Datagrid/styles/_datagrid.scss +129 -20
- package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
- package/scss/components/Datagrid/styles/_index.scss +1 -0
- package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
- package/scss/components/Datagrid/styles/_useExpandedRow.scss +57 -11
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +419 -0
- package/scss/components/Datagrid/styles/_useNestedRows.scss +33 -1
- package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +47 -6
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
- package/scss/components/EditUpdateCards/_carbon-imports.scss +9 -0
- package/scss/components/EditUpdateCards/_edit-update-cards.scss +85 -0
- package/scss/components/EditUpdateCards/_index-with-carbon.scss +9 -0
- package/scss/components/EditUpdateCards/_index.scss +8 -0
- package/scss/components/EditUpdateCards/_storybook-styles.scss +55 -0
- package/scss/components/{InlineEdit → InlineEditV1}/_carbon-imports.scss +0 -0
- package/scss/components/{InlineEdit → InlineEditV1}/_index-with-carbon.scss +1 -1
- package/scss/components/{InlineEdit → InlineEditV1}/_index.scss +1 -1
- package/scss/components/{InlineEdit/_inline-edit.scss → InlineEditV1/_inline-edit-v1.scss} +5 -3
- package/scss/components/{InlineEdit → InlineEditV1}/_storybook-styles.scss +0 -0
- package/scss/components/InlineEditV2/_carbon-imports.scss +9 -0
- package/scss/components/InlineEditV2/_index-with-carbon.scss +9 -0
- package/scss/components/InlineEditV2/_index.scss +10 -0
- package/scss/components/InlineEditV2/_inline-edit-v2.scss +83 -0
- package/scss/components/InlineEditV2/_storybook-styles.scss +9 -0
- package/scss/components/MultiAddSelect/_multi-add-select.scss +7 -0
- package/scss/components/MultiAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
- package/scss/components/RemoveModal/_remove-modal.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +3 -82
- package/scss/components/SidePanel/_storybook-styles.scss +6 -1
- package/scss/components/SingleAddSelect/_carbon-imports.scss +1 -1
- package/scss/components/SingleAddSelect/_index-with-carbon.scss +1 -1
- package/scss/components/SingleAddSelect/_index.scss +7 -0
- package/scss/components/SingleAddSelect/_single-add-select.scss +7 -0
- package/scss/components/SingleAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/Tearsheet/_tearsheet.scss +2 -2
- package/scss/components/WebTerminal/_carbon-imports.scss +6 -0
- package/scss/components/WebTerminal/_index.scss +7 -0
- package/scss/components/WebTerminal/_storybook-styles.scss +7 -0
- package/scss/components/_index-released-only-with-carbon.scss +1 -1
- package/scss/components/_index-released-only.scss +2 -1
- package/scss/components/_index-with-carbon.scss +3 -1
- package/scss/components/_index.scss +3 -1
@@ -0,0 +1,289 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["cancelLabel", "editLabel", "id", "invalid", "invalidLabel", "labelText", "onCancel", "onChange", "onSave", "saveLabel", "value"];
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Copyright IBM Corp. 2022, 2022
|
9
|
+
*
|
10
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
12
|
+
*/
|
13
|
+
import React, { useState, useEffect, forwardRef, useRef } from 'react';
|
14
|
+
import { Button } from '@carbon/react';
|
15
|
+
import cx from 'classnames';
|
16
|
+
import PropTypes from 'prop-types';
|
17
|
+
import { Edit, Checkmark, Close, // EditOff,
|
18
|
+
WarningFilled } from '@carbon/react/icons';
|
19
|
+
import { pkg, carbon } from '../../settings';
|
20
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
21
|
+
var componentName = 'InlineEditV2';
|
22
|
+
var blockClass = "".concat(pkg.prefix, "--inline-edit-v2");
|
23
|
+
export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
24
|
+
var cancelLabel = _ref.cancelLabel,
|
25
|
+
editLabel = _ref.editLabel,
|
26
|
+
id = _ref.id,
|
27
|
+
invalid = _ref.invalid,
|
28
|
+
invalidLabel = _ref.invalidLabel,
|
29
|
+
labelText = _ref.labelText,
|
30
|
+
onCancel = _ref.onCancel,
|
31
|
+
onChange = _ref.onChange,
|
32
|
+
onSave = _ref.onSave,
|
33
|
+
saveLabel = _ref.saveLabel,
|
34
|
+
value = _ref.value,
|
35
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
36
|
+
|
37
|
+
var _useState = useState(false),
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
39
|
+
focused = _useState2[0],
|
40
|
+
setFocused = _useState2[1];
|
41
|
+
|
42
|
+
var _useState3 = useState(''),
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
44
|
+
initialValue = _useState4[0],
|
45
|
+
setInitialValue = _useState4[1];
|
46
|
+
|
47
|
+
var _useState5 = useState(false),
|
48
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
49
|
+
dirtyInput = _useState6[0],
|
50
|
+
setDirtyInput = _useState6[1];
|
51
|
+
|
52
|
+
var inputRef = useRef(null);
|
53
|
+
var canSave = value !== initialValue && !invalid;
|
54
|
+
var escaping = useRef(false);
|
55
|
+
useEffect(function () {
|
56
|
+
if (!initialValue && !dirtyInput) {
|
57
|
+
setInitialValue(value);
|
58
|
+
}
|
59
|
+
}, [initialValue, dirtyInput, value]);
|
60
|
+
|
61
|
+
var isTargetingChild = function isTargetingChild(_ref2) {
|
62
|
+
var currentTarget = _ref2.currentTarget,
|
63
|
+
relatedTarget = _ref2.relatedTarget;
|
64
|
+
return currentTarget.contains(relatedTarget);
|
65
|
+
};
|
66
|
+
|
67
|
+
var onChangeHandler = function onChangeHandler(_ref3) {
|
68
|
+
var target = _ref3.target;
|
69
|
+
|
70
|
+
if (!dirtyInput) {
|
71
|
+
setDirtyInput(true);
|
72
|
+
}
|
73
|
+
|
74
|
+
onChange(target.value);
|
75
|
+
};
|
76
|
+
|
77
|
+
var onFocusHandler = function onFocusHandler(e) {
|
78
|
+
// if (readOnly) {
|
79
|
+
// return;
|
80
|
+
// }
|
81
|
+
if (!isTargetingChild(e)) {
|
82
|
+
inputRef.current.focus();
|
83
|
+
setFocused(true);
|
84
|
+
}
|
85
|
+
};
|
86
|
+
|
87
|
+
var onSaveHandler = function onSaveHandler() {
|
88
|
+
setInitialValue(value);
|
89
|
+
setFocused(false);
|
90
|
+
setDirtyInput(false);
|
91
|
+
onSave();
|
92
|
+
};
|
93
|
+
|
94
|
+
var onCancelHandler = function onCancelHandler() {
|
95
|
+
setFocused(false);
|
96
|
+
setDirtyInput(false);
|
97
|
+
onCancel(initialValue);
|
98
|
+
};
|
99
|
+
|
100
|
+
var onBlurHandler = function onBlurHandler(e) {
|
101
|
+
// if (readOnly || escaping.current) {
|
102
|
+
if (escaping.current) {
|
103
|
+
return;
|
104
|
+
}
|
105
|
+
|
106
|
+
if (!isTargetingChild(e)) {
|
107
|
+
if (canSave) {
|
108
|
+
onSaveHandler();
|
109
|
+
} else {
|
110
|
+
onCancelHandler();
|
111
|
+
}
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
var returnHandler = function returnHandler() {
|
116
|
+
if (canSave) {
|
117
|
+
onSaveHandler();
|
118
|
+
}
|
119
|
+
};
|
120
|
+
|
121
|
+
var escapeHandler = function escapeHandler() {
|
122
|
+
onCancelHandler();
|
123
|
+
};
|
124
|
+
|
125
|
+
var onKeyHandler = function onKeyHandler(e) {
|
126
|
+
// to prevent blur handler from being called twice add additional state to check if escape is being used
|
127
|
+
escaping.current = true;
|
128
|
+
|
129
|
+
switch (e.key) {
|
130
|
+
case 'Escape':
|
131
|
+
inputRef.current.blur();
|
132
|
+
escapeHandler();
|
133
|
+
break;
|
134
|
+
|
135
|
+
case 'Enter':
|
136
|
+
inputRef.current.blur();
|
137
|
+
returnHandler();
|
138
|
+
break;
|
139
|
+
|
140
|
+
default:
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
|
144
|
+
escaping.current = false;
|
145
|
+
};
|
146
|
+
|
147
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
148
|
+
ref: ref
|
149
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("div", {
|
150
|
+
className: cx(blockClass, _defineProperty({}, "".concat(blockClass, "-focused"), focused)),
|
151
|
+
onFocus: onFocusHandler,
|
152
|
+
onBlur: onBlurHandler
|
153
|
+
}, /*#__PURE__*/React.createElement("label", {
|
154
|
+
className: "".concat(blockClass, "__text-input-label"),
|
155
|
+
htmlFor: id
|
156
|
+
}, labelText), /*#__PURE__*/React.createElement("input", {
|
157
|
+
id: id,
|
158
|
+
className: cx("".concat(blockClass, "__text-input"), "".concat(carbon.prefix, "--text-input"), "".concat(carbon.prefix, "--text-input--sm")),
|
159
|
+
type: "text",
|
160
|
+
value: value,
|
161
|
+
onChange: onChangeHandler,
|
162
|
+
ref: inputRef // readOnly={readOnly}
|
163
|
+
,
|
164
|
+
onKeyDown: onKeyHandler
|
165
|
+
}), focused ? /*#__PURE__*/React.createElement(React.Fragment, null, invalid && /*#__PURE__*/React.createElement(WarningFilled, {
|
166
|
+
size: 16,
|
167
|
+
className: "".concat(blockClass, "__warning-icon")
|
168
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
169
|
+
hasIconOnly: true,
|
170
|
+
renderIcon: function renderIcon() {
|
171
|
+
return /*#__PURE__*/React.createElement(Close, {
|
172
|
+
size: 24
|
173
|
+
});
|
174
|
+
},
|
175
|
+
size: "sm",
|
176
|
+
iconDescription: cancelLabel,
|
177
|
+
onClick: onCancelHandler,
|
178
|
+
kind: "ghost",
|
179
|
+
tabIndex: 0,
|
180
|
+
key: "cancel",
|
181
|
+
className: "".concat(blockClass, "__btn ").concat(blockClass, "__btn-cancel")
|
182
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
183
|
+
hasIconOnly: true,
|
184
|
+
renderIcon: function renderIcon() {
|
185
|
+
return /*#__PURE__*/React.createElement(Checkmark, {
|
186
|
+
size: 24
|
187
|
+
});
|
188
|
+
},
|
189
|
+
size: "sm",
|
190
|
+
iconDescription: saveLabel,
|
191
|
+
onClick: onSaveHandler,
|
192
|
+
kind: "ghost",
|
193
|
+
tabIndex: 0,
|
194
|
+
key: "save",
|
195
|
+
className: "".concat(blockClass, "__btn ").concat(blockClass, "__btn-save"),
|
196
|
+
disabled: !canSave
|
197
|
+
})) : /*#__PURE__*/React.createElement(Button, {
|
198
|
+
className: "".concat(blockClass, "__btn ").concat(blockClass, "__btn-edit"),
|
199
|
+
hasIconOnly: true // renderIcon={readOnly ? EditOff24 : Edit24}
|
200
|
+
,
|
201
|
+
renderIcon: function renderIcon() {
|
202
|
+
return /*#__PURE__*/React.createElement(Edit, {
|
203
|
+
size: 24
|
204
|
+
});
|
205
|
+
},
|
206
|
+
size: "sm" // iconDescription={readOnly ? readOnlyLabel : editLabel}
|
207
|
+
,
|
208
|
+
iconDescription: editLabel,
|
209
|
+
onClick: onFocusHandler,
|
210
|
+
kind: "ghost",
|
211
|
+
tabIndex: 0,
|
212
|
+
key: "edit"
|
213
|
+
})), focused && invalid && /*#__PURE__*/React.createElement("p", {
|
214
|
+
className: "".concat(blockClass, "__warning-text")
|
215
|
+
}, invalidLabel));
|
216
|
+
});
|
217
|
+
InlineEditV2 = pkg.checkComponentEnabled(InlineEditV2, componentName);
|
218
|
+
InlineEditV2.displayName = componentName;
|
219
|
+
InlineEditV2.propTypes = {
|
220
|
+
/**
|
221
|
+
* label for cancel button
|
222
|
+
*/
|
223
|
+
cancelLabel: PropTypes.string.isRequired,
|
224
|
+
|
225
|
+
/**
|
226
|
+
* label for edit button
|
227
|
+
*/
|
228
|
+
editLabel: PropTypes.string.isRequired,
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Specify a custom id for the input
|
232
|
+
*/
|
233
|
+
id: PropTypes.string.isRequired,
|
234
|
+
|
235
|
+
/**
|
236
|
+
* determines if the input is invalid
|
237
|
+
*/
|
238
|
+
invalid: PropTypes.bool,
|
239
|
+
|
240
|
+
/**
|
241
|
+
* text that is displayed if the input is invalid
|
242
|
+
*/
|
243
|
+
invalidLabel: PropTypes.string,
|
244
|
+
|
245
|
+
/**
|
246
|
+
* Provide the text that will be read by a screen reader when visiting this control
|
247
|
+
*/
|
248
|
+
labelText: PropTypes.string.isRequired,
|
249
|
+
|
250
|
+
/**
|
251
|
+
* handler that is called when the cancel button is pressed or when the user removes focus from the input and there is no new value
|
252
|
+
*/
|
253
|
+
onCancel: PropTypes.func.isRequired,
|
254
|
+
|
255
|
+
/**
|
256
|
+
* handler that is called when the input is updated
|
257
|
+
*/
|
258
|
+
onChange: PropTypes.func.isRequired,
|
259
|
+
|
260
|
+
/**
|
261
|
+
* handler that is called when the save button is pressed or when the user removes focus from the input if it has a new value
|
262
|
+
*/
|
263
|
+
onSave: PropTypes.func.isRequired,
|
264
|
+
|
265
|
+
/**
|
266
|
+
* determines if the input is in readOnly mode
|
267
|
+
*/
|
268
|
+
// readOnly: PropTypes.bool,
|
269
|
+
|
270
|
+
/**
|
271
|
+
* label for the edit button that displays when in read only mode
|
272
|
+
*/
|
273
|
+
// readOnlyLabel: PropTypes.string,
|
274
|
+
|
275
|
+
/**
|
276
|
+
* label for save button
|
277
|
+
*/
|
278
|
+
saveLabel: PropTypes.string.isRequired,
|
279
|
+
|
280
|
+
/**
|
281
|
+
* current value of the input
|
282
|
+
*/
|
283
|
+
value: PropTypes.string.isRequired
|
284
|
+
};
|
285
|
+
InlineEditV2.defaultProps = {
|
286
|
+
invalid: false,
|
287
|
+
invalidLabel: '' // readOnly: false,
|
288
|
+
|
289
|
+
};
|
@@ -6,7 +6,7 @@
|
|
6
6
|
//
|
7
7
|
import React from 'react';
|
8
8
|
import PropTypes from 'prop-types';
|
9
|
-
import { Add } from '@carbon/icons
|
9
|
+
import { Add } from '@carbon/react/icons';
|
10
10
|
import { pkg } from '../../settings';
|
11
11
|
var blockClass = "".concat(pkg.prefix, "--modified-tabs");
|
12
12
|
export var ModifiedTabLabelNew = function ModifiedTabLabelNew(_ref) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import { Close, CloseFilled } from '@carbon/icons
|
3
|
+
import { Close, CloseFilled } from '@carbon/react/icons';
|
4
4
|
import { pkg } from '../../settings';
|
5
5
|
var blockClass = "".concat(pkg.prefix, "--modified-tabs");
|
6
6
|
export var ModifiedTabLabelWithClose = function ModifiedTabLabelWithClose(_ref) {
|
@@ -1,4 +1,10 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
//
|
3
|
+
// Copyright IBM Corp. 2022, 2022
|
4
|
+
//
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
7
|
+
//
|
2
8
|
import React, { forwardRef } from 'react';
|
3
9
|
import PropTypes from 'prop-types';
|
4
10
|
import { AddSelect } from '../AddSelect';
|
@@ -64,6 +70,11 @@ MultiAddSelect.propTypes = {
|
|
64
70
|
*/
|
65
71
|
globalSearchPlaceholder: PropTypes.string,
|
66
72
|
|
73
|
+
/**
|
74
|
+
* the theme for the empty state illustration
|
75
|
+
*/
|
76
|
+
illustrationTheme: PropTypes.oneOf(['light', 'dark']),
|
77
|
+
|
67
78
|
/**
|
68
79
|
* title that displays in the sidebar / influencer
|
69
80
|
*/
|
@@ -84,7 +95,8 @@ MultiAddSelect.propTypes = {
|
|
84
95
|
avatar: PropTypes.shape({
|
85
96
|
alt: PropTypes.string,
|
86
97
|
icon: PropTypes.func,
|
87
|
-
src: PropTypes.string
|
98
|
+
src: PropTypes.string,
|
99
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
88
100
|
}),
|
89
101
|
children: PropTypes.object,
|
90
102
|
icon: PropTypes.func,
|
@@ -145,15 +157,10 @@ MultiAddSelect.propTypes = {
|
|
145
157
|
*/
|
146
158
|
open: PropTypes.bool,
|
147
159
|
|
148
|
-
/**
|
149
|
-
* description for the remove item icon
|
150
|
-
*/
|
151
|
-
removeIconDescription: PropTypes.string,
|
152
|
-
|
153
160
|
/**
|
154
161
|
* text that displays when displaying filtered items
|
155
162
|
*/
|
156
|
-
|
163
|
+
searchResultsTitle: PropTypes.string,
|
157
164
|
|
158
165
|
/**
|
159
166
|
* header text
|
@@ -22,7 +22,7 @@ import { timeAgo } from './utils';
|
|
22
22
|
import { NotificationsEmptyState } from '../EmptyStates/NotificationsEmptyState'; // Carbon and package components we use.
|
23
23
|
|
24
24
|
import { Button, Link, Toggle, IconButton } from '@carbon/react';
|
25
|
-
import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/icons
|
25
|
+
import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/react/icons';
|
26
26
|
import { usePreviousValue } from '../../global/js/hooks'; // The block part of our conventional BEM class names (blockClass__E--M).
|
27
27
|
|
28
28
|
var componentName = 'NotificationsPanel';
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["children", "className", "enabled", "invalid", "invalidText", "locked", "lockedText", "onToggle", "open", "size", "summary", "title", "titleId", "warn", "warnText"];
|
5
|
+
var _excluded = ["children", "className", "enabled", "invalid", "invalidText", "locked", "lockedText", "onChange", "onToggle", "open", "size", "summary", "title", "titleId", "warn", "warnText"];
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Copyright IBM Corp. 2021, 2022
|
@@ -17,10 +17,11 @@ import PropTypes from 'prop-types';
|
|
17
17
|
import cx from 'classnames';
|
18
18
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
19
19
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
20
|
-
import { pkg } from '../../settings';
|
20
|
+
import { pkg } from '../../settings';
|
21
|
+
import { useControllableState } from '../../global/js/hooks'; // Carbon and package components we use.
|
21
22
|
|
22
23
|
import { Toggle } from '@carbon/react';
|
23
|
-
import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/icons
|
24
|
+
import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/react/icons';
|
24
25
|
import * as carbonMotion from '@carbon/motion'; // The block part of our conventional BEM class names (blockClass__E--M).
|
25
26
|
|
26
27
|
var blockClass = "".concat(pkg.prefix, "--options-tile");
|
@@ -28,6 +29,7 @@ var componentName = 'OptionsTile'; // NOTE: the component SCSS is not imported h
|
|
28
29
|
// Default values for props
|
29
30
|
|
30
31
|
var defaults = {
|
32
|
+
onChange: function onChange() {},
|
31
33
|
size: 'xl'
|
32
34
|
};
|
33
35
|
/**
|
@@ -42,6 +44,8 @@ export var OptionsTile = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
42
44
|
invalidText = _ref.invalidText,
|
43
45
|
locked = _ref.locked,
|
44
46
|
lockedText = _ref.lockedText,
|
47
|
+
_ref$onChange = _ref.onChange,
|
48
|
+
_onChange = _ref$onChange === void 0 ? defaults.onChange : _ref$onChange,
|
45
49
|
onToggle = _ref.onToggle,
|
46
50
|
open = _ref.open,
|
47
51
|
_ref$size = _ref.size,
|
@@ -55,18 +59,24 @@ export var OptionsTile = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
55
59
|
|
56
60
|
var _useState = useState(open),
|
57
61
|
_useState2 = _slicedToArray(_useState, 2),
|
58
|
-
|
59
|
-
|
62
|
+
prevIsOpen = _useState2[0],
|
63
|
+
setPrevIsOpen = _useState2[1];
|
60
64
|
|
61
|
-
var _useState3 = useState(
|
65
|
+
var _useState3 = useState(false),
|
62
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
var
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
closing = _useState4[0],
|
68
|
+
setClosing = _useState4[1];
|
69
|
+
|
70
|
+
var _useControllableState = useControllableState({
|
71
|
+
value: open,
|
72
|
+
defaultValue: open || null,
|
73
|
+
onChange: function onChange(value) {
|
74
|
+
return _onChange(value);
|
75
|
+
}
|
76
|
+
}),
|
77
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
78
|
+
isOpen = _useControllableState2[0],
|
79
|
+
setIsOpen = _useControllableState2[1];
|
70
80
|
|
71
81
|
var detailsRef = useRef(null);
|
72
82
|
var contentRef = useRef(null);
|
@@ -297,6 +307,12 @@ OptionsTile.propTypes = {
|
|
297
307
|
*/
|
298
308
|
lockedText: PropTypes.string,
|
299
309
|
|
310
|
+
/**
|
311
|
+
* Provide a function which will be called each time the user
|
312
|
+
* toggles the open state of the OptionsTile.
|
313
|
+
*/
|
314
|
+
onChange: PropTypes.func,
|
315
|
+
|
300
316
|
/**
|
301
317
|
* Provide a function which will be called each time the user
|
302
318
|
* interacts with the toggle.
|
@@ -29,7 +29,7 @@ import { ActionBar } from '../ActionBar/';
|
|
29
29
|
import { BreadcrumbWithOverflow } from '../BreadcrumbWithOverflow';
|
30
30
|
import { TagSet, string_required_if_more_than_10_tags } from '../TagSet/TagSet';
|
31
31
|
import { ButtonSetWithOverflow } from '../ButtonSetWithOverflow';
|
32
|
-
import { ChevronUp } from '@carbon/icons
|
32
|
+
import { ChevronUp } from '@carbon/react/icons';
|
33
33
|
var componentName = 'PageHeader';
|
34
34
|
import { blockClass, utilCheckUpdateVerticalSpace, utilGetBreadcrumbItemForTitle, utilSetCollapsed } from './PageHeaderUtils';
|
35
35
|
import { PageHeaderTitle } from './PageHeaderTitle'; // Default values for props
|
@@ -301,7 +301,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
301
301
|
var current = _ref5.current;
|
302
302
|
// on window resize and other updates some values may have changed
|
303
303
|
checkUpdateVerticalSpace();
|
304
|
-
setWidthIsNarrow(current.innerWidth < breakpoints.md.width); // small (below medium) media query
|
304
|
+
setWidthIsNarrow(current.innerWidth / 16 < parseInt(breakpoints.md.width)); // small (below medium) media query
|
305
305
|
}, [actionBarItems, children, breadcrumbs, enableBreadcrumbScroll, navigation, pageActions, subtitle, tags, title]);
|
306
306
|
useEffect(function () {
|
307
307
|
checkUpdateVerticalSpace(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
@@ -344,7 +344,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
344
344
|
};
|
345
345
|
|
346
346
|
useEffect(function () {
|
347
|
-
if (
|
347
|
+
if (collapseHeader === true) {
|
348
348
|
utilSetCollapsed(collapseHeader, metrics.headerOffset, metrics.headerTopValue);
|
349
349
|
}
|
350
350
|
}, [collapseHeader, metrics.headerOffset, metrics.headerTopValue]);
|
@@ -484,7 +484,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
484
484
|
onWidthChange: handleWidthChange,
|
485
485
|
buttons: pageActions,
|
486
486
|
buttonSetOverflowLabel: pageActionsOverflowLabel,
|
487
|
-
rightAlign:
|
487
|
+
rightAlign: !widthIsNarrow
|
488
488
|
})));
|
489
489
|
}
|
490
490
|
}
|
@@ -65,7 +65,7 @@ export var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
65
65
|
titleText = asText;
|
66
66
|
}
|
67
67
|
|
68
|
-
return /*#__PURE__*/React.createElement("
|
68
|
+
return /*#__PURE__*/React.createElement("h1", {
|
69
69
|
className: cx("".concat(blockClass, "__title"), _defineProperty({}, "".concat(blockClass, "__title--editable"), isEditable), _defineProperty({}, "".concat(blockClass, "__title--fades"), hasBreadcrumbRow)),
|
70
70
|
title: titleText
|
71
71
|
}, titleInnards);
|
@@ -117,6 +117,11 @@ ProductiveCard.propTypes = {
|
|
117
117
|
*/
|
118
118
|
primaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
119
119
|
|
120
|
+
/**
|
121
|
+
* Determines if the primary button is on the top or bottom of the card
|
122
|
+
*/
|
123
|
+
primaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
|
124
|
+
|
120
125
|
/**
|
121
126
|
* The text that's displayed in the primary button
|
122
127
|
*/
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["body", "className", "iconDescription", "inputInvalidText", "inputLabelText", "inputPlaceholderText", "label", "onClose", "onRequestSubmit", "open", "preventCloseOnClickOutside", "primaryButtonText", "resourceName", "secondaryButtonText", "textConfirmation", "title"];
|
5
|
+
var _excluded = ["body", "className", "iconDescription", "inputInvalidText", "inputLabelText", "inputPlaceholderText", "label", "onClose", "onRequestSubmit", "open", "preventCloseOnClickOutside", "primaryButtonDisabled", "primaryButtonText", "resourceName", "secondaryButtonText", "textConfirmation", "title"];
|
6
6
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
8
8
|
|
@@ -35,6 +35,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
35
35
|
onRequestSubmit = _ref.onRequestSubmit,
|
36
36
|
open = _ref.open,
|
37
37
|
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
38
|
+
primaryButtonDisabled = _ref.primaryButtonDisabled,
|
38
39
|
primaryButtonText = _ref.primaryButtonText,
|
39
40
|
resourceName = _ref.resourceName,
|
40
41
|
secondaryButtonText = _ref.secondaryButtonText,
|
@@ -57,7 +58,18 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
57
58
|
setUserInput(e.target.value);
|
58
59
|
};
|
59
60
|
|
60
|
-
var
|
61
|
+
var checkPrimaryButtonDisabled = function checkPrimaryButtonDisabled() {
|
62
|
+
// user control should be used primarily
|
63
|
+
if (primaryButtonDisabled) {
|
64
|
+
return true;
|
65
|
+
} else if (textConfirmation && userInput !== resourceName) {
|
66
|
+
return true;
|
67
|
+
}
|
68
|
+
|
69
|
+
return false;
|
70
|
+
};
|
71
|
+
|
72
|
+
var primaryButtonStatus = checkPrimaryButtonDisabled();
|
61
73
|
var blockClass = "".concat(pkg.prefix, "--remove-modal"); // Clear the user input this way so that if the onRequestSubmit handler fails for some reason
|
62
74
|
// the value of the input will still remain: we only want to empty the input value
|
63
75
|
// when open actually changes to false.
|
@@ -100,7 +112,7 @@ export var RemoveModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
100
112
|
type: "submit",
|
101
113
|
kind: "danger",
|
102
114
|
onClick: onRequestSubmit,
|
103
|
-
disabled:
|
115
|
+
disabled: primaryButtonStatus
|
104
116
|
}, primaryButtonText)));
|
105
117
|
}); // Return a placeholder if not released and not enabled by feature flag
|
106
118
|
|
@@ -161,6 +173,11 @@ RemoveModal.propTypes = {
|
|
161
173
|
*/
|
162
174
|
preventCloseOnClickOutside: PropTypes.bool,
|
163
175
|
|
176
|
+
/**
|
177
|
+
* Specify whether the primary button should be disabled. This value will override textConfirmation
|
178
|
+
*/
|
179
|
+
primaryButtonDisabled: PropTypes.bool,
|
180
|
+
|
164
181
|
/**
|
165
182
|
* Specify the text for the primary button
|
166
183
|
*/
|
@@ -12,7 +12,7 @@ var _excluded = ["secondaryButtonText", "className", "defaultIconDescription", "
|
|
12
12
|
import React, { forwardRef } from 'react';
|
13
13
|
import cx from 'classnames';
|
14
14
|
import { Button, InlineLoading } from '@carbon/react';
|
15
|
-
import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/icons
|
15
|
+
import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/react/icons';
|
16
16
|
import PropTypes from 'prop-types';
|
17
17
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
18
18
|
import { pkg } from '../../settings';
|