@itwin/itwinui-react 3.0.0-dev.3 → 3.0.0-dev.5
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 +65 -0
- package/cjs/core/Alert/Alert.d.ts +5 -5
- package/cjs/core/Alert/Alert.js +72 -59
- package/cjs/core/Alert/index.js +9 -4
- package/cjs/core/Avatar/Avatar.d.ts +3 -7
- package/cjs/core/Avatar/Avatar.js +61 -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 +70 -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 +131 -61
- package/cjs/core/Breadcrumbs/index.js +9 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/cjs/core/ButtonGroup/ButtonGroup.js +65 -53
- package/cjs/core/ButtonGroup/index.js +9 -4
- package/cjs/core/Buttons/Button/Button.d.ts +1 -1
- package/cjs/core/Buttons/Button/Button.js +43 -36
- package/cjs/core/Buttons/Button/index.js +9 -4
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +61 -51
- package/cjs/core/Buttons/DropdownButton/index.js +9 -4
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +59 -38
- 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 +1 -1
- package/cjs/core/Buttons/SplitButton/SplitButton.js +68 -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 +3 -3
- package/cjs/core/Carousel/Carousel.js +109 -107
- package/cjs/core/Carousel/CarouselContext.js +4 -26
- package/cjs/core/Carousel/CarouselDot.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDot.js +25 -37
- package/cjs/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDotsList.js +129 -95
- package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/cjs/core/Carousel/CarouselNavigation.js +97 -66
- package/cjs/core/Carousel/CarouselSlide.d.ts +1 -1
- package/cjs/core/Carousel/CarouselSlide.js +39 -46
- package/cjs/core/Carousel/CarouselSlider.js +66 -71
- 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 +289 -198
- package/cjs/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +453 -282
- package/cjs/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorPalette.js +124 -113
- package/cjs/core/ColorPicker/ColorPicker.d.ts +1 -6
- package/cjs/core/ColorPicker/ColorPicker.js +82 -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 +6 -6
- package/cjs/core/ComboBox/ComboBox.js +393 -294
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxDropdown.js +39 -42
- package/cjs/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +46 -43
- package/cjs/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxInput.js +200 -152
- package/cjs/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +35 -34
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.js +108 -73
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +71 -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 +2 -2
- package/cjs/core/ComboBox/helpers.js +47 -65
- package/cjs/core/ComboBox/index.js +9 -4
- package/cjs/core/DatePicker/DatePicker.d.ts +2 -2
- package/cjs/core/DatePicker/DatePicker.js +523 -357
- package/cjs/core/DatePicker/index.js +15 -5
- package/cjs/core/Dialog/Dialog.d.ts +1 -1
- package/cjs/core/Dialog/Dialog.js +72 -68
- 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.js +3 -3
- package/cjs/core/Dialog/DialogContext.d.ts +1 -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 +184 -142
- 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 +4 -4
- package/cjs/core/DropdownMenu/DropdownMenu.js +72 -50
- package/cjs/core/DropdownMenu/index.js +9 -4
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +233 -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 +1 -1
- package/cjs/core/FileUpload/FileUpload.js +67 -67
- package/cjs/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadCard.js +168 -108
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +51 -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 +37 -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 +1 -1
- package/cjs/core/Header/HeaderButton.js +74 -43
- package/cjs/core/Header/HeaderDropdownButton.js +49 -45
- package/cjs/core/Header/HeaderLogo.d.ts +1 -1
- package/cjs/core/Header/HeaderLogo.js +42 -36
- package/cjs/core/Header/HeaderSplitButton.js +68 -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 -67
- 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 +1 -6
- package/cjs/core/Input/Input.js +16 -40
- package/cjs/core/Input/index.js +9 -4
- package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
- package/cjs/core/InputGroup/InputGroup.js +46 -41
- package/cjs/core/InputGroup/index.js +9 -4
- package/cjs/core/Label/Label.d.ts +1 -1
- package/cjs/core/Label/Label.js +30 -36
- package/cjs/core/Label/index.js +9 -4
- package/cjs/core/LabeledInput/LabeledInput.d.ts +1 -1
- package/cjs/core/LabeledInput/LabeledInput.js +49 -33
- package/cjs/core/LabeledInput/index.js +9 -4
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +56 -44
- package/cjs/core/LabeledSelect/index.js +9 -4
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +49 -33
- 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 +1 -1
- package/cjs/core/Menu/Menu.js +66 -78
- package/cjs/core/Menu/MenuDivider.js +4 -4
- package/cjs/core/Menu/MenuExtraContent.js +4 -4
- package/cjs/core/Menu/MenuItem.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.js +143 -86
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +54 -43
- package/cjs/core/Menu/index.js +43 -13
- package/cjs/core/Modal/Modal.d.ts +1 -1
- package/cjs/core/Modal/Modal.js +38 -33
- 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/{esm/core/ProgressIndicators/ProgressRadial → cjs/core/Overlay}/index.js +10 -2
- package/cjs/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
- package/cjs/core/ProgressIndicators/ProgressLinear.js +64 -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 +1 -6
- package/cjs/core/Radio/Radio.js +41 -42
- package/cjs/core/Radio/index.js +9 -4
- package/cjs/core/RadioTiles/RadioTile.d.ts +1 -6
- package/cjs/core/RadioTiles/RadioTile.js +46 -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 +5 -10
- package/cjs/core/Select/Select.js +291 -181
- 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 +1 -1
- package/cjs/core/SideNavigation/SideNavigation.js +105 -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 +5 -9
- package/cjs/core/Slider/Slider.js +343 -227
- package/cjs/core/Slider/Thumb.d.ts +4 -4
- package/cjs/core/Slider/Thumb.js +111 -84
- package/cjs/core/Slider/Track.d.ts +3 -3
- package/cjs/core/Slider/Track.js +72 -76
- package/cjs/core/Slider/index.js +9 -4
- package/cjs/core/StatusMessage/StatusMessage.d.ts +2 -2
- package/cjs/core/StatusMessage/StatusMessage.js +19 -32
- package/cjs/core/StatusMessage/index.js +9 -4
- package/cjs/core/Stepper/Stepper.d.ts +3 -3
- package/cjs/core/Stepper/Stepper.js +51 -36
- package/cjs/core/Stepper/StepperStep.d.ts +1 -1
- package/cjs/core/Stepper/StepperStep.js +84 -63
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +1 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +25 -33
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
- package/cjs/core/Stepper/WorkflowDiagramStep.js +32 -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 +35 -37
- package/cjs/core/Table/Table.d.ts +2 -2
- package/cjs/core/Table/Table.js +725 -448
- 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 +312 -159
- package/cjs/core/Table/TableRowMemoized.d.ts +4 -4
- package/cjs/core/Table/TableRowMemoized.js +137 -89
- package/cjs/core/Table/actionHandlers/expandHandler.js +12 -12
- package/cjs/core/Table/actionHandlers/filterHandler.js +25 -17
- 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 -68
- 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 +106 -96
- 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 +3 -2
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +92 -72
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +118 -79
- 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 +59 -51
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +58 -52
- package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +40 -44
- 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 +1 -1
- 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 -290
- package/cjs/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/cjs/core/Table/hooks/useScrollToRow.js +46 -60
- package/cjs/core/Table/hooks/useSelectionCell.js +17 -10
- package/cjs/core/Table/hooks/useStickyColumns.js +64 -62
- package/cjs/core/Table/hooks/useSubRowFiltering.js +95 -110
- package/cjs/core/Table/hooks/useSubRowSelection.js +32 -53
- 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 +51 -38
- package/cjs/core/Tabs/Tabs.d.ts +6 -42
- package/cjs/core/Tabs/Tabs.js +408 -364
- 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 +2 -9
- package/cjs/core/Textarea/Textarea.js +17 -41
- package/cjs/core/Textarea/index.js +9 -4
- package/cjs/core/ThemeProvider/ThemeContext.js +4 -26
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +4 -4
- package/cjs/core/ThemeProvider/ThemeProvider.js +77 -54
- package/cjs/core/ThemeProvider/index.js +9 -4
- package/cjs/core/Tile/Tile.d.ts +157 -99
- package/cjs/core/Tile/Tile.js +417 -143
- 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 +5 -5
- package/cjs/core/Toast/Toast.js +192 -132
- package/cjs/core/Toast/Toaster.d.ts +5 -5
- package/cjs/core/Toast/Toaster.js +103 -100
- package/cjs/core/Toast/index.js +9 -4
- 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 +67 -7
- package/cjs/core/Tooltip/Tooltip.js +152 -38
- package/cjs/core/Tooltip/index.js +9 -4
- package/cjs/core/TransferList/TransferList.d.ts +6 -6
- package/cjs/core/TransferList/TransferList.js +184 -103
- package/cjs/core/TransferList/index.js +9 -4
- package/cjs/core/Tree/Tree.d.ts +5 -5
- package/cjs/core/Tree/Tree.js +205 -157
- 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 -129
- 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 +6 -5
- package/cjs/core/index.js +889 -184
- package/cjs/core/utils/color/ColorValue.d.ts +4 -4
- package/cjs/core/utils/color/ColorValue.js +535 -453
- 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 -35
- package/cjs/core/utils/components/Box.js +3 -3
- 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 +1 -1
- package/cjs/core/utils/components/Icon.js +25 -43
- package/cjs/core/utils/components/InputContainer.d.ts +2 -2
- package/cjs/core/utils/components/InputContainer.js +75 -46
- package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -1
- package/cjs/core/utils/components/InputFlexContainer.js +22 -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 -44
- package/cjs/core/utils/components/Popover.d.ts +3 -3
- package/cjs/core/utils/components/Popover.js +111 -135
- package/cjs/core/utils/components/Resizer.d.ts +2 -2
- package/cjs/core/utils/components/Resizer.js +246 -211
- package/cjs/core/utils/components/VirtualScroll.d.ts +2 -2
- package/cjs/core/utils/components/VirtualScroll.js +304 -245
- 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.js +18 -31
- package/cjs/core/utils/functions/colors.js +36 -33
- package/cjs/core/utils/functions/date.js +10 -10
- package/cjs/core/utils/functions/dom.js +24 -17
- 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 +1 -0
- package/cjs/core/utils/functions/index.js +11 -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/supports.js +5 -4
- package/cjs/core/utils/hooks/index.js +16 -29
- package/cjs/core/utils/hooks/useContainerWidth.js +26 -41
- package/cjs/core/utils/hooks/useDragAndDrop.js +110 -109
- package/cjs/core/utils/hooks/useEventListener.js +22 -44
- package/cjs/core/utils/hooks/useGlobals.js +34 -51
- package/cjs/core/utils/hooks/useId.js +9 -30
- package/cjs/core/utils/hooks/useIntersection.js +30 -46
- 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 -53
- package/cjs/core/utils/hooks/useMergedRefs.js +15 -38
- package/cjs/core/utils/hooks/useOverflow.js +69 -78
- package/cjs/core/utils/hooks/useResizeObserver.js +22 -39
- 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.js +5 -18
- package/cjs/package.json +1 -0
- package/cjs/styles.js +453 -445
- package/cjs/types/react-table-config.js +2 -2
- package/esm/core/Alert/Alert.d.ts +5 -5
- package/esm/core/Alert/Alert.js +73 -28
- package/esm/core/Avatar/Avatar.d.ts +3 -7
- package/esm/core/Avatar/Avatar.js +48 -17
- 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 +63 -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 +128 -31
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/core/ButtonGroup/ButtonGroup.js +59 -22
- package/esm/core/Buttons/Button/Button.d.ts +1 -1
- package/esm/core/Buttons/Button/Button.js +37 -5
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +54 -19
- package/esm/core/Buttons/IconButton/IconButton.d.ts +1 -1
- package/esm/core/Buttons/IconButton/IconButton.js +51 -7
- 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 +1 -1
- package/esm/core/Buttons/SplitButton/SplitButton.js +59 -15
- package/esm/core/Carousel/Carousel.d.ts +3 -3
- package/esm/core/Carousel/Carousel.js +97 -70
- package/esm/core/Carousel/CarouselDot.d.ts +1 -1
- package/esm/core/Carousel/CarouselDot.js +19 -6
- package/esm/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/esm/core/Carousel/CarouselDotsList.js +123 -63
- package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/esm/core/Carousel/CarouselNavigation.js +85 -32
- package/esm/core/Carousel/CarouselSlide.d.ts +1 -1
- package/esm/core/Carousel/CarouselSlide.js +29 -14
- package/esm/core/Carousel/CarouselSlider.js +65 -40
- package/esm/core/Checkbox/Checkbox.d.ts +9 -5
- package/esm/core/Checkbox/Checkbox.js +78 -28
- package/esm/core/ColorPicker/ColorBuilder.js +277 -166
- package/esm/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +437 -248
- package/esm/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/esm/core/ColorPicker/ColorPalette.js +115 -80
- package/esm/core/ColorPicker/ColorPicker.d.ts +1 -6
- package/esm/core/ColorPicker/ColorPicker.js +75 -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 +6 -6
- package/esm/core/ComboBox/ComboBox.js +385 -256
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxDropdown.js +32 -15
- package/esm/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxEndIcon.js +39 -12
- package/esm/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxInput.js +197 -124
- package/esm/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxInputContainer.js +20 -5
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.js +94 -38
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.js +59 -13
- package/esm/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMultipleContainer.js +6 -2
- package/esm/core/ComboBox/helpers.d.ts +2 -2
- package/esm/core/ComboBox/helpers.js +38 -38
- package/esm/core/DatePicker/DatePicker.d.ts +2 -2
- package/esm/core/DatePicker/DatePicker.js +519 -325
- package/esm/core/Dialog/Dialog.d.ts +1 -1
- package/esm/core/Dialog/Dialog.js +65 -31
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +39 -19
- package/esm/core/Dialog/DialogContext.d.ts +1 -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 +178 -108
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBar.js +45 -10
- package/esm/core/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/esm/core/DropdownMenu/DropdownMenu.js +66 -22
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
- package/esm/core/ExpandableBlock/ExpandableBlock.js +225 -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 +1 -1
- package/esm/core/FileUpload/FileUpload.js +49 -36
- package/esm/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadCard.js +154 -76
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +37 -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 +28 -7
- package/esm/core/Header/HeaderBreadcrumbs.d.ts +1 -1
- package/esm/core/Header/HeaderBreadcrumbs.js +32 -8
- package/esm/core/Header/HeaderButton.d.ts +1 -1
- package/esm/core/Header/HeaderButton.js +60 -13
- package/esm/core/Header/HeaderDropdownButton.js +43 -13
- package/esm/core/Header/HeaderLogo.d.ts +1 -1
- package/esm/core/Header/HeaderLogo.js +36 -5
- package/esm/core/Header/HeaderSplitButton.js +57 -13
- package/esm/core/InformationPanel/InformationPanel.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanel.js +71 -36
- 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 +1 -6
- package/esm/core/Input/Input.js +10 -9
- package/esm/core/InputGroup/InputGroup.d.ts +1 -1
- package/esm/core/InputGroup/InputGroup.js +37 -14
- package/esm/core/Label/Label.d.ts +1 -1
- package/esm/core/Label/Label.js +24 -5
- package/esm/core/LabeledInput/LabeledInput.d.ts +1 -1
- package/esm/core/LabeledInput/LabeledInput.js +43 -5
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +50 -16
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
- package/esm/core/LabeledTextarea/LabeledTextarea.js +43 -5
- package/esm/core/List/ListItem.d.ts +4 -4
- package/esm/core/List/ListItem.js +46 -28
- package/esm/core/Menu/Menu.d.ts +1 -1
- package/esm/core/Menu/Menu.js +58 -47
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Menu/MenuExtraContent.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +1 -1
- package/esm/core/Menu/MenuItem.js +131 -57
- package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.js +44 -12
- package/esm/core/Modal/Modal.d.ts +1 -1
- package/esm/core/Modal/Modal.js +33 -6
- 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/ProgressLinear → Overlay}/index.js +1 -2
- package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
- package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.js → ProgressLinear.js} +33 -12
- 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 +1 -6
- package/esm/core/Radio/Radio.js +32 -11
- package/esm/core/RadioTiles/RadioTile.d.ts +1 -6
- package/esm/core/RadioTiles/RadioTile.js +32 -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 +5 -10
- package/esm/core/Select/Select.js +283 -148
- 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 +1 -1
- package/esm/core/SideNavigation/SideNavigation.js +94 -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 +5 -9
- package/esm/core/Slider/Slider.js +319 -194
- package/esm/core/Slider/Thumb.d.ts +4 -4
- package/esm/core/Slider/Thumb.js +100 -52
- package/esm/core/Slider/Track.d.ts +3 -3
- package/esm/core/Slider/Track.js +67 -49
- package/esm/core/StatusMessage/StatusMessage.d.ts +2 -2
- package/esm/core/StatusMessage/StatusMessage.js +18 -5
- package/esm/core/Stepper/Stepper.d.ts +3 -3
- package/esm/core/Stepper/Stepper.js +45 -8
- package/esm/core/Stepper/StepperStep.d.ts +1 -1
- package/esm/core/Stepper/StepperStep.js +73 -31
- package/esm/core/Stepper/WorkflowDiagram.d.ts +1 -1
- package/esm/core/Stepper/WorkflowDiagram.js +19 -5
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
- package/esm/core/Stepper/WorkflowDiagramStep.js +18 -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 +29 -9
- package/esm/core/Table/Table.d.ts +2 -2
- package/esm/core/Table/Table.js +726 -411
- 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 +307 -125
- package/esm/core/Table/TableRowMemoized.d.ts +4 -4
- package/esm/core/Table/TableRowMemoized.js +129 -58
- package/esm/core/Table/actionHandlers/expandHandler.js +10 -10
- package/esm/core/Table/actionHandlers/filterHandler.js +23 -15
- 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 -41
- package/esm/core/Table/columns/actionColumn.d.ts +3 -3
- package/esm/core/Table/columns/actionColumn.js +90 -58
- 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 +3 -2
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +84 -42
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +108 -46
- 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 +55 -20
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +50 -22
- package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/esm/core/Table/filters/TextFilter/TextFilter.js +32 -14
- 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 +1 -1
- 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 -287
- package/esm/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/esm/core/Table/hooks/useScrollToRow.js +42 -34
- package/esm/core/Table/hooks/useSelectionCell.js +10 -6
- package/esm/core/Table/hooks/useStickyColumns.js +61 -59
- package/esm/core/Table/hooks/useSubRowFiltering.js +90 -83
- package/esm/core/Table/hooks/useSubRowSelection.js +28 -27
- 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 -7
- package/esm/core/Tabs/Tabs.d.ts +6 -42
- package/esm/core/Tabs/Tabs.js +391 -329
- 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 +2 -9
- package/esm/core/Textarea/Textarea.js +11 -10
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +4 -4
- package/esm/core/ThemeProvider/ThemeProvider.js +65 -21
- package/esm/core/Tile/Tile.d.ts +157 -99
- package/esm/core/Tile/Tile.js +397 -109
- package/esm/core/TimePicker/TimePicker.d.ts +3 -3
- package/esm/core/TimePicker/TimePicker.js +448 -228
- package/esm/core/Toast/Toast.d.ts +5 -5
- package/esm/core/Toast/Toast.js +180 -99
- package/esm/core/Toast/Toaster.d.ts +5 -5
- package/esm/core/Toast/Toaster.js +83 -67
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
- package/esm/core/ToggleSwitch/ToggleSwitch.js +60 -22
- package/esm/core/Tooltip/Tooltip.d.ts +67 -7
- package/esm/core/Tooltip/Tooltip.js +161 -7
- package/esm/core/TransferList/TransferList.d.ts +6 -6
- package/esm/core/TransferList/TransferList.js +163 -93
- package/esm/core/Tree/Tree.d.ts +5 -5
- package/esm/core/Tree/Tree.js +197 -125
- 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 -96
- 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 +6 -5
- package/esm/core/index.js +82 -14
- package/esm/core/utils/color/ColorValue.d.ts +4 -4
- package/esm/core/utils/color/ColorValue.js +524 -449
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +11 -7
- 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 +1 -1
- package/esm/core/utils/components/Icon.js +19 -12
- package/esm/core/utils/components/InputContainer.d.ts +2 -2
- package/esm/core/utils/components/InputContainer.js +65 -15
- package/esm/core/utils/components/InputFlexContainer.d.ts +1 -1
- package/esm/core/utils/components/InputFlexContainer.js +13 -2
- package/esm/core/utils/components/MiddleTextTruncation.d.ts +2 -2
- package/esm/core/utils/components/MiddleTextTruncation.js +27 -17
- package/esm/core/utils/components/Popover.d.ts +3 -3
- package/esm/core/utils/components/Popover.js +103 -102
- package/esm/core/utils/components/Resizer.d.ts +2 -2
- package/esm/core/utils/components/Resizer.js +242 -184
- package/esm/core/utils/components/VirtualScroll.d.ts +2 -2
- package/esm/core/utils/components/VirtualScroll.js +297 -218
- 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/functions/colors.js +30 -30
- package/esm/core/utils/functions/date.js +8 -8
- package/esm/core/utils/functions/dom.js +17 -14
- 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 +13 -0
- package/esm/core/utils/functions/index.d.ts +1 -0
- package/esm/core/utils/functions/index.js +1 -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/supports.js +2 -1
- package/esm/core/utils/hooks/useContainerWidth.js +16 -13
- package/esm/core/utils/hooks/useDragAndDrop.js +99 -80
- package/esm/core/utils/hooks/useEventListener.js +18 -18
- package/esm/core/utils/hooks/useGlobals.js +29 -24
- package/esm/core/utils/hooks/useId.js +2 -2
- package/esm/core/utils/hooks/useIntersection.js +25 -19
- 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 -25
- package/esm/core/utils/hooks/useMergedRefs.js +11 -12
- package/esm/core/utils/hooks/useOverflow.js +62 -50
- package/esm/core/utils/hooks/useResizeObserver.js +17 -12
- 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/styles.js +453 -447
- package/package.json +34 -30
- package/styles.css +575 -598
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -65
- package/cjs/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
- package/cjs/core/ProgressIndicators/ProgressLinear/index.js +0 -10
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -77
- package/cjs/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
- package/cjs/core/ProgressIndicators/ProgressRadial/index.js +0 -10
- package/cjs/core/Stepper/Wizard.d.ts +0 -46
- package/cjs/core/Stepper/Wizard.js +0 -55
- 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
|
@@ -4,48 +4,64 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
mergeRefs,
|
|
9
|
+
useResizeObserver,
|
|
10
|
+
useIsomorphicLayoutEffect,
|
|
11
|
+
} from '../hooks/index.js';
|
|
12
|
+
const unstable_batchedUpdates =
|
|
13
|
+
ReactDOM.unstable_batchedUpdates ?? ((cb) => void cb());
|
|
9
14
|
const getScrollableParent = (element, ownerDocument = document) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
if (!element || element === ownerDocument.body) {
|
|
16
|
+
return ownerDocument.body;
|
|
17
|
+
}
|
|
18
|
+
return isElementScrollable(element)
|
|
19
|
+
? element
|
|
20
|
+
: getScrollableParent(element.parentElement, ownerDocument);
|
|
16
21
|
};
|
|
17
22
|
const isElementScrollable = (element) => {
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
return /(auto|scroll|overlay)/.test(
|
|
24
|
+
getElementStyle(element, 'overflow') +
|
|
25
|
+
getElementStyle(element, 'overflow-y'),
|
|
26
|
+
);
|
|
20
27
|
};
|
|
21
28
|
const getElementStyle = (element, prop) => {
|
|
22
|
-
|
|
29
|
+
return getComputedStyle(element, null).getPropertyValue(prop);
|
|
23
30
|
};
|
|
24
31
|
const getElementHeight = (element) => {
|
|
25
|
-
|
|
32
|
+
return element?.getBoundingClientRect().height ?? 0;
|
|
26
33
|
};
|
|
27
34
|
const getElementHeightWithMargins = (element) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
if (!element) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const margin =
|
|
39
|
+
parseFloat(getElementStyle(element, 'margin-top')) +
|
|
40
|
+
parseFloat(getElementStyle(element, 'margin-bottom'));
|
|
41
|
+
return getElementHeight(element) + (isNaN(margin) ? 0 : margin);
|
|
34
42
|
};
|
|
35
43
|
const getNumberOfNodesInHeight = (childHeight, totalHeight) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
if (!childHeight) {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
return Math.floor(totalHeight / childHeight);
|
|
40
48
|
};
|
|
41
49
|
const getTranslateValue = (childHeight, startIndex) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
if (startIndex > 0) {
|
|
51
|
+
return childHeight * startIndex;
|
|
52
|
+
}
|
|
53
|
+
return 0;
|
|
46
54
|
};
|
|
47
|
-
const getVisibleNodeCount = (
|
|
48
|
-
|
|
55
|
+
const getVisibleNodeCount = (
|
|
56
|
+
childHeight,
|
|
57
|
+
startIndex,
|
|
58
|
+
childrenLength,
|
|
59
|
+
scrollContainer,
|
|
60
|
+
) => {
|
|
61
|
+
return Math.min(
|
|
62
|
+
childrenLength - startIndex,
|
|
63
|
+
getNumberOfNodesInHeight(childHeight, getElementHeight(scrollContainer)),
|
|
64
|
+
);
|
|
49
65
|
};
|
|
50
66
|
/**
|
|
51
67
|
* `VirtualScroll` component is used to render a huge amount of items in the DOM. It renders only the ones which are visible
|
|
@@ -69,9 +85,12 @@ const getVisibleNodeCount = (childHeight, startIndex, childrenLength, scrollCont
|
|
|
69
85
|
* @private
|
|
70
86
|
*/
|
|
71
87
|
export const VirtualScroll = React.forwardRef((props, ref) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
const { innerProps, outerProps, visibleChildren } = useVirtualization(props);
|
|
89
|
+
return React.createElement(
|
|
90
|
+
'div',
|
|
91
|
+
{ ...outerProps, ref: ref },
|
|
92
|
+
React.createElement('div', { ...innerProps }, visibleChildren),
|
|
93
|
+
);
|
|
75
94
|
});
|
|
76
95
|
/**
|
|
77
96
|
* `useVirtualization` is used for efficiently rendering only the visible rows from a large list.
|
|
@@ -94,193 +113,253 @@ export const VirtualScroll = React.forwardRef((props, ref) => {
|
|
|
94
113
|
* @private
|
|
95
114
|
*/
|
|
96
115
|
export const useVirtualization = (props) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
resizeRef(scrollableParent);
|
|
153
|
-
}, [resizeRef]);
|
|
154
|
-
// Stop watching resize, when virtual scroll is unmounted
|
|
155
|
-
useIsomorphicLayoutEffect(() => {
|
|
156
|
-
return () => resizeObserver?.disconnect();
|
|
157
|
-
}, [resizeObserver]);
|
|
158
|
-
// Get child height when children available
|
|
159
|
-
useIsomorphicLayoutEffect(() => updateChildHeight(), [updateChildHeight]);
|
|
160
|
-
const updateVirtualScroll = React.useCallback(() => {
|
|
161
|
-
const scrollableContainer = getScrollableContainer();
|
|
162
|
-
if (!scrollableContainer) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const start = getNumberOfNodesInHeight(childHeight.current.middle, Math.round(scrollableContainer.scrollTop));
|
|
166
|
-
const visibleNodes = getVisibleNodeCount(childHeight.current.middle, start, itemsLength, scrollableContainer);
|
|
167
|
-
// If there are less items at the end than buffer size
|
|
168
|
-
// show more items at the start.
|
|
169
|
-
// Have boundaries for edge cases, e.g. 1 item length
|
|
170
|
-
const startIndex = Math.min(Math.max(0, start - bufferSize), Math.max(0, itemsLength - bufferSize * 2 - visibleNodes));
|
|
171
|
-
visibleIndex.current = { start: start, end: start + visibleNodes };
|
|
172
|
-
setStartNode(startIndex);
|
|
173
|
-
setVisibleNodeCount(visibleNodes);
|
|
174
|
-
if (!parentRef.current) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
parentRef.current.style.transform = `translateY(${getTranslateValue(childHeight.current.middle, startIndex)}px)`;
|
|
178
|
-
}, [bufferSize, itemsLength]);
|
|
179
|
-
const onScroll = React.useCallback(() => {
|
|
180
|
-
updateVirtualScroll();
|
|
181
|
-
}, [updateVirtualScroll]);
|
|
182
|
-
const removeScrollListener = React.useCallback(() => {
|
|
183
|
-
if (!onScrollRef.current) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
!scrollContainer.current ||
|
|
187
|
-
scrollContainer.current === parentRef.current?.ownerDocument.body
|
|
188
|
-
? parentRef.current?.ownerDocument.removeEventListener('scroll', onScrollRef.current)
|
|
189
|
-
: scrollContainer.current.removeEventListener('scroll', onScrollRef.current);
|
|
190
|
-
}, []);
|
|
191
|
-
// Add event listener to the scrollable container.
|
|
192
|
-
useIsomorphicLayoutEffect(() => {
|
|
193
|
-
removeScrollListener();
|
|
194
|
-
onScrollRef.current = onScroll;
|
|
195
|
-
if (!scrollContainer.current ||
|
|
196
|
-
scrollContainer.current === parentRef.current?.ownerDocument.body) {
|
|
197
|
-
parentRef.current?.ownerDocument.addEventListener('scroll', onScroll);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
scrollContainer.current.addEventListener('scroll', onScroll);
|
|
201
|
-
}
|
|
202
|
-
return removeScrollListener;
|
|
203
|
-
}, [onScroll, removeScrollListener]);
|
|
204
|
-
useIsomorphicLayoutEffect(() => {
|
|
205
|
-
if (!isMounted) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
const scrollableContainer = getScrollableContainer();
|
|
209
|
-
if (!scrollableContainer || scrollToIndex == null) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
// if `scrollToIndex` is not visible, scroll to it
|
|
213
|
-
if (scrollToIndex > visibleIndex.current.end ||
|
|
214
|
-
scrollToIndex < visibleIndex.current.start) {
|
|
215
|
-
const indexDiff = scrollToIndex > visibleIndex.current.end
|
|
216
|
-
? scrollToIndex - visibleIndex.current.end
|
|
217
|
-
: scrollToIndex - visibleIndex.current.start;
|
|
218
|
-
if (scrollToIndex === 0) {
|
|
219
|
-
scrollableContainer.scrollTo({ top: 0 });
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
// If go down: add to the existing scrollTop needed height
|
|
223
|
-
// If go up: calculate the exact scroll top
|
|
224
|
-
scrollableContainer.scrollTo({
|
|
225
|
-
top: indexDiff > 0
|
|
226
|
-
? Math.ceil(scrollableContainer.scrollTop) +
|
|
227
|
-
indexDiff * childHeight.current.middle
|
|
228
|
-
: scrollToIndex * childHeight.current.middle,
|
|
229
|
-
});
|
|
230
|
-
// update visible index
|
|
231
|
-
const start = getNumberOfNodesInHeight(childHeight.current.middle, Math.round(scrollableContainer.scrollTop));
|
|
232
|
-
const visibleNodes = getVisibleNodeCount(childHeight.current.middle, start, itemsLength, scrollableContainer);
|
|
233
|
-
visibleIndex.current = { start: start, end: start + visibleNodes };
|
|
234
|
-
}
|
|
235
|
-
// if `scrollToIndex` is the first visible node
|
|
236
|
-
// ensure it is fully visible
|
|
237
|
-
if (scrollToIndex === visibleIndex.current.start) {
|
|
238
|
-
const roundedScrollTop = Math.round(scrollableContainer.scrollTop);
|
|
239
|
-
const diff = roundedScrollTop % childHeight.current.middle;
|
|
240
|
-
diff > 0 &&
|
|
241
|
-
scrollableContainer.scrollTo({
|
|
242
|
-
top: roundedScrollTop - diff,
|
|
243
|
-
});
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
// if `scrollToIndex` is the last visible node
|
|
247
|
-
// ensure it is fully visible
|
|
248
|
-
if (scrollToIndex === visibleIndex.current.end) {
|
|
249
|
-
const diff = (scrollableContainer.offsetHeight - childHeight.current.first) %
|
|
250
|
-
childHeight.current.middle;
|
|
251
|
-
const roundedScrollTop = Math.ceil(scrollableContainer.scrollTop);
|
|
252
|
-
const scrollTopMod = roundedScrollTop % childHeight.current.middle;
|
|
253
|
-
if (diff > 0 && scrollTopMod === 0) {
|
|
254
|
-
scrollableContainer.scrollTo({
|
|
255
|
-
top: roundedScrollTop + childHeight.current.middle - diff,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}, [scrollToIndex, isMounted]);
|
|
260
|
-
useIsomorphicLayoutEffect(() => {
|
|
261
|
-
if (!scrollContainerHeight) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
updateVirtualScroll();
|
|
265
|
-
}, [scrollContainerHeight, updateVirtualScroll]);
|
|
266
|
-
return {
|
|
267
|
-
outerProps: {
|
|
268
|
-
style: {
|
|
269
|
-
minHeight: itemsLength > 1
|
|
270
|
-
? Math.max(itemsLength - 2, 0) * childHeight.current.middle +
|
|
271
|
-
childHeight.current.first +
|
|
272
|
-
childHeight.current.last
|
|
273
|
-
: childHeight.current.middle,
|
|
274
|
-
minWidth: '100%',
|
|
275
|
-
...style,
|
|
276
|
-
},
|
|
277
|
-
...rest,
|
|
278
|
-
},
|
|
279
|
-
innerProps: {
|
|
280
|
-
style: { willChange: 'transform' },
|
|
281
|
-
ref: mergeRefs(parentRef), // convert object ref to callback ref for better types
|
|
282
|
-
},
|
|
283
|
-
visibleChildren,
|
|
116
|
+
const {
|
|
117
|
+
itemsLength,
|
|
118
|
+
itemRenderer,
|
|
119
|
+
bufferSize = 10,
|
|
120
|
+
scrollToIndex,
|
|
121
|
+
style,
|
|
122
|
+
...rest
|
|
123
|
+
} = props;
|
|
124
|
+
const [startNode, setStartNode] = React.useState(0);
|
|
125
|
+
const [visibleNodeCount, setVisibleNodeCount] = React.useState(0);
|
|
126
|
+
const scrollContainer = React.useRef();
|
|
127
|
+
const parentRef = React.useRef(null);
|
|
128
|
+
const childHeight = React.useRef({ first: 0, middle: 0, last: 0 });
|
|
129
|
+
const onScrollRef = React.useRef();
|
|
130
|
+
// Used only to recalculate on resize
|
|
131
|
+
const [scrollContainerHeight, setScrollContainerHeight] = React.useState(0);
|
|
132
|
+
const visibleIndex = React.useRef({ start: 0, end: 0 });
|
|
133
|
+
// Used to mark when scroll container has height (updated by resize observer)
|
|
134
|
+
// because before that calculations are not right
|
|
135
|
+
const [isMounted, setIsMounted] = React.useState(false);
|
|
136
|
+
const getScrollableContainer = () =>
|
|
137
|
+
scrollContainer.current ??
|
|
138
|
+
parentRef.current?.ownerDocument.scrollingElement;
|
|
139
|
+
const visibleChildren = React.useMemo(() => {
|
|
140
|
+
const arr = [];
|
|
141
|
+
const endIndex = Math.min(
|
|
142
|
+
itemsLength,
|
|
143
|
+
startNode + visibleNodeCount + bufferSize * 2,
|
|
144
|
+
);
|
|
145
|
+
for (let i = startNode; i < endIndex; i++) {
|
|
146
|
+
arr.push(itemRenderer(i));
|
|
147
|
+
}
|
|
148
|
+
return arr;
|
|
149
|
+
}, [itemsLength, itemRenderer, bufferSize, startNode, visibleNodeCount]);
|
|
150
|
+
const updateChildHeight = React.useCallback(() => {
|
|
151
|
+
if (!parentRef.current || !visibleChildren.length) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const firstChild = parentRef.current.children.item(0);
|
|
155
|
+
const secondChild = parentRef.current.children.item(1);
|
|
156
|
+
const lastChild = parentRef.current.children.item(
|
|
157
|
+
parentRef.current.children.length - 1,
|
|
158
|
+
);
|
|
159
|
+
const firstChildHeight = Number(
|
|
160
|
+
getElementHeightWithMargins(firstChild)?.toFixed(2) ?? 0,
|
|
161
|
+
);
|
|
162
|
+
childHeight.current = {
|
|
163
|
+
first: firstChildHeight,
|
|
164
|
+
middle: Number(
|
|
165
|
+
getElementHeightWithMargins(secondChild)?.toFixed(2) ??
|
|
166
|
+
firstChildHeight,
|
|
167
|
+
),
|
|
168
|
+
last: Number(
|
|
169
|
+
getElementHeightWithMargins(lastChild)?.toFixed(2) ?? firstChildHeight,
|
|
170
|
+
),
|
|
284
171
|
};
|
|
172
|
+
}, [visibleChildren.length]);
|
|
173
|
+
const onResize = React.useCallback(
|
|
174
|
+
({ height }) => {
|
|
175
|
+
// Initial value returned by resize observer is 0
|
|
176
|
+
// So wait for the next one
|
|
177
|
+
if (height > 0) {
|
|
178
|
+
setIsMounted(true);
|
|
179
|
+
}
|
|
180
|
+
unstable_batchedUpdates(() => {
|
|
181
|
+
setScrollContainerHeight(height);
|
|
182
|
+
updateChildHeight();
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
[updateChildHeight],
|
|
186
|
+
);
|
|
187
|
+
const [resizeRef, resizeObserver] = useResizeObserver(onResize);
|
|
188
|
+
// Find scrollable parent
|
|
189
|
+
// Needed only on init
|
|
190
|
+
useIsomorphicLayoutEffect(() => {
|
|
191
|
+
const scrollableParent = getScrollableParent(
|
|
192
|
+
parentRef.current,
|
|
193
|
+
parentRef.current?.ownerDocument,
|
|
194
|
+
);
|
|
195
|
+
scrollContainer.current = scrollableParent;
|
|
196
|
+
resizeRef(scrollableParent);
|
|
197
|
+
}, [resizeRef]);
|
|
198
|
+
// Stop watching resize, when virtual scroll is unmounted
|
|
199
|
+
useIsomorphicLayoutEffect(() => {
|
|
200
|
+
return () => resizeObserver?.disconnect();
|
|
201
|
+
}, [resizeObserver]);
|
|
202
|
+
// Get child height when children available
|
|
203
|
+
useIsomorphicLayoutEffect(() => updateChildHeight(), [updateChildHeight]);
|
|
204
|
+
const updateVirtualScroll = React.useCallback(() => {
|
|
205
|
+
const scrollableContainer = getScrollableContainer();
|
|
206
|
+
if (!scrollableContainer) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const start = getNumberOfNodesInHeight(
|
|
210
|
+
childHeight.current.middle,
|
|
211
|
+
Math.round(scrollableContainer.scrollTop),
|
|
212
|
+
);
|
|
213
|
+
const visibleNodes = getVisibleNodeCount(
|
|
214
|
+
childHeight.current.middle,
|
|
215
|
+
start,
|
|
216
|
+
itemsLength,
|
|
217
|
+
scrollableContainer,
|
|
218
|
+
);
|
|
219
|
+
// If there are less items at the end than buffer size
|
|
220
|
+
// show more items at the start.
|
|
221
|
+
// Have boundaries for edge cases, e.g. 1 item length
|
|
222
|
+
const startIndex = Math.min(
|
|
223
|
+
Math.max(0, start - bufferSize),
|
|
224
|
+
Math.max(0, itemsLength - bufferSize * 2 - visibleNodes),
|
|
225
|
+
);
|
|
226
|
+
visibleIndex.current = { start: start, end: start + visibleNodes };
|
|
227
|
+
setStartNode(startIndex);
|
|
228
|
+
setVisibleNodeCount(visibleNodes);
|
|
229
|
+
if (!parentRef.current) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
parentRef.current.style.transform = `translateY(${getTranslateValue(
|
|
233
|
+
childHeight.current.middle,
|
|
234
|
+
startIndex,
|
|
235
|
+
)}px)`;
|
|
236
|
+
}, [bufferSize, itemsLength]);
|
|
237
|
+
const onScroll = React.useCallback(() => {
|
|
238
|
+
updateVirtualScroll();
|
|
239
|
+
}, [updateVirtualScroll]);
|
|
240
|
+
const removeScrollListener = React.useCallback(() => {
|
|
241
|
+
if (!onScrollRef.current) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
!scrollContainer.current ||
|
|
245
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body
|
|
246
|
+
? parentRef.current?.ownerDocument.removeEventListener(
|
|
247
|
+
'scroll',
|
|
248
|
+
onScrollRef.current,
|
|
249
|
+
)
|
|
250
|
+
: scrollContainer.current.removeEventListener(
|
|
251
|
+
'scroll',
|
|
252
|
+
onScrollRef.current,
|
|
253
|
+
);
|
|
254
|
+
}, []);
|
|
255
|
+
// Add event listener to the scrollable container.
|
|
256
|
+
useIsomorphicLayoutEffect(() => {
|
|
257
|
+
removeScrollListener();
|
|
258
|
+
onScrollRef.current = onScroll;
|
|
259
|
+
if (
|
|
260
|
+
!scrollContainer.current ||
|
|
261
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body
|
|
262
|
+
) {
|
|
263
|
+
parentRef.current?.ownerDocument.addEventListener('scroll', onScroll);
|
|
264
|
+
} else {
|
|
265
|
+
scrollContainer.current.addEventListener('scroll', onScroll);
|
|
266
|
+
}
|
|
267
|
+
return removeScrollListener;
|
|
268
|
+
}, [onScroll, removeScrollListener]);
|
|
269
|
+
useIsomorphicLayoutEffect(() => {
|
|
270
|
+
if (!isMounted) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const scrollableContainer = getScrollableContainer();
|
|
274
|
+
if (!scrollableContainer || scrollToIndex == null) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
// if `scrollToIndex` is not visible, scroll to it
|
|
278
|
+
if (
|
|
279
|
+
scrollToIndex > visibleIndex.current.end ||
|
|
280
|
+
scrollToIndex < visibleIndex.current.start
|
|
281
|
+
) {
|
|
282
|
+
const indexDiff =
|
|
283
|
+
scrollToIndex > visibleIndex.current.end
|
|
284
|
+
? scrollToIndex - visibleIndex.current.end
|
|
285
|
+
: scrollToIndex - visibleIndex.current.start;
|
|
286
|
+
if (scrollToIndex === 0) {
|
|
287
|
+
scrollableContainer.scrollTo({ top: 0 });
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
// If go down: add to the existing scrollTop needed height
|
|
291
|
+
// If go up: calculate the exact scroll top
|
|
292
|
+
scrollableContainer.scrollTo({
|
|
293
|
+
top:
|
|
294
|
+
indexDiff > 0
|
|
295
|
+
? Math.ceil(scrollableContainer.scrollTop) +
|
|
296
|
+
indexDiff * childHeight.current.middle
|
|
297
|
+
: scrollToIndex * childHeight.current.middle,
|
|
298
|
+
});
|
|
299
|
+
// update visible index
|
|
300
|
+
const start = getNumberOfNodesInHeight(
|
|
301
|
+
childHeight.current.middle,
|
|
302
|
+
Math.round(scrollableContainer.scrollTop),
|
|
303
|
+
);
|
|
304
|
+
const visibleNodes = getVisibleNodeCount(
|
|
305
|
+
childHeight.current.middle,
|
|
306
|
+
start,
|
|
307
|
+
itemsLength,
|
|
308
|
+
scrollableContainer,
|
|
309
|
+
);
|
|
310
|
+
visibleIndex.current = { start: start, end: start + visibleNodes };
|
|
311
|
+
}
|
|
312
|
+
// if `scrollToIndex` is the first visible node
|
|
313
|
+
// ensure it is fully visible
|
|
314
|
+
if (scrollToIndex === visibleIndex.current.start) {
|
|
315
|
+
const roundedScrollTop = Math.round(scrollableContainer.scrollTop);
|
|
316
|
+
const diff = roundedScrollTop % childHeight.current.middle;
|
|
317
|
+
diff > 0 &&
|
|
318
|
+
scrollableContainer.scrollTo({
|
|
319
|
+
top: roundedScrollTop - diff,
|
|
320
|
+
});
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
// if `scrollToIndex` is the last visible node
|
|
324
|
+
// ensure it is fully visible
|
|
325
|
+
if (scrollToIndex === visibleIndex.current.end) {
|
|
326
|
+
const diff =
|
|
327
|
+
(scrollableContainer.offsetHeight - childHeight.current.first) %
|
|
328
|
+
childHeight.current.middle;
|
|
329
|
+
const roundedScrollTop = Math.ceil(scrollableContainer.scrollTop);
|
|
330
|
+
const scrollTopMod = roundedScrollTop % childHeight.current.middle;
|
|
331
|
+
if (diff > 0 && scrollTopMod === 0) {
|
|
332
|
+
scrollableContainer.scrollTo({
|
|
333
|
+
top: roundedScrollTop + childHeight.current.middle - diff,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}, [scrollToIndex, isMounted]);
|
|
338
|
+
useIsomorphicLayoutEffect(() => {
|
|
339
|
+
if (!scrollContainerHeight) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
updateVirtualScroll();
|
|
343
|
+
}, [scrollContainerHeight, updateVirtualScroll]);
|
|
344
|
+
return {
|
|
345
|
+
outerProps: {
|
|
346
|
+
style: {
|
|
347
|
+
minHeight:
|
|
348
|
+
itemsLength > 1
|
|
349
|
+
? Math.max(itemsLength - 2, 0) * childHeight.current.middle +
|
|
350
|
+
childHeight.current.first +
|
|
351
|
+
childHeight.current.last
|
|
352
|
+
: childHeight.current.middle,
|
|
353
|
+
minWidth: '100%',
|
|
354
|
+
...style,
|
|
355
|
+
},
|
|
356
|
+
...rest,
|
|
357
|
+
},
|
|
358
|
+
innerProps: {
|
|
359
|
+
style: { willChange: 'transform' },
|
|
360
|
+
ref: mergeRefs(parentRef), // convert object ref to callback ref for better types
|
|
361
|
+
},
|
|
362
|
+
visibleChildren,
|
|
363
|
+
};
|
|
285
364
|
};
|
|
286
365
|
export default VirtualScroll;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PolymorphicForwardRefComponent } from '../props.js';
|
|
2
|
-
|
|
2
|
+
type VisuallyHiddenOwnProps = {
|
|
3
3
|
/**
|
|
4
4
|
* When VisuallyHidden is used with an interactive element (e.g. button),
|
|
5
5
|
* that element will "unhide" (become visible again) when focused.
|
|
@@ -16,7 +16,13 @@ import { Box } from './Box.js';
|
|
|
16
16
|
* @see https://www.scottohara.me/blog/2017/04/14/inclusively-hidden.html
|
|
17
17
|
*/
|
|
18
18
|
export const VisuallyHidden = React.forwardRef((props, ref) => {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const { className, unhideOnFocus = true, ...rest } = props;
|
|
20
|
+
return React.createElement(Box, {
|
|
21
|
+
as: 'span',
|
|
22
|
+
className: cx('iui-visually-hidden', className),
|
|
23
|
+
'data-iui-unhide-on-focus': unhideOnFocus ? true : undefined,
|
|
24
|
+
ref: ref,
|
|
25
|
+
...rest,
|
|
26
|
+
});
|
|
21
27
|
});
|
|
22
28
|
export default VisuallyHidden;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import type { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
3
3
|
export declare const WithCSSTransition: (props: Partial<CSSTransitionProps> & {
|
|
4
4
|
children: JSX.Element;
|
|
5
5
|
dimension?: 'height' | 'width';
|
|
6
|
-
}) => JSX.Element;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
7
|
export default WithCSSTransition;
|
|
@@ -5,28 +5,45 @@
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { CSSTransition } from 'react-transition-group';
|
|
7
7
|
export const WithCSSTransition = (props) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
const { in: visible, dimension = 'height', children, ...rest } = props;
|
|
9
|
+
const expandedSize = React.useRef(0);
|
|
10
|
+
const dimensionCamelCase = dimension === 'height' ? 'Height' : 'Width';
|
|
11
|
+
return React.createElement(
|
|
12
|
+
CSSTransition,
|
|
13
|
+
{
|
|
14
|
+
in: visible,
|
|
15
|
+
timeout: 200,
|
|
16
|
+
unmountOnExit: true,
|
|
17
|
+
onEnter: (node) => {
|
|
18
|
+
node.style[`min${dimensionCamelCase}`] = 'initial';
|
|
19
|
+
node.style[dimension] = '0px';
|
|
20
|
+
},
|
|
21
|
+
onEntering: (node) => {
|
|
22
|
+
node.style[dimension] = `${expandedSize.current}px`;
|
|
23
|
+
},
|
|
24
|
+
onEntered: (node) => {
|
|
25
|
+
node.style[`min${dimensionCamelCase}`] = '';
|
|
26
|
+
node.style[dimension] = '';
|
|
27
|
+
},
|
|
28
|
+
onExit: (node) => {
|
|
29
|
+
node.style[dimension] = `${expandedSize.current}px`;
|
|
30
|
+
},
|
|
31
|
+
onExiting: (node) => {
|
|
32
|
+
node.style[`min${dimensionCamelCase}`] = 'initial';
|
|
33
|
+
node.style[dimension] = '0px';
|
|
34
|
+
},
|
|
35
|
+
classNames: 'iui',
|
|
36
|
+
...rest,
|
|
37
|
+
},
|
|
38
|
+
React.isValidElement(children)
|
|
39
|
+
? React.cloneElement(children, {
|
|
40
|
+
ref: (el) => {
|
|
26
41
|
if (el) {
|
|
27
|
-
|
|
42
|
+
expandedSize.current = el.getBoundingClientRect()[dimension];
|
|
28
43
|
}
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
: React.createElement(React.Fragment, null),
|
|
47
|
+
);
|
|
31
48
|
};
|
|
32
49
|
export default WithCSSTransition;
|