@carbon/ibm-products 2.12.1 → 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 +3482 -3232
- 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 +1040 -988
- 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 +1415 -1431
- 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/DatagridToolbar.js +1 -1
- 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/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 +28 -17
- package/es/global/js/package-settings.js +4 -2
- 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 +1 -2
- 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 +3 -4
- package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridRow.js +1 -2
- 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 +1 -2
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +4 -5
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
- 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 +1 -2
- 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 +1 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -4
- 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 +4 -5
- 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 +1 -2
- 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 +3 -4
- 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 +3 -4
- package/lib/components/Datagrid/useSkeletonRows.js +1 -2
- package/lib/components/Datagrid/useSortableColumns.js +1 -2
- 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 +30 -20
- 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 +2 -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/addons/_RowSizeDropdown.scss +5 -0
- package/scss/components/_index.scss +2 -1
@@ -0,0 +1,297 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.Checklist = void 0;
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
15
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
16
|
+
var _devtools = require("../../global/js/utils/devtools");
|
17
|
+
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
18
|
+
var _settings = require("../../settings");
|
19
|
+
var _react2 = require("@carbon/react");
|
20
|
+
var _icons = require("@carbon/react/icons");
|
21
|
+
var _ChecklistIcon = require("./ChecklistIcon");
|
22
|
+
var _ChecklistChart = require("./ChecklistChart");
|
23
|
+
var _excluded = ["chartValue", "chartLabel", "checklistAriaLabel", "checklistToggleAriaLabel", "className", "onClickViewAll", "onToggle", "open", "showToggle", "taskLists", "theme", "title", "toggleLabel", "toggleLabelAlign", "viewAllLabel"];
|
24
|
+
/**
|
25
|
+
* Copyright IBM Corp. 2023, 2023
|
26
|
+
*
|
27
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
29
|
+
*/
|
30
|
+
/**
|
31
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
32
|
+
* See
|
33
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
34
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
35
|
+
*/
|
36
|
+
// Import portions of React that are needed.
|
37
|
+
// Other standard imports.
|
38
|
+
// Carbon and package components we use.
|
39
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
40
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
41
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
42
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--checklist");
|
43
|
+
var componentName = 'Checklist';
|
44
|
+
|
45
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
46
|
+
|
47
|
+
// Default values can be included here and then assigned to the prop params,
|
48
|
+
// e.g. prop = defaults.prop,
|
49
|
+
// This gathers default values together neatly and ensures non-primitive
|
50
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
51
|
+
// Note that default values are not required for props that are 'required',
|
52
|
+
// nor for props where the component can apply undefined values reasonably.
|
53
|
+
// Default values should be provided when the component needs to make a choice
|
54
|
+
// or assumption when a prop is not supplied.
|
55
|
+
|
56
|
+
// Default values for props
|
57
|
+
var defaults = {
|
58
|
+
checklistAriaLabel: 'Checklist',
|
59
|
+
checklistToggleAriaLabel: 'Checklist toggle',
|
60
|
+
onClickViewAll: function onClickViewAll() {},
|
61
|
+
onToggle: function onToggle() {},
|
62
|
+
open: true,
|
63
|
+
showToggle: true,
|
64
|
+
taskLists: [],
|
65
|
+
theme: 'light',
|
66
|
+
toggleLabel: 'Toggle',
|
67
|
+
toggleLabelAlign: 'top'
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
* The Checklist tracks a user's progress much like Your Learning or
|
72
|
+
* WalkMe. Each item in the list can be clickable, and each item has
|
73
|
+
* an icon that defines the item's state as "not started", "in progress",
|
74
|
+
* and "complete".
|
75
|
+
*/
|
76
|
+
var Checklist = exports.Checklist = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
77
|
+
var chartValue = _ref.chartValue,
|
78
|
+
chartLabel = _ref.chartLabel,
|
79
|
+
_ref$checklistAriaLab = _ref.checklistAriaLabel,
|
80
|
+
checklistAriaLabel = _ref$checklistAriaLab === void 0 ? defaults.checklistAriaLabel : _ref$checklistAriaLab,
|
81
|
+
_ref$checklistToggleA = _ref.checklistToggleAriaLabel,
|
82
|
+
checklistToggleAriaLabel = _ref$checklistToggleA === void 0 ? defaults.checklistToggleAriaLabel : _ref$checklistToggleA,
|
83
|
+
className = _ref.className,
|
84
|
+
_ref$onClickViewAll = _ref.onClickViewAll,
|
85
|
+
onClickViewAll = _ref$onClickViewAll === void 0 ? defaults.onClickViewAll : _ref$onClickViewAll,
|
86
|
+
_ref$onToggle = _ref.onToggle,
|
87
|
+
onToggle = _ref$onToggle === void 0 ? defaults.onToggle : _ref$onToggle,
|
88
|
+
_ref$open = _ref.open,
|
89
|
+
open = _ref$open === void 0 ? defaults.open : _ref$open,
|
90
|
+
_ref$showToggle = _ref.showToggle,
|
91
|
+
showToggle = _ref$showToggle === void 0 ? defaults.showToggle : _ref$showToggle,
|
92
|
+
_ref$taskLists = _ref.taskLists,
|
93
|
+
taskLists = _ref$taskLists === void 0 ? defaults.taskLists : _ref$taskLists,
|
94
|
+
_ref$theme = _ref.theme,
|
95
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
96
|
+
title = _ref.title,
|
97
|
+
_ref$toggleLabel = _ref.toggleLabel,
|
98
|
+
toggleLabel = _ref$toggleLabel === void 0 ? defaults.toggleLabel : _ref$toggleLabel,
|
99
|
+
_ref$toggleLabelAlign = _ref.toggleLabelAlign,
|
100
|
+
toggleLabelAlign = _ref$toggleLabelAlign === void 0 ? defaults.toggleLabelAlign : _ref$toggleLabelAlign,
|
101
|
+
viewAllLabel = _ref.viewAllLabel,
|
102
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
103
|
+
var _useState = (0, _react.useState)(open),
|
104
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
105
|
+
isOpen = _useState2[0],
|
106
|
+
setIsOpen = _useState2[1];
|
107
|
+
var listContainerId = (0, _react.useRef)((0, _uuidv.default)()).current;
|
108
|
+
var chartLabelId = (0, _react.useRef)((0, _uuidv.default)()).current;
|
109
|
+
|
110
|
+
// Don't use this test: {chartValue && chartLabel && (render...)}.
|
111
|
+
// If `chartValue` is 0 (zero) - a valid value - then it will render 0 and skip the remaining statement.
|
112
|
+
// Use this test instead: {chartLabelAndValue && (render...)}.
|
113
|
+
// The ChecklistChart component will validate `chartValue`.
|
114
|
+
var chartLabelAndValue = typeof chartValue === 'number' && chartLabel;
|
115
|
+
var handleClickToggle = function handleClickToggle() {
|
116
|
+
setIsOpen(function (prevOpen) {
|
117
|
+
return !prevOpen;
|
118
|
+
});
|
119
|
+
};
|
120
|
+
var handleClickViewAll = function handleClickViewAll() {
|
121
|
+
onClickViewAll();
|
122
|
+
};
|
123
|
+
|
124
|
+
// If state changes, then trigger callback.
|
125
|
+
(0, _react.useEffect)(function () {
|
126
|
+
onToggle(isOpen);
|
127
|
+
}, [isOpen, onToggle]);
|
128
|
+
|
129
|
+
// If the "open" prop is changed after initialization,
|
130
|
+
// then update internal state.
|
131
|
+
(0, _react.useEffect)(function () {
|
132
|
+
setIsOpen(open);
|
133
|
+
}, [open]);
|
134
|
+
return /*#__PURE__*/_react.default.createElement("aside", (0, _extends2.default)({}, rest, {
|
135
|
+
"aria-label": checklistAriaLabel,
|
136
|
+
className: (0, _classnames.default)(blockClass,
|
137
|
+
// Apply the block class to the main HTML element
|
138
|
+
className, // Apply any supplied class names to the main HTML element.
|
139
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
140
|
+
(0, _defineProperty2.default)({}, "".concat(blockClass, "__closed"), !isOpen)),
|
141
|
+
ref: ref
|
142
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), (title || chartLabelAndValue) && /*#__PURE__*/_react.default.createElement("header", {
|
143
|
+
className: "".concat(blockClass, "__header")
|
144
|
+
}, chartLabelAndValue && /*#__PURE__*/_react.default.createElement(_ChecklistChart.ChecklistChart, {
|
145
|
+
"aria-labelledby": chartLabelId,
|
146
|
+
theme: theme,
|
147
|
+
value: chartValue
|
148
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
149
|
+
className: "".concat(blockClass, "__titles")
|
150
|
+
}, title && /*#__PURE__*/_react.default.createElement("h2", {
|
151
|
+
className: "".concat(blockClass, "__title")
|
152
|
+
}, title), chartLabelAndValue && /*#__PURE__*/_react.default.createElement("h3", {
|
153
|
+
id: chartLabelId,
|
154
|
+
className: "".concat(blockClass, "__chart-label")
|
155
|
+
}, chartLabel)), showToggle && /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
|
156
|
+
align: toggleLabelAlign,
|
157
|
+
"aria-controls": listContainerId,
|
158
|
+
"aria-expanded": isOpen,
|
159
|
+
"aria-label": checklistToggleAriaLabel,
|
160
|
+
className: "".concat(blockClass, "__toggle"),
|
161
|
+
kind: "ghost",
|
162
|
+
label: toggleLabel,
|
163
|
+
onClick: handleClickToggle,
|
164
|
+
size: "sm"
|
165
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.ChevronUp, {
|
166
|
+
size: 16,
|
167
|
+
className: (0, _classnames.default)("".concat(blockClass, "__chevron"))
|
168
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
169
|
+
id: listContainerId,
|
170
|
+
className: "".concat(blockClass, "__content-outer")
|
171
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
172
|
+
className: "".concat(blockClass, "__content-inner")
|
173
|
+
}, /*#__PURE__*/_react.default.createElement("section", {
|
174
|
+
className: (0, _classnames.default)("".concat(blockClass, "__body"))
|
175
|
+
}, taskLists.map(function (list, index) {
|
176
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
177
|
+
className: "".concat(blockClass, "__list-group"),
|
178
|
+
key: "".concat(list.title, "-").concat(index)
|
179
|
+
}, list.title && /*#__PURE__*/_react.default.createElement("h3", {
|
180
|
+
title: list.title,
|
181
|
+
className: "".concat(blockClass, "__list-title")
|
182
|
+
}, list.title), /*#__PURE__*/_react.default.createElement("ol", {
|
183
|
+
className: "".concat(blockClass, "__list")
|
184
|
+
}, list.tasks.map(function (item, index) {
|
185
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
186
|
+
className: "".concat(blockClass, "__list-item"),
|
187
|
+
key: "".concat(item.label, "-").concat(index)
|
188
|
+
}, /*#__PURE__*/_react.default.createElement(_ChecklistIcon.ChecklistIcon, {
|
189
|
+
kind: item.kind
|
190
|
+
}), typeof item.onClick === 'function' ? /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
191
|
+
className: (0, _classnames.default)("".concat(blockClass, "__button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__button--error"), item.kind === 'error')),
|
192
|
+
onClick: function onClick() {
|
193
|
+
item.onClick(item);
|
194
|
+
},
|
195
|
+
size: "sm",
|
196
|
+
title: item.label
|
197
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, item.label)) : /*#__PURE__*/_react.default.createElement("div", {
|
198
|
+
className: (0, _classnames.default)("".concat(blockClass, "__label"), "".concat(blockClass, "__label--").concat(item.kind)),
|
199
|
+
title: item.label
|
200
|
+
}, item.label));
|
201
|
+
})));
|
202
|
+
})), viewAllLabel && /*#__PURE__*/_react.default.createElement("footer", {
|
203
|
+
className: "".concat(blockClass, "__footer")
|
204
|
+
}, /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
205
|
+
className: (0, _classnames.default)("".concat(blockClass, "__button"), "".concat(blockClass, "__view-all")),
|
206
|
+
onClick: handleClickViewAll,
|
207
|
+
size: "sm"
|
208
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, viewAllLabel))))));
|
209
|
+
});
|
210
|
+
|
211
|
+
// Return a placeholder if not released and not enabled by feature flag
|
212
|
+
exports.Checklist = Checklist = _settings.pkg.checkComponentEnabled(Checklist, componentName);
|
213
|
+
Checklist.displayName = componentName;
|
214
|
+
|
215
|
+
// The types and DocGen commentary for the component props,
|
216
|
+
// in alphabetical order (for consistency).
|
217
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
218
|
+
Checklist.propTypes = {
|
219
|
+
/**
|
220
|
+
* Define both `chartLabel` and `chartValue` to show the chart and its label together.
|
221
|
+
*/
|
222
|
+
chartLabel: _propTypes.default.string,
|
223
|
+
/**
|
224
|
+
* A number between 0 and 1.
|
225
|
+
*
|
226
|
+
* Define both `chartLabel` and `chartValue` to show the chart and its label together.
|
227
|
+
*/
|
228
|
+
chartValue: _propTypes.default.number,
|
229
|
+
/**
|
230
|
+
* Aria-label for the Checklist component.
|
231
|
+
*/
|
232
|
+
checklistAriaLabel: _propTypes.default.string,
|
233
|
+
/**
|
234
|
+
* Aria-label for the Checklist's toggle component.
|
235
|
+
*/
|
236
|
+
checklistToggleAriaLabel: _propTypes.default.string,
|
237
|
+
/**
|
238
|
+
* Provide an optional class to be applied to the containing node.
|
239
|
+
*/
|
240
|
+
className: _propTypes.default.string,
|
241
|
+
/**
|
242
|
+
* Callback for the "View all" button. See also `viewAllLabel`.
|
243
|
+
*/
|
244
|
+
onClickViewAll: _propTypes.default.func,
|
245
|
+
/**
|
246
|
+
* Optional callback for when the list is opened/closed.
|
247
|
+
*/
|
248
|
+
onToggle: _propTypes.default.func,
|
249
|
+
/**
|
250
|
+
* Specifies whether the component is opened or closed.
|
251
|
+
* This can be set during initialization, or changed after being rendered.
|
252
|
+
*/
|
253
|
+
open: _propTypes.default.bool,
|
254
|
+
/**
|
255
|
+
* Whether or not to show the open/close toggle.
|
256
|
+
*/
|
257
|
+
showToggle: _propTypes.default.bool,
|
258
|
+
/**
|
259
|
+
* The task list can be broken down into sub-lists.
|
260
|
+
*
|
261
|
+
* Each sub-list can include an optional `title`.
|
262
|
+
*
|
263
|
+
* Each task must specify the appropriate icon (`kind`) and `label`.
|
264
|
+
*
|
265
|
+
* If any task has an `onClick` callback function defined,
|
266
|
+
* then the `label` will be rendered as a button,
|
267
|
+
* else the `label` will be rendered as plain text.
|
268
|
+
*/
|
269
|
+
taskLists: _propTypes.default.arrayOf(_propTypes.default.shape({
|
270
|
+
title: _propTypes.default.string,
|
271
|
+
tasks: _propTypes.default.arrayOf(_propTypes.default.shape({
|
272
|
+
kind: _propTypes.default.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']).isRequired,
|
273
|
+
label: _propTypes.default.string.isRequired,
|
274
|
+
onClick: _propTypes.default.func
|
275
|
+
})).isRequired
|
276
|
+
})).isRequired,
|
277
|
+
/**
|
278
|
+
* Determines the theme of the component.
|
279
|
+
*/
|
280
|
+
theme: _propTypes.default.oneOf(['light', 'dark']),
|
281
|
+
/**
|
282
|
+
* The title of the component.
|
283
|
+
*/
|
284
|
+
title: _propTypes.default.string,
|
285
|
+
/**
|
286
|
+
* The label for the toggle's tooltip.
|
287
|
+
*/
|
288
|
+
toggleLabel: _propTypes.default.string,
|
289
|
+
/**
|
290
|
+
* The alignment of the toggle's tooltip.
|
291
|
+
*/
|
292
|
+
toggleLabelAlign: _propTypes.default.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
|
293
|
+
/**
|
294
|
+
* If defined, will show and enable the "View all (#)" button at the bottom of the list.
|
295
|
+
*/
|
296
|
+
viewAllLabel: _propTypes.default.string
|
297
|
+
};
|
@@ -0,0 +1,99 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.ChecklistChart = void 0;
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
|
+
var _devtools = require("../../global/js/utils/devtools");
|
14
|
+
var _settings = require("../../settings");
|
15
|
+
var _clamp = _interopRequireDefault(require("lodash/clamp"));
|
16
|
+
var _excluded = ["className", "value", "theme"];
|
17
|
+
/**
|
18
|
+
* Copyright IBM Corp. 2023, 2023
|
19
|
+
*
|
20
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
22
|
+
*/
|
23
|
+
/**
|
24
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
25
|
+
* See
|
26
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
27
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
28
|
+
*/
|
29
|
+
// Import portions of React that are needed.
|
30
|
+
// Other standard imports.
|
31
|
+
// Carbon and package components we use.
|
32
|
+
/* TODO: @import(s) of carbon components and other package components. */ // The block part of our conventional BEM class names (blockClass__E--M).
|
33
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--checklist__chart");
|
34
|
+
var componentName = 'ChecklistChart';
|
35
|
+
|
36
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
37
|
+
|
38
|
+
// Default values can be included here and then assigned to the prop params,
|
39
|
+
// e.g. prop = defaults.prop,
|
40
|
+
// This gathers default values together neatly and ensures non-primitive
|
41
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
42
|
+
// Note that default values are not required for props that are 'required',
|
43
|
+
// nor for props where the component can apply undefined values reasonably.
|
44
|
+
// Default values should be provided when the component needs to make a choice
|
45
|
+
// or assumption when a prop is not supplied.
|
46
|
+
|
47
|
+
// Default values for props
|
48
|
+
var defaults = {
|
49
|
+
theme: 'light'
|
50
|
+
};
|
51
|
+
|
52
|
+
/**
|
53
|
+
* TODO: A description of the component.
|
54
|
+
*/
|
55
|
+
var ChecklistChart = exports.ChecklistChart = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
56
|
+
var className = _ref.className,
|
57
|
+
value = _ref.value,
|
58
|
+
_ref$theme = _ref.theme,
|
59
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
60
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
61
|
+
var numDegrees = (0, _clamp.default)(value * 360, 0, 360);
|
62
|
+
var circleColor = theme === 'light' ? '#e0e0e0' : '#525252'; // $ui-03 (-ish)
|
63
|
+
var progressColor = theme === 'light' ? '#a56eff' : '#a56eff'; // $purple-50
|
64
|
+
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
66
|
+
className: (0, _classnames.default)(blockClass, className),
|
67
|
+
style: {
|
68
|
+
backgroundImage: "conic-gradient(".concat(progressColor, " ").concat(numDegrees, "deg, ").concat(circleColor, " ").concat(numDegrees, "deg 360deg)"),
|
69
|
+
borderRadius: '50%'
|
70
|
+
},
|
71
|
+
ref: ref,
|
72
|
+
role: "img"
|
73
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)));
|
74
|
+
});
|
75
|
+
|
76
|
+
// Return a placeholder if not released and not enabled by feature flag
|
77
|
+
// ChecklistChart = pkg.checkComponentEnabled(ChecklistChart, componentName);
|
78
|
+
|
79
|
+
// The display name of the component, used by React. Note that displayName
|
80
|
+
// is used in preference to relying on function.name.
|
81
|
+
// ChecklistChart.displayName = componentName;
|
82
|
+
|
83
|
+
// The types and DocGen commentary for the component props,
|
84
|
+
// in alphabetical order (for consistency).
|
85
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
86
|
+
ChecklistChart.propTypes = {
|
87
|
+
/**
|
88
|
+
* Optional class name for this component.
|
89
|
+
*/
|
90
|
+
className: _propTypes.default.string,
|
91
|
+
/**
|
92
|
+
* Determines the theme of the component.
|
93
|
+
*/
|
94
|
+
theme: _propTypes.default.oneOf(['light', 'dark']),
|
95
|
+
/**
|
96
|
+
* Number between 0 and 1.
|
97
|
+
*/
|
98
|
+
value: _propTypes.default.number.isRequired
|
99
|
+
};
|
@@ -0,0 +1,109 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.ChecklistIcon = void 0;
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
|
+
var _devtools = require("../../global/js/utils/devtools");
|
14
|
+
var _settings = require("../../settings");
|
15
|
+
var _icons = require("@carbon/react/icons");
|
16
|
+
var _excluded = ["className", "kind", "theme"];
|
17
|
+
/**
|
18
|
+
* Copyright IBM Corp. 2023, 2023
|
19
|
+
*
|
20
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
22
|
+
*/
|
23
|
+
/**
|
24
|
+
* TODO: Breakdown titles, icons, clickable items into sub-components
|
25
|
+
* See
|
26
|
+
* ModifiedTabs (ModifiedTabLabelNew, ModifiedTabLabelWithClose)
|
27
|
+
* PageHeader (PageHeaderTitle, PageHeaderUtils)
|
28
|
+
*/
|
29
|
+
// Import portions of React that are needed.
|
30
|
+
// Other standard imports.
|
31
|
+
// Carbon and package components we use.
|
32
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
33
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
34
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--checklist__icon");
|
35
|
+
var componentName = 'ChecklistIcon';
|
36
|
+
|
37
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
38
|
+
|
39
|
+
// Default values can be included here and then assigned to the prop params,
|
40
|
+
// e.g. prop = defaults.prop,
|
41
|
+
// This gathers default values together neatly and ensures non-primitive
|
42
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
43
|
+
// Note that default values are not required for props that are 'required',
|
44
|
+
// nor for props where the component can apply undefined values reasonably.
|
45
|
+
// Default values should be provided when the component needs to make a choice
|
46
|
+
// or assumption when a prop is not supplied.
|
47
|
+
|
48
|
+
// Default values for props
|
49
|
+
var defaults = {
|
50
|
+
theme: 'light'
|
51
|
+
};
|
52
|
+
|
53
|
+
/**
|
54
|
+
* TODO: A description of the component.
|
55
|
+
*/
|
56
|
+
var ChecklistIcon = exports.ChecklistIcon = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
57
|
+
var className = _ref.className,
|
58
|
+
kind = _ref.kind,
|
59
|
+
_ref$theme = _ref.theme,
|
60
|
+
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
61
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
62
|
+
var Icon;
|
63
|
+
switch (kind) {
|
64
|
+
case 'error':
|
65
|
+
Icon = _icons.Warning;
|
66
|
+
break;
|
67
|
+
case 'indeterminate':
|
68
|
+
Icon = _icons.Incomplete;
|
69
|
+
break;
|
70
|
+
case 'checked':
|
71
|
+
Icon = _icons.CheckmarkOutline;
|
72
|
+
break;
|
73
|
+
default:
|
74
|
+
// "unchecked" or "disabled"
|
75
|
+
Icon = _icons.CircleDash;
|
76
|
+
break;
|
77
|
+
}
|
78
|
+
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, rest, {
|
79
|
+
className: (0, _classnames.default)(blockClass, className, "".concat(blockClass, "--").concat(kind), "".concat(blockClass, "__").concat(theme)),
|
80
|
+
ref: ref
|
81
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(Icon, {
|
82
|
+
size: 16
|
83
|
+
}));
|
84
|
+
});
|
85
|
+
|
86
|
+
// Return a placeholder if not released and not enabled by feature flag
|
87
|
+
// ChecklistIcon = pkg.checkComponentEnabled(ChecklistIcon, componentName);
|
88
|
+
|
89
|
+
// The display name of the component, used by React. Note that displayName
|
90
|
+
// is used in preference to relying on function.name.
|
91
|
+
// ChecklistIcon.displayName = componentName;
|
92
|
+
|
93
|
+
// The types and DocGen commentary for the component props,
|
94
|
+
// in alphabetical order (for consistency).
|
95
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
96
|
+
ChecklistIcon.propTypes = {
|
97
|
+
/**
|
98
|
+
* Provide an optional class to be applied to the containing node.
|
99
|
+
*/
|
100
|
+
className: _propTypes.default.string,
|
101
|
+
/**
|
102
|
+
* The icon to be displayed.
|
103
|
+
*/
|
104
|
+
kind: _propTypes.default.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']),
|
105
|
+
/**
|
106
|
+
* Determines the theme of the component.
|
107
|
+
*/
|
108
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
109
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "Checklist", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _Checklist.Checklist;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _Checklist = require("./Checklist");
|
@@ -26,8 +26,8 @@ var _excluded = ["children", "className", "overflowMenu"],
|
|
26
26
|
* This source code is licensed under the Apache-2.0 license found in the
|
27
27
|
* LICENSE file in the root directory of this source tree.
|
28
28
|
*/
|
29
|
-
function _getRequireWildcardCache(
|
30
|
-
function _interopRequireWildcard(
|
29
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
30
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
31
31
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
32
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
33
33
|
var blockClass = 'security--combo-button';
|
@@ -36,7 +36,7 @@ var componentName = 'ComboButton';
|
|
36
36
|
/**
|
37
37
|
* The combo button consolidates similar actions, while exposing the most commonly used one.
|
38
38
|
*/
|
39
|
-
var ComboButton = function ComboButton(_ref) {
|
39
|
+
var ComboButton = exports.ComboButton = function ComboButton(_ref) {
|
40
40
|
var children = _ref.children,
|
41
41
|
className = _ref.className,
|
42
42
|
overflowMenu = _ref.overflowMenu,
|
@@ -100,7 +100,6 @@ var ComboButton = function ComboButton(_ref) {
|
|
100
100
|
}));
|
101
101
|
})));
|
102
102
|
};
|
103
|
-
exports.ComboButton = ComboButton;
|
104
103
|
ComboButton.deprecated = {
|
105
104
|
level: 'warn',
|
106
105
|
details: "Please replace ".concat(componentName, " with Carbon's ComboButton")
|
@@ -19,11 +19,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
19
19
|
/**
|
20
20
|
* The combo button item provides additional actions a user can take.
|
21
21
|
*/
|
22
|
-
var ComboButtonItem = function ComboButtonItem(_ref) {
|
22
|
+
var ComboButtonItem = exports.ComboButtonItem = function ComboButtonItem(_ref) {
|
23
23
|
var rest = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_ref), _ref));
|
24
24
|
return /*#__PURE__*/_react.default.createElement("span", rest);
|
25
25
|
};
|
26
|
-
exports.ComboButtonItem = ComboButtonItem;
|
27
26
|
ComboButtonItem.propTypes = {
|
28
27
|
/** Provide the contents of the `ComboButtonItem` */
|
29
28
|
children: _propTypes.node.isRequired,
|
@@ -9,8 +9,8 @@ exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
10
10
|
var _StoryDocsPage = require("../../global/js/utils/StoryDocsPage");
|
11
11
|
var stories = _interopRequireWildcard(require("./CreateFullPage.stories"));
|
12
|
-
function _getRequireWildcardCache(
|
13
|
-
function _interopRequireWildcard(
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
14
14
|
var DocsPage = function DocsPage() {
|
15
15
|
return /*#__PURE__*/_react.default.createElement(_StoryDocsPage.StoryDocsPage, {
|
16
16
|
altGuidelinesHref: "https://pages.github.ibm.com/cdai-design/pal/patterns/creation-flows/usage#full-page",
|
@@ -52,5 +52,4 @@ var DocsPage = function DocsPage() {
|
|
52
52
|
}]
|
53
53
|
});
|
54
54
|
};
|
55
|
-
var _default = DocsPage;
|
56
|
-
exports.default = _default;
|
55
|
+
var _default = exports.default = DocsPage;
|
@@ -31,20 +31,19 @@ var _excluded = ["breadcrumbsOverflowAriaLabel", "breadcrumbs", "backButtonText"
|
|
31
31
|
// Import portions of React that are needed.
|
32
32
|
// Other standard imports.
|
33
33
|
// Carbon and package components we use.
|
34
|
-
function _getRequireWildcardCache(
|
35
|
-
function _interopRequireWildcard(
|
34
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
35
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
36
36
|
var blockClass = "".concat(_settings.pkg.prefix, "--create-full-page");
|
37
37
|
var componentName = 'CreateFullPage';
|
38
38
|
|
39
39
|
// This is a general context for the steps container
|
40
40
|
// containing information about the state of the container
|
41
41
|
// and providing some callback methods for steps to use
|
42
|
-
var StepsContext = /*#__PURE__*/(0, _react.createContext)(null);
|
42
|
+
var StepsContext = exports.StepsContext = /*#__PURE__*/(0, _react.createContext)(null);
|
43
43
|
|
44
44
|
// This is a context supplied separately to each step in the container
|
45
45
|
// to let it know what number it is in the sequence of steps
|
46
|
-
exports.
|
47
|
-
var StepNumberContext = /*#__PURE__*/(0, _react.createContext)(-1);
|
46
|
+
var StepNumberContext = exports.StepNumberContext = /*#__PURE__*/(0, _react.createContext)(-1);
|
48
47
|
|
49
48
|
/**
|
50
49
|
* Use with creations that must be completed in order for a service to be usable.
|
@@ -58,8 +57,7 @@ on the Carbon's grid system
|
|
58
57
|
include `<Row>` and `<Column>` components inside of each `CreateFullPageStep`
|
59
58
|
component to get the desired affect.
|
60
59
|
*/
|
61
|
-
exports.
|
62
|
-
var CreateFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
60
|
+
var CreateFullPage = exports.CreateFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
63
61
|
var breadcrumbsOverflowAriaLabel = _ref.breadcrumbsOverflowAriaLabel,
|
64
62
|
breadcrumbs = _ref.breadcrumbs,
|
65
63
|
backButtonText = _ref.backButtonText,
|
@@ -283,7 +281,6 @@ var CreateFullPage = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
283
281
|
});
|
284
282
|
|
285
283
|
// Return a placeholder if not released and not enabled by feature flag.
|
286
|
-
exports.CreateFullPage = CreateFullPage;
|
287
284
|
exports.CreateFullPage = CreateFullPage = _settings.pkg.checkComponentEnabled(CreateFullPage, componentName);
|
288
285
|
|
289
286
|
// The display name of the component, used by React. Note that displayName
|