@carbon/ibm-products 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +3485 -3237
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -10
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +464 -696
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -4
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +1041 -991
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -8
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +1419 -1437
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -8
- package/css/index.min.css.map +1 -1
- package/es/components/APIKeyModal/APIKeyDownloader.js +7 -5
- package/es/components/APIKeyModal/APIKeyModal.js +7 -5
- package/es/components/Checklist/Checklist.docs-page.js +13 -0
- package/es/components/Checklist/Checklist.js +292 -0
- package/es/components/Checklist/ChecklistChart.js +98 -0
- package/es/components/Checklist/ChecklistIcon.js +107 -0
- package/es/components/Checklist/index.js +8 -0
- package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +1 -3
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +3 -5
- package/es/components/Datagrid/Datagrid/DatagridRefBody.js +1 -3
- package/es/components/Datagrid/Datagrid/DatagridRow.js +2 -6
- package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +1 -3
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +1 -1
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +1 -3
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +9 -8
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +6 -12
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +0 -5
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +20 -6
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +5 -4
- package/es/components/Datagrid/Datagrid.docs-page.js +1 -1
- package/es/components/Datagrid/useDisableSelectRows.js +1 -1
- package/es/components/Datagrid/useInlineEdit.js +1 -6
- package/es/components/Datagrid/useSelectRows.js +1 -1
- package/es/components/Datagrid/useSortableColumns.js +14 -25
- package/es/components/ImportModal/ImportModal.js +7 -5
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/index.js +2 -1
- package/es/global/js/hooks/useCreateComponentFocus.js +7 -5
- package/es/global/js/hooks/useCreateComponentStepChange.js +42 -37
- package/es/global/js/package-settings.js +4 -2
- package/es/global/js/utils/getNodeTextContent.js +4 -0
- package/es/global/js/utils/story-helper.js +2 -1
- package/es/global/js/utils/test-helper.js +28 -17
- package/lib/components/APIKeyModal/APIKeyDownloader.js +10 -9
- package/lib/components/APIKeyModal/APIKeyModal.docs-page.js +3 -4
- package/lib/components/APIKeyModal/APIKeyModal.js +10 -9
- package/lib/components/AboutModal/AboutModal.docs-page.js +3 -4
- package/lib/components/AboutModal/AboutModal.js +3 -4
- package/lib/components/ActionBar/ActionBar.js +3 -4
- package/lib/components/ActionBar/ActionBarItem.js +1 -2
- package/lib/components/ActionBar/ActionBarOverflowItems.js +3 -4
- package/lib/components/ActionSet/ActionSet.js +1 -2
- package/lib/components/ActionSet/actions.js +4 -7
- package/lib/components/AddSelect/AddSelect.js +3 -4
- package/lib/components/AddSelect/AddSelectBody.js +3 -4
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +1 -2
- package/lib/components/AddSelect/AddSelectColumn.js +3 -4
- package/lib/components/AddSelect/AddSelectFilter.js +3 -4
- package/lib/components/AddSelect/AddSelectFormControl.js +1 -2
- package/lib/components/AddSelect/AddSelectList.js +1 -2
- package/lib/components/AddSelect/AddSelectMetaPanel.js +3 -4
- package/lib/components/AddSelect/AddSelectRow.js +3 -4
- package/lib/components/AddSelect/AddSelectSidebar.js +1 -2
- package/lib/components/AddSelect/AddSelectSort.js +1 -2
- package/lib/components/AddSelect/add-select-utils.js +5 -9
- package/lib/components/AddSelect/hooks/useFocus.js +1 -2
- package/lib/components/AddSelect/hooks/useItemSort.js +2 -3
- package/lib/components/AddSelect/hooks/useParentSelect.js +1 -2
- package/lib/components/AddSelect/hooks/usePath.js +1 -2
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +3 -4
- package/lib/components/ButtonMenu/ButtonMenu.js +1 -2
- package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +3 -4
- package/lib/components/Card/Card.js +3 -4
- package/lib/components/Card/CardFooter.js +1 -2
- package/lib/components/Card/CardHeader.js +1 -2
- package/lib/components/Cascade/Cascade.docs-page.js +3 -4
- package/lib/components/Cascade/Cascade.js +3 -4
- package/lib/components/Checklist/Checklist.docs-page.js +23 -0
- package/lib/components/Checklist/Checklist.js +297 -0
- package/lib/components/Checklist/ChecklistChart.js +99 -0
- package/lib/components/Checklist/ChecklistIcon.js +109 -0
- package/lib/components/Checklist/index.js +12 -0
- package/lib/components/ComboButton/ComboButton.js +3 -4
- package/lib/components/ComboButton/ComboButtonItem/index.js +1 -2
- package/lib/components/CreateFullPage/CreateFullPage.docs-page.js +3 -4
- package/lib/components/CreateFullPage/CreateFullPage.js +5 -8
- package/lib/components/CreateFullPage/CreateFullPageStep.js +3 -4
- package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -2
- package/lib/components/CreateModal/CreateModal.docs-page.js +3 -4
- package/lib/components/CreateModal/CreateModal.js +1 -2
- package/lib/components/CreateSidePanel/CreateSidePanel.docs-page.js +3 -4
- package/lib/components/CreateSidePanel/CreateSidePanel.js +1 -2
- package/lib/components/CreateTearsheet/CreateTearsheet.docs-page.js +3 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +5 -8
- package/lib/components/CreateTearsheet/CreateTearsheetDivider.js +3 -4
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +3 -4
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +4 -5
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +4 -5
- package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +1 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +3 -4
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +3 -4
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +3 -4
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseUp.js +2 -3
- package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +2 -3
- package/lib/components/DataSpreadsheet/utils/checkActiveHeaderCell.js +2 -3
- package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +2 -3
- package/lib/components/DataSpreadsheet/utils/createActiveCellFn.js +2 -3
- package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +2 -3
- package/lib/components/DataSpreadsheet/utils/generateData.js +2 -3
- package/lib/components/DataSpreadsheet/utils/getCellSize.js +2 -3
- package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +2 -3
- package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -3
- package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +4 -7
- package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +2 -3
- package/lib/components/DataSpreadsheet/utils/removeCellSelections.js +2 -3
- package/lib/components/DataSpreadsheet/utils/selectAllCells.js +2 -3
- package/lib/components/Datagrid/Datagrid/Datagrid.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -4
- package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +2 -5
- package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridHead.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +6 -9
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +2 -5
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +3 -8
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -4
- package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +2 -5
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +4 -7
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +10 -10
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +4 -6
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +5 -8
- package/lib/components/Datagrid/Datagrid/addons/Filtering/OverflowCheckboxes.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/constants.js +13 -26
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +4 -6
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useSubscribeToEventEmitter.js +1 -2
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +4 -7
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +7 -14
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -9
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +4 -6
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +2 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +26 -13
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +9 -6
- package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +5 -9
- package/lib/components/Datagrid/Datagrid.docs-page.js +5 -6
- package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +2 -3
- package/lib/components/Datagrid/Datagrid.stories/common.js +4 -7
- package/lib/components/Datagrid/Extensions/ColumnAlignment/ColumnAlignment.docs-page.js +2 -3
- package/lib/components/Datagrid/Extensions/ColumnCustomization/ColumnCustomization.docs-page.js +2 -3
- package/lib/components/Datagrid/Extensions/EditableCell/EditableCell.docs-page.js +2 -3
- package/lib/components/Datagrid/Extensions/ExpandableRow/ExpandableRow.docs-page.js +2 -3
- package/lib/components/Datagrid/Extensions/Filtering/Filtering.docs-page.js +2 -3
- package/lib/components/Datagrid/Extensions/RowActionButtons/RowActionButtons.docs-page.js +2 -3
- package/lib/components/Datagrid/common-column-ids.js +1 -2
- package/lib/components/Datagrid/useActionsColumn.js +3 -4
- package/lib/components/Datagrid/useColumnCenterAlign.js +1 -2
- package/lib/components/Datagrid/useColumnOrder.js +1 -2
- package/lib/components/Datagrid/useColumnRightAlign.js +1 -2
- package/lib/components/Datagrid/useCustomizeColumns.js +3 -4
- package/lib/components/Datagrid/useDatagrid.js +1 -2
- package/lib/components/Datagrid/useDefaultStringRenderer.js +1 -2
- package/lib/components/Datagrid/useDisableSelectRows.js +2 -3
- package/lib/components/Datagrid/useEditableCell.js +1 -2
- package/lib/components/Datagrid/useExpandedRow.js +1 -2
- package/lib/components/Datagrid/useFiltering.js +1 -2
- package/lib/components/Datagrid/useFlexResize.js +1 -2
- package/lib/components/Datagrid/useFloatingScroll.js +1 -2
- package/lib/components/Datagrid/useInfiniteScroll.js +1 -2
- package/lib/components/Datagrid/useInlineEdit.js +4 -10
- package/lib/components/Datagrid/useNestedRowExpander.js +3 -4
- package/lib/components/Datagrid/useNestedRows.js +1 -2
- package/lib/components/Datagrid/useOnRowClick.js +1 -2
- package/lib/components/Datagrid/useParentDimensions.js +1 -2
- package/lib/components/Datagrid/useResizeTable.js +1 -2
- package/lib/components/Datagrid/useRowExpander.js +3 -4
- package/lib/components/Datagrid/useRowIsMouseOver.js +1 -2
- package/lib/components/Datagrid/useRowRenderer.js +1 -2
- package/lib/components/Datagrid/useRowSize.js +1 -2
- package/lib/components/Datagrid/useSelectAllToggle.js +3 -4
- package/lib/components/Datagrid/useSelectRows.js +4 -5
- package/lib/components/Datagrid/useSkeletonRows.js +1 -2
- package/lib/components/Datagrid/useSortableColumns.js +15 -27
- package/lib/components/Datagrid/useStickyColumn.js +1 -2
- package/lib/components/Datagrid/utils/DatagridActions.js +4 -5
- package/lib/components/Datagrid/utils/DatagridPagination.js +2 -3
- package/lib/components/Datagrid/utils/Wrapper.js +2 -3
- package/lib/components/Datagrid/utils/getArgTypes.js +2 -3
- package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +2 -3
- package/lib/components/Datagrid/utils/getInlineEditColumns.js +3 -5
- package/lib/components/Datagrid/utils/makeData.js +3 -6
- package/lib/components/EditFullPage/EditFullPage.docs-page.js +3 -4
- package/lib/components/EditFullPage/EditFullPage.js +1 -2
- package/lib/components/EditInPlace/EditInPlace.js +4 -6
- package/lib/components/EditSidePanel/EditSidePanel.js +1 -2
- package/lib/components/EditTearsheet/EditTearsheet.docs-page.js +3 -4
- package/lib/components/EditTearsheet/EditTearsheet.js +5 -8
- package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -4
- package/lib/components/EditTearsheet/preview-components/MultiFormEditTearsheet.js +4 -5
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.js +1 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +1 -2
- package/lib/components/EmptyStates/EmptyState.js +2 -4
- package/lib/components/EmptyStates/EmptyStateContent.js +1 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -2
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -2
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -2
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -2
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +1 -2
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +1 -2
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +1 -2
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +1 -2
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +1 -2
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +1 -2
- package/lib/components/ExampleComponent/ExampleComponent.docs-page.js +3 -4
- package/lib/components/ExampleComponent/ExampleComponent.js +3 -4
- package/lib/components/ExampleComponent/ExampleDeprecatedComponent.js +1 -2
- package/lib/components/ExampleComponent/useExample.js +1 -2
- package/lib/components/ExportModal/ExportModal.js +3 -4
- package/lib/components/ExpressiveCard/ExpressiveCard.js +3 -4
- package/lib/components/FilterSummary/FilterSummary.js +1 -2
- package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -2
- package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -2
- package/lib/components/HTTPErrors/HTTPErrorContent.js +1 -2
- package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +1 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +1 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +1 -2
- package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +1 -2
- package/lib/components/ImportModal/ImportModal.docs-page.js +1 -2
- package/lib/components/ImportModal/ImportModal.js +10 -9
- package/lib/components/MultiAddSelect/MultiAddSelect.docs-page.js +1 -2
- package/lib/components/MultiAddSelect/MultiAddSelect.js +3 -4
- package/lib/components/NotificationsPanel/NotificationsPanel.js +3 -4
- package/lib/components/NotificationsPanel/NotificationsPanel_data.js +1 -2
- package/lib/components/NotificationsPanel/preview-components/UnreadNotificationBell.js +2 -3
- package/lib/components/NotificationsPanel/utils.js +1 -2
- package/lib/components/OptionsTile/OptionsTile.js +3 -4
- package/lib/components/PageHeader/PageHeader.js +5 -7
- package/lib/components/PageHeader/PageHeaderDemo.data.js +3 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +2 -4
- package/lib/components/PageHeader/PageHeaderUtils.js +5 -9
- package/lib/components/ProductiveCard/ProductiveCard.js +3 -4
- package/lib/components/RemoveModal/RemoveModal.docs-page.js +1 -2
- package/lib/components/RemoveModal/RemoveModal.js +3 -4
- package/lib/components/Saving/Saving.js +3 -4
- package/lib/components/SidePanel/SidePanel.js +3 -4
- package/lib/components/SidePanel/constants.js +2 -3
- package/lib/components/SidePanel/motion/variants.js +3 -5
- package/lib/components/SimpleHeader/SimpleHeader.docs-page.js +3 -4
- package/lib/components/SimpleHeader/SimpleHeader.js +4 -6
- package/lib/components/SingleAddSelect/SingleAddSelect.docs-page.js +1 -2
- package/lib/components/SingleAddSelect/SingleAddSelect.js +3 -4
- package/lib/components/StatusIcon/StatusIcon.docs-page.js +3 -4
- package/lib/components/StatusIcon/StatusIcon.js +3 -4
- package/lib/components/TagSet/TagSet.js +5 -8
- package/lib/components/TagSet/TagSetModal.js +3 -4
- package/lib/components/TagSet/TagSetOverflow.js +3 -4
- package/lib/components/TagSet/constants.js +2 -3
- package/lib/components/Tearsheet/Tearsheet.js +2 -4
- package/lib/components/Tearsheet/TearsheetNarrow.js +2 -4
- package/lib/components/Tearsheet/TearsheetShell.js +8 -14
- package/lib/components/Toolbar/Toolbar.docs-page.js +3 -4
- package/lib/components/Toolbar/Toolbar.js +6 -10
- package/lib/components/Toolbar/ToolbarButton.js +4 -6
- package/lib/components/Toolbar/ToolbarGroup.js +3 -4
- package/lib/components/TooltipTrigger/TooltipTrigger.js +1 -2
- package/lib/components/TooltipTrigger/useExample.js +1 -2
- package/lib/components/UserProfileImage/UserProfileImage.docs-page.js +3 -4
- package/lib/components/UserProfileImage/UserProfileImage.js +1 -2
- package/lib/components/WebTerminal/WebTerminal.docs-page.js +3 -4
- package/lib/components/WebTerminal/WebTerminal.js +3 -4
- package/lib/components/WebTerminal/WebTerminalContentWrapper.js +1 -2
- package/lib/components/WebTerminal/hooks/index.js +6 -9
- package/lib/components/WebTerminal/preview-components/Navigation.js +1 -2
- package/lib/components/WebTerminal/preview-components/documentationLinks.js +2 -3
- package/lib/components/_Canary/Canary.js +1 -2
- package/lib/components/index.js +8 -1
- package/lib/global/decorators/sidePanelDecorator.js +2 -3
- package/lib/global/js/hooks/useActiveElement.js +2 -3
- package/lib/global/js/hooks/useClickOutside.js +2 -3
- package/lib/global/js/hooks/useCreateComponentFocus.js +9 -8
- package/lib/global/js/hooks/useCreateComponentStepChange.js +44 -40
- package/lib/global/js/hooks/usePortalTarget.js +2 -3
- package/lib/global/js/hooks/usePreviousValue.js +2 -3
- package/lib/global/js/hooks/useResetCreateComponent.js +2 -3
- package/lib/global/js/hooks/useResizeObserver.js +2 -3
- package/lib/global/js/hooks/useRetrieveFormTitles.js +2 -3
- package/lib/global/js/hooks/useRetrieveStepData.js +2 -3
- package/lib/global/js/hooks/useValidCreateStepCount.js +2 -3
- package/lib/global/js/hooks/useWindowResize.js +2 -3
- package/lib/global/js/package-settings.js +6 -5
- package/lib/global/js/utils/ClickListener.js +3 -4
- package/lib/global/js/utils/DisplayBox.js +1 -2
- package/lib/global/js/utils/StoryDocsPage.js +2 -4
- package/lib/global/js/utils/Wrap.js +1 -2
- package/lib/global/js/utils/deepCloneObject.js +2 -3
- package/lib/global/js/utils/devtools.js +1 -2
- package/lib/global/js/utils/getBezierValues.js +2 -3
- package/lib/global/js/utils/getFocusableElements.js +2 -3
- package/lib/global/js/utils/getNodeTextContent.js +6 -3
- package/lib/global/js/utils/getNumberOfHiddenSteps.js +2 -3
- package/lib/global/js/utils/getScrollbarWidth.js +2 -3
- package/lib/global/js/utils/keyboardNavigation.js +4 -8
- package/lib/global/js/utils/lastIndexInArray.js +2 -3
- package/lib/global/js/utils/motionConstants.js +4 -5
- package/lib/global/js/utils/pconsole.js +8 -15
- package/lib/global/js/utils/props-helper.js +7 -14
- package/lib/global/js/utils/rangeWithCallback.js +2 -3
- package/lib/global/js/utils/scrollableAncestor.js +2 -3
- package/lib/global/js/utils/story-helper.js +15 -26
- package/lib/global/js/utils/test-helper.js +39 -42
- package/lib/global/js/utils/unwrap-if-fragment.js +1 -2
- package/lib/global/js/utils/uuidv4.js +1 -2
- package/lib/global/js/utils/wait.js +1 -2
- package/lib/global/js/utils/wrapFocus.js +1 -2
- package/lib/settings.js +2 -4
- package/package.json +6 -6
- package/scss/components/AboutModal/_about-modal.scss +1 -2
- package/scss/components/Checklist/_checklist.scss +217 -0
- package/scss/components/Checklist/_index.scss +8 -0
- package/scss/components/Checklist/_storybook-styles.scss +13 -0
- package/scss/components/CreateFullPage/_storybook-styles.scss +1 -1
- package/scss/components/Datagrid/_datagrid.scss +1 -0
- package/scss/components/Datagrid/styles/_datagrid.scss +1 -2
- package/scss/components/Datagrid/styles/_useInlineEdit.scss +8 -11
- package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +5 -0
- package/scss/components/_index.scss +2 -1
- package/es/components/Datagrid/utils/getColTitle.js +0 -25
- package/lib/components/Datagrid/utils/getColTitle.js +0 -32
@@ -0,0 +1,292 @@
|
|
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 = ["chartValue", "chartLabel", "checklistAriaLabel", "checklistToggleAriaLabel", "className", "onClickViewAll", "onToggle", "open", "showToggle", "taskLists", "theme", "title", "toggleLabel", "toggleLabelAlign", "viewAllLabel"];
|
6
|
+
/**
|
7
|
+
* Copyright IBM Corp. 2023, 2023
|
8
|
+
*
|
9
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
15
|
+
* See
|
16
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
17
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
18
|
+
*/
|
19
|
+
|
20
|
+
// Import portions of React that are needed.
|
21
|
+
import React, { useEffect, useRef, useState } from 'react';
|
22
|
+
|
23
|
+
// Other standard imports.
|
24
|
+
import PropTypes from 'prop-types';
|
25
|
+
import cx from 'classnames';
|
26
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
27
|
+
import uuidv4 from '../../global/js/utils/uuidv4';
|
28
|
+
import { pkg } from '../../settings';
|
29
|
+
|
30
|
+
// Carbon and package components we use.
|
31
|
+
import { Button, IconButton } from '@carbon/react';
|
32
|
+
import { ChevronUp } from '@carbon/react/icons';
|
33
|
+
import { ChecklistIcon } from './ChecklistIcon';
|
34
|
+
import { ChecklistChart } from './ChecklistChart';
|
35
|
+
|
36
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
37
|
+
var blockClass = "".concat(pkg.prefix, "--checklist");
|
38
|
+
var componentName = 'Checklist';
|
39
|
+
|
40
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
41
|
+
|
42
|
+
// Default values can be included here and then assigned to the prop params,
|
43
|
+
// e.g. prop = defaults.prop,
|
44
|
+
// This gathers default values together neatly and ensures non-primitive
|
45
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
46
|
+
// Note that default values are not required for props that are 'required',
|
47
|
+
// nor for props where the component can apply undefined values reasonably.
|
48
|
+
// Default values should be provided when the component needs to make a choice
|
49
|
+
// or assumption when a prop is not supplied.
|
50
|
+
|
51
|
+
// Default values for props
|
52
|
+
var defaults = {
|
53
|
+
checklistAriaLabel: 'Checklist',
|
54
|
+
checklistToggleAriaLabel: 'Checklist toggle',
|
55
|
+
onClickViewAll: function onClickViewAll() {},
|
56
|
+
onToggle: function onToggle() {},
|
57
|
+
open: true,
|
58
|
+
showToggle: true,
|
59
|
+
taskLists: [],
|
60
|
+
theme: 'light',
|
61
|
+
toggleLabel: 'Toggle',
|
62
|
+
toggleLabelAlign: 'top'
|
63
|
+
};
|
64
|
+
|
65
|
+
/**
|
66
|
+
* The Checklist tracks a user's progress much like Your Learning or
|
67
|
+
* WalkMe. Each item in the list can be clickable, and each item has
|
68
|
+
* an icon that defines the item's state as "not started", "in progress",
|
69
|
+
* and "complete".
|
70
|
+
*/
|
71
|
+
export var Checklist = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
72
|
+
var chartValue = _ref.chartValue,
|
73
|
+
chartLabel = _ref.chartLabel,
|
74
|
+
_ref$checklistAriaLab = _ref.checklistAriaLabel,
|
75
|
+
checklistAriaLabel = _ref$checklistAriaLab === void 0 ? defaults.checklistAriaLabel : _ref$checklistAriaLab,
|
76
|
+
_ref$checklistToggleA = _ref.checklistToggleAriaLabel,
|
77
|
+
checklistToggleAriaLabel = _ref$checklistToggleA === void 0 ? defaults.checklistToggleAriaLabel : _ref$checklistToggleA,
|
78
|
+
className = _ref.className,
|
79
|
+
_ref$onClickViewAll = _ref.onClickViewAll,
|
80
|
+
onClickViewAll = _ref$onClickViewAll === void 0 ? defaults.onClickViewAll : _ref$onClickViewAll,
|
81
|
+
_ref$onToggle = _ref.onToggle,
|
82
|
+
onToggle = _ref$onToggle === void 0 ? defaults.onToggle : _ref$onToggle,
|
83
|
+
_ref$open = _ref.open,
|
84
|
+
open = _ref$open === void 0 ? defaults.open : _ref$open,
|
85
|
+
_ref$showToggle = _ref.showToggle,
|
86
|
+
showToggle = _ref$showToggle === void 0 ? defaults.showToggle : _ref$showToggle,
|
87
|
+
_ref$taskLists = _ref.taskLists,
|
88
|
+
taskLists = _ref$taskLists === void 0 ? defaults.taskLists : _ref$taskLists,
|
89
|
+
_ref$theme = _ref.theme,
|
90
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
91
|
+
title = _ref.title,
|
92
|
+
_ref$toggleLabel = _ref.toggleLabel,
|
93
|
+
toggleLabel = _ref$toggleLabel === void 0 ? defaults.toggleLabel : _ref$toggleLabel,
|
94
|
+
_ref$toggleLabelAlign = _ref.toggleLabelAlign,
|
95
|
+
toggleLabelAlign = _ref$toggleLabelAlign === void 0 ? defaults.toggleLabelAlign : _ref$toggleLabelAlign,
|
96
|
+
viewAllLabel = _ref.viewAllLabel,
|
97
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
98
|
+
var _useState = useState(open),
|
99
|
+
_useState2 = _slicedToArray(_useState, 2),
|
100
|
+
isOpen = _useState2[0],
|
101
|
+
setIsOpen = _useState2[1];
|
102
|
+
var listContainerId = useRef(uuidv4()).current;
|
103
|
+
var chartLabelId = useRef(uuidv4()).current;
|
104
|
+
|
105
|
+
// Don't use this test: {chartValue && chartLabel && (render...)}.
|
106
|
+
// If `chartValue` is 0 (zero) - a valid value - then it will render 0 and skip the remaining statement.
|
107
|
+
// Use this test instead: {chartLabelAndValue && (render...)}.
|
108
|
+
// The ChecklistChart component will validate `chartValue`.
|
109
|
+
var chartLabelAndValue = typeof chartValue === 'number' && chartLabel;
|
110
|
+
var handleClickToggle = function handleClickToggle() {
|
111
|
+
setIsOpen(function (prevOpen) {
|
112
|
+
return !prevOpen;
|
113
|
+
});
|
114
|
+
};
|
115
|
+
var handleClickViewAll = function handleClickViewAll() {
|
116
|
+
onClickViewAll();
|
117
|
+
};
|
118
|
+
|
119
|
+
// If state changes, then trigger callback.
|
120
|
+
useEffect(function () {
|
121
|
+
onToggle(isOpen);
|
122
|
+
}, [isOpen, onToggle]);
|
123
|
+
|
124
|
+
// If the "open" prop is changed after initialization,
|
125
|
+
// then update internal state.
|
126
|
+
useEffect(function () {
|
127
|
+
setIsOpen(open);
|
128
|
+
}, [open]);
|
129
|
+
return /*#__PURE__*/React.createElement("aside", _extends({}, rest, {
|
130
|
+
"aria-label": checklistAriaLabel,
|
131
|
+
className: cx(blockClass,
|
132
|
+
// Apply the block class to the main HTML element
|
133
|
+
className, // Apply any supplied class names to the main HTML element.
|
134
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
135
|
+
_defineProperty({}, "".concat(blockClass, "__closed"), !isOpen)),
|
136
|
+
ref: ref
|
137
|
+
}, getDevtoolsProps(componentName)), (title || chartLabelAndValue) && /*#__PURE__*/React.createElement("header", {
|
138
|
+
className: "".concat(blockClass, "__header")
|
139
|
+
}, chartLabelAndValue && /*#__PURE__*/React.createElement(ChecklistChart, {
|
140
|
+
"aria-labelledby": chartLabelId,
|
141
|
+
theme: theme,
|
142
|
+
value: chartValue
|
143
|
+
}), /*#__PURE__*/React.createElement("div", {
|
144
|
+
className: "".concat(blockClass, "__titles")
|
145
|
+
}, title && /*#__PURE__*/React.createElement("h2", {
|
146
|
+
className: "".concat(blockClass, "__title")
|
147
|
+
}, title), chartLabelAndValue && /*#__PURE__*/React.createElement("h3", {
|
148
|
+
id: chartLabelId,
|
149
|
+
className: "".concat(blockClass, "__chart-label")
|
150
|
+
}, chartLabel)), showToggle && /*#__PURE__*/React.createElement(IconButton, {
|
151
|
+
align: toggleLabelAlign,
|
152
|
+
"aria-controls": listContainerId,
|
153
|
+
"aria-expanded": isOpen,
|
154
|
+
"aria-label": checklistToggleAriaLabel,
|
155
|
+
className: "".concat(blockClass, "__toggle"),
|
156
|
+
kind: "ghost",
|
157
|
+
label: toggleLabel,
|
158
|
+
onClick: handleClickToggle,
|
159
|
+
size: "sm"
|
160
|
+
}, /*#__PURE__*/React.createElement(ChevronUp, {
|
161
|
+
size: 16,
|
162
|
+
className: cx("".concat(blockClass, "__chevron"))
|
163
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
164
|
+
id: listContainerId,
|
165
|
+
className: "".concat(blockClass, "__content-outer")
|
166
|
+
}, /*#__PURE__*/React.createElement("div", {
|
167
|
+
className: "".concat(blockClass, "__content-inner")
|
168
|
+
}, /*#__PURE__*/React.createElement("section", {
|
169
|
+
className: cx("".concat(blockClass, "__body"))
|
170
|
+
}, taskLists.map(function (list, index) {
|
171
|
+
return /*#__PURE__*/React.createElement("div", {
|
172
|
+
className: "".concat(blockClass, "__list-group"),
|
173
|
+
key: "".concat(list.title, "-").concat(index)
|
174
|
+
}, list.title && /*#__PURE__*/React.createElement("h3", {
|
175
|
+
title: list.title,
|
176
|
+
className: "".concat(blockClass, "__list-title")
|
177
|
+
}, list.title), /*#__PURE__*/React.createElement("ol", {
|
178
|
+
className: "".concat(blockClass, "__list")
|
179
|
+
}, list.tasks.map(function (item, index) {
|
180
|
+
return /*#__PURE__*/React.createElement("li", {
|
181
|
+
className: "".concat(blockClass, "__list-item"),
|
182
|
+
key: "".concat(item.label, "-").concat(index)
|
183
|
+
}, /*#__PURE__*/React.createElement(ChecklistIcon, {
|
184
|
+
kind: item.kind
|
185
|
+
}), typeof item.onClick === 'function' ? /*#__PURE__*/React.createElement(Button, {
|
186
|
+
className: cx("".concat(blockClass, "__button"), _defineProperty({}, "".concat(blockClass, "__button--error"), item.kind === 'error')),
|
187
|
+
onClick: function onClick() {
|
188
|
+
item.onClick(item);
|
189
|
+
},
|
190
|
+
size: "sm",
|
191
|
+
title: item.label
|
192
|
+
}, /*#__PURE__*/React.createElement("div", null, item.label)) : /*#__PURE__*/React.createElement("div", {
|
193
|
+
className: cx("".concat(blockClass, "__label"), "".concat(blockClass, "__label--").concat(item.kind)),
|
194
|
+
title: item.label
|
195
|
+
}, item.label));
|
196
|
+
})));
|
197
|
+
})), viewAllLabel && /*#__PURE__*/React.createElement("footer", {
|
198
|
+
className: "".concat(blockClass, "__footer")
|
199
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
200
|
+
className: cx("".concat(blockClass, "__button"), "".concat(blockClass, "__view-all")),
|
201
|
+
onClick: handleClickViewAll,
|
202
|
+
size: "sm"
|
203
|
+
}, /*#__PURE__*/React.createElement("div", null, viewAllLabel))))));
|
204
|
+
});
|
205
|
+
|
206
|
+
// Return a placeholder if not released and not enabled by feature flag
|
207
|
+
Checklist = pkg.checkComponentEnabled(Checklist, componentName);
|
208
|
+
Checklist.displayName = componentName;
|
209
|
+
|
210
|
+
// The types and DocGen commentary for the component props,
|
211
|
+
// in alphabetical order (for consistency).
|
212
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
213
|
+
Checklist.propTypes = {
|
214
|
+
/**
|
215
|
+
* Define both `chartLabel` and `chartValue` to show the chart and its label together.
|
216
|
+
*/
|
217
|
+
chartLabel: PropTypes.string,
|
218
|
+
/**
|
219
|
+
* A number between 0 and 1.
|
220
|
+
*
|
221
|
+
* Define both `chartLabel` and `chartValue` to show the chart and its label together.
|
222
|
+
*/
|
223
|
+
chartValue: PropTypes.number,
|
224
|
+
/**
|
225
|
+
* Aria-label for the Checklist component.
|
226
|
+
*/
|
227
|
+
checklistAriaLabel: PropTypes.string,
|
228
|
+
/**
|
229
|
+
* Aria-label for the Checklist's toggle component.
|
230
|
+
*/
|
231
|
+
checklistToggleAriaLabel: PropTypes.string,
|
232
|
+
/**
|
233
|
+
* Provide an optional class to be applied to the containing node.
|
234
|
+
*/
|
235
|
+
className: PropTypes.string,
|
236
|
+
/**
|
237
|
+
* Callback for the "View all" button. See also `viewAllLabel`.
|
238
|
+
*/
|
239
|
+
onClickViewAll: PropTypes.func,
|
240
|
+
/**
|
241
|
+
* Optional callback for when the list is opened/closed.
|
242
|
+
*/
|
243
|
+
onToggle: PropTypes.func,
|
244
|
+
/**
|
245
|
+
* Specifies whether the component is opened or closed.
|
246
|
+
* This can be set during initialization, or changed after being rendered.
|
247
|
+
*/
|
248
|
+
open: PropTypes.bool,
|
249
|
+
/**
|
250
|
+
* Whether or not to show the open/close toggle.
|
251
|
+
*/
|
252
|
+
showToggle: PropTypes.bool,
|
253
|
+
/**
|
254
|
+
* The task list can be broken down into sub-lists.
|
255
|
+
*
|
256
|
+
* Each sub-list can include an optional `title`.
|
257
|
+
*
|
258
|
+
* Each task must specify the appropriate icon (`kind`) and `label`.
|
259
|
+
*
|
260
|
+
* If any task has an `onClick` callback function defined,
|
261
|
+
* then the `label` will be rendered as a button,
|
262
|
+
* else the `label` will be rendered as plain text.
|
263
|
+
*/
|
264
|
+
taskLists: PropTypes.arrayOf(PropTypes.shape({
|
265
|
+
title: PropTypes.string,
|
266
|
+
tasks: PropTypes.arrayOf(PropTypes.shape({
|
267
|
+
kind: PropTypes.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']).isRequired,
|
268
|
+
label: PropTypes.string.isRequired,
|
269
|
+
onClick: PropTypes.func
|
270
|
+
})).isRequired
|
271
|
+
})).isRequired,
|
272
|
+
/**
|
273
|
+
* Determines the theme of the component.
|
274
|
+
*/
|
275
|
+
theme: PropTypes.oneOf(['light', 'dark']),
|
276
|
+
/**
|
277
|
+
* The title of the component.
|
278
|
+
*/
|
279
|
+
title: PropTypes.string,
|
280
|
+
/**
|
281
|
+
* The label for the toggle's tooltip.
|
282
|
+
*/
|
283
|
+
toggleLabel: PropTypes.string,
|
284
|
+
/**
|
285
|
+
* The alignment of the toggle's tooltip.
|
286
|
+
*/
|
287
|
+
toggleLabelAlign: PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
288
|
+
/**
|
289
|
+
* If defined, will show and enable the "View all (#)" button at the bottom of the list.
|
290
|
+
*/
|
291
|
+
viewAllLabel: PropTypes.string
|
292
|
+
};
|
@@ -0,0 +1,98 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["className", "value", "theme"];
|
4
|
+
/**
|
5
|
+
* Copyright IBM Corp. 2023, 2023
|
6
|
+
*
|
7
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
13
|
+
* See
|
14
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
15
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
16
|
+
*/
|
17
|
+
|
18
|
+
// Import portions of React that are needed.
|
19
|
+
import React from 'react';
|
20
|
+
|
21
|
+
// Other standard imports.
|
22
|
+
import PropTypes from 'prop-types';
|
23
|
+
import cx from 'classnames';
|
24
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
25
|
+
import { pkg } from '../../settings';
|
26
|
+
import clamp from 'lodash/clamp';
|
27
|
+
|
28
|
+
// Carbon and package components we use.
|
29
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
30
|
+
|
31
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
32
|
+
var blockClass = "".concat(pkg.prefix, "--checklist__chart");
|
33
|
+
var componentName = 'ChecklistChart';
|
34
|
+
|
35
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
36
|
+
|
37
|
+
// Default values can be included here and then assigned to the prop params,
|
38
|
+
// e.g. prop = defaults.prop,
|
39
|
+
// This gathers default values together neatly and ensures non-primitive
|
40
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
41
|
+
// Note that default values are not required for props that are 'required',
|
42
|
+
// nor for props where the component can apply undefined values reasonably.
|
43
|
+
// Default values should be provided when the component needs to make a choice
|
44
|
+
// or assumption when a prop is not supplied.
|
45
|
+
|
46
|
+
// Default values for props
|
47
|
+
var defaults = {
|
48
|
+
theme: 'light'
|
49
|
+
};
|
50
|
+
|
51
|
+
/**
|
52
|
+
* TODO: A description of the component.
|
53
|
+
*/
|
54
|
+
export var ChecklistChart = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
55
|
+
var className = _ref.className,
|
56
|
+
value = _ref.value,
|
57
|
+
_ref$theme = _ref.theme,
|
58
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
59
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
60
|
+
var numDegrees = clamp(value * 360, 0, 360);
|
61
|
+
var circleColor = theme === 'light' ? '#e0e0e0' : '#525252'; // $ui-03 (-ish)
|
62
|
+
var progressColor = theme === 'light' ? '#a56eff' : '#a56eff'; // $purple-50
|
63
|
+
|
64
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
65
|
+
className: cx(blockClass, className),
|
66
|
+
style: {
|
67
|
+
backgroundImage: "conic-gradient(".concat(progressColor, " ").concat(numDegrees, "deg, ").concat(circleColor, " ").concat(numDegrees, "deg 360deg)"),
|
68
|
+
borderRadius: '50%'
|
69
|
+
},
|
70
|
+
ref: ref,
|
71
|
+
role: "img"
|
72
|
+
}, getDevtoolsProps(componentName)));
|
73
|
+
});
|
74
|
+
|
75
|
+
// Return a placeholder if not released and not enabled by feature flag
|
76
|
+
// ChecklistChart = pkg.checkComponentEnabled(ChecklistChart, componentName);
|
77
|
+
|
78
|
+
// The display name of the component, used by React. Note that displayName
|
79
|
+
// is used in preference to relying on function.name.
|
80
|
+
// ChecklistChart.displayName = componentName;
|
81
|
+
|
82
|
+
// The types and DocGen commentary for the component props,
|
83
|
+
// in alphabetical order (for consistency).
|
84
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
85
|
+
ChecklistChart.propTypes = {
|
86
|
+
/**
|
87
|
+
* Optional class name for this component.
|
88
|
+
*/
|
89
|
+
className: PropTypes.string,
|
90
|
+
/**
|
91
|
+
* Determines the theme of the component.
|
92
|
+
*/
|
93
|
+
theme: PropTypes.oneOf(['light', 'dark']),
|
94
|
+
/**
|
95
|
+
* Number between 0 and 1.
|
96
|
+
*/
|
97
|
+
value: PropTypes.number.isRequired
|
98
|
+
};
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["className", "kind", "theme"];
|
4
|
+
/**
|
5
|
+
* Copyright IBM Corp. 2023, 2023
|
6
|
+
*
|
7
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
13
|
+
* See
|
14
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
15
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
16
|
+
*/
|
17
|
+
|
18
|
+
// Import portions of React that are needed.
|
19
|
+
import React from 'react';
|
20
|
+
|
21
|
+
// Other standard imports.
|
22
|
+
import PropTypes from 'prop-types';
|
23
|
+
import cx from 'classnames';
|
24
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
25
|
+
import { pkg } from '../../settings';
|
26
|
+
|
27
|
+
// Carbon and package components we use.
|
28
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
29
|
+
import { CheckmarkOutline, CircleDash, Incomplete, Warning } from '@carbon/react/icons';
|
30
|
+
|
31
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
32
|
+
var blockClass = "".concat(pkg.prefix, "--checklist__icon");
|
33
|
+
var componentName = 'ChecklistIcon';
|
34
|
+
|
35
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
36
|
+
|
37
|
+
// Default values can be included here and then assigned to the prop params,
|
38
|
+
// e.g. prop = defaults.prop,
|
39
|
+
// This gathers default values together neatly and ensures non-primitive
|
40
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
41
|
+
// Note that default values are not required for props that are 'required',
|
42
|
+
// nor for props where the component can apply undefined values reasonably.
|
43
|
+
// Default values should be provided when the component needs to make a choice
|
44
|
+
// or assumption when a prop is not supplied.
|
45
|
+
|
46
|
+
// Default values for props
|
47
|
+
var defaults = {
|
48
|
+
theme: 'light'
|
49
|
+
};
|
50
|
+
|
51
|
+
/**
|
52
|
+
* TODO: A description of the component.
|
53
|
+
*/
|
54
|
+
export var ChecklistIcon = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
55
|
+
var className = _ref.className,
|
56
|
+
kind = _ref.kind,
|
57
|
+
_ref$theme = _ref.theme,
|
58
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
59
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
60
|
+
var Icon;
|
61
|
+
switch (kind) {
|
62
|
+
case 'error':
|
63
|
+
Icon = Warning;
|
64
|
+
break;
|
65
|
+
case 'indeterminate':
|
66
|
+
Icon = Incomplete;
|
67
|
+
break;
|
68
|
+
case 'checked':
|
69
|
+
Icon = CheckmarkOutline;
|
70
|
+
break;
|
71
|
+
default:
|
72
|
+
// "unchecked" or "disabled"
|
73
|
+
Icon = CircleDash;
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
77
|
+
className: cx(blockClass, className, "".concat(blockClass, "--").concat(kind), "".concat(blockClass, "__").concat(theme)),
|
78
|
+
ref: ref
|
79
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(Icon, {
|
80
|
+
size: 16
|
81
|
+
}));
|
82
|
+
});
|
83
|
+
|
84
|
+
// Return a placeholder if not released and not enabled by feature flag
|
85
|
+
// ChecklistIcon = pkg.checkComponentEnabled(ChecklistIcon, componentName);
|
86
|
+
|
87
|
+
// The display name of the component, used by React. Note that displayName
|
88
|
+
// is used in preference to relying on function.name.
|
89
|
+
// ChecklistIcon.displayName = componentName;
|
90
|
+
|
91
|
+
// The types and DocGen commentary for the component props,
|
92
|
+
// in alphabetical order (for consistency).
|
93
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
94
|
+
ChecklistIcon.propTypes = {
|
95
|
+
/**
|
96
|
+
* Provide an optional class to be applied to the containing node.
|
97
|
+
*/
|
98
|
+
className: PropTypes.string,
|
99
|
+
/**
|
100
|
+
* The icon to be displayed.
|
101
|
+
*/
|
102
|
+
kind: PropTypes.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']),
|
103
|
+
/**
|
104
|
+
* Determines the theme of the component.
|
105
|
+
*/
|
106
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
107
|
+
};
|
@@ -31,9 +31,7 @@ var DatagridEmptyBody = function DatagridEmptyBody(datagridState) {
|
|
31
31
|
link: emptyStateLink
|
32
32
|
};
|
33
33
|
var validEmptyStates = ['error', 'noData', 'notFound'];
|
34
|
-
return /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps({
|
35
|
-
role: false
|
36
|
-
}), {
|
34
|
+
return /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps(), {
|
37
35
|
className: "".concat(blockClass, "__empty-state-body")
|
38
36
|
}), /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableCell, {
|
39
37
|
colSpan: headers.length,
|
@@ -15,12 +15,12 @@ import { TableHeader, TableRow } from '@carbon/react';
|
|
15
15
|
import { px } from '@carbon/layout';
|
16
16
|
import { selectionColumnId } from '../common-column-ids';
|
17
17
|
import { pkg } from '../../../settings';
|
18
|
-
import getColTitle from '../utils/getColTitle';
|
19
18
|
import { handleColumnResizeEndEvent, handleColumnResizeStartEvent, handleColumnResizingEvent } from './addons/stateReducer';
|
19
|
+
import { getNodeTextContent } from '../../../global/js/utils/getNodeTextContent';
|
20
20
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
21
21
|
var getAccessibilityProps = function getAccessibilityProps(header) {
|
22
22
|
var props = {};
|
23
|
-
var title =
|
23
|
+
var title = getNodeTextContent(header.Header);
|
24
24
|
if (title) {
|
25
25
|
props.title = title;
|
26
26
|
} else {
|
@@ -90,9 +90,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
|
|
90
90
|
};
|
91
91
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
92
92
|
}, [datagridState.state.isResizing]);
|
93
|
-
return /*#__PURE__*/React.createElement(TableRow, _extends({}, headerGroup.getHeaderGroupProps({
|
94
|
-
role: false
|
95
|
-
}), {
|
93
|
+
return /*#__PURE__*/React.createElement(TableRow, _extends({}, headerGroup.getHeaderGroupProps(), {
|
96
94
|
className: cx("".concat(blockClass, "__head"), headerGroup.getHeaderGroupProps().className),
|
97
95
|
ref: headRef
|
98
96
|
}), datagridState.headers.filter(function (_ref2) {
|
@@ -22,9 +22,7 @@ var DatagridRefBody = function DatagridRefBody(datagridState) {
|
|
22
22
|
var getTableBodyProps = datagridState.getTableBodyProps,
|
23
23
|
rows = datagridState.rows,
|
24
24
|
prepareRow = datagridState.prepareRow;
|
25
|
-
return /*#__PURE__*/React.createElement("tbody", _extends({}, getTableBodyProps({
|
26
|
-
role: false
|
27
|
-
}), {
|
25
|
+
return /*#__PURE__*/React.createElement("tbody", _extends({}, getTableBodyProps(), {
|
28
26
|
className: cx("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
|
29
27
|
}), rows.map(function (row) {
|
30
28
|
prepareRow(row);
|
@@ -92,9 +92,7 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
92
92
|
var rowClassNames = cx("".concat(blockClass, "__carbon-row"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), _defineProperty(_cx, "".concat(carbon.prefix, "--data-table--selected"), row.isSelected), _cx));
|
93
93
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableRow, _extends({
|
94
94
|
className: rowClassNames
|
95
|
-
}, row.getRowProps({
|
96
|
-
role: false
|
97
|
-
}), {
|
95
|
+
}, row.getRowProps(), {
|
98
96
|
key: row.id,
|
99
97
|
onMouseEnter: hoverHandler,
|
100
98
|
onMouseLeave: handleMouseLeave,
|
@@ -103,9 +101,7 @@ var DatagridRow = function DatagridRow(datagridState) {
|
|
103
101
|
onKeyUp: handleOnKeyUp
|
104
102
|
}), row.cells.map(function (cell, index) {
|
105
103
|
var _cell$column;
|
106
|
-
var cellProps = cell.getCellProps(
|
107
|
-
role: false
|
108
|
-
});
|
104
|
+
var cellProps = cell.getCellProps();
|
109
105
|
var children = cellProps.children,
|
110
106
|
restProps = _objectWithoutProperties(cellProps, _excluded);
|
111
107
|
var content = children || /*#__PURE__*/React.createElement(React.Fragment, null, !row.isSkeleton && cell.render('Cell'), row.isSkeleton && /*#__PURE__*/React.createElement(SkeletonText, null));
|
@@ -18,9 +18,7 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
|
|
18
18
|
var getTableBodyProps = datagridState.getTableBodyProps,
|
19
19
|
rows = datagridState.rows,
|
20
20
|
prepareRow = datagridState.prepareRow;
|
21
|
-
return /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps({
|
22
|
-
role: false
|
23
|
-
}), {
|
21
|
+
return /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps(), {
|
24
22
|
className: cx("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
|
25
23
|
}), rows.map(function (row) {
|
26
24
|
prepareRow(row);
|
@@ -124,7 +124,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
|
|
124
124
|
key: "".concat(batchAction.label, "-").concat(index),
|
125
125
|
renderIcon: batchAction.renderIcon,
|
126
126
|
onClick: function onClick(event) {
|
127
|
-
return onClickHandler(
|
127
|
+
return onClickHandler(event, batchAction);
|
128
128
|
},
|
129
129
|
iconDescription: batchAction.label
|
130
130
|
}, batchAction.label);
|
@@ -72,9 +72,7 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
|
|
72
72
|
width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
|
73
73
|
overflow: 'hidden'
|
74
74
|
}
|
75
|
-
}, /*#__PURE__*/React.createElement(DatagridHead, datagridState)), /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps({
|
76
|
-
role: false
|
77
|
-
}), {
|
75
|
+
}, /*#__PURE__*/React.createElement(DatagridHead, datagridState)), /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps(), {
|
78
76
|
onScroll: function onScroll(e) {
|
79
77
|
return syncScroll(e);
|
80
78
|
}
|