@itwin/itwinui-react 3.0.0-dev.1 → 3.0.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +277 -1
- package/cjs/core/Alert/Alert.d.ts +57 -27
- package/cjs/core/Alert/Alert.js +156 -53
- package/cjs/core/Alert/index.js +9 -4
- package/cjs/core/Avatar/Avatar.d.ts +6 -9
- package/cjs/core/Avatar/Avatar.js +63 -49
- package/cjs/core/Avatar/index.d.ts +1 -1
- package/cjs/core/Avatar/index.js +10 -6
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +1 -5
- package/cjs/core/AvatarGroup/AvatarGroup.js +65 -58
- package/cjs/core/AvatarGroup/index.d.ts +1 -1
- package/cjs/core/AvatarGroup/index.js +10 -6
- package/cjs/core/Backdrop/Backdrop.d.ts +1 -1
- package/cjs/core/Backdrop/Backdrop.js +16 -33
- package/cjs/core/Backdrop/index.js +9 -4
- package/cjs/core/Badge/Badge.d.ts +1 -1
- package/cjs/core/Badge/Badge.js +39 -47
- package/cjs/core/Badge/index.js +9 -4
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +149 -63
- package/cjs/core/Breadcrumbs/index.js +9 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/cjs/core/ButtonGroup/ButtonGroup.js +64 -52
- package/cjs/core/ButtonGroup/index.js +9 -4
- package/cjs/core/Buttons/Button/Button.d.ts +16 -3
- package/cjs/core/Buttons/Button/Button.js +57 -36
- package/cjs/core/Buttons/Button/index.js +9 -4
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +2 -2
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +50 -54
- package/cjs/core/Buttons/DropdownButton/index.js +9 -4
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +6 -2
- package/cjs/core/Buttons/IconButton/IconButton.js +50 -40
- package/cjs/core/Buttons/IconButton/index.js +9 -4
- package/cjs/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +20 -30
- package/cjs/core/Buttons/IdeasButton/index.js +9 -4
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +13 -4
- package/cjs/core/Buttons/SplitButton/SplitButton.js +102 -49
- package/cjs/core/Buttons/SplitButton/index.js +9 -4
- package/cjs/core/Buttons/index.js +43 -13
- package/cjs/core/Carousel/Carousel.d.ts +9 -7
- package/cjs/core/Carousel/Carousel.js +109 -109
- package/cjs/core/Carousel/CarouselContext.js +4 -26
- package/cjs/core/Carousel/CarouselDot.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDot.js +23 -37
- package/cjs/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDotsList.js +129 -97
- package/cjs/core/Carousel/CarouselNavigation.d.ts +8 -6
- package/cjs/core/Carousel/CarouselNavigation.js +97 -68
- package/cjs/core/Carousel/CarouselSlide.d.ts +1 -1
- package/cjs/core/Carousel/CarouselSlide.js +39 -46
- package/cjs/core/Carousel/CarouselSlider.js +66 -76
- package/cjs/core/Carousel/index.js +9 -4
- package/cjs/core/Checkbox/Checkbox.d.ts +9 -5
- package/cjs/core/Checkbox/Checkbox.js +88 -60
- package/cjs/core/Checkbox/index.js +9 -4
- package/cjs/core/ColorPicker/ColorBuilder.js +290 -201
- package/cjs/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +393 -284
- package/cjs/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorPalette.js +124 -115
- package/cjs/core/ColorPicker/ColorPicker.d.ts +10 -6
- package/cjs/core/ColorPicker/ColorPicker.js +85 -85
- package/cjs/core/ColorPicker/ColorPickerContext.js +11 -31
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +30 -39
- package/cjs/core/ColorPicker/index.js +43 -13
- package/cjs/core/ComboBox/ComboBox.d.ts +13 -8
- package/cjs/core/ComboBox/ComboBox.js +403 -301
- package/cjs/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +27 -43
- package/cjs/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxInput.js +208 -151
- package/cjs/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +35 -34
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxMenu.js +89 -77
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +73 -42
- package/cjs/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMultipleContainer.js +13 -32
- package/cjs/core/ComboBox/helpers.d.ts +7 -5
- package/cjs/core/ComboBox/helpers.js +47 -66
- package/cjs/core/ComboBox/index.js +9 -4
- package/cjs/core/DatePicker/DatePicker.d.ts +41 -10
- package/cjs/core/DatePicker/DatePicker.js +567 -357
- package/cjs/core/DatePicker/index.js +15 -5
- package/cjs/core/Dialog/Dialog.d.ts +1 -1
- package/cjs/core/Dialog/Dialog.js +65 -61
- package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/cjs/core/Dialog/DialogBackdrop.js +47 -52
- package/cjs/core/Dialog/DialogButtonBar.js +3 -3
- package/cjs/core/Dialog/DialogContent.d.ts +2 -1
- package/cjs/core/Dialog/DialogContent.js +28 -4
- package/cjs/core/Dialog/DialogContext.d.ts +11 -1
- package/cjs/core/Dialog/DialogContext.js +5 -27
- package/cjs/core/Dialog/DialogDragContext.d.ts +1 -1
- package/cjs/core/Dialog/DialogDragContext.js +8 -30
- package/cjs/core/Dialog/DialogMain.d.ts +1 -1
- package/cjs/core/Dialog/DialogMain.js +183 -148
- package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBar.js +67 -45
- package/cjs/core/Dialog/DialogTitleBarTitle.js +3 -3
- package/cjs/core/Dialog/index.js +9 -4
- package/cjs/core/DropdownMenu/DropdownMenu.d.ts +8 -7
- package/cjs/core/DropdownMenu/DropdownMenu.js +82 -58
- package/cjs/core/DropdownMenu/index.js +9 -4
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +83 -21
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +254 -76
- package/cjs/core/ExpandableBlock/index.js +9 -4
- package/cjs/core/Fieldset/Fieldset.d.ts +1 -1
- package/cjs/core/Fieldset/Fieldset.js +25 -39
- package/cjs/core/Fieldset/index.js +9 -4
- package/cjs/core/FileUpload/FileEmptyCard.js +43 -42
- package/cjs/core/FileUpload/FileUpload.d.ts +8 -5
- package/cjs/core/FileUpload/FileUpload.js +90 -72
- package/cjs/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadCard.js +168 -109
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +2 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +52 -41
- package/cjs/core/FileUpload/index.js +35 -11
- package/cjs/core/Footer/Footer.d.ts +4 -4
- package/cjs/core/Footer/Footer.js +103 -89
- package/cjs/core/Footer/FooterItem.js +3 -3
- package/cjs/core/Footer/FooterList.js +3 -3
- package/cjs/core/Footer/FooterSeparator.js +8 -5
- package/cjs/core/Footer/index.js +15 -5
- package/cjs/core/Header/Header.d.ts +3 -22
- package/cjs/core/Header/Header.js +67 -48
- package/cjs/core/Header/HeaderBasicButton.js +24 -38
- package/cjs/core/Header/HeaderBreadcrumbs.d.ts +1 -1
- package/cjs/core/Header/HeaderBreadcrumbs.js +38 -39
- package/cjs/core/Header/HeaderButton.d.ts +5 -1
- package/cjs/core/Header/HeaderButton.js +76 -43
- package/cjs/core/Header/HeaderDropdownButton.js +48 -45
- package/cjs/core/Header/HeaderLogo.d.ts +1 -1
- package/cjs/core/Header/HeaderLogo.js +42 -36
- package/cjs/core/Header/HeaderSplitButton.js +66 -46
- package/cjs/core/Header/index.js +35 -11
- package/cjs/core/InformationPanel/InformationPanel.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanel.js +77 -70
- package/cjs/core/InformationPanel/InformationPanelBody.js +6 -4
- package/cjs/core/InformationPanel/InformationPanelContent.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanelContent.js +20 -33
- package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.js +34 -39
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -4
- package/cjs/core/InformationPanel/index.js +43 -13
- package/cjs/core/Input/Input.d.ts +10 -6
- package/cjs/core/Input/Input.js +18 -40
- package/cjs/core/Input/index.js +9 -4
- package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
- package/cjs/core/InputGrid/InputGrid.js +39 -0
- package/cjs/core/InputGrid/index.d.ts +3 -0
- package/cjs/core/{ProgressIndicators/ProgressLinear → InputGrid}/index.js +11 -6
- package/cjs/core/InputGroup/InputGroup.d.ts +14 -1
- package/cjs/core/InputGroup/InputGroup.js +72 -41
- package/cjs/core/InputGroup/index.js +9 -4
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
- package/cjs/core/InputWithDecorations/index.d.ts +3 -0
- package/cjs/core/InputWithDecorations/index.js +15 -0
- package/cjs/core/Label/Label.d.ts +6 -1
- package/cjs/core/Label/Label.js +32 -36
- package/cjs/core/Label/index.js +9 -4
- package/cjs/core/LabeledInput/LabeledInput.d.ts +23 -17
- package/cjs/core/LabeledInput/LabeledInput.js +72 -33
- package/cjs/core/LabeledInput/index.js +9 -4
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +18 -8
- package/cjs/core/LabeledSelect/LabeledSelect.js +75 -44
- package/cjs/core/LabeledSelect/index.js +9 -4
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +16 -7
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +17 -34
- package/cjs/core/LabeledTextarea/index.js +9 -4
- package/cjs/core/List/List.js +3 -3
- package/cjs/core/List/ListItem.d.ts +4 -4
- package/cjs/core/List/ListItem.js +55 -60
- package/cjs/core/List/index.js +16 -6
- package/cjs/core/Menu/Menu.d.ts +2 -2
- package/cjs/core/Menu/Menu.js +66 -79
- package/cjs/core/Menu/MenuDivider.d.ts +2 -1
- package/cjs/core/Menu/MenuDivider.js +5 -5
- package/cjs/core/Menu/MenuExtraContent.js +4 -4
- package/cjs/core/Menu/MenuItem.d.ts +2 -2
- package/cjs/core/Menu/MenuItem.js +168 -91
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +2 -2
- package/cjs/core/Menu/MenuItemSkeleton.js +53 -43
- package/cjs/core/Menu/index.js +43 -13
- package/cjs/core/Modal/Modal.d.ts +9 -10
- package/cjs/core/Modal/Modal.js +38 -43
- package/cjs/core/Modal/ModalButtonBar.js +7 -4
- package/cjs/core/Modal/ModalContent.js +3 -3
- package/cjs/core/Modal/index.js +23 -8
- package/cjs/core/NonIdealState/ErrorPage.d.ts +6 -7
- package/cjs/core/NonIdealState/ErrorPage.js +187 -146
- package/cjs/core/NonIdealState/NonIdealState.d.ts +17 -1
- package/cjs/core/NonIdealState/NonIdealState.js +77 -37
- package/cjs/core/NonIdealState/index.js +16 -6
- package/cjs/core/NotificationMarker/NotificationMarker.d.ts +1 -1
- package/cjs/core/NotificationMarker/NotificationMarker.js +29 -33
- package/cjs/core/NotificationMarker/index.js +9 -4
- package/cjs/core/Overlay/Overlay.d.ts +57 -0
- package/cjs/core/Overlay/Overlay.js +96 -0
- package/cjs/core/Overlay/index.d.ts +1 -0
- package/cjs/core/{ProgressIndicators/ProgressRadial → Overlay}/index.js +10 -6
- package/{esm/core/ProgressIndicators/ProgressLinear → cjs/core/ProgressIndicators}/ProgressLinear.d.ts +10 -6
- package/cjs/core/ProgressIndicators/ProgressLinear.js +72 -0
- package/cjs/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +4 -4
- package/cjs/core/ProgressIndicators/ProgressRadial.js +74 -0
- package/cjs/core/ProgressIndicators/index.d.ts +2 -2
- package/cjs/core/ProgressIndicators/index.js +16 -6
- package/cjs/core/Radio/Radio.d.ts +7 -4
- package/cjs/core/Radio/Radio.js +54 -42
- package/cjs/core/Radio/index.js +9 -4
- package/cjs/core/RadioTiles/RadioTile.d.ts +15 -4
- package/cjs/core/RadioTiles/RadioTile.js +80 -45
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +16 -31
- package/cjs/core/RadioTiles/index.js +16 -6
- package/cjs/core/SearchBox/SearchBox.d.ts +3 -3
- package/cjs/core/SearchBox/SearchBox.js +220 -128
- package/cjs/core/SearchBox/index.js +9 -4
- package/cjs/core/Select/Select.d.ts +12 -13
- package/cjs/core/Select/Select.js +272 -185
- package/cjs/core/Select/SelectTag.d.ts +1 -1
- package/cjs/core/Select/SelectTag.js +21 -34
- package/cjs/core/Select/SelectTagContainer.d.ts +1 -1
- package/cjs/core/Select/SelectTagContainer.js +30 -39
- package/cjs/core/Select/index.js +9 -4
- package/cjs/core/SideNavigation/SideNavigation.d.ts +17 -1
- package/cjs/core/SideNavigation/SideNavigation.js +138 -54
- package/cjs/core/SideNavigation/SidenavButton.d.ts +1 -1
- package/cjs/core/SideNavigation/SidenavButton.js +30 -33
- package/cjs/core/SideNavigation/SidenavSubmenu.js +23 -34
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +29 -35
- package/cjs/core/SideNavigation/index.js +35 -11
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +20 -33
- package/cjs/core/SkipToContentLink/index.js +9 -4
- package/cjs/core/Slider/Slider.d.ts +29 -9
- package/cjs/core/Slider/Slider.js +391 -230
- package/cjs/core/Slider/Thumb.d.ts +4 -4
- package/cjs/core/Slider/Thumb.js +112 -84
- package/cjs/core/Slider/Track.d.ts +4 -4
- package/cjs/core/Slider/Track.js +83 -76
- package/cjs/core/Slider/index.js +9 -4
- package/cjs/core/StatusMessage/StatusMessage.d.ts +13 -3
- package/cjs/core/StatusMessage/StatusMessage.js +36 -35
- package/cjs/core/StatusMessage/index.js +9 -4
- package/cjs/core/Stepper/Stepper.d.ts +29 -4
- package/cjs/core/Stepper/Stepper.js +80 -36
- package/cjs/core/Stepper/StepperStep.d.ts +18 -1
- package/cjs/core/Stepper/StepperStep.js +109 -63
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +39 -34
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +8 -3
- package/cjs/core/Stepper/WorkflowDiagramStep.js +39 -36
- package/cjs/core/Stepper/index.d.ts +0 -4
- package/cjs/core/Stepper/index.js +17 -10
- package/cjs/core/Surface/Surface.d.ts +2 -2
- package/cjs/core/Surface/Surface.js +78 -70
- package/cjs/core/Surface/index.js +9 -4
- package/cjs/core/Table/SubRowExpander.d.ts +2 -2
- package/cjs/core/Table/SubRowExpander.js +37 -37
- package/cjs/core/Table/Table.d.ts +18 -2
- package/cjs/core/Table/Table.js +764 -453
- package/cjs/core/Table/TableCell.d.ts +2 -2
- package/cjs/core/Table/TableCell.js +113 -88
- package/cjs/core/Table/TablePaginator.d.ts +3 -3
- package/cjs/core/Table/TablePaginator.js +310 -160
- package/cjs/core/Table/TableRowMemoized.d.ts +4 -4
- package/cjs/core/Table/TableRowMemoized.js +156 -115
- package/cjs/core/Table/actionHandlers/expandHandler.js +12 -12
- package/cjs/core/Table/actionHandlers/filterHandler.js +25 -18
- package/cjs/core/Table/actionHandlers/index.js +56 -14
- package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -13
- package/cjs/core/Table/actionHandlers/selectHandler.js +123 -96
- package/cjs/core/Table/cells/DefaultCell.d.ts +2 -2
- package/cjs/core/Table/cells/DefaultCell.js +48 -38
- package/cjs/core/Table/cells/EditableCell.d.ts +2 -2
- package/cjs/core/Table/cells/EditableCell.js +75 -74
- package/cjs/core/Table/cells/index.js +16 -6
- package/cjs/core/Table/columns/actionColumn.d.ts +3 -3
- package/cjs/core/Table/columns/actionColumn.js +97 -99
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -2
- package/cjs/core/Table/columns/expanderColumn.js +45 -54
- package/cjs/core/Table/columns/index.js +41 -11
- package/cjs/core/Table/columns/selectionColumn.d.ts +4 -4
- package/cjs/core/Table/columns/selectionColumn.js +57 -51
- package/cjs/core/Table/filters/BaseFilter.d.ts +2 -2
- package/cjs/core/Table/filters/BaseFilter.js +24 -38
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +9 -3
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +118 -75
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +6 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +120 -80
- package/cjs/core/Table/filters/FilterButtonBar.d.ts +3 -3
- package/cjs/core/Table/filters/FilterButtonBar.js +39 -41
- package/cjs/core/Table/filters/FilterToggle.d.ts +3 -3
- package/cjs/core/Table/filters/FilterToggle.js +61 -51
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +58 -53
- package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +40 -45
- package/cjs/core/Table/filters/customFilterFunctions.js +16 -14
- package/cjs/core/Table/filters/defaultFilterFunctions.js +86 -81
- package/cjs/core/Table/filters/index.js +35 -11
- package/cjs/core/Table/filters/tableFilters.d.ts +5 -5
- package/cjs/core/Table/filters/tableFilters.js +44 -54
- package/cjs/core/Table/filters/types.d.ts +2 -19
- package/cjs/core/Table/filters/types.js +2 -2
- package/cjs/core/Table/hooks/index.js +67 -19
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +101 -88
- package/cjs/core/Table/hooks/useExpanderCell.d.ts +1 -1
- package/cjs/core/Table/hooks/useExpanderCell.js +33 -47
- package/cjs/core/Table/hooks/useResizeColumns.js +362 -296
- package/cjs/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/cjs/core/Table/hooks/useScrollToRow.js +46 -61
- package/cjs/core/Table/hooks/useSelectionCell.js +17 -10
- package/cjs/core/Table/hooks/useStickyColumns.js +64 -64
- package/cjs/core/Table/hooks/useSubRowFiltering.js +95 -112
- package/cjs/core/Table/hooks/useSubRowSelection.js +32 -53
- package/cjs/core/Table/index.d.ts +1 -1
- package/cjs/core/Table/index.js +78 -18
- package/cjs/core/Table/utils.js +42 -40
- package/cjs/core/Tabs/Tab.d.ts +2 -2
- package/cjs/core/Tabs/Tab.js +50 -38
- package/cjs/core/Tabs/Tabs.d.ts +6 -42
- package/cjs/core/Tabs/Tabs.js +409 -368
- package/cjs/core/Tabs/index.d.ts +1 -1
- package/cjs/core/Tabs/index.js +17 -9
- package/cjs/core/Tag/Tag.d.ts +1 -1
- package/cjs/core/Tag/Tag.js +42 -40
- package/cjs/core/Tag/TagContainer.d.ts +1 -1
- package/cjs/core/Tag/TagContainer.js +23 -36
- package/cjs/core/Tag/index.js +16 -6
- package/cjs/core/Textarea/Textarea.d.ts +4 -5
- package/cjs/core/Textarea/Textarea.js +13 -42
- package/cjs/core/Textarea/index.js +9 -4
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeContext.js +4 -26
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +29 -10
- package/cjs/core/ThemeProvider/ThemeProvider.js +114 -57
- package/cjs/core/ThemeProvider/index.js +9 -4
- package/cjs/core/Tile/Tile.d.ts +200 -17
- package/cjs/core/Tile/Tile.js +495 -132
- package/cjs/core/Tile/index.js +9 -4
- package/cjs/core/TimePicker/TimePicker.d.ts +3 -3
- package/cjs/core/TimePicker/TimePicker.js +458 -259
- package/cjs/core/TimePicker/index.js +9 -4
- package/cjs/core/Toast/Toast.d.ts +20 -17
- package/cjs/core/Toast/Toast.js +206 -134
- package/cjs/core/Toast/Toaster.d.ts +26 -28
- package/cjs/core/Toast/Toaster.js +126 -153
- package/cjs/core/Toast/index.d.ts +1 -4
- package/cjs/core/Toast/index.js +10 -8
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +66 -53
- package/cjs/core/ToggleSwitch/index.js +9 -4
- package/cjs/core/Tooltip/Tooltip.d.ts +81 -14
- package/cjs/core/Tooltip/Tooltip.js +153 -41
- package/cjs/core/Tooltip/index.js +9 -4
- package/cjs/core/TransferList/TransferList.d.ts +6 -6
- package/cjs/core/TransferList/TransferList.js +176 -104
- package/cjs/core/TransferList/index.js +9 -4
- package/cjs/core/Tree/Tree.d.ts +5 -5
- package/cjs/core/Tree/Tree.js +205 -161
- package/cjs/core/Tree/TreeContext.d.ts +1 -1
- package/cjs/core/Tree/TreeContext.js +9 -31
- package/cjs/core/Tree/TreeNode.d.ts +2 -2
- package/cjs/core/Tree/TreeNode.js +207 -130
- package/cjs/core/Tree/TreeNodeExpander.d.ts +1 -1
- package/cjs/core/Tree/TreeNodeExpander.js +26 -37
- package/cjs/core/Tree/index.js +23 -8
- package/cjs/core/Typography/Anchor/Anchor.js +3 -3
- package/cjs/core/Typography/Anchor/index.js +9 -4
- package/cjs/core/Typography/Blockquote/Blockquote.d.ts +1 -1
- package/cjs/core/Typography/Blockquote/Blockquote.js +18 -35
- package/cjs/core/Typography/Blockquote/index.js +9 -4
- package/cjs/core/Typography/Code/Code.js +3 -3
- package/cjs/core/Typography/Code/index.js +9 -4
- package/cjs/core/Typography/Kbd/Kbd.d.ts +1 -1
- package/cjs/core/Typography/Kbd/Kbd.js +30 -46
- package/cjs/core/Typography/Kbd/index.js +15 -5
- package/cjs/core/Typography/Text/Text.d.ts +1 -1
- package/cjs/core/Typography/Text/Text.js +26 -38
- package/cjs/core/Typography/Text/index.js +9 -4
- package/cjs/core/Typography/index.js +50 -14
- package/cjs/core/index.d.ts +10 -8
- package/cjs/core/index.js +912 -187
- package/cjs/core/utils/color/ColorValue.d.ts +4 -4
- package/cjs/core/utils/color/ColorValue.js +535 -459
- package/cjs/core/utils/color/index.js +4 -17
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +20 -36
- package/cjs/core/utils/components/Box.js +3 -3
- package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
- package/cjs/core/utils/components/ButtonBase.js +46 -0
- package/cjs/core/utils/components/Divider.d.ts +1 -1
- package/cjs/core/utils/components/Divider.js +14 -33
- package/cjs/core/utils/components/Flex.d.ts +4 -4
- package/cjs/core/utils/components/Flex.js +93 -102
- package/cjs/core/utils/components/FocusTrap.d.ts +3 -3
- package/cjs/core/utils/components/FocusTrap.js +47 -60
- package/cjs/core/utils/components/Icon.d.ts +6 -1
- package/cjs/core/utils/components/Icon.js +32 -43
- package/cjs/core/utils/components/InputContainer.d.ts +4 -5
- package/cjs/core/utils/components/InputContainer.js +62 -49
- package/cjs/core/utils/components/InputFlexContainer.d.ts +2 -1
- package/cjs/core/utils/components/InputFlexContainer.js +24 -10
- package/cjs/core/utils/components/LinkAction.js +3 -3
- package/cjs/core/utils/components/MiddleTextTruncation.d.ts +2 -2
- package/cjs/core/utils/components/MiddleTextTruncation.js +32 -45
- package/cjs/core/utils/components/Popover.d.ts +113 -27
- package/cjs/core/utils/components/Popover.js +160 -147
- package/cjs/core/utils/components/Portal.d.ts +27 -0
- package/cjs/core/utils/components/Portal.js +43 -0
- package/cjs/core/utils/components/Resizer.d.ts +2 -2
- package/cjs/core/utils/components/Resizer.js +254 -210
- package/cjs/core/utils/components/VirtualScroll.d.ts +2 -2
- package/cjs/core/utils/components/VirtualScroll.js +303 -251
- package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -1
- package/cjs/core/utils/components/VisuallyHidden.js +14 -33
- package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/cjs/core/utils/components/WithCSSTransition.js +43 -48
- package/cjs/core/utils/components/index.d.ts +2 -0
- package/cjs/core/utils/components/index.js +20 -31
- package/cjs/core/utils/functions/colors.d.ts +1 -1
- package/cjs/core/utils/functions/colors.js +26 -35
- package/cjs/core/utils/functions/date.js +10 -10
- package/cjs/core/utils/functions/dev.d.ts +11 -0
- package/cjs/core/utils/functions/dev.js +34 -0
- package/cjs/core/utils/functions/dom.d.ts +0 -8
- package/cjs/core/utils/functions/dom.js +24 -40
- package/cjs/core/utils/functions/focusable.js +26 -17
- package/cjs/core/utils/functions/import.d.ts +6 -0
- package/cjs/core/utils/functions/import.js +61 -0
- package/cjs/core/utils/functions/index.d.ts +3 -0
- package/cjs/core/utils/functions/index.js +13 -23
- package/cjs/core/utils/functions/numbers.js +9 -9
- package/cjs/core/utils/functions/polymorphic.d.ts +5 -3
- package/cjs/core/utils/functions/polymorphic.js +43 -55
- package/cjs/core/utils/functions/react.d.ts +8 -0
- package/cjs/core/utils/functions/react.js +40 -0
- package/cjs/core/utils/functions/supports.js +5 -4
- package/cjs/core/utils/hooks/index.d.ts +1 -1
- package/cjs/core/utils/hooks/index.js +17 -30
- package/cjs/core/utils/hooks/useContainerWidth.js +26 -41
- package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
- package/cjs/core/utils/hooks/useControlledState.js +39 -0
- package/cjs/core/utils/hooks/useDragAndDrop.js +110 -111
- package/cjs/core/utils/hooks/useEventListener.js +22 -44
- package/cjs/core/utils/hooks/useGlobals.d.ts +9 -2
- package/cjs/core/utils/hooks/useGlobals.js +35 -54
- package/cjs/core/utils/hooks/useId.js +9 -31
- package/cjs/core/utils/hooks/useIntersection.js +30 -47
- package/cjs/core/utils/hooks/useIsClient.js +9 -31
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +6 -27
- package/cjs/core/utils/hooks/useLatestRef.js +9 -31
- package/cjs/core/utils/hooks/useMediaQuery.js +31 -55
- package/cjs/core/utils/hooks/useMergedRefs.js +15 -38
- package/cjs/core/utils/hooks/useOverflow.js +69 -79
- package/cjs/core/utils/hooks/useResizeObserver.js +22 -40
- package/cjs/core/utils/hooks/useSafeContext.js +9 -31
- package/cjs/core/utils/icons/StatusIconMap.d.ts +5 -5
- package/cjs/core/utils/icons/StatusIconMap.js +28 -34
- package/cjs/core/utils/icons/Svg.js +3 -3
- package/cjs/core/utils/icons/SvgCalendar.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCalendar.js +12 -29
- package/cjs/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCheckmark.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCheckmark.js +10 -29
- package/cjs/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +12 -29
- package/cjs/core/utils/icons/SvgChevronLeft.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronLeft.js +12 -29
- package/cjs/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +12 -29
- package/cjs/core/utils/icons/SvgChevronRight.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronRight.js +12 -29
- package/cjs/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +12 -29
- package/cjs/core/utils/icons/SvgClose.d.ts +1 -1
- package/cjs/core/utils/icons/SvgClose.js +12 -29
- package/cjs/core/utils/icons/SvgCloseSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCloseSmall.js +12 -29
- package/cjs/core/utils/icons/SvgColumnManager.d.ts +1 -1
- package/cjs/core/utils/icons/SvgColumnManager.js +12 -29
- package/cjs/core/utils/icons/SvgDocument.d.ts +1 -1
- package/cjs/core/utils/icons/SvgDocument.js +10 -29
- package/cjs/core/utils/icons/SvgFilter.d.ts +1 -1
- package/cjs/core/utils/icons/SvgFilter.js +10 -29
- package/cjs/core/utils/icons/SvgFilterHollow.d.ts +1 -1
- package/cjs/core/utils/icons/SvgFilterHollow.js +12 -29
- package/cjs/core/utils/icons/SvgImportantSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgImportantSmall.js +12 -29
- package/cjs/core/utils/icons/SvgInfoCircular.d.ts +1 -1
- package/cjs/core/utils/icons/SvgInfoCircular.js +12 -29
- package/cjs/core/utils/icons/SvgMore.d.ts +1 -1
- package/cjs/core/utils/icons/SvgMore.js +12 -29
- package/cjs/core/utils/icons/SvgMoreVertical.d.ts +1 -1
- package/cjs/core/utils/icons/SvgMoreVertical.js +12 -29
- package/cjs/core/utils/icons/SvgNew.d.ts +1 -1
- package/cjs/core/utils/icons/SvgNew.js +12 -29
- package/cjs/core/utils/icons/SvgSearch.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSearch.js +12 -29
- package/cjs/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSmileyHappy.js +12 -29
- package/cjs/core/utils/icons/SvgSortDown.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSortDown.js +12 -29
- package/cjs/core/utils/icons/SvgSortUp.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSortUp.js +12 -29
- package/cjs/core/utils/icons/SvgStatusError.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusError.js +12 -29
- package/cjs/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusSuccess.js +12 -29
- package/cjs/core/utils/icons/SvgStatusWarning.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusWarning.js +12 -29
- package/cjs/core/utils/icons/SvgSwap.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSwap.js +12 -29
- package/cjs/core/utils/icons/SvgUpload.d.ts +1 -1
- package/cjs/core/utils/icons/SvgUpload.js +12 -29
- package/cjs/core/utils/icons/index.js +34 -47
- package/cjs/core/utils/index.js +10 -23
- package/cjs/core/utils/props.d.ts +2 -2
- package/cjs/core/utils/props.js +2 -2
- package/cjs/core/utils/types.d.ts +1 -1
- package/cjs/core/utils/types.js +2 -2
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +4 -18
- package/cjs/package.json +1 -0
- package/cjs/react-table/react-table.d.ts +745 -0
- package/cjs/react-table/react-table.js +10 -0
- package/cjs/styles.js +424 -448
- package/esm/core/Alert/Alert.d.ts +57 -27
- package/esm/core/Alert/Alert.js +159 -23
- package/esm/core/Avatar/Avatar.d.ts +6 -9
- package/esm/core/Avatar/Avatar.js +53 -18
- package/esm/core/Avatar/index.d.ts +1 -1
- package/esm/core/Avatar/index.js +1 -1
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +1 -5
- package/esm/core/AvatarGroup/AvatarGroup.js +58 -26
- package/esm/core/AvatarGroup/index.d.ts +1 -1
- package/esm/core/AvatarGroup/index.js +1 -1
- package/esm/core/Backdrop/Backdrop.d.ts +1 -1
- package/esm/core/Backdrop/Backdrop.js +10 -2
- package/esm/core/Badge/Badge.d.ts +1 -1
- package/esm/core/Badge/Badge.js +31 -16
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
- package/esm/core/Breadcrumbs/Breadcrumbs.js +147 -33
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/core/ButtonGroup/ButtonGroup.js +58 -21
- package/esm/core/Buttons/Button/Button.d.ts +16 -3
- package/esm/core/Buttons/Button/Button.js +46 -6
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +2 -2
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +39 -22
- package/esm/core/Buttons/IconButton/IconButton.d.ts +6 -2
- package/esm/core/Buttons/IconButton/IconButton.js +42 -10
- package/esm/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +12 -2
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +13 -4
- package/esm/core/Buttons/SplitButton/SplitButton.js +103 -17
- package/esm/core/Carousel/Carousel.d.ts +9 -7
- package/esm/core/Carousel/Carousel.js +103 -73
- package/esm/core/Carousel/CarouselDot.d.ts +1 -1
- package/esm/core/Carousel/CarouselDot.js +18 -7
- package/esm/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/esm/core/Carousel/CarouselDotsList.js +123 -65
- package/esm/core/Carousel/CarouselNavigation.d.ts +8 -6
- package/esm/core/Carousel/CarouselNavigation.js +85 -34
- package/esm/core/Carousel/CarouselSlide.d.ts +1 -1
- package/esm/core/Carousel/CarouselSlide.js +29 -14
- package/esm/core/Carousel/CarouselSlider.js +65 -45
- package/esm/core/Checkbox/Checkbox.d.ts +9 -5
- package/esm/core/Checkbox/Checkbox.js +78 -28
- package/esm/core/ColorPicker/ColorBuilder.js +278 -169
- package/esm/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +378 -251
- package/esm/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/esm/core/ColorPicker/ColorPalette.js +115 -82
- package/esm/core/ColorPicker/ColorPicker.d.ts +10 -6
- package/esm/core/ColorPicker/ColorPicker.js +78 -54
- package/esm/core/ColorPicker/ColorPickerContext.js +7 -5
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +19 -7
- package/esm/core/ComboBox/ComboBox.d.ts +13 -8
- package/esm/core/ComboBox/ComboBox.js +397 -264
- package/esm/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxEndIcon.js +19 -13
- package/esm/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxInput.js +198 -123
- package/esm/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxInputContainer.js +20 -5
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxMenu.js +79 -46
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxMenuItem.js +62 -14
- package/esm/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMultipleContainer.js +6 -2
- package/esm/core/ComboBox/helpers.d.ts +7 -5
- package/esm/core/ComboBox/helpers.js +38 -39
- package/esm/core/DatePicker/DatePicker.d.ts +41 -10
- package/esm/core/DatePicker/DatePicker.js +553 -325
- package/esm/core/Dialog/Dialog.d.ts +1 -1
- package/esm/core/Dialog/Dialog.js +54 -25
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +39 -19
- package/esm/core/Dialog/DialogContent.d.ts +2 -1
- package/esm/core/Dialog/DialogContent.js +25 -2
- package/esm/core/Dialog/DialogContext.d.ts +11 -1
- package/esm/core/Dialog/DialogContext.js +1 -1
- package/esm/core/Dialog/DialogDragContext.d.ts +1 -1
- package/esm/core/Dialog/DialogDragContext.js +4 -4
- package/esm/core/Dialog/DialogMain.d.ts +1 -1
- package/esm/core/Dialog/DialogMain.js +177 -114
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBar.js +45 -10
- package/esm/core/DropdownMenu/DropdownMenu.d.ts +8 -7
- package/esm/core/DropdownMenu/DropdownMenu.js +80 -30
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +83 -21
- package/esm/core/ExpandableBlock/ExpandableBlock.js +246 -46
- package/esm/core/Fieldset/Fieldset.d.ts +1 -1
- package/esm/core/Fieldset/Fieldset.js +19 -8
- package/esm/core/FileUpload/FileEmptyCard.js +19 -8
- package/esm/core/FileUpload/FileUpload.d.ts +8 -5
- package/esm/core/FileUpload/FileUpload.js +74 -41
- package/esm/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadCard.js +154 -77
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +2 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +38 -9
- package/esm/core/Footer/Footer.d.ts +4 -4
- package/esm/core/Footer/Footer.js +86 -55
- package/esm/core/Footer/FooterSeparator.js +1 -1
- package/esm/core/Header/Header.d.ts +3 -22
- package/esm/core/Header/Header.js +55 -15
- package/esm/core/Header/HeaderBasicButton.js +16 -8
- package/esm/core/Header/HeaderBreadcrumbs.d.ts +1 -1
- package/esm/core/Header/HeaderBreadcrumbs.js +32 -8
- package/esm/core/Header/HeaderButton.d.ts +5 -1
- package/esm/core/Header/HeaderButton.js +62 -13
- package/esm/core/Header/HeaderDropdownButton.js +42 -13
- package/esm/core/Header/HeaderLogo.d.ts +1 -1
- package/esm/core/Header/HeaderLogo.js +36 -5
- package/esm/core/Header/HeaderSplitButton.js +61 -14
- package/esm/core/InformationPanel/InformationPanel.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanel.js +71 -39
- package/esm/core/InformationPanel/InformationPanelContent.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanelContent.js +17 -3
- package/esm/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanelHeader.js +32 -8
- package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -1
- package/esm/core/Input/Input.d.ts +10 -6
- package/esm/core/Input/Input.js +12 -9
- package/esm/core/InputGrid/InputGrid.d.ts +25 -0
- package/esm/core/InputGrid/InputGrid.js +35 -0
- package/esm/core/InputGrid/index.d.ts +3 -0
- package/esm/core/{ProgressIndicators/ProgressLinear → InputGrid}/index.js +2 -2
- package/esm/core/InputGroup/InputGroup.d.ts +14 -1
- package/esm/core/InputGroup/InputGroup.js +62 -15
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
- package/esm/core/InputWithDecorations/index.d.ts +3 -0
- package/esm/core/InputWithDecorations/index.js +6 -0
- package/esm/core/Label/Label.d.ts +6 -1
- package/esm/core/Label/Label.js +26 -5
- package/esm/core/LabeledInput/LabeledInput.d.ts +23 -17
- package/esm/core/LabeledInput/LabeledInput.js +68 -6
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +18 -8
- package/esm/core/LabeledSelect/LabeledSelect.js +70 -17
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +16 -7
- package/esm/core/LabeledTextarea/LabeledTextarea.js +15 -8
- package/esm/core/List/ListItem.d.ts +4 -4
- package/esm/core/List/ListItem.js +46 -28
- package/esm/core/Menu/Menu.d.ts +2 -2
- package/esm/core/Menu/Menu.js +64 -49
- package/esm/core/Menu/MenuDivider.d.ts +2 -1
- package/esm/core/Menu/MenuDivider.js +2 -2
- package/esm/core/Menu/MenuExtraContent.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +2 -2
- package/esm/core/Menu/MenuItem.js +167 -63
- package/esm/core/Menu/MenuItemSkeleton.d.ts +2 -2
- package/esm/core/Menu/MenuItemSkeleton.js +43 -12
- package/esm/core/Modal/Modal.d.ts +9 -10
- package/esm/core/Modal/Modal.js +33 -13
- package/esm/core/NonIdealState/ErrorPage.d.ts +6 -7
- package/esm/core/NonIdealState/ErrorPage.js +177 -117
- package/esm/core/NonIdealState/NonIdealState.d.ts +17 -1
- package/esm/core/NonIdealState/NonIdealState.js +65 -6
- package/esm/core/NotificationMarker/NotificationMarker.d.ts +1 -1
- package/esm/core/NotificationMarker/NotificationMarker.js +20 -2
- package/esm/core/Overlay/Overlay.d.ts +57 -0
- package/esm/core/Overlay/Overlay.js +88 -0
- package/esm/core/Overlay/index.d.ts +1 -0
- package/esm/core/{ProgressIndicators/ProgressRadial → Overlay}/index.js +1 -2
- package/{cjs/core/ProgressIndicators/ProgressLinear → esm/core/ProgressIndicators}/ProgressLinear.d.ts +10 -6
- package/esm/core/ProgressIndicators/ProgressLinear.js +65 -0
- package/esm/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +4 -4
- package/esm/core/ProgressIndicators/ProgressRadial.js +64 -0
- package/esm/core/ProgressIndicators/index.d.ts +2 -2
- package/esm/core/ProgressIndicators/index.js +2 -2
- package/esm/core/Radio/Radio.d.ts +7 -4
- package/esm/core/Radio/Radio.js +45 -11
- package/esm/core/RadioTiles/RadioTile.d.ts +15 -4
- package/esm/core/RadioTiles/RadioTile.js +62 -14
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +10 -3
- package/esm/core/SearchBox/SearchBox.d.ts +3 -3
- package/esm/core/SearchBox/SearchBox.js +215 -97
- package/esm/core/Select/Select.d.ts +12 -13
- package/esm/core/Select/Select.js +267 -152
- package/esm/core/Select/SelectTag.d.ts +1 -1
- package/esm/core/Select/SelectTag.js +15 -3
- package/esm/core/Select/SelectTagContainer.d.ts +1 -1
- package/esm/core/Select/SelectTagContainer.js +20 -7
- package/esm/core/SideNavigation/SideNavigation.d.ts +17 -1
- package/esm/core/SideNavigation/SideNavigation.js +118 -21
- package/esm/core/SideNavigation/SidenavButton.d.ts +1 -1
- package/esm/core/SideNavigation/SidenavButton.js +24 -2
- package/esm/core/SideNavigation/SidenavSubmenu.js +14 -3
- package/esm/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +20 -4
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.js +11 -2
- package/esm/core/Slider/Slider.d.ts +29 -9
- package/esm/core/Slider/Slider.js +352 -197
- package/esm/core/Slider/Thumb.d.ts +4 -4
- package/esm/core/Slider/Thumb.js +101 -52
- package/esm/core/Slider/Track.d.ts +4 -4
- package/esm/core/Slider/Track.js +75 -49
- package/esm/core/StatusMessage/StatusMessage.d.ts +13 -3
- package/esm/core/StatusMessage/StatusMessage.js +28 -8
- package/esm/core/Stepper/Stepper.d.ts +29 -4
- package/esm/core/Stepper/Stepper.js +71 -8
- package/esm/core/Stepper/StepperStep.d.ts +18 -1
- package/esm/core/Stepper/StepperStep.js +92 -31
- package/esm/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/esm/core/Stepper/WorkflowDiagram.js +23 -6
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +8 -3
- package/esm/core/Stepper/WorkflowDiagramStep.js +22 -4
- package/esm/core/Stepper/index.d.ts +0 -4
- package/esm/core/Stepper/index.js +0 -2
- package/esm/core/Surface/Surface.d.ts +2 -2
- package/esm/core/Surface/Surface.js +68 -39
- package/esm/core/Table/SubRowExpander.d.ts +2 -2
- package/esm/core/Table/SubRowExpander.js +31 -9
- package/esm/core/Table/Table.d.ts +18 -2
- package/esm/core/Table/Table.js +763 -416
- package/esm/core/Table/TableCell.d.ts +2 -2
- package/esm/core/Table/TableCell.js +87 -53
- package/esm/core/Table/TablePaginator.d.ts +3 -3
- package/esm/core/Table/TablePaginator.js +306 -126
- package/esm/core/Table/TableRowMemoized.d.ts +4 -4
- package/esm/core/Table/TableRowMemoized.js +148 -84
- package/esm/core/Table/actionHandlers/expandHandler.js +10 -10
- package/esm/core/Table/actionHandlers/filterHandler.js +23 -16
- package/esm/core/Table/actionHandlers/index.js +5 -1
- package/esm/core/Table/actionHandlers/resizeHandler.js +11 -11
- package/esm/core/Table/actionHandlers/selectHandler.js +117 -93
- package/esm/core/Table/cells/DefaultCell.d.ts +2 -2
- package/esm/core/Table/cells/DefaultCell.js +42 -7
- package/esm/core/Table/cells/EditableCell.d.ts +2 -2
- package/esm/core/Table/cells/EditableCell.js +70 -47
- package/esm/core/Table/columns/actionColumn.d.ts +3 -3
- package/esm/core/Table/columns/actionColumn.js +85 -62
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -2
- package/esm/core/Table/columns/expanderColumn.js +38 -25
- package/esm/core/Table/columns/selectionColumn.d.ts +4 -4
- package/esm/core/Table/columns/selectionColumn.js +51 -23
- package/esm/core/Table/filters/BaseFilter.d.ts +2 -2
- package/esm/core/Table/filters/BaseFilter.js +15 -7
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +9 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +113 -48
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +6 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +110 -47
- package/esm/core/Table/filters/FilterButtonBar.d.ts +3 -3
- package/esm/core/Table/filters/FilterButtonBar.js +28 -9
- package/esm/core/Table/filters/FilterToggle.d.ts +3 -3
- package/esm/core/Table/filters/FilterToggle.js +57 -20
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +50 -23
- package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/esm/core/Table/filters/TextFilter/TextFilter.js +32 -15
- package/esm/core/Table/filters/customFilterFunctions.js +14 -12
- package/esm/core/Table/filters/defaultFilterFunctions.js +84 -79
- package/esm/core/Table/filters/tableFilters.d.ts +5 -5
- package/esm/core/Table/filters/tableFilters.js +34 -25
- package/esm/core/Table/filters/types.d.ts +2 -19
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +88 -81
- package/esm/core/Table/hooks/useExpanderCell.d.ts +1 -1
- package/esm/core/Table/hooks/useExpanderCell.js +26 -20
- package/esm/core/Table/hooks/useResizeColumns.js +353 -293
- package/esm/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/esm/core/Table/hooks/useScrollToRow.js +42 -35
- package/esm/core/Table/hooks/useSelectionCell.js +10 -6
- package/esm/core/Table/hooks/useStickyColumns.js +61 -61
- package/esm/core/Table/hooks/useSubRowFiltering.js +90 -85
- package/esm/core/Table/hooks/useSubRowSelection.js +28 -27
- package/esm/core/Table/index.d.ts +1 -1
- package/esm/core/Table/index.js +5 -1
- package/esm/core/Table/utils.js +40 -38
- package/esm/core/Tabs/Tab.d.ts +2 -2
- package/esm/core/Tabs/Tab.js +41 -8
- package/esm/core/Tabs/Tabs.d.ts +6 -42
- package/esm/core/Tabs/Tabs.js +392 -333
- package/esm/core/Tabs/index.d.ts +1 -1
- package/esm/core/Tabs/index.js +1 -1
- package/esm/core/Tag/Tag.d.ts +1 -1
- package/esm/core/Tag/Tag.js +35 -8
- package/esm/core/Tag/TagContainer.d.ts +1 -1
- package/esm/core/Tag/TagContainer.js +17 -5
- package/esm/core/Textarea/Textarea.d.ts +4 -5
- package/esm/core/Textarea/Textarea.js +9 -13
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +29 -10
- package/esm/core/ThemeProvider/ThemeProvider.js +112 -26
- package/esm/core/Tile/Tile.d.ts +200 -17
- package/esm/core/Tile/Tile.js +475 -98
- package/esm/core/TimePicker/TimePicker.d.ts +3 -3
- package/esm/core/TimePicker/TimePicker.js +448 -228
- package/esm/core/Toast/Toast.d.ts +20 -17
- package/esm/core/Toast/Toast.js +196 -101
- package/esm/core/Toast/Toaster.d.ts +26 -28
- package/esm/core/Toast/Toaster.js +106 -126
- package/esm/core/Toast/index.d.ts +1 -4
- package/esm/core/Toast/index.js +1 -3
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
- package/esm/core/ToggleSwitch/ToggleSwitch.js +60 -22
- package/esm/core/Tooltip/Tooltip.d.ts +81 -14
- package/esm/core/Tooltip/Tooltip.js +167 -10
- package/esm/core/TransferList/TransferList.d.ts +6 -6
- package/esm/core/TransferList/TransferList.js +158 -94
- package/esm/core/Tree/Tree.d.ts +5 -5
- package/esm/core/Tree/Tree.js +197 -129
- package/esm/core/Tree/TreeContext.d.ts +1 -1
- package/esm/core/Tree/TreeContext.js +5 -5
- package/esm/core/Tree/TreeNode.d.ts +2 -2
- package/esm/core/Tree/TreeNode.js +195 -97
- package/esm/core/Tree/TreeNodeExpander.d.ts +1 -1
- package/esm/core/Tree/TreeNodeExpander.js +16 -5
- package/esm/core/Typography/Blockquote/Blockquote.d.ts +1 -1
- package/esm/core/Typography/Blockquote/Blockquote.js +12 -4
- package/esm/core/Typography/Kbd/Kbd.d.ts +1 -1
- package/esm/core/Typography/Kbd/Kbd.js +24 -15
- package/esm/core/Typography/Text/Text.d.ts +1 -1
- package/esm/core/Typography/Text/Text.js +20 -7
- package/esm/core/index.d.ts +10 -8
- package/esm/core/index.js +86 -15
- package/esm/core/utils/color/ColorValue.d.ts +4 -4
- package/esm/core/utils/color/ColorValue.js +524 -455
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +11 -8
- package/esm/core/utils/components/ButtonBase.d.ts +14 -0
- package/esm/core/utils/components/ButtonBase.js +42 -0
- package/esm/core/utils/components/Divider.d.ts +1 -1
- package/esm/core/utils/components/Divider.js +8 -2
- package/esm/core/utils/components/Flex.d.ts +4 -4
- package/esm/core/utils/components/Flex.js +87 -71
- package/esm/core/utils/components/FocusTrap.d.ts +3 -3
- package/esm/core/utils/components/FocusTrap.js +41 -32
- package/esm/core/utils/components/Icon.d.ts +6 -1
- package/esm/core/utils/components/Icon.js +26 -12
- package/esm/core/utils/components/InputContainer.d.ts +4 -5
- package/esm/core/utils/components/InputContainer.js +56 -17
- package/esm/core/utils/components/InputFlexContainer.d.ts +2 -1
- package/esm/core/utils/components/InputFlexContainer.js +15 -2
- package/esm/core/utils/components/MiddleTextTruncation.d.ts +2 -2
- package/esm/core/utils/components/MiddleTextTruncation.js +27 -18
- package/esm/core/utils/components/Popover.d.ts +113 -27
- package/esm/core/utils/components/Popover.js +175 -118
- package/esm/core/utils/components/Portal.d.ts +27 -0
- package/esm/core/utils/components/Portal.js +36 -0
- package/esm/core/utils/components/Resizer.d.ts +2 -2
- package/esm/core/utils/components/Resizer.js +250 -183
- package/esm/core/utils/components/VirtualScroll.d.ts +2 -2
- package/esm/core/utils/components/VirtualScroll.js +296 -224
- package/esm/core/utils/components/VisuallyHidden.d.ts +1 -1
- package/esm/core/utils/components/VisuallyHidden.js +8 -2
- package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/esm/core/utils/components/WithCSSTransition.js +38 -21
- package/esm/core/utils/components/index.d.ts +2 -0
- package/esm/core/utils/components/index.js +2 -0
- package/esm/core/utils/functions/colors.d.ts +1 -1
- package/esm/core/utils/functions/colors.js +20 -32
- package/esm/core/utils/functions/date.js +8 -8
- package/esm/core/utils/functions/dev.d.ts +11 -0
- package/esm/core/utils/functions/dev.js +29 -0
- package/esm/core/utils/functions/dom.d.ts +0 -8
- package/esm/core/utils/functions/dom.js +17 -33
- package/esm/core/utils/functions/focusable.js +24 -15
- package/esm/core/utils/functions/import.d.ts +6 -0
- package/esm/core/utils/functions/import.js +14 -0
- package/esm/core/utils/functions/index.d.ts +3 -0
- package/esm/core/utils/functions/index.js +3 -0
- package/esm/core/utils/functions/numbers.js +7 -7
- package/esm/core/utils/functions/polymorphic.d.ts +5 -3
- package/esm/core/utils/functions/polymorphic.js +32 -23
- package/esm/core/utils/functions/react.d.ts +8 -0
- package/esm/core/utils/functions/react.js +35 -0
- package/esm/core/utils/functions/supports.js +2 -1
- package/esm/core/utils/hooks/index.d.ts +1 -1
- package/esm/core/utils/hooks/index.js +1 -1
- package/esm/core/utils/hooks/useContainerWidth.js +16 -13
- package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
- package/esm/core/utils/hooks/useControlledState.js +34 -0
- package/esm/core/utils/hooks/useDragAndDrop.js +99 -82
- package/esm/core/utils/hooks/useEventListener.js +18 -18
- package/esm/core/utils/hooks/useGlobals.d.ts +9 -2
- package/esm/core/utils/hooks/useGlobals.js +30 -27
- package/esm/core/utils/hooks/useId.js +3 -4
- package/esm/core/utils/hooks/useIntersection.js +25 -20
- package/esm/core/utils/hooks/useIsClient.js +5 -5
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/esm/core/utils/hooks/useLatestRef.js +5 -5
- package/esm/core/utils/hooks/useMediaQuery.js +23 -27
- package/esm/core/utils/hooks/useMergedRefs.js +11 -12
- package/esm/core/utils/hooks/useOverflow.js +62 -51
- package/esm/core/utils/hooks/useResizeObserver.js +17 -13
- package/esm/core/utils/hooks/useSafeContext.js +5 -5
- package/esm/core/utils/icons/StatusIconMap.d.ts +5 -5
- package/esm/core/utils/icons/StatusIconMap.js +8 -4
- package/esm/core/utils/icons/SvgCalendar.d.ts +1 -1
- package/esm/core/utils/icons/SvgCalendar.js +7 -2
- package/esm/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretDownSmall.js +7 -2
- package/esm/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretRightSmall.js +7 -2
- package/esm/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretUpSmall.js +7 -2
- package/esm/core/utils/icons/SvgCheckmark.d.ts +1 -1
- package/esm/core/utils/icons/SvgCheckmark.js +5 -2
- package/esm/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +7 -2
- package/esm/core/utils/icons/SvgChevronLeft.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronLeft.js +7 -2
- package/esm/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +7 -2
- package/esm/core/utils/icons/SvgChevronRight.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronRight.js +7 -2
- package/esm/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronRightDouble.js +7 -2
- package/esm/core/utils/icons/SvgClose.d.ts +1 -1
- package/esm/core/utils/icons/SvgClose.js +7 -2
- package/esm/core/utils/icons/SvgCloseSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCloseSmall.js +7 -2
- package/esm/core/utils/icons/SvgColumnManager.d.ts +1 -1
- package/esm/core/utils/icons/SvgColumnManager.js +7 -2
- package/esm/core/utils/icons/SvgDocument.d.ts +1 -1
- package/esm/core/utils/icons/SvgDocument.js +5 -2
- package/esm/core/utils/icons/SvgFilter.d.ts +1 -1
- package/esm/core/utils/icons/SvgFilter.js +5 -2
- package/esm/core/utils/icons/SvgFilterHollow.d.ts +1 -1
- package/esm/core/utils/icons/SvgFilterHollow.js +7 -2
- package/esm/core/utils/icons/SvgImportantSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgImportantSmall.js +7 -2
- package/esm/core/utils/icons/SvgInfoCircular.d.ts +1 -1
- package/esm/core/utils/icons/SvgInfoCircular.js +7 -2
- package/esm/core/utils/icons/SvgMore.d.ts +1 -1
- package/esm/core/utils/icons/SvgMore.js +7 -2
- package/esm/core/utils/icons/SvgMoreVertical.d.ts +1 -1
- package/esm/core/utils/icons/SvgMoreVertical.js +7 -2
- package/esm/core/utils/icons/SvgNew.d.ts +1 -1
- package/esm/core/utils/icons/SvgNew.js +7 -2
- package/esm/core/utils/icons/SvgSearch.d.ts +1 -1
- package/esm/core/utils/icons/SvgSearch.js +7 -2
- package/esm/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
- package/esm/core/utils/icons/SvgSmileyHappy.js +7 -2
- package/esm/core/utils/icons/SvgSortDown.d.ts +1 -1
- package/esm/core/utils/icons/SvgSortDown.js +7 -2
- package/esm/core/utils/icons/SvgSortUp.d.ts +1 -1
- package/esm/core/utils/icons/SvgSortUp.js +7 -2
- package/esm/core/utils/icons/SvgStatusError.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusError.js +7 -2
- package/esm/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusSuccess.js +7 -2
- package/esm/core/utils/icons/SvgStatusWarning.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusWarning.js +7 -2
- package/esm/core/utils/icons/SvgSwap.d.ts +1 -1
- package/esm/core/utils/icons/SvgSwap.js +7 -2
- package/esm/core/utils/icons/SvgUpload.d.ts +1 -1
- package/esm/core/utils/icons/SvgUpload.js +7 -2
- package/esm/core/utils/props.d.ts +2 -2
- package/esm/core/utils/types.d.ts +1 -1
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -1
- package/esm/react-table/react-table.d.ts +745 -0
- package/esm/react-table/react-table.js +9 -0
- package/esm/styles.js +424 -450
- package/package.json +45 -41
- package/react-table.d.ts +745 -0
- package/styles.css +751 -1610
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
- package/cjs/core/ComboBox/ComboBoxDropdown.js +0 -52
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -65
- package/cjs/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -77
- package/cjs/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
- package/cjs/core/Stepper/Wizard.d.ts +0 -46
- package/cjs/core/Stepper/Wizard.js +0 -55
- package/cjs/core/Toast/ToastWrapper.d.ts +0 -10
- package/cjs/core/Toast/ToastWrapper.js +0 -49
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
- package/cjs/types/react-table-config.d.ts +0 -135
- package/cjs/types/react-table-config.js +0 -2
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
- package/esm/core/ComboBox/ComboBoxDropdown.js +0 -26
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -36
- package/esm/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -48
- package/esm/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
- package/esm/core/Stepper/Wizard.d.ts +0 -46
- package/esm/core/Stepper/Wizard.js +0 -29
- package/esm/core/Toast/ToastWrapper.d.ts +0 -10
- package/esm/core/Toast/ToastWrapper.js +0 -20
- package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
- package/esm/types/react-table-config.d.ts +0 -135
- package/esm/types/react-table-config.js +0 -1
|
@@ -4,105 +4,116 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
SvgChevronLeft,
|
|
9
|
+
SvgChevronRight,
|
|
10
|
+
SvgChevronLeftDouble,
|
|
11
|
+
SvgChevronRightDouble,
|
|
12
|
+
isBefore,
|
|
13
|
+
Box,
|
|
14
|
+
useId,
|
|
15
|
+
} from '../utils/index.js';
|
|
8
16
|
import { IconButton } from '../Buttons/IconButton/index.js';
|
|
9
17
|
import { TimePicker } from '../TimePicker/index.js';
|
|
18
|
+
import { Surface } from '../Surface/index.js';
|
|
10
19
|
const isSameDay = (a, b) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
return (
|
|
21
|
+
a &&
|
|
22
|
+
b &&
|
|
23
|
+
a.getFullYear() === b.getFullYear() &&
|
|
24
|
+
a.getMonth() === b.getMonth() &&
|
|
25
|
+
a.getDate() === b.getDate()
|
|
26
|
+
);
|
|
16
27
|
};
|
|
17
28
|
const isInDateRange = (date, startDate, endDate) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
if (!date || !startDate || !endDate) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const minDate = new Date(startDate);
|
|
33
|
+
const maxDate = new Date(endDate);
|
|
34
|
+
const testDate = new Date(date);
|
|
35
|
+
testDate && testDate.setHours(0, 0, 0, 0);
|
|
36
|
+
minDate && minDate.setHours(0, 0, 0, 0);
|
|
37
|
+
maxDate && maxDate.setHours(0, 0, 0, 0);
|
|
38
|
+
return testDate > minDate && testDate < maxDate;
|
|
28
39
|
};
|
|
29
40
|
// Type guard for multiple did not work
|
|
30
41
|
const isSingleOnChange = (onChange, enableRangeSelect) => {
|
|
31
|
-
|
|
42
|
+
return !enableRangeSelect;
|
|
32
43
|
};
|
|
33
44
|
const defaultMonths = [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
'January',
|
|
46
|
+
'February',
|
|
47
|
+
'March',
|
|
48
|
+
'April',
|
|
49
|
+
'May',
|
|
50
|
+
'June',
|
|
51
|
+
'July',
|
|
52
|
+
'August',
|
|
53
|
+
'September',
|
|
54
|
+
'October',
|
|
55
|
+
'November',
|
|
56
|
+
'December',
|
|
46
57
|
];
|
|
47
58
|
const defaultShortDays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
48
59
|
const defaultLongDays = [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
'Sunday',
|
|
61
|
+
'Monday',
|
|
62
|
+
'Tuesday',
|
|
63
|
+
'Wednesday',
|
|
64
|
+
'Thursday',
|
|
65
|
+
'Friday',
|
|
66
|
+
'Saturday',
|
|
56
67
|
];
|
|
57
68
|
/**
|
|
58
69
|
* Generate localized months and days strings using `Intl.DateTimeFormat` for passed locale to use in DatePicker component.
|
|
59
70
|
* If locale is not passed, browser locale will be used.
|
|
60
71
|
*/
|
|
61
72
|
export const generateLocalizedStrings = (locale) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
const shortWeekDayFormatter = new Intl.DateTimeFormat(locale, {
|
|
74
|
+
weekday: 'short',
|
|
75
|
+
});
|
|
76
|
+
const longWeekDayFormatter = new Intl.DateTimeFormat(locale, {
|
|
77
|
+
weekday: 'long',
|
|
78
|
+
});
|
|
79
|
+
const monthFormatter = new Intl.DateTimeFormat(locale, { month: 'long' });
|
|
80
|
+
const months = [
|
|
81
|
+
monthFormatter.format(new Date(2020, 0, 1)),
|
|
82
|
+
monthFormatter.format(new Date(2020, 1, 1)),
|
|
83
|
+
monthFormatter.format(new Date(2020, 2, 1)),
|
|
84
|
+
monthFormatter.format(new Date(2020, 3, 1)),
|
|
85
|
+
monthFormatter.format(new Date(2020, 4, 1)),
|
|
86
|
+
monthFormatter.format(new Date(2020, 5, 1)),
|
|
87
|
+
monthFormatter.format(new Date(2020, 6, 1)),
|
|
88
|
+
monthFormatter.format(new Date(2020, 7, 1)),
|
|
89
|
+
monthFormatter.format(new Date(2020, 8, 1)),
|
|
90
|
+
monthFormatter.format(new Date(2020, 9, 1)),
|
|
91
|
+
monthFormatter.format(new Date(2020, 10, 1)),
|
|
92
|
+
monthFormatter.format(new Date(2020, 11, 1)),
|
|
93
|
+
];
|
|
94
|
+
const days = [
|
|
95
|
+
longWeekDayFormatter.format(new Date(2020, 10, 1)),
|
|
96
|
+
longWeekDayFormatter.format(new Date(2020, 10, 2)),
|
|
97
|
+
longWeekDayFormatter.format(new Date(2020, 10, 3)),
|
|
98
|
+
longWeekDayFormatter.format(new Date(2020, 10, 4)),
|
|
99
|
+
longWeekDayFormatter.format(new Date(2020, 10, 5)),
|
|
100
|
+
longWeekDayFormatter.format(new Date(2020, 10, 6)),
|
|
101
|
+
longWeekDayFormatter.format(new Date(2020, 10, 7)),
|
|
102
|
+
];
|
|
103
|
+
const shortDays = [
|
|
104
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 1)).slice(0, 2),
|
|
105
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 2)).slice(0, 2),
|
|
106
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 3)).slice(0, 2),
|
|
107
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 4)).slice(0, 2),
|
|
108
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 5)).slice(0, 2),
|
|
109
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 6)).slice(0, 2),
|
|
110
|
+
shortWeekDayFormatter.format(new Date(2020, 10, 7)).slice(0, 2),
|
|
111
|
+
];
|
|
112
|
+
return {
|
|
113
|
+
months,
|
|
114
|
+
shortDays,
|
|
115
|
+
days,
|
|
116
|
+
};
|
|
106
117
|
};
|
|
107
118
|
/**
|
|
108
119
|
* Date picker component
|
|
@@ -110,255 +121,472 @@ export const generateLocalizedStrings = (locale) => {
|
|
|
110
121
|
* <DatePicker date={new Date()} onChange={(e) => console.log('New date value: ' + e)} />
|
|
111
122
|
*/
|
|
112
123
|
export const DatePicker = React.forwardRef((props, forwardedRef) => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
124
|
+
const {
|
|
125
|
+
date,
|
|
126
|
+
onChange,
|
|
127
|
+
localizedNames,
|
|
128
|
+
className,
|
|
129
|
+
setFocus = false,
|
|
130
|
+
showTime = false,
|
|
131
|
+
use12Hours = false,
|
|
132
|
+
precision,
|
|
133
|
+
hourStep,
|
|
134
|
+
minuteStep,
|
|
135
|
+
secondStep,
|
|
136
|
+
useCombinedRenderer,
|
|
137
|
+
combinedRenderer,
|
|
138
|
+
hourRenderer,
|
|
139
|
+
minuteRenderer,
|
|
140
|
+
secondRenderer,
|
|
141
|
+
meridiemRenderer,
|
|
142
|
+
showYearSelection = false,
|
|
143
|
+
enableRangeSelect = false,
|
|
144
|
+
startDate,
|
|
145
|
+
endDate,
|
|
146
|
+
monthYearProps,
|
|
147
|
+
calendarProps,
|
|
148
|
+
monthProps,
|
|
149
|
+
weekDayProps,
|
|
150
|
+
dayProps,
|
|
151
|
+
weekProps,
|
|
152
|
+
isDateDisabled,
|
|
153
|
+
applyBackground = true,
|
|
154
|
+
...rest
|
|
155
|
+
} = props;
|
|
156
|
+
const monthNames = localizedNames?.months ?? defaultMonths;
|
|
157
|
+
const shortDays = localizedNames?.shortDays ?? defaultShortDays;
|
|
158
|
+
const longDays = localizedNames?.days ?? defaultLongDays;
|
|
159
|
+
const [selectedDay, setSelectedDay] = React.useState(date);
|
|
160
|
+
const [selectedStartDay, setSelectedStartDay] = React.useState(startDate);
|
|
161
|
+
const [selectedEndDay, setSelectedEndDay] = React.useState(endDate);
|
|
162
|
+
const [focusedDay, setFocusedDay] = React.useState(
|
|
163
|
+
selectedStartDay ?? selectedDay ?? new Date(),
|
|
164
|
+
);
|
|
165
|
+
const [displayedMonthIndex, setDisplayedMonthIndex] = React.useState(
|
|
166
|
+
selectedStartDay?.getMonth() ??
|
|
167
|
+
selectedDay?.getMonth() ??
|
|
168
|
+
new Date().getMonth(),
|
|
169
|
+
);
|
|
170
|
+
const [displayedYear, setDisplayedYear] = React.useState(
|
|
171
|
+
selectedStartDay?.getFullYear() ??
|
|
172
|
+
selectedDay?.getFullYear() ??
|
|
173
|
+
new Date().getFullYear(),
|
|
174
|
+
);
|
|
175
|
+
// boolean that toggles between the user picking the start date and end date for date range
|
|
176
|
+
const [isSelectingStartDate, setIsSelectingStartDate] = React.useState(true);
|
|
177
|
+
// Used to focus days only when days are changed
|
|
178
|
+
// e.g. without this, when changing months day would be focused
|
|
179
|
+
const needFocus = React.useRef(setFocus);
|
|
180
|
+
React.useEffect(() => {
|
|
181
|
+
if (needFocus.current) {
|
|
182
|
+
needFocus.current = false;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
const setMonthAndYear = React.useCallback((newMonth, newYear) => {
|
|
186
|
+
setDisplayedMonthIndex(newMonth);
|
|
187
|
+
setDisplayedYear(newYear);
|
|
188
|
+
}, []);
|
|
189
|
+
React.useEffect(() => {
|
|
190
|
+
const currentDate = new Date();
|
|
191
|
+
setSelectedDay(date);
|
|
192
|
+
setSelectedStartDay(startDate);
|
|
193
|
+
setSelectedEndDay(endDate);
|
|
194
|
+
if (!enableRangeSelect) {
|
|
195
|
+
setFocusedDay(date ?? currentDate);
|
|
196
|
+
}
|
|
197
|
+
setMonthAndYear(
|
|
198
|
+
startDate?.getMonth() ?? date?.getMonth() ?? currentDate.getMonth(),
|
|
199
|
+
startDate?.getFullYear() ??
|
|
200
|
+
date?.getFullYear() ??
|
|
201
|
+
currentDate.getFullYear(),
|
|
202
|
+
);
|
|
203
|
+
}, [date, setMonthAndYear, startDate, endDate, enableRangeSelect]);
|
|
204
|
+
const days = React.useMemo(() => {
|
|
205
|
+
let offsetToFirst = new Date(
|
|
206
|
+
displayedYear,
|
|
207
|
+
displayedMonthIndex,
|
|
208
|
+
1,
|
|
209
|
+
).getDay();
|
|
210
|
+
// if its sunday, show one week before
|
|
211
|
+
if (0 === offsetToFirst) {
|
|
212
|
+
offsetToFirst = 7;
|
|
213
|
+
}
|
|
214
|
+
const daysInMonth = [];
|
|
215
|
+
// generate 6 weeks of dates
|
|
216
|
+
for (let i = 1; i <= 42; i++) {
|
|
217
|
+
const adjustedDay = i - offsetToFirst;
|
|
218
|
+
daysInMonth.push(
|
|
219
|
+
new Date(displayedYear, displayedMonthIndex, adjustedDay),
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
return daysInMonth;
|
|
223
|
+
}, [displayedMonthIndex, displayedYear]);
|
|
224
|
+
const weeks = React.useMemo(() => {
|
|
225
|
+
const weeksInMonth = [];
|
|
226
|
+
const weekCount = Math.ceil(days.length / 7);
|
|
227
|
+
for (let i = 0; i < weekCount; i++) {
|
|
228
|
+
weeksInMonth.push(days.slice(i * 7, (i + 1) * 7));
|
|
229
|
+
}
|
|
230
|
+
return weeksInMonth;
|
|
231
|
+
}, [days]);
|
|
232
|
+
const getNewFocusedDate = (newYear, newMonth) => {
|
|
233
|
+
const currentDate = selectedStartDay ?? selectedDay ?? new Date();
|
|
234
|
+
const newDate = new Date(
|
|
235
|
+
newYear,
|
|
236
|
+
newMonth,
|
|
237
|
+
currentDate.getDate(),
|
|
238
|
+
currentDate.getHours(),
|
|
239
|
+
currentDate.getMinutes(),
|
|
240
|
+
currentDate.getSeconds(),
|
|
241
|
+
);
|
|
242
|
+
return newDate;
|
|
243
|
+
};
|
|
244
|
+
const handleMoveToPreviousYear = () => {
|
|
245
|
+
const newYear = displayedYear - 1;
|
|
246
|
+
setMonthAndYear(displayedMonthIndex, newYear);
|
|
247
|
+
setFocusedDay(getNewFocusedDate(newYear, displayedMonthIndex));
|
|
248
|
+
};
|
|
249
|
+
const handleMoveToNextYear = () => {
|
|
250
|
+
const newYear = displayedYear + 1;
|
|
251
|
+
setMonthAndYear(displayedMonthIndex, newYear);
|
|
252
|
+
setFocusedDay(getNewFocusedDate(newYear, displayedMonthIndex));
|
|
253
|
+
};
|
|
254
|
+
const handleMoveToPreviousMonth = () => {
|
|
255
|
+
const newMonth = displayedMonthIndex !== 0 ? displayedMonthIndex - 1 : 11;
|
|
256
|
+
const newYear =
|
|
257
|
+
displayedMonthIndex !== 0 ? displayedYear : displayedYear - 1;
|
|
258
|
+
setMonthAndYear(newMonth, newYear);
|
|
259
|
+
setFocusedDay(getNewFocusedDate(newYear, newMonth));
|
|
260
|
+
};
|
|
261
|
+
const handleMoveToNextMonth = () => {
|
|
262
|
+
const newMonth = displayedMonthIndex !== 11 ? displayedMonthIndex + 1 : 0;
|
|
263
|
+
const newYear =
|
|
264
|
+
displayedMonthIndex !== 11 ? displayedYear : displayedYear + 1;
|
|
265
|
+
setMonthAndYear(newMonth, newYear);
|
|
266
|
+
setFocusedDay(getNewFocusedDate(newYear, newMonth));
|
|
267
|
+
};
|
|
268
|
+
const onDayClick = (day) => {
|
|
269
|
+
// single date selection
|
|
270
|
+
if (!enableRangeSelect) {
|
|
271
|
+
if (day.getMonth() !== selectedDay?.getMonth()) {
|
|
272
|
+
setMonthAndYear(day.getMonth(), day.getFullYear());
|
|
273
|
+
}
|
|
274
|
+
const currentDate = selectedDay ?? new Date();
|
|
275
|
+
const newDate = new Date(
|
|
276
|
+
day.getFullYear(),
|
|
277
|
+
day.getMonth(),
|
|
278
|
+
day.getDate(),
|
|
279
|
+
currentDate.getHours(),
|
|
280
|
+
currentDate.getMinutes(),
|
|
281
|
+
currentDate.getSeconds(),
|
|
282
|
+
);
|
|
283
|
+
setSelectedDay(newDate);
|
|
284
|
+
setFocusedDay(newDate);
|
|
285
|
+
isSingleOnChange(onChange, enableRangeSelect) && onChange?.(newDate);
|
|
286
|
+
}
|
|
287
|
+
// start date selection (date range only)
|
|
288
|
+
else if (isSelectingStartDate) {
|
|
289
|
+
if (day.getMonth() !== selectedStartDay?.getMonth()) {
|
|
290
|
+
setMonthAndYear(day.getMonth(), day.getFullYear());
|
|
291
|
+
}
|
|
292
|
+
const currentStartDate = selectedStartDay ?? new Date();
|
|
293
|
+
const newStartDate = new Date(
|
|
294
|
+
day.getFullYear(),
|
|
295
|
+
day.getMonth(),
|
|
296
|
+
day.getDate(),
|
|
297
|
+
currentStartDate.getHours(),
|
|
298
|
+
currentStartDate.getMinutes(),
|
|
299
|
+
currentStartDate.getSeconds(),
|
|
300
|
+
);
|
|
301
|
+
setSelectedStartDay(newStartDate);
|
|
302
|
+
setFocusedDay(newStartDate);
|
|
303
|
+
// if the start date is after the end date or the end date is undefined, reset the end date
|
|
304
|
+
if (!isBefore(newStartDate, selectedEndDay)) {
|
|
305
|
+
setSelectedEndDay(newStartDate);
|
|
306
|
+
onChange?.(newStartDate, newStartDate);
|
|
307
|
+
} else {
|
|
308
|
+
selectedEndDay && onChange?.(newStartDate, selectedEndDay);
|
|
309
|
+
}
|
|
310
|
+
setIsSelectingStartDate(false);
|
|
311
|
+
}
|
|
312
|
+
// end date selection (date range only)
|
|
313
|
+
else {
|
|
314
|
+
if (day.getMonth() !== selectedEndDay?.getMonth()) {
|
|
315
|
+
setMonthAndYear(day.getMonth(), day.getFullYear());
|
|
316
|
+
}
|
|
317
|
+
const currentEndDate = selectedEndDay ?? new Date();
|
|
318
|
+
const newEndDate = new Date(
|
|
319
|
+
day.getFullYear(),
|
|
320
|
+
day.getMonth(),
|
|
321
|
+
day.getDate(),
|
|
322
|
+
currentEndDate.getHours(),
|
|
323
|
+
currentEndDate.getMinutes(),
|
|
324
|
+
currentEndDate.getSeconds(),
|
|
325
|
+
);
|
|
326
|
+
setFocusedDay(newEndDate);
|
|
327
|
+
// if the end date is before the start date, move back the start date and still have user select end date
|
|
328
|
+
if (!isBefore(newEndDate, selectedStartDay)) {
|
|
329
|
+
setSelectedEndDay(newEndDate);
|
|
330
|
+
selectedStartDay && onChange?.(selectedStartDay, newEndDate);
|
|
331
|
+
setIsSelectingStartDate(true);
|
|
332
|
+
} else {
|
|
333
|
+
setSelectedStartDay(newEndDate);
|
|
334
|
+
selectedEndDay && onChange?.(newEndDate, selectedEndDay);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const handleCalendarKeyDown = (event) => {
|
|
339
|
+
if (event.altKey) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (!focusedDay) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const adjustedFocusedDay = new Date(focusedDay);
|
|
346
|
+
switch (event.key) {
|
|
347
|
+
case 'ArrowDown':
|
|
348
|
+
adjustedFocusedDay.setDate(focusedDay.getDate() + 7);
|
|
349
|
+
if (adjustedFocusedDay.getMonth() !== displayedMonthIndex) {
|
|
350
|
+
handleMoveToNextMonth();
|
|
314
351
|
}
|
|
315
|
-
|
|
316
|
-
|
|
352
|
+
setFocusedDay(adjustedFocusedDay);
|
|
353
|
+
needFocus.current = true;
|
|
354
|
+
event.preventDefault();
|
|
355
|
+
break;
|
|
356
|
+
case 'ArrowUp':
|
|
357
|
+
adjustedFocusedDay.setDate(focusedDay.getDate() - 7);
|
|
358
|
+
if (adjustedFocusedDay.getMonth() !== displayedMonthIndex) {
|
|
359
|
+
handleMoveToPreviousMonth();
|
|
317
360
|
}
|
|
318
|
-
|
|
319
|
-
|
|
361
|
+
setFocusedDay(adjustedFocusedDay);
|
|
362
|
+
needFocus.current = true;
|
|
363
|
+
event.preventDefault();
|
|
364
|
+
break;
|
|
365
|
+
case 'ArrowLeft':
|
|
366
|
+
adjustedFocusedDay.setDate(focusedDay.getDate() - 1);
|
|
367
|
+
if (adjustedFocusedDay.getMonth() !== displayedMonthIndex) {
|
|
368
|
+
handleMoveToPreviousMonth();
|
|
320
369
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
370
|
+
setFocusedDay(adjustedFocusedDay);
|
|
371
|
+
needFocus.current = true;
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
break;
|
|
374
|
+
case 'ArrowRight':
|
|
375
|
+
adjustedFocusedDay.setDate(focusedDay.getDate() + 1);
|
|
376
|
+
if (adjustedFocusedDay.getMonth() !== displayedMonthIndex) {
|
|
377
|
+
handleMoveToNextMonth();
|
|
326
378
|
}
|
|
327
|
-
|
|
328
|
-
|
|
379
|
+
setFocusedDay(adjustedFocusedDay);
|
|
380
|
+
needFocus.current = true;
|
|
381
|
+
event.preventDefault();
|
|
382
|
+
break;
|
|
383
|
+
case 'Enter':
|
|
384
|
+
case ' ':
|
|
385
|
+
case 'Spacebar':
|
|
386
|
+
if (!isDateDisabled?.(focusedDay)) {
|
|
387
|
+
onDayClick(focusedDay);
|
|
329
388
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
389
|
+
event.preventDefault();
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const getDayClass = (day) => {
|
|
394
|
+
if (day.getMonth() !== displayedMonthIndex) {
|
|
395
|
+
return 'iui-calendar-day-outside-month';
|
|
396
|
+
}
|
|
397
|
+
let dayClass = 'iui-calendar-day';
|
|
398
|
+
const isSelectedDay =
|
|
399
|
+
isSameDay(day, selectedDay) ||
|
|
400
|
+
(isSameDay(day, selectedStartDay) && isSameDay(day, selectedEndDay));
|
|
401
|
+
if (isSelectedDay) {
|
|
402
|
+
dayClass += '-selected';
|
|
403
|
+
} else if (isSameDay(day, selectedStartDay)) {
|
|
404
|
+
dayClass += '-range-start';
|
|
405
|
+
} else if (isSameDay(day, selectedEndDay)) {
|
|
406
|
+
dayClass += '-range-end';
|
|
407
|
+
}
|
|
408
|
+
// adds range class to dates between start and end date
|
|
409
|
+
if (
|
|
410
|
+
selectedStartDay &&
|
|
411
|
+
selectedEndDay &&
|
|
412
|
+
isInDateRange(day, selectedStartDay, selectedEndDay)
|
|
413
|
+
) {
|
|
414
|
+
dayClass += '-range';
|
|
415
|
+
}
|
|
416
|
+
if (isSameDay(day, new Date())) {
|
|
417
|
+
dayClass += '-today';
|
|
418
|
+
}
|
|
419
|
+
return dayClass;
|
|
420
|
+
};
|
|
421
|
+
const dateTableId = useId();
|
|
422
|
+
return React.createElement(
|
|
423
|
+
Box,
|
|
424
|
+
{
|
|
425
|
+
as: applyBackground ? Surface : 'div',
|
|
426
|
+
className: cx('iui-date-picker', className),
|
|
427
|
+
ref: forwardedRef,
|
|
428
|
+
...rest,
|
|
429
|
+
},
|
|
430
|
+
React.createElement(
|
|
431
|
+
'div',
|
|
432
|
+
null,
|
|
433
|
+
React.createElement(
|
|
434
|
+
Box,
|
|
435
|
+
{
|
|
436
|
+
as: 'div',
|
|
437
|
+
...monthYearProps,
|
|
438
|
+
className: cx('iui-calendar-month-year', monthYearProps?.className),
|
|
439
|
+
},
|
|
440
|
+
showYearSelection &&
|
|
441
|
+
React.createElement(
|
|
442
|
+
IconButton,
|
|
443
|
+
{
|
|
444
|
+
styleType: 'borderless',
|
|
445
|
+
onClick: handleMoveToPreviousYear,
|
|
446
|
+
'aria-label': 'Previous year',
|
|
447
|
+
size: 'small',
|
|
448
|
+
},
|
|
449
|
+
React.createElement(SvgChevronLeftDouble, null),
|
|
450
|
+
),
|
|
451
|
+
React.createElement(
|
|
452
|
+
IconButton,
|
|
453
|
+
{
|
|
454
|
+
styleType: 'borderless',
|
|
455
|
+
onClick: handleMoveToPreviousMonth,
|
|
456
|
+
'aria-label': 'Previous month',
|
|
457
|
+
size: 'small',
|
|
458
|
+
},
|
|
459
|
+
React.createElement(SvgChevronLeft, null),
|
|
460
|
+
),
|
|
461
|
+
React.createElement(
|
|
462
|
+
'span',
|
|
463
|
+
{ 'aria-live': 'polite' },
|
|
464
|
+
React.createElement(
|
|
465
|
+
Box,
|
|
466
|
+
{
|
|
467
|
+
as: 'span',
|
|
468
|
+
id: dateTableId,
|
|
469
|
+
title: monthNames[displayedMonthIndex],
|
|
470
|
+
...monthProps,
|
|
471
|
+
className: cx('iui-calendar-month', monthProps?.className),
|
|
472
|
+
},
|
|
473
|
+
monthNames[displayedMonthIndex],
|
|
474
|
+
),
|
|
475
|
+
'\u00A0',
|
|
476
|
+
displayedYear,
|
|
477
|
+
),
|
|
478
|
+
React.createElement(
|
|
479
|
+
IconButton,
|
|
480
|
+
{
|
|
481
|
+
styleType: 'borderless',
|
|
482
|
+
onClick: handleMoveToNextMonth,
|
|
483
|
+
'aria-label': 'Next month',
|
|
484
|
+
size: 'small',
|
|
485
|
+
},
|
|
486
|
+
React.createElement(SvgChevronRight, null),
|
|
487
|
+
),
|
|
488
|
+
showYearSelection &&
|
|
489
|
+
React.createElement(
|
|
490
|
+
IconButton,
|
|
491
|
+
{
|
|
492
|
+
styleType: 'borderless',
|
|
493
|
+
onClick: handleMoveToNextYear,
|
|
494
|
+
'aria-label': 'Next year',
|
|
495
|
+
size: 'small',
|
|
496
|
+
},
|
|
497
|
+
React.createElement(SvgChevronRightDouble, null),
|
|
498
|
+
),
|
|
499
|
+
),
|
|
500
|
+
React.createElement(
|
|
501
|
+
Box,
|
|
502
|
+
{
|
|
503
|
+
as: 'div',
|
|
504
|
+
...weekDayProps,
|
|
505
|
+
className: cx('iui-calendar-weekdays', weekDayProps?.className),
|
|
506
|
+
},
|
|
507
|
+
shortDays.map((day, index) =>
|
|
508
|
+
React.createElement('div', { key: day, title: longDays[index] }, day),
|
|
509
|
+
),
|
|
510
|
+
),
|
|
511
|
+
React.createElement(
|
|
512
|
+
'div',
|
|
513
|
+
{
|
|
514
|
+
onKeyDown: handleCalendarKeyDown,
|
|
515
|
+
role: 'listbox',
|
|
516
|
+
'aria-labelledby': dateTableId,
|
|
517
|
+
...calendarProps,
|
|
518
|
+
},
|
|
519
|
+
weeks.map((weekDays, weekIndex) => {
|
|
520
|
+
return React.createElement(
|
|
521
|
+
Box,
|
|
522
|
+
{
|
|
523
|
+
as: 'div',
|
|
524
|
+
key: `week-${displayedMonthIndex}-${weekIndex}`,
|
|
525
|
+
...weekProps,
|
|
526
|
+
className: cx('iui-calendar-week', weekProps?.className),
|
|
527
|
+
},
|
|
528
|
+
weekDays.map((weekDay, dayIndex) => {
|
|
529
|
+
const dateValue = weekDay.getDate();
|
|
530
|
+
const isDisabled = isDateDisabled?.(weekDay);
|
|
531
|
+
return React.createElement(
|
|
532
|
+
Box,
|
|
533
|
+
{
|
|
534
|
+
as: 'div',
|
|
535
|
+
key: `day-${displayedMonthIndex}-${dayIndex}`,
|
|
536
|
+
onClick: () => !isDisabled && onDayClick(weekDay),
|
|
537
|
+
role: 'option',
|
|
538
|
+
tabIndex: isSameDay(weekDay, focusedDay) ? 0 : -1,
|
|
539
|
+
'aria-disabled': isDisabled ? 'true' : undefined,
|
|
540
|
+
ref: (element) =>
|
|
541
|
+
isSameDay(weekDay, focusedDay) &&
|
|
542
|
+
needFocus.current &&
|
|
543
|
+
element?.focus(),
|
|
544
|
+
...dayProps,
|
|
545
|
+
className: cx(getDayClass(weekDay), dayProps?.className),
|
|
546
|
+
},
|
|
547
|
+
dateValue,
|
|
548
|
+
);
|
|
549
|
+
}),
|
|
550
|
+
);
|
|
551
|
+
}),
|
|
552
|
+
),
|
|
553
|
+
),
|
|
554
|
+
showTime &&
|
|
555
|
+
React.createElement(TimePicker, {
|
|
556
|
+
date: selectedStartDay ?? selectedDay,
|
|
557
|
+
use12Hours: use12Hours,
|
|
558
|
+
precision: precision,
|
|
559
|
+
hourStep: hourStep,
|
|
560
|
+
minuteStep: minuteStep,
|
|
561
|
+
secondStep: secondStep,
|
|
562
|
+
useCombinedRenderer: useCombinedRenderer,
|
|
563
|
+
combinedRenderer: combinedRenderer,
|
|
564
|
+
hourRenderer: hourRenderer,
|
|
565
|
+
minuteRenderer: minuteRenderer,
|
|
566
|
+
secondRenderer: secondRenderer,
|
|
567
|
+
meridiemRenderer: meridiemRenderer,
|
|
568
|
+
onChange: (date) =>
|
|
569
|
+
isSingleOnChange(onChange, enableRangeSelect)
|
|
570
|
+
? onChange?.(date)
|
|
571
|
+
: onChange?.(
|
|
572
|
+
new Date(
|
|
573
|
+
selectedStartDay?.getFullYear() ?? date.getFullYear(),
|
|
574
|
+
selectedStartDay?.getMonth() ?? date.getMonth(),
|
|
575
|
+
selectedStartDay?.getDate() ?? date.getDate(),
|
|
576
|
+
date.getHours(),
|
|
577
|
+
date.getMinutes(),
|
|
578
|
+
date.getSeconds(),
|
|
579
|
+
),
|
|
580
|
+
new Date(
|
|
581
|
+
selectedEndDay?.getFullYear() ?? date.getFullYear(),
|
|
582
|
+
selectedEndDay?.getMonth() ?? date.getMonth(),
|
|
583
|
+
selectedEndDay?.getDate() ?? date.getDate(),
|
|
584
|
+
date.getHours(),
|
|
585
|
+
date.getMinutes(),
|
|
586
|
+
date.getSeconds(),
|
|
587
|
+
),
|
|
588
|
+
),
|
|
589
|
+
}),
|
|
590
|
+
);
|
|
363
591
|
});
|
|
364
592
|
export default DatePicker;
|