@itwin/itwinui-react 3.0.0-dev.0 → 3.0.0-dev.2
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 +38 -0
- package/README.md +28 -22
- package/cjs/core/Alert/Alert.d.ts +47 -29
- package/cjs/core/Alert/Alert.js +73 -22
- package/cjs/core/Avatar/Avatar.d.ts +0 -1
- package/cjs/core/Avatar/Avatar.js +1 -2
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +0 -1
- package/cjs/core/AvatarGroup/AvatarGroup.js +1 -2
- package/cjs/core/Backdrop/Backdrop.d.ts +0 -1
- package/cjs/core/Backdrop/Backdrop.js +0 -1
- package/cjs/core/Badge/Badge.d.ts +0 -1
- package/cjs/core/Badge/Badge.js +0 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +2 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/cjs/core/ButtonGroup/ButtonGroup.js +1 -5
- package/cjs/core/Buttons/Button/Button.d.ts +0 -1
- package/cjs/core/Buttons/Button/Button.js +0 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +0 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +3 -6
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +0 -2
- package/cjs/core/Buttons/IconButton/IconButton.js +0 -2
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +0 -1
- package/cjs/core/Buttons/SplitButton/SplitButton.js +0 -1
- package/cjs/core/Carousel/Carousel.d.ts +2 -3
- package/cjs/core/Carousel/Carousel.js +3 -6
- package/cjs/core/Carousel/CarouselDotsList.d.ts +0 -1
- package/cjs/core/Carousel/CarouselDotsList.js +8 -11
- package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/cjs/core/Carousel/CarouselNavigation.js +3 -5
- package/cjs/core/Carousel/CarouselSlider.js +10 -15
- package/cjs/core/Checkbox/Checkbox.d.ts +0 -1
- package/cjs/core/Checkbox/Checkbox.js +0 -1
- package/cjs/core/ColorPicker/ColorBuilder.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorBuilder.js +7 -11
- package/cjs/core/ColorPicker/ColorInputPanel.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +12 -16
- package/cjs/core/ColorPicker/ColorPalette.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorPalette.js +4 -7
- package/cjs/core/ColorPicker/ColorPicker.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorPicker.js +3 -4
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +0 -1
- package/cjs/core/ComboBox/ComboBox.d.ts +0 -1
- package/cjs/core/ComboBox/ComboBox.js +25 -33
- package/cjs/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/cjs/core/ComboBox/ComboBoxInput.js +21 -20
- package/cjs/core/ComboBox/ComboBoxMenu.js +3 -4
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/cjs/core/ComboBox/helpers.js +4 -5
- package/cjs/core/DatePicker/DatePicker.d.ts +0 -1
- package/cjs/core/DatePicker/DatePicker.js +32 -33
- package/cjs/core/Dialog/Dialog.d.ts +0 -1
- package/cjs/core/Dialog/Dialog.js +12 -5
- package/cjs/core/Dialog/DialogBackdrop.js +1 -1
- package/cjs/core/Dialog/DialogButtonBar.d.ts +0 -1
- package/cjs/core/Dialog/DialogButtonBar.js +0 -1
- package/cjs/core/Dialog/DialogContent.d.ts +0 -1
- package/cjs/core/Dialog/DialogContent.js +0 -1
- package/cjs/core/Dialog/DialogContext.d.ts +15 -0
- package/cjs/core/Dialog/DialogMain.d.ts +0 -1
- package/cjs/core/Dialog/DialogMain.js +18 -25
- package/cjs/core/Dialog/DialogTitleBar.d.ts +0 -1
- package/cjs/core/Dialog/DialogTitleBar.js +0 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.d.ts +0 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.js +0 -1
- package/cjs/core/DropdownMenu/DropdownMenu.js +6 -8
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +5 -1
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +8 -6
- package/cjs/core/Fieldset/Fieldset.d.ts +0 -1
- package/cjs/core/Fieldset/Fieldset.js +0 -1
- package/cjs/core/FileUpload/FileEmptyCard.js +1 -1
- package/cjs/core/FileUpload/FileUpload.d.ts +0 -1
- package/cjs/core/FileUpload/FileUpload.js +3 -7
- package/cjs/core/FileUpload/FileUploadCard.d.ts +0 -1
- package/cjs/core/FileUpload/FileUploadCard.js +10 -12
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +0 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +0 -1
- package/cjs/core/Footer/Footer.d.ts +0 -1
- package/cjs/core/Footer/Footer.js +0 -1
- package/cjs/core/Footer/FooterItem.d.ts +0 -1
- package/cjs/core/Footer/FooterItem.js +0 -1
- package/cjs/core/Footer/FooterList.d.ts +0 -1
- package/cjs/core/Footer/FooterList.js +0 -1
- package/cjs/core/Footer/FooterSeparator.d.ts +0 -1
- package/cjs/core/Footer/FooterSeparator.js +0 -1
- package/cjs/core/Header/Header.d.ts +0 -1
- package/cjs/core/Header/Header.js +0 -1
- package/cjs/core/Header/HeaderBreadcrumbs.d.ts +0 -1
- package/cjs/core/Header/HeaderBreadcrumbs.js +0 -1
- package/cjs/core/Header/HeaderButton.d.ts +0 -1
- package/cjs/core/Header/HeaderButton.js +0 -1
- package/cjs/core/Header/HeaderLogo.d.ts +0 -1
- package/cjs/core/Header/HeaderLogo.js +0 -1
- package/cjs/core/InformationPanel/InformationPanel.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanel.js +1 -5
- package/cjs/core/InformationPanel/InformationPanelBody.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelBody.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelContent.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelContent.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelWrapper.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +0 -1
- package/cjs/core/Input/Input.d.ts +0 -1
- package/cjs/core/Input/Input.js +0 -1
- package/cjs/core/InputGroup/InputGroup.d.ts +0 -1
- package/cjs/core/InputGroup/InputGroup.js +0 -1
- package/cjs/core/Label/Label.d.ts +0 -1
- package/cjs/core/Label/Label.js +0 -1
- package/cjs/core/LabeledInput/LabeledInput.d.ts +0 -1
- package/cjs/core/LabeledInput/LabeledInput.js +1 -2
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +0 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +0 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +0 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -2
- package/cjs/core/List/List.d.ts +0 -1
- package/cjs/core/List/List.js +0 -1
- package/cjs/core/List/ListItem.d.ts +0 -1
- package/cjs/core/List/ListItem.js +0 -1
- package/cjs/core/Menu/Menu.d.ts +0 -1
- package/cjs/core/Menu/Menu.js +3 -5
- package/cjs/core/Menu/MenuDivider.d.ts +0 -1
- package/cjs/core/Menu/MenuDivider.js +0 -1
- package/cjs/core/Menu/MenuExtraContent.d.ts +0 -1
- package/cjs/core/Menu/MenuExtraContent.js +0 -1
- package/cjs/core/Menu/MenuItem.d.ts +0 -1
- package/cjs/core/Menu/MenuItem.js +8 -12
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +0 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
- package/cjs/core/Modal/Modal.d.ts +8 -10
- package/cjs/core/Modal/Modal.js +7 -18
- package/cjs/core/NonIdealState/NonIdealState.d.ts +0 -1
- package/cjs/core/NonIdealState/NonIdealState.js +0 -1
- package/cjs/core/NotificationMarker/NotificationMarker.d.ts +0 -1
- package/cjs/core/NotificationMarker/NotificationMarker.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +0 -1
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -1
- package/cjs/core/Radio/Radio.d.ts +0 -1
- package/cjs/core/Radio/Radio.js +0 -1
- package/cjs/core/RadioTiles/RadioTile.d.ts +0 -1
- package/cjs/core/RadioTiles/RadioTile.js +0 -1
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +0 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +0 -1
- package/cjs/core/SearchBox/SearchBox.d.ts +0 -1
- package/cjs/core/SearchBox/SearchBox.js +12 -13
- package/cjs/core/Select/Select.d.ts +0 -1
- package/cjs/core/Select/Select.js +12 -18
- package/cjs/core/Select/SelectTag.d.ts +0 -1
- package/cjs/core/Select/SelectTag.js +0 -1
- package/cjs/core/SideNavigation/SideNavigation.d.ts +0 -1
- package/cjs/core/SideNavigation/SideNavigation.js +2 -3
- package/cjs/core/SideNavigation/SidenavButton.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavButton.js +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenu.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenu.js +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +0 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +0 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +0 -1
- package/cjs/core/Slider/Slider.d.ts +0 -1
- package/cjs/core/Slider/Slider.js +16 -20
- package/cjs/core/Slider/Thumb.js +1 -1
- package/cjs/core/Slider/Track.js +2 -1
- package/cjs/core/StatusMessage/StatusMessage.js +1 -1
- package/cjs/core/Stepper/Stepper.d.ts +0 -1
- package/cjs/core/Stepper/Stepper.js +1 -2
- package/cjs/core/Stepper/StepperStep.js +1 -1
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +0 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +0 -1
- package/cjs/core/Surface/Surface.d.ts +0 -1
- package/cjs/core/Surface/Surface.js +0 -1
- package/cjs/core/Table/Table.d.ts +0 -1
- package/cjs/core/Table/Table.js +33 -34
- package/cjs/core/Table/TableCell.js +3 -2
- package/cjs/core/Table/TablePaginator.d.ts +0 -1
- package/cjs/core/Table/TablePaginator.js +10 -12
- package/cjs/core/Table/TableRowMemoized.js +40 -47
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -5
- package/cjs/core/Table/actionHandlers/selectHandler.js +6 -6
- package/cjs/core/Table/cells/DefaultCell.js +4 -3
- package/cjs/core/Table/cells/EditableCell.js +7 -13
- package/cjs/core/Table/columns/actionColumn.js +3 -6
- package/cjs/core/Table/columns/expanderColumn.js +3 -3
- package/cjs/core/Table/columns/selectionColumn.js +4 -4
- package/cjs/core/Table/filters/BaseFilter.d.ts +0 -1
- package/cjs/core/Table/filters/BaseFilter.js +1 -2
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +0 -1
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -4
- package/cjs/core/Table/filters/FilterButtonBar.d.ts +0 -1
- package/cjs/core/Table/filters/FilterButtonBar.js +1 -2
- package/cjs/core/Table/filters/FilterToggle.d.ts +0 -1
- package/cjs/core/Table/filters/FilterToggle.js +0 -1
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +0 -1
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -4
- package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +0 -1
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +1 -3
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +8 -4
- package/cjs/core/Table/hooks/useResizeColumns.js +16 -22
- package/cjs/core/Table/hooks/useScrollToRow.js +1 -2
- package/cjs/core/Table/hooks/useStickyColumns.js +3 -5
- package/cjs/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/cjs/core/Tabs/Tab.d.ts +0 -1
- package/cjs/core/Tabs/Tab.js +0 -1
- package/cjs/core/Tabs/Tabs.d.ts +0 -1
- package/cjs/core/Tabs/Tabs.js +16 -19
- package/cjs/core/Tag/Tag.d.ts +0 -1
- package/cjs/core/Tag/Tag.js +0 -1
- package/cjs/core/Tag/TagContainer.d.ts +0 -1
- package/cjs/core/Tag/TagContainer.js +0 -1
- package/cjs/core/Textarea/Textarea.d.ts +0 -1
- package/cjs/core/Textarea/Textarea.js +0 -1
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +2 -5
- package/cjs/core/ThemeProvider/ThemeProvider.js +11 -15
- package/cjs/core/Tile/Tile.d.ts +0 -1
- package/cjs/core/Tile/Tile.js +3 -7
- package/cjs/core/TimePicker/TimePicker.d.ts +0 -1
- package/cjs/core/TimePicker/TimePicker.js +13 -14
- package/cjs/core/Toast/Toast.d.ts +0 -1
- package/cjs/core/Toast/Toast.js +2 -4
- package/cjs/core/Toast/ToastWrapper.d.ts +0 -1
- package/cjs/core/Toast/ToastWrapper.js +0 -1
- package/cjs/core/Toast/Toaster.js +6 -11
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +0 -1
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +1 -3
- package/cjs/core/Tooltip/Tooltip.d.ts +0 -1
- package/cjs/core/Tooltip/Tooltip.js +0 -1
- package/cjs/core/TransferList/TransferList.d.ts +69 -0
- package/cjs/core/TransferList/TransferList.js +147 -0
- package/cjs/core/TransferList/index.d.ts +3 -0
- package/cjs/core/TransferList/index.js +10 -0
- package/cjs/core/Tree/Tree.d.ts +0 -1
- package/cjs/core/Tree/Tree.js +9 -14
- package/cjs/core/Tree/TreeNode.d.ts +0 -1
- package/cjs/core/Tree/TreeNode.js +9 -11
- package/cjs/core/Tree/TreeNodeExpander.d.ts +0 -1
- package/cjs/core/Tree/TreeNodeExpander.js +0 -1
- package/cjs/core/Typography/Anchor/Anchor.d.ts +0 -1
- package/cjs/core/Typography/Anchor/Anchor.js +0 -1
- package/cjs/core/Typography/Blockquote/Blockquote.d.ts +0 -1
- package/cjs/core/Typography/Blockquote/Blockquote.js +0 -1
- package/cjs/core/Typography/Code/Code.d.ts +0 -1
- package/cjs/core/Typography/Code/Code.js +0 -1
- package/cjs/core/Typography/Kbd/Kbd.d.ts +0 -1
- package/cjs/core/Typography/Kbd/Kbd.js +0 -1
- package/cjs/core/Typography/Text/Text.d.ts +0 -1
- package/cjs/core/Typography/Text/Text.js +0 -1
- package/cjs/core/index.d.ts +1 -0
- package/cjs/core/index.js +118 -116
- package/cjs/core/utils/color/ColorValue.js +9 -15
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/cjs/core/utils/components/Divider.d.ts +0 -1
- package/cjs/core/utils/components/Divider.js +0 -1
- package/cjs/core/utils/components/Flex.d.ts +0 -1
- package/cjs/core/utils/components/Flex.js +0 -1
- package/cjs/core/utils/components/FocusTrap.js +4 -4
- package/cjs/core/utils/components/Icon.d.ts +0 -1
- package/cjs/core/utils/components/Icon.js +0 -1
- package/cjs/core/utils/components/InputContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputContainer.js +0 -1
- package/cjs/core/utils/components/InputFlexContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputFlexContainer.js +0 -1
- package/cjs/core/utils/components/LinkAction.d.ts +0 -1
- package/cjs/core/utils/components/LinkAction.js +0 -1
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -2
- package/cjs/core/utils/components/Popover.d.ts +0 -1
- package/cjs/core/utils/components/Popover.js +5 -9
- package/cjs/core/utils/components/Resizer.js +7 -6
- package/cjs/core/utils/components/VirtualScroll.js +14 -21
- package/cjs/core/utils/components/VisuallyHidden.d.ts +0 -1
- package/cjs/core/utils/components/VisuallyHidden.js +0 -1
- package/cjs/core/utils/functions/dom.d.ts +6 -0
- package/cjs/core/utils/functions/dom.js +24 -6
- package/cjs/core/utils/functions/index.d.ts +0 -1
- package/cjs/core/utils/functions/index.js +0 -1
- package/cjs/core/utils/functions/polymorphic.js +9 -1
- package/cjs/core/utils/functions/supports.js +1 -1
- package/cjs/core/utils/hooks/index.d.ts +0 -1
- package/cjs/core/utils/hooks/index.js +0 -1
- package/cjs/core/utils/hooks/useContainerWidth.js +1 -1
- package/cjs/core/utils/hooks/useDragAndDrop.js +8 -10
- package/cjs/core/utils/hooks/useEventListener.js +1 -1
- package/cjs/core/utils/hooks/useGlobals.d.ts +9 -4
- package/cjs/core/utils/hooks/useGlobals.js +6 -6
- package/cjs/core/utils/hooks/useId.js +1 -2
- package/cjs/core/utils/hooks/useIntersection.js +2 -3
- package/cjs/core/utils/hooks/useMediaQuery.js +6 -8
- package/cjs/core/utils/hooks/useOverflow.js +1 -2
- package/cjs/core/utils/hooks/useResizeObserver.js +3 -4
- package/cjs/styles.d.ts +5 -0
- package/cjs/styles.js +450 -0
- package/esm/core/Alert/Alert.d.ts +47 -29
- package/esm/core/Alert/Alert.js +74 -23
- package/esm/core/Avatar/Avatar.d.ts +0 -1
- package/esm/core/Avatar/Avatar.js +1 -2
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +0 -1
- package/esm/core/AvatarGroup/AvatarGroup.js +1 -2
- package/esm/core/Backdrop/Backdrop.d.ts +0 -1
- package/esm/core/Backdrop/Backdrop.js +0 -1
- package/esm/core/Badge/Badge.d.ts +0 -1
- package/esm/core/Badge/Badge.js +0 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -4
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/esm/core/ButtonGroup/ButtonGroup.js +1 -5
- package/esm/core/Buttons/Button/Button.d.ts +0 -1
- package/esm/core/Buttons/Button/Button.js +0 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +0 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +3 -6
- package/esm/core/Buttons/IconButton/IconButton.d.ts +0 -2
- package/esm/core/Buttons/IconButton/IconButton.js +0 -2
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +0 -1
- package/esm/core/Buttons/SplitButton/SplitButton.js +0 -1
- package/esm/core/Carousel/Carousel.d.ts +2 -3
- package/esm/core/Carousel/Carousel.js +3 -6
- package/esm/core/Carousel/CarouselDotsList.d.ts +0 -1
- package/esm/core/Carousel/CarouselDotsList.js +8 -11
- package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/esm/core/Carousel/CarouselNavigation.js +3 -5
- package/esm/core/Carousel/CarouselSlider.js +10 -15
- package/esm/core/Checkbox/Checkbox.d.ts +0 -1
- package/esm/core/Checkbox/Checkbox.js +0 -1
- package/esm/core/ColorPicker/ColorBuilder.d.ts +0 -1
- package/esm/core/ColorPicker/ColorBuilder.js +7 -11
- package/esm/core/ColorPicker/ColorInputPanel.d.ts +0 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +12 -16
- package/esm/core/ColorPicker/ColorPalette.d.ts +0 -1
- package/esm/core/ColorPicker/ColorPalette.js +4 -7
- package/esm/core/ColorPicker/ColorPicker.d.ts +0 -1
- package/esm/core/ColorPicker/ColorPicker.js +3 -4
- package/esm/core/ColorPicker/ColorSwatch.d.ts +0 -1
- package/esm/core/ColorPicker/ColorSwatch.js +0 -1
- package/esm/core/ComboBox/ComboBox.d.ts +0 -1
- package/esm/core/ComboBox/ComboBox.js +25 -33
- package/esm/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/esm/core/ComboBox/ComboBoxInput.js +21 -20
- package/esm/core/ComboBox/ComboBoxMenu.js +3 -4
- package/esm/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/esm/core/ComboBox/helpers.js +4 -5
- package/esm/core/DatePicker/DatePicker.d.ts +0 -1
- package/esm/core/DatePicker/DatePicker.js +32 -33
- package/esm/core/Dialog/Dialog.d.ts +0 -1
- package/esm/core/Dialog/Dialog.js +13 -6
- package/esm/core/Dialog/DialogBackdrop.js +1 -1
- package/esm/core/Dialog/DialogButtonBar.d.ts +0 -1
- package/esm/core/Dialog/DialogButtonBar.js +0 -1
- package/esm/core/Dialog/DialogContent.d.ts +0 -1
- package/esm/core/Dialog/DialogContent.js +0 -1
- package/esm/core/Dialog/DialogContext.d.ts +15 -0
- package/esm/core/Dialog/DialogMain.d.ts +0 -1
- package/esm/core/Dialog/DialogMain.js +18 -25
- package/esm/core/Dialog/DialogTitleBar.d.ts +0 -1
- package/esm/core/Dialog/DialogTitleBar.js +0 -1
- package/esm/core/Dialog/DialogTitleBarTitle.d.ts +0 -1
- package/esm/core/Dialog/DialogTitleBarTitle.js +0 -1
- package/esm/core/DropdownMenu/DropdownMenu.js +6 -8
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +5 -1
- package/esm/core/ExpandableBlock/ExpandableBlock.js +8 -6
- package/esm/core/Fieldset/Fieldset.d.ts +0 -1
- package/esm/core/Fieldset/Fieldset.js +0 -1
- package/esm/core/FileUpload/FileEmptyCard.js +1 -1
- package/esm/core/FileUpload/FileUpload.d.ts +0 -1
- package/esm/core/FileUpload/FileUpload.js +3 -7
- package/esm/core/FileUpload/FileUploadCard.d.ts +0 -1
- package/esm/core/FileUpload/FileUploadCard.js +10 -12
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +0 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +0 -1
- package/esm/core/Footer/Footer.d.ts +0 -1
- package/esm/core/Footer/Footer.js +0 -1
- package/esm/core/Footer/FooterItem.d.ts +0 -1
- package/esm/core/Footer/FooterItem.js +0 -1
- package/esm/core/Footer/FooterList.d.ts +0 -1
- package/esm/core/Footer/FooterList.js +0 -1
- package/esm/core/Footer/FooterSeparator.d.ts +0 -1
- package/esm/core/Footer/FooterSeparator.js +0 -1
- package/esm/core/Header/Header.d.ts +0 -1
- package/esm/core/Header/Header.js +0 -1
- package/esm/core/Header/HeaderBreadcrumbs.d.ts +0 -1
- package/esm/core/Header/HeaderBreadcrumbs.js +0 -1
- package/esm/core/Header/HeaderButton.d.ts +0 -1
- package/esm/core/Header/HeaderButton.js +0 -1
- package/esm/core/Header/HeaderLogo.d.ts +0 -1
- package/esm/core/Header/HeaderLogo.js +0 -1
- package/esm/core/InformationPanel/InformationPanel.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanel.js +1 -5
- package/esm/core/InformationPanel/InformationPanelBody.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelBody.js +0 -1
- package/esm/core/InformationPanel/InformationPanelContent.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelContent.js +0 -1
- package/esm/core/InformationPanel/InformationPanelHeader.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/esm/core/InformationPanel/InformationPanelWrapper.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelWrapper.js +0 -1
- package/esm/core/Input/Input.d.ts +0 -1
- package/esm/core/Input/Input.js +0 -1
- package/esm/core/InputGroup/InputGroup.d.ts +0 -1
- package/esm/core/InputGroup/InputGroup.js +0 -1
- package/esm/core/Label/Label.d.ts +0 -1
- package/esm/core/Label/Label.js +0 -1
- package/esm/core/LabeledInput/LabeledInput.d.ts +0 -1
- package/esm/core/LabeledInput/LabeledInput.js +1 -2
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +0 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +0 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +0 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -2
- package/esm/core/List/List.d.ts +0 -1
- package/esm/core/List/List.js +0 -1
- package/esm/core/List/ListItem.d.ts +0 -1
- package/esm/core/List/ListItem.js +0 -1
- package/esm/core/Menu/Menu.d.ts +0 -1
- package/esm/core/Menu/Menu.js +3 -5
- package/esm/core/Menu/MenuDivider.d.ts +0 -1
- package/esm/core/Menu/MenuDivider.js +0 -1
- package/esm/core/Menu/MenuExtraContent.d.ts +0 -1
- package/esm/core/Menu/MenuExtraContent.js +0 -1
- package/esm/core/Menu/MenuItem.d.ts +0 -1
- package/esm/core/Menu/MenuItem.js +8 -12
- package/esm/core/Menu/MenuItemSkeleton.d.ts +0 -1
- package/esm/core/Menu/MenuItemSkeleton.js +0 -1
- package/esm/core/Modal/Modal.d.ts +8 -10
- package/esm/core/Modal/Modal.js +3 -11
- package/esm/core/NonIdealState/NonIdealState.d.ts +0 -1
- package/esm/core/NonIdealState/NonIdealState.js +0 -1
- package/esm/core/NotificationMarker/NotificationMarker.d.ts +0 -1
- package/esm/core/NotificationMarker/NotificationMarker.js +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -1
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +0 -1
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -1
- package/esm/core/Radio/Radio.d.ts +0 -1
- package/esm/core/Radio/Radio.js +0 -1
- package/esm/core/RadioTiles/RadioTile.d.ts +0 -1
- package/esm/core/RadioTiles/RadioTile.js +0 -1
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +0 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +0 -1
- package/esm/core/SearchBox/SearchBox.d.ts +0 -1
- package/esm/core/SearchBox/SearchBox.js +12 -13
- package/esm/core/Select/Select.d.ts +0 -1
- package/esm/core/Select/Select.js +12 -18
- package/esm/core/Select/SelectTag.d.ts +0 -1
- package/esm/core/Select/SelectTag.js +0 -1
- package/esm/core/SideNavigation/SideNavigation.d.ts +0 -1
- package/esm/core/SideNavigation/SideNavigation.js +2 -3
- package/esm/core/SideNavigation/SidenavButton.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavButton.js +0 -1
- package/esm/core/SideNavigation/SidenavSubmenu.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavSubmenu.js +0 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +0 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +0 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.js +0 -1
- package/esm/core/Slider/Slider.d.ts +0 -1
- package/esm/core/Slider/Slider.js +16 -20
- package/esm/core/Slider/Thumb.js +1 -1
- package/esm/core/Slider/Track.js +2 -1
- package/esm/core/StatusMessage/StatusMessage.js +1 -1
- package/esm/core/Stepper/Stepper.d.ts +0 -1
- package/esm/core/Stepper/Stepper.js +1 -2
- package/esm/core/Stepper/StepperStep.js +1 -1
- package/esm/core/Stepper/WorkflowDiagram.d.ts +0 -1
- package/esm/core/Stepper/WorkflowDiagram.js +0 -1
- package/esm/core/Surface/Surface.d.ts +0 -1
- package/esm/core/Surface/Surface.js +0 -1
- package/esm/core/Table/Table.d.ts +0 -1
- package/esm/core/Table/Table.js +34 -35
- package/esm/core/Table/TableCell.js +3 -2
- package/esm/core/Table/TablePaginator.d.ts +0 -1
- package/esm/core/Table/TablePaginator.js +11 -13
- package/esm/core/Table/TableRowMemoized.js +41 -48
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -5
- package/esm/core/Table/actionHandlers/selectHandler.js +6 -6
- package/esm/core/Table/cells/DefaultCell.js +4 -3
- package/esm/core/Table/cells/EditableCell.js +8 -14
- package/esm/core/Table/columns/actionColumn.js +3 -6
- package/esm/core/Table/columns/expanderColumn.js +3 -3
- package/esm/core/Table/columns/selectionColumn.js +4 -4
- package/esm/core/Table/filters/BaseFilter.d.ts +0 -1
- package/esm/core/Table/filters/BaseFilter.js +2 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +0 -1
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -4
- package/esm/core/Table/filters/FilterButtonBar.d.ts +0 -1
- package/esm/core/Table/filters/FilterButtonBar.js +2 -3
- package/esm/core/Table/filters/FilterToggle.d.ts +0 -1
- package/esm/core/Table/filters/FilterToggle.js +0 -1
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +0 -1
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -4
- package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +0 -1
- package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -3
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +5 -4
- package/esm/core/Table/hooks/useResizeColumns.js +16 -22
- package/esm/core/Table/hooks/useScrollToRow.js +1 -2
- package/esm/core/Table/hooks/useStickyColumns.js +3 -5
- package/esm/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/esm/core/Tabs/Tab.d.ts +0 -1
- package/esm/core/Tabs/Tab.js +0 -1
- package/esm/core/Tabs/Tabs.d.ts +0 -1
- package/esm/core/Tabs/Tabs.js +16 -19
- package/esm/core/Tag/Tag.d.ts +0 -1
- package/esm/core/Tag/Tag.js +0 -1
- package/esm/core/Tag/TagContainer.d.ts +0 -1
- package/esm/core/Tag/TagContainer.js +0 -1
- package/esm/core/Textarea/Textarea.d.ts +0 -1
- package/esm/core/Textarea/Textarea.js +0 -1
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +2 -5
- package/esm/core/ThemeProvider/ThemeProvider.js +12 -16
- package/esm/core/Tile/Tile.d.ts +0 -1
- package/esm/core/Tile/Tile.js +3 -7
- package/esm/core/TimePicker/TimePicker.d.ts +0 -1
- package/esm/core/TimePicker/TimePicker.js +13 -14
- package/esm/core/Toast/Toast.d.ts +0 -1
- package/esm/core/Toast/Toast.js +2 -4
- package/esm/core/Toast/ToastWrapper.d.ts +0 -1
- package/esm/core/Toast/ToastWrapper.js +0 -1
- package/esm/core/Toast/Toaster.js +6 -11
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +0 -1
- package/esm/core/ToggleSwitch/ToggleSwitch.js +1 -3
- package/esm/core/Tooltip/Tooltip.d.ts +0 -1
- package/esm/core/Tooltip/Tooltip.js +0 -1
- package/esm/core/TransferList/TransferList.d.ts +69 -0
- package/esm/core/TransferList/TransferList.js +141 -0
- package/esm/core/TransferList/index.d.ts +3 -0
- package/esm/core/TransferList/index.js +6 -0
- package/esm/core/Tree/Tree.d.ts +0 -1
- package/esm/core/Tree/Tree.js +9 -14
- package/esm/core/Tree/TreeNode.d.ts +0 -1
- package/esm/core/Tree/TreeNode.js +9 -11
- package/esm/core/Tree/TreeNodeExpander.d.ts +0 -1
- package/esm/core/Tree/TreeNodeExpander.js +0 -1
- package/esm/core/Typography/Anchor/Anchor.d.ts +0 -1
- package/esm/core/Typography/Anchor/Anchor.js +0 -1
- package/esm/core/Typography/Blockquote/Blockquote.d.ts +0 -1
- package/esm/core/Typography/Blockquote/Blockquote.js +0 -1
- package/esm/core/Typography/Code/Code.d.ts +0 -1
- package/esm/core/Typography/Code/Code.js +0 -1
- package/esm/core/Typography/Kbd/Kbd.d.ts +0 -1
- package/esm/core/Typography/Kbd/Kbd.js +0 -1
- package/esm/core/Typography/Text/Text.d.ts +0 -1
- package/esm/core/Typography/Text/Text.js +0 -1
- package/esm/core/index.d.ts +1 -0
- package/esm/core/index.js +1 -0
- package/esm/core/utils/color/ColorValue.js +9 -15
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/esm/core/utils/components/Divider.d.ts +0 -1
- package/esm/core/utils/components/Divider.js +0 -1
- package/esm/core/utils/components/Flex.d.ts +0 -1
- package/esm/core/utils/components/Flex.js +0 -1
- package/esm/core/utils/components/FocusTrap.js +4 -4
- package/esm/core/utils/components/Icon.d.ts +0 -1
- package/esm/core/utils/components/Icon.js +0 -1
- package/esm/core/utils/components/InputContainer.d.ts +0 -1
- package/esm/core/utils/components/InputContainer.js +0 -1
- package/esm/core/utils/components/InputFlexContainer.d.ts +0 -1
- package/esm/core/utils/components/InputFlexContainer.js +0 -1
- package/esm/core/utils/components/LinkAction.d.ts +0 -1
- package/esm/core/utils/components/LinkAction.js +0 -1
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -2
- package/esm/core/utils/components/Popover.d.ts +0 -1
- package/esm/core/utils/components/Popover.js +5 -9
- package/esm/core/utils/components/Resizer.js +7 -6
- package/esm/core/utils/components/VirtualScroll.js +14 -21
- package/esm/core/utils/components/VisuallyHidden.d.ts +0 -1
- package/esm/core/utils/components/VisuallyHidden.js +0 -1
- package/esm/core/utils/functions/dom.d.ts +6 -0
- package/esm/core/utils/functions/dom.js +19 -5
- package/esm/core/utils/functions/index.d.ts +0 -1
- package/esm/core/utils/functions/index.js +0 -1
- package/esm/core/utils/functions/polymorphic.js +9 -1
- package/esm/core/utils/functions/supports.js +1 -1
- package/esm/core/utils/hooks/index.d.ts +0 -1
- package/esm/core/utils/hooks/index.js +0 -1
- package/esm/core/utils/hooks/useContainerWidth.js +1 -1
- package/esm/core/utils/hooks/useDragAndDrop.js +8 -10
- package/esm/core/utils/hooks/useEventListener.js +1 -1
- package/esm/core/utils/hooks/useGlobals.d.ts +9 -4
- package/esm/core/utils/hooks/useGlobals.js +6 -6
- package/esm/core/utils/hooks/useId.js +1 -2
- package/esm/core/utils/hooks/useIntersection.js +2 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -8
- package/esm/core/utils/hooks/useOverflow.js +1 -2
- package/esm/core/utils/hooks/useResizeObserver.js +3 -4
- package/esm/styles.d.ts +5 -0
- package/esm/styles.js +451 -0
- package/package.json +14 -11
- package/styles.css +1940 -0
- package/cjs/core/utils/functions/styles.d.ts +0 -6
- package/cjs/core/utils/functions/styles.js +0 -21
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
- package/esm/core/utils/functions/styles.d.ts +0 -6
- package/esm/core/utils/functions/styles.js +0 -17
- package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
|
@@ -116,27 +116,24 @@ class ColorValue {
|
|
|
116
116
|
* This allows component builders to know if they received bad input from user.
|
|
117
117
|
*/
|
|
118
118
|
static fromString(val, defaultColorIfNotParsed) {
|
|
119
|
-
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed
|
|
119
|
+
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
|
|
120
120
|
return new ColorValue(tbgr, hue);
|
|
121
121
|
}
|
|
122
122
|
/** Create a ColorValue from hue, saturation, lightness values. */
|
|
123
123
|
static fromHSL(hsl) {
|
|
124
|
-
|
|
125
|
-
const alpha = (_a = hsl.a) !== null && _a !== void 0 ? _a : 1;
|
|
124
|
+
const alpha = hsl.a ?? 1;
|
|
126
125
|
return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
|
|
127
126
|
}
|
|
128
127
|
/** Create a ColorValue from an RgbColor */
|
|
129
128
|
static fromRGB(rgb) {
|
|
130
|
-
|
|
131
|
-
const alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
|
|
129
|
+
const alpha = rgb.a ?? 1;
|
|
132
130
|
return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
|
|
133
131
|
}
|
|
134
132
|
/**
|
|
135
133
|
* Create a ColorValue from an HsvColor
|
|
136
134
|
*/
|
|
137
135
|
static fromHSV(hsv) {
|
|
138
|
-
|
|
139
|
-
const alpha = (_a = hsv.a) !== null && _a !== void 0 ? _a : 1;
|
|
136
|
+
const alpha = hsv.a ?? 1;
|
|
140
137
|
const transparency = Math.round((1 - alpha) * 255);
|
|
141
138
|
// Check for simple case first.
|
|
142
139
|
if (!hsv.s || hsv.h === -1) {
|
|
@@ -487,33 +484,30 @@ class ColorValue {
|
|
|
487
484
|
}
|
|
488
485
|
/** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
|
|
489
486
|
toRgbString(includeAlpha) {
|
|
490
|
-
var _a;
|
|
491
487
|
const rgb = this.toRgbColor();
|
|
492
488
|
const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
|
|
493
489
|
if (includeAlpha) {
|
|
494
|
-
const alpha =
|
|
490
|
+
const alpha = rgb.a ?? 1;
|
|
495
491
|
return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
496
492
|
}
|
|
497
493
|
return `rgb(${rgbString})`;
|
|
498
494
|
}
|
|
499
495
|
/** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
|
|
500
496
|
toHslString(includeAlpha) {
|
|
501
|
-
var _a, _b;
|
|
502
497
|
const hsl = this.toHslColor();
|
|
503
|
-
const hslString = `${ColorValue.getFormattedColorNumber(
|
|
498
|
+
const hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
|
|
504
499
|
if (includeAlpha) {
|
|
505
|
-
const alpha =
|
|
500
|
+
const alpha = hsl.a ?? 1;
|
|
506
501
|
return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
507
502
|
}
|
|
508
503
|
return `hsl(${hslString})`;
|
|
509
504
|
}
|
|
510
505
|
/** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
|
|
511
506
|
toHsvString(includeAlpha) {
|
|
512
|
-
var _a, _b;
|
|
513
507
|
const hsv = this.toHsvColor();
|
|
514
|
-
const hsvString = `${
|
|
508
|
+
const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
|
|
515
509
|
if (includeAlpha) {
|
|
516
|
-
const alpha =
|
|
510
|
+
const alpha = hsv.a ?? 1;
|
|
517
511
|
return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
518
512
|
}
|
|
519
513
|
return `hsv(${hsvString})`;
|
|
@@ -42,10 +42,9 @@ const index_js_1 = require("../functions/index.js");
|
|
|
42
42
|
const AutoclearingHiddenLiveRegion = ({ text = '' }) => {
|
|
43
43
|
const [maybeText, setMaybeText] = React.useState(text);
|
|
44
44
|
React.useEffect(() => {
|
|
45
|
-
var _a;
|
|
46
45
|
setMaybeText(text);
|
|
47
|
-
const timeout = (
|
|
48
|
-
return () =>
|
|
46
|
+
const timeout = (0, index_js_1.getWindow)()?.setTimeout(() => setMaybeText(''), 5000);
|
|
47
|
+
return () => void (0, index_js_1.getWindow)()?.clearTimeout(timeout);
|
|
49
48
|
}, [text]);
|
|
50
49
|
return (React.createElement(VisuallyHidden_js_1.VisuallyHidden, { as: 'div', "aria-live": 'polite', "aria-atomic": 'true' }, maybeText));
|
|
51
50
|
};
|
|
@@ -33,7 +33,6 @@ exports.Divider = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
37
36
|
const Box_js_1 = require("./Box.js");
|
|
38
37
|
/**
|
|
39
38
|
* Shows a divider
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { AnyString } from '../types.js';
|
|
3
3
|
import type { PolymorphicForwardRefComponent } from '../props.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
5
4
|
declare const sizeTokens: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl"];
|
|
6
5
|
/**
|
|
7
6
|
* String literal shorthands that correspond to the size tokens in [itwinui-variables](https://github.com/iTwin/iTwinUI/blob/main/packages/itwinui-variables/src/sizes.scss).
|
|
@@ -33,7 +33,6 @@ exports.Flex = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
37
36
|
const Box_js_1 = require("./Box.js");
|
|
38
37
|
const sizeTokens = [
|
|
39
38
|
'3xs',
|
|
@@ -47,19 +47,19 @@ const FocusTrap = (props) => {
|
|
|
47
47
|
const onFirstFocus = (event) => {
|
|
48
48
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
49
49
|
if (event.relatedTarget === firstElement) {
|
|
50
|
-
lastElement
|
|
50
|
+
lastElement?.focus();
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
firstElement
|
|
53
|
+
firstElement?.focus();
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
const onLastFocus = (event) => {
|
|
57
57
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
58
58
|
if (event.relatedTarget === lastElement) {
|
|
59
|
-
firstElement
|
|
59
|
+
firstElement?.focus();
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
lastElement
|
|
62
|
+
lastElement?.focus();
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
return (React.createElement(React.Fragment, null,
|
|
@@ -33,7 +33,6 @@ exports.Icon = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
37
36
|
const Box_js_1 = require("./Box.js");
|
|
38
37
|
const getSizeValue = (size) => {
|
|
39
38
|
switch (size) {
|
|
@@ -33,7 +33,6 @@ exports.InputContainer = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
37
36
|
const Box_js_1 = require("./Box.js");
|
|
38
37
|
/**
|
|
39
38
|
* Input container to wrap inputs with label, and add optional message and icon.
|
|
@@ -10,7 +10,6 @@ exports.InputFlexContainer = void 0;
|
|
|
10
10
|
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
-
require("@itwin/itwinui-css/css/input-container.css");
|
|
14
13
|
const Box_js_1 = require("./Box.js");
|
|
15
14
|
/**
|
|
16
15
|
* Utility component for input container with display flex abilities.
|
|
@@ -5,7 +5,6 @@ exports.LinkBox = exports.LinkAction = void 0;
|
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
9
8
|
const polymorphic_js_1 = require("../functions/polymorphic.js");
|
|
10
9
|
/**
|
|
11
10
|
* Polymorphic link action component.
|
|
@@ -48,7 +48,6 @@ const ELLIPSIS_CHAR = '…';
|
|
|
48
48
|
* />
|
|
49
49
|
*/
|
|
50
50
|
const MiddleTextTruncation = (props) => {
|
|
51
|
-
var _a;
|
|
52
51
|
const { text, endCharsCount = 6, textRenderer, style, ...rest } = props;
|
|
53
52
|
const [ref, visibleCount] = (0, useOverflow_js_1.useOverflow)(text);
|
|
54
53
|
const truncatedText = React.useMemo(() => {
|
|
@@ -65,7 +64,7 @@ const MiddleTextTruncation = (props) => {
|
|
|
65
64
|
flexGrow: 1,
|
|
66
65
|
whiteSpace: 'nowrap',
|
|
67
66
|
...style,
|
|
68
|
-
}, ref: ref, ...rest },
|
|
67
|
+
}, ref: ref, ...rest }, textRenderer?.(truncatedText, text) ?? truncatedText));
|
|
69
68
|
};
|
|
70
69
|
exports.MiddleTextTruncation = MiddleTextTruncation;
|
|
71
70
|
exports.default = exports.MiddleTextTruncation;
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import type { TippyProps } from '@tippyjs/react';
|
|
3
3
|
import type { Placement, Instance } from 'tippy.js';
|
|
4
4
|
export declare type PopoverInstance = Instance;
|
|
5
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
6
5
|
export declare type PopoverProps = {
|
|
7
6
|
/**
|
|
8
7
|
* Controlled flag for whether the popover is visible.
|
|
@@ -35,7 +35,6 @@ const React = __importStar(require("react"));
|
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const react_1 = __importDefault(require("@tippyjs/react"));
|
|
37
37
|
const index_js_1 = require("../hooks/index.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
39
38
|
const ThemeContext_js_1 = require("../../ThemeProvider/ThemeContext.js");
|
|
40
39
|
/**
|
|
41
40
|
* Wrapper around [tippy.js](https://atomiks.github.io/tippyjs)
|
|
@@ -43,7 +42,6 @@ const ThemeContext_js_1 = require("../../ThemeProvider/ThemeContext.js");
|
|
|
43
42
|
* @private
|
|
44
43
|
*/
|
|
45
44
|
exports.Popover = React.forwardRef((props, ref) => {
|
|
46
|
-
var _a;
|
|
47
45
|
const [mounted, setMounted] = React.useState(false);
|
|
48
46
|
const themeInfo = React.useContext(ThemeContext_js_1.ThemeContext);
|
|
49
47
|
const isDomAvailable = (0, index_js_1.useIsClient)();
|
|
@@ -60,15 +58,14 @@ exports.Popover = React.forwardRef((props, ref) => {
|
|
|
60
58
|
const removeTabIndex = {
|
|
61
59
|
fn: () => ({
|
|
62
60
|
onCreate: (instance) => {
|
|
63
|
-
|
|
64
|
-
(_a = instance.popper.firstElementChild) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
|
|
61
|
+
instance.popper.firstElementChild?.removeAttribute('tabindex');
|
|
65
62
|
},
|
|
66
63
|
}),
|
|
67
64
|
};
|
|
68
65
|
const computedProps = {
|
|
69
66
|
allowHTML: true,
|
|
70
67
|
animation: false,
|
|
71
|
-
appendTo: (el) =>
|
|
68
|
+
appendTo: (el) => themeInfo?.portalContainerRef?.current || el.ownerDocument.body,
|
|
72
69
|
arrow: false,
|
|
73
70
|
duration: 0,
|
|
74
71
|
interactive: true,
|
|
@@ -93,7 +90,7 @@ exports.Popover = React.forwardRef((props, ref) => {
|
|
|
93
90
|
modifiers: [
|
|
94
91
|
{ name: 'flip' },
|
|
95
92
|
{ name: 'preventOverflow', options: { padding: 0 } },
|
|
96
|
-
...(
|
|
93
|
+
...(props.popperOptions?.modifiers || []),
|
|
97
94
|
],
|
|
98
95
|
},
|
|
99
96
|
};
|
|
@@ -108,9 +105,8 @@ exports.Popover = React.forwardRef((props, ref) => {
|
|
|
108
105
|
const clonedContent = React.isValidElement(props.content)
|
|
109
106
|
? React.cloneElement(props.content, {
|
|
110
107
|
onClick: (e) => {
|
|
111
|
-
var _a, _b;
|
|
112
108
|
e.stopPropagation();
|
|
113
|
-
|
|
109
|
+
props.content.props.onClick?.(e);
|
|
114
110
|
},
|
|
115
111
|
})
|
|
116
112
|
: props.content;
|
|
@@ -127,7 +123,7 @@ exports.hideOnEscOrTab = {
|
|
|
127
123
|
/** @returns true if none of the children are tabbable */
|
|
128
124
|
const shouldHideOnTab = () => {
|
|
129
125
|
const descendents = Array.from(instance.popper.querySelectorAll('*'));
|
|
130
|
-
return !descendents.some((el) =>
|
|
126
|
+
return !descendents.some((el) => el?.tabIndex >= 0);
|
|
131
127
|
};
|
|
132
128
|
const onKeyDown = (event) => {
|
|
133
129
|
if (event.altKey) {
|
|
@@ -64,17 +64,18 @@ const Resizer = (props) => {
|
|
|
64
64
|
const originalUserSelect = ownerDocument.body.style.userSelect;
|
|
65
65
|
ownerDocument.body.style.userSelect = 'none';
|
|
66
66
|
const onResizePointerMove = (event) => {
|
|
67
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
68
67
|
if (!elementRef.current) {
|
|
69
68
|
return;
|
|
70
69
|
}
|
|
71
70
|
if (!isResizing.current) {
|
|
72
71
|
isResizing.current = true;
|
|
73
|
-
onResizeStart
|
|
72
|
+
onResizeStart?.();
|
|
74
73
|
}
|
|
75
|
-
const containerRect =
|
|
76
|
-
const clientX = (0, index_js_1.getBoundedValue)(event.clientX,
|
|
77
|
-
const clientY = (0, index_js_1.getBoundedValue)(event.clientY,
|
|
74
|
+
const containerRect = containerRef?.current?.getBoundingClientRect();
|
|
75
|
+
const clientX = (0, index_js_1.getBoundedValue)(event.clientX, containerRect?.left ?? 0, containerRect?.right ?? ownerDocument.documentElement.clientWidth ?? 0);
|
|
76
|
+
const clientY = (0, index_js_1.getBoundedValue)(event.clientY, containerRect?.top ?? 0, containerRect?.bottom ??
|
|
77
|
+
ownerDocument.documentElement.clientHeight ??
|
|
78
|
+
0);
|
|
78
79
|
const diffX = initialPointerX - clientX;
|
|
79
80
|
const diffY = initialPointerY - clientY;
|
|
80
81
|
switch (resizer) {
|
|
@@ -155,7 +156,7 @@ const Resizer = (props) => {
|
|
|
155
156
|
if (elementRef.current) {
|
|
156
157
|
ownerDocument.body.style.userSelect = originalUserSelect;
|
|
157
158
|
isResizing.current = false;
|
|
158
|
-
onResizeEnd
|
|
159
|
+
onResizeEnd?.({
|
|
159
160
|
width,
|
|
160
161
|
height,
|
|
161
162
|
transform: `translate(${translateX}px, ${translateY}px)`,
|
|
@@ -22,7 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var _a;
|
|
26
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
26
|
exports.useVirtualization = exports.VirtualScroll = void 0;
|
|
28
27
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -32,7 +31,7 @@ exports.useVirtualization = exports.VirtualScroll = void 0;
|
|
|
32
31
|
const React = __importStar(require("react"));
|
|
33
32
|
const ReactDOM = __importStar(require("react-dom"));
|
|
34
33
|
const index_js_1 = require("../hooks/index.js");
|
|
35
|
-
const unstable_batchedUpdates =
|
|
34
|
+
const unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates ?? ((cb) => void cb());
|
|
36
35
|
const getScrollableParent = (element, ownerDocument = document) => {
|
|
37
36
|
if (!element || element === ownerDocument.body) {
|
|
38
37
|
return ownerDocument.body;
|
|
@@ -49,8 +48,7 @@ const getElementStyle = (element, prop) => {
|
|
|
49
48
|
return getComputedStyle(element, null).getPropertyValue(prop);
|
|
50
49
|
};
|
|
51
50
|
const getElementHeight = (element) => {
|
|
52
|
-
|
|
53
|
-
return (_a = element === null || element === void 0 ? void 0 : element.getBoundingClientRect().height) !== null && _a !== void 0 ? _a : 0;
|
|
51
|
+
return element?.getBoundingClientRect().height ?? 0;
|
|
54
52
|
};
|
|
55
53
|
const getElementHeightWithMargins = (element) => {
|
|
56
54
|
if (!element) {
|
|
@@ -135,10 +133,8 @@ const useVirtualization = (props) => {
|
|
|
135
133
|
// Used to mark when scroll container has height (updated by resize observer)
|
|
136
134
|
// because before that calculations are not right
|
|
137
135
|
const [isMounted, setIsMounted] = React.useState(false);
|
|
138
|
-
const getScrollableContainer = () =>
|
|
139
|
-
|
|
140
|
-
return (_a = scrollContainer.current) !== null && _a !== void 0 ? _a : (_b = parentRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.scrollingElement;
|
|
141
|
-
};
|
|
136
|
+
const getScrollableContainer = () => scrollContainer.current ??
|
|
137
|
+
parentRef.current?.ownerDocument.scrollingElement;
|
|
142
138
|
const visibleChildren = React.useMemo(() => {
|
|
143
139
|
const arr = [];
|
|
144
140
|
const endIndex = Math.min(itemsLength, startNode + visibleNodeCount + bufferSize * 2);
|
|
@@ -148,18 +144,18 @@ const useVirtualization = (props) => {
|
|
|
148
144
|
return arr;
|
|
149
145
|
}, [itemsLength, itemRenderer, bufferSize, startNode, visibleNodeCount]);
|
|
150
146
|
const updateChildHeight = React.useCallback(() => {
|
|
151
|
-
var _a, _b, _c, _d, _e, _f;
|
|
152
147
|
if (!parentRef.current || !visibleChildren.length) {
|
|
153
148
|
return;
|
|
154
149
|
}
|
|
155
150
|
const firstChild = parentRef.current.children.item(0);
|
|
156
151
|
const secondChild = parentRef.current.children.item(1);
|
|
157
152
|
const lastChild = parentRef.current.children.item(parentRef.current.children.length - 1);
|
|
158
|
-
const firstChildHeight = Number(
|
|
153
|
+
const firstChildHeight = Number(getElementHeightWithMargins(firstChild)?.toFixed(2) ?? 0);
|
|
159
154
|
childHeight.current = {
|
|
160
155
|
first: firstChildHeight,
|
|
161
|
-
middle: Number(
|
|
162
|
-
|
|
156
|
+
middle: Number(getElementHeightWithMargins(secondChild)?.toFixed(2) ??
|
|
157
|
+
firstChildHeight),
|
|
158
|
+
last: Number(getElementHeightWithMargins(lastChild)?.toFixed(2) ?? firstChildHeight),
|
|
163
159
|
};
|
|
164
160
|
}, [visibleChildren.length]);
|
|
165
161
|
const onResize = React.useCallback(({ height }) => {
|
|
@@ -177,14 +173,13 @@ const useVirtualization = (props) => {
|
|
|
177
173
|
// Find scrollable parent
|
|
178
174
|
// Needed only on init
|
|
179
175
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
180
|
-
|
|
181
|
-
const scrollableParent = getScrollableParent(parentRef.current, (_a = parentRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument);
|
|
176
|
+
const scrollableParent = getScrollableParent(parentRef.current, parentRef.current?.ownerDocument);
|
|
182
177
|
scrollContainer.current = scrollableParent;
|
|
183
178
|
resizeRef(scrollableParent);
|
|
184
179
|
}, [resizeRef]);
|
|
185
180
|
// Stop watching resize, when virtual scroll is unmounted
|
|
186
181
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
187
|
-
return () => resizeObserver
|
|
182
|
+
return () => resizeObserver?.disconnect();
|
|
188
183
|
}, [resizeObserver]);
|
|
189
184
|
// Get child height when children available
|
|
190
185
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => updateChildHeight(), [updateChildHeight]);
|
|
@@ -211,23 +206,21 @@ const useVirtualization = (props) => {
|
|
|
211
206
|
updateVirtualScroll();
|
|
212
207
|
}, [updateVirtualScroll]);
|
|
213
208
|
const removeScrollListener = React.useCallback(() => {
|
|
214
|
-
var _a, _b;
|
|
215
209
|
if (!onScrollRef.current) {
|
|
216
210
|
return;
|
|
217
211
|
}
|
|
218
212
|
!scrollContainer.current ||
|
|
219
|
-
scrollContainer.current ===
|
|
220
|
-
?
|
|
213
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body
|
|
214
|
+
? parentRef.current?.ownerDocument.removeEventListener('scroll', onScrollRef.current)
|
|
221
215
|
: scrollContainer.current.removeEventListener('scroll', onScrollRef.current);
|
|
222
216
|
}, []);
|
|
223
217
|
// Add event listener to the scrollable container.
|
|
224
218
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
225
|
-
var _a, _b;
|
|
226
219
|
removeScrollListener();
|
|
227
220
|
onScrollRef.current = onScroll;
|
|
228
221
|
if (!scrollContainer.current ||
|
|
229
|
-
scrollContainer.current ===
|
|
230
|
-
|
|
222
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body) {
|
|
223
|
+
parentRef.current?.ownerDocument.addEventListener('scroll', onScroll);
|
|
231
224
|
}
|
|
232
225
|
else {
|
|
233
226
|
scrollContainer.current.addEventListener('scroll', onScroll);
|
|
@@ -33,7 +33,6 @@ exports.VisuallyHidden = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/utils.css");
|
|
37
36
|
const Box_js_1 = require("./Box.js");
|
|
38
37
|
/**
|
|
39
38
|
* Hides content visually but keeps it still accessible to screen readers
|
|
@@ -22,3 +22,9 @@ export declare const getWindow: () => (Window & typeof globalThis) | undefined;
|
|
|
22
22
|
* `defaultPrevented` is respected for each callback.
|
|
23
23
|
*/
|
|
24
24
|
export declare const mergeEventHandlers: <E extends import("react").SyntheticEvent<Element, Event>>(...callbacks: (((event: E) => void) | undefined)[]) => (event: E) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Returns translate values as an array of a given element.
|
|
27
|
+
* @param element HTML element you want to get translate value of
|
|
28
|
+
* @returns Translate values in pixels in an array `[translateX, translateY]`
|
|
29
|
+
*/
|
|
30
|
+
export declare const getTranslateValues: (element: HTMLElement | null | undefined) => number[];
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
6
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.mergeEventHandlers = exports.getWindow = exports.getDocument = exports.getContainer = void 0;
|
|
10
|
+
exports.getTranslateValues = exports.mergeEventHandlers = exports.getWindow = exports.getDocument = exports.getContainer = void 0;
|
|
11
|
+
const styles_js_1 = __importDefault(require("../../../styles.js"));
|
|
8
12
|
/**
|
|
9
13
|
* Get the container as a child of body, or create one if it doesn't exist.
|
|
10
14
|
* Mostly used for dynamic components like Modal or Toast.
|
|
@@ -13,12 +17,12 @@ exports.mergeEventHandlers = exports.getWindow = exports.getDocument = exports.g
|
|
|
13
17
|
* @param ownerDocument Can be changed if the container should be in a different document (e.g. in popup).
|
|
14
18
|
*/
|
|
15
19
|
const getContainer = (containerId, ownerDocument = (0, exports.getDocument)()) => {
|
|
16
|
-
|
|
17
|
-
let container = (_a = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.getElementById(containerId)) !== null && _a !== void 0 ? _a : undefined;
|
|
20
|
+
let container = ownerDocument?.getElementById(containerId) ?? undefined;
|
|
18
21
|
if (container == null && !!ownerDocument) {
|
|
19
22
|
container = ownerDocument.createElement('div');
|
|
20
23
|
container.setAttribute('id', containerId);
|
|
21
|
-
const root =
|
|
24
|
+
const root = ownerDocument.querySelector(`.${styles_js_1.default['iui-root']}`) ??
|
|
25
|
+
ownerDocument.body;
|
|
22
26
|
root.appendChild(container);
|
|
23
27
|
}
|
|
24
28
|
return container;
|
|
@@ -46,10 +50,24 @@ exports.getWindow = getWindow;
|
|
|
46
50
|
*/
|
|
47
51
|
const mergeEventHandlers = (...callbacks) => (event) => {
|
|
48
52
|
for (const cb of callbacks) {
|
|
49
|
-
cb
|
|
50
|
-
if (event
|
|
53
|
+
cb?.(event);
|
|
54
|
+
if (event?.defaultPrevented) {
|
|
51
55
|
return;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
exports.mergeEventHandlers = mergeEventHandlers;
|
|
60
|
+
/**
|
|
61
|
+
* Returns translate values as an array of a given element.
|
|
62
|
+
* @param element HTML element you want to get translate value of
|
|
63
|
+
* @returns Translate values in pixels in an array `[translateX, translateY]`
|
|
64
|
+
*/
|
|
65
|
+
const getTranslateValues = (element) => {
|
|
66
|
+
if (!element) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
const transformValue = getComputedStyle(element).getPropertyValue('transform');
|
|
70
|
+
const matrix = new DOMMatrix(transformValue);
|
|
71
|
+
return [matrix.m41, matrix.m42];
|
|
72
|
+
};
|
|
73
|
+
exports.getTranslateValues = getTranslateValues;
|
|
@@ -23,6 +23,5 @@ __exportStar(require("./dom.js"), exports);
|
|
|
23
23
|
__exportStar(require("./colors.js"), exports);
|
|
24
24
|
__exportStar(require("./numbers.js"), exports);
|
|
25
25
|
__exportStar(require("./focusable.js"), exports);
|
|
26
|
-
__exportStar(require("./styles.js"), exports);
|
|
27
26
|
__exportStar(require("./supports.js"), exports);
|
|
28
27
|
__exportStar(require("./polymorphic.js"), exports);
|
|
@@ -34,12 +34,13 @@ exports.polymorphic = void 0;
|
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const useGlobals_js_1 = require("../hooks/useGlobals.js");
|
|
37
|
+
const styles_js_1 = __importDefault(require("../../../styles.js"));
|
|
37
38
|
const _base = (defaultElement) => {
|
|
38
39
|
return (className, attrs) => {
|
|
39
40
|
const Comp = React.forwardRef(({ as = defaultElement, ...props }, ref) => {
|
|
40
41
|
const Element = as || 'div'; // eslint-disable-line
|
|
41
42
|
(0, useGlobals_js_1.useGlobals)();
|
|
42
|
-
return (React.createElement(Element, { ref: ref, ...attrs, ...props, className: (0, classnames_1.default)(className, attrs
|
|
43
|
+
return (React.createElement(Element, { ref: ref, ...attrs, ...props, className: getScopedClassName((0, classnames_1.default)(className, attrs?.className, props.className)) }));
|
|
43
44
|
});
|
|
44
45
|
Comp.displayName = getDisplayNameFromClass(className);
|
|
45
46
|
return Comp;
|
|
@@ -79,3 +80,10 @@ const getDisplayNameFromClass = (str) => {
|
|
|
79
80
|
const camel = str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
80
81
|
return camel.substring(3);
|
|
81
82
|
};
|
|
83
|
+
// e.g. iui-button -> _iui3-button
|
|
84
|
+
const getScopedClassName = (className = '') => {
|
|
85
|
+
return (className
|
|
86
|
+
.split(' ')
|
|
87
|
+
.map((c) => (c in styles_js_1.default ? styles_js_1.default[c] : c))
|
|
88
|
+
.join(' ') || null);
|
|
89
|
+
};
|
|
@@ -9,5 +9,5 @@ const dom_js_1 = require("./dom.js");
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns true if the :has selector is supported in the browser
|
|
11
11
|
*/
|
|
12
|
-
const supportsHas = () =>
|
|
12
|
+
const supportsHas = () => (0, dom_js_1.getWindow)()?.CSS?.supports?.('selector(:has(+ *))');
|
|
13
13
|
exports.supportsHas = supportsHas;
|
|
@@ -9,6 +9,5 @@ export * from './useMediaQuery.js';
|
|
|
9
9
|
export * from './useSafeContext.js';
|
|
10
10
|
export * from './useLatestRef.js';
|
|
11
11
|
export * from './useIsomorphicLayoutEffect.js';
|
|
12
|
-
export * from './useIsThemeAlreadySet.js';
|
|
13
12
|
export * from './useIsClient.js';
|
|
14
13
|
export * from './useId.js';
|
|
@@ -29,6 +29,5 @@ __exportStar(require("./useMediaQuery.js"), exports);
|
|
|
29
29
|
__exportStar(require("./useSafeContext.js"), exports);
|
|
30
30
|
__exportStar(require("./useLatestRef.js"), exports);
|
|
31
31
|
__exportStar(require("./useIsomorphicLayoutEffect.js"), exports);
|
|
32
|
-
__exportStar(require("./useIsThemeAlreadySet.js"), exports);
|
|
33
32
|
__exportStar(require("./useIsClient.js"), exports);
|
|
34
33
|
__exportStar(require("./useId.js"), exports);
|
|
@@ -57,7 +57,7 @@ const useContainerWidth = (watchResizes = true) => {
|
|
|
57
57
|
const updateWidth = React.useCallback(({ width }) => setContentWidth(width), []);
|
|
58
58
|
const [resizeRef, resizeObserver] = (0, useResizeObserver_js_1.useResizeObserver)(updateWidth);
|
|
59
59
|
if (!watchResizes) {
|
|
60
|
-
resizeObserver
|
|
60
|
+
resizeObserver?.disconnect();
|
|
61
61
|
}
|
|
62
62
|
const refs = (0, useMergedRefs_js_1.useMergedRefs)(ref, watchResizes ? resizeRef : undefined);
|
|
63
63
|
return [refs, contentWidth];
|