@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
|
@@ -34,7 +34,6 @@ exports.Carousel = void 0;
|
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/carousel.css");
|
|
38
37
|
const CarouselContext_js_1 = require("./CarouselContext.js");
|
|
39
38
|
const CarouselSlider_js_1 = require("./CarouselSlider.js");
|
|
40
39
|
const CarouselSlide_js_1 = require("./CarouselSlide.js");
|
|
@@ -44,7 +43,7 @@ const CarouselNavigation_js_1 = require("./CarouselNavigation.js");
|
|
|
44
43
|
const CarouselComponent = React.forwardRef((props, ref) => {
|
|
45
44
|
const { activeSlideIndex: userActiveIndex = 0, onSlideChange, className, children, ...rest } = props;
|
|
46
45
|
// Generate a stateful random id if not specified
|
|
47
|
-
const [id] = React.useState(() =>
|
|
46
|
+
const [id] = React.useState(() => props.id ?? `iui-carousel-${(0, index_js_1.getRandomValue)(10)}`);
|
|
48
47
|
const isManuallyUpdating = React.useRef(false);
|
|
49
48
|
const carouselRef = React.useRef(null);
|
|
50
49
|
const refs = (0, index_js_1.useMergedRefs)(carouselRef, ref);
|
|
@@ -52,7 +51,6 @@ const CarouselComponent = React.forwardRef((props, ref) => {
|
|
|
52
51
|
const scrollToSlide = React.useRef(() => { }); // stub function populated in CarouselSlider
|
|
53
52
|
const justMounted = React.useRef(true);
|
|
54
53
|
React.useEffect(() => {
|
|
55
|
-
var _a;
|
|
56
54
|
setCurrentIndex(userActiveIndex);
|
|
57
55
|
scrollToSlide.current(userActiveIndex, {
|
|
58
56
|
instant: justMounted.current,
|
|
@@ -60,7 +58,7 @@ const CarouselComponent = React.forwardRef((props, ref) => {
|
|
|
60
58
|
// re-focus the carousel for keyboard nav, but not on first mount
|
|
61
59
|
// because it shows outline and might interfere with other components
|
|
62
60
|
if (!justMounted.current) {
|
|
63
|
-
|
|
61
|
+
carouselRef.current?.focus({ preventScroll: true });
|
|
64
62
|
}
|
|
65
63
|
justMounted.current = false;
|
|
66
64
|
}, [userActiveIndex]);
|
|
@@ -95,8 +93,7 @@ const CarouselComponent = React.forwardRef((props, ref) => {
|
|
|
95
93
|
};
|
|
96
94
|
const userOnSlideChange = React.useRef(onSlideChange);
|
|
97
95
|
React.useEffect(() => {
|
|
98
|
-
|
|
99
|
-
(_a = userOnSlideChange.current) === null || _a === void 0 ? void 0 : _a.call(userOnSlideChange, currentIndex);
|
|
96
|
+
userOnSlideChange.current?.(currentIndex);
|
|
100
97
|
}, [currentIndex]);
|
|
101
98
|
return (React.createElement(index_js_1.Box, { as: 'section', "aria-roledescription": 'carousel', tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: refs, className: (0, classnames_1.default)('iui-carousel', className), ...rest, id: id },
|
|
102
99
|
React.createElement(CarouselContext_js_1.CarouselContext.Provider, { value: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
|
-
import '@itwin/itwinui-css/css/carousel.css';
|
|
3
2
|
declare type CarouselDotsListProps = {
|
|
4
3
|
/** Number of total dots/slides in the carousel. Will be inferred from Carousel context or children. Otherwise, it is required to be passed. */
|
|
5
4
|
length?: number;
|
|
@@ -36,7 +36,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
36
36
|
const CarouselContext_js_1 = require("./CarouselContext.js");
|
|
37
37
|
const index_js_1 = require("../utils/index.js");
|
|
38
38
|
const CarouselDot_js_1 = require("./CarouselDot.js");
|
|
39
|
-
require("@itwin/itwinui-css/css/carousel.css");
|
|
40
39
|
/**
|
|
41
40
|
* The `CarouselDotsList` component shows a list of `CarouselDot` components which can be used to
|
|
42
41
|
* choose a specific slide. If used as a descendant of `Carousel`, then this component does not need
|
|
@@ -60,18 +59,17 @@ require("@itwin/itwinui-css/css/carousel.css");
|
|
|
60
59
|
* />
|
|
61
60
|
*/
|
|
62
61
|
exports.CarouselDotsList = React.forwardRef((props, ref) => {
|
|
63
|
-
var _a, _b, _c;
|
|
64
62
|
const { currentIndex: userCurrentIndex, length, className, onSlideChange, children, ...rest } = props;
|
|
65
63
|
const context = React.useContext(CarouselContext_js_1.CarouselContext);
|
|
66
|
-
const slideCount =
|
|
67
|
-
const currentIndex =
|
|
68
|
-
const idPrefix =
|
|
64
|
+
const slideCount = length ?? context?.slideCount ?? React.Children.count(children);
|
|
65
|
+
const currentIndex = userCurrentIndex ?? context?.currentIndex ?? 0;
|
|
66
|
+
const idPrefix = props.id ?? context?.idPrefix;
|
|
69
67
|
const handleSlideChange = React.useCallback((index) => {
|
|
70
68
|
if (context) {
|
|
71
69
|
context.setCurrentIndex(index);
|
|
72
70
|
context.scrollToSlide.current(index);
|
|
73
71
|
}
|
|
74
|
-
onSlideChange
|
|
72
|
+
onSlideChange?.(index);
|
|
75
73
|
}, [context, onSlideChange]);
|
|
76
74
|
const justMounted = React.useRef(true);
|
|
77
75
|
const [visibleCount, setVisibleCount] = React.useState(slideCount);
|
|
@@ -85,7 +83,7 @@ exports.CarouselDotsList = React.forwardRef((props, ref) => {
|
|
|
85
83
|
const dotWidth = listRef.current.children[0].offsetWidth;
|
|
86
84
|
setVisibleCount(Math.floor(width / dotWidth));
|
|
87
85
|
});
|
|
88
|
-
React.useEffect(() => resizeObserver
|
|
86
|
+
React.useEffect(() => resizeObserver?.disconnect(), [resizeObserver]);
|
|
89
87
|
const refs = (0, index_js_1.useMergedRefs)(ref, resizeRef, listRef);
|
|
90
88
|
const firstVisibleDotIndex = React.useMemo(() => (0, index_js_1.getBoundedValue)(currentIndex - Math.ceil(visibleCount / 2) + 1, 0, slideCount - visibleCount), [currentIndex, slideCount, visibleCount]);
|
|
91
89
|
const lastVisibleDotIndex = React.useMemo(() => (0, index_js_1.getBoundedValue)(currentIndex + Math.floor(visibleCount / 2), visibleCount - 1, slideCount - 1), [currentIndex, slideCount, visibleCount]);
|
|
@@ -109,12 +107,11 @@ exports.CarouselDotsList = React.forwardRef((props, ref) => {
|
|
|
109
107
|
handleSlideChange,
|
|
110
108
|
]);
|
|
111
109
|
React.useEffect(() => {
|
|
112
|
-
|
|
113
|
-
const firstDot = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.children[firstVisibleDotIndex];
|
|
110
|
+
const firstDot = listRef.current?.children[firstVisibleDotIndex];
|
|
114
111
|
if (!listRef.current || !firstDot) {
|
|
115
112
|
return;
|
|
116
113
|
}
|
|
117
|
-
const motionOk = (
|
|
114
|
+
const motionOk = (0, index_js_1.getWindow)()?.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
|
|
118
115
|
listRef.current.scrollTo({
|
|
119
116
|
left: firstDot.offsetLeft - listRef.current.offsetLeft,
|
|
120
117
|
behavior: motionOk && !justMounted.current ? 'smooth' : 'auto',
|
|
@@ -124,5 +121,5 @@ exports.CarouselDotsList = React.forwardRef((props, ref) => {
|
|
|
124
121
|
}
|
|
125
122
|
}, [currentIndex, firstVisibleDotIndex, slideCount, visibleCount, width]);
|
|
126
123
|
return (React.createElement(React.Fragment, null,
|
|
127
|
-
React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-carousel-navigation-dots', className), role: 'tablist', "aria-label": 'Slides', ref: refs, ...rest }, children
|
|
124
|
+
React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-carousel-navigation-dots', className), role: 'tablist', "aria-label": 'Slides', ref: refs, ...rest }, children ?? dots)));
|
|
128
125
|
});
|
|
@@ -9,7 +9,7 @@ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
|
9
9
|
export declare const CarouselNavigation: PolymorphicForwardRefComponent<"nav", {}> & {
|
|
10
10
|
PreviousButton: PolymorphicForwardRefComponent<"button", Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
11
11
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
12
|
-
}, "label" | "as" | "size" | "
|
|
12
|
+
}, "label" | "as" | "size" | "styleType" | "isActive"> & {
|
|
13
13
|
isActive?: boolean | undefined;
|
|
14
14
|
label?: React.ReactNode;
|
|
15
15
|
} & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
|
|
@@ -17,7 +17,7 @@ export declare const CarouselNavigation: PolymorphicForwardRefComponent<"nav", {
|
|
|
17
17
|
}>;
|
|
18
18
|
NextButton: PolymorphicForwardRefComponent<"button", Omit<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
19
19
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
20
|
-
}, "label" | "as" | "size" | "
|
|
20
|
+
}, "label" | "as" | "size" | "styleType" | "isActive"> & {
|
|
21
21
|
isActive?: boolean | undefined;
|
|
22
22
|
label?: React.ReactNode;
|
|
23
23
|
} & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
|
|
@@ -39,7 +39,7 @@ const CarouselDotsList_js_1 = require("./CarouselDotsList.js");
|
|
|
39
39
|
const index_js_2 = require("../utils/index.js");
|
|
40
40
|
const CarouselNavigationComponent = React.forwardRef((props, ref) => {
|
|
41
41
|
const { className, children, ...rest } = props;
|
|
42
|
-
return (React.createElement(index_js_2.Box, { as: 'nav', className: (0, classnames_1.default)('iui-carousel-navigation', className), ref: ref, ...rest }, children
|
|
42
|
+
return (React.createElement(index_js_2.Box, { as: 'nav', className: (0, classnames_1.default)('iui-carousel-navigation', className), ref: ref, ...rest }, children ?? (React.createElement(React.Fragment, null,
|
|
43
43
|
React.createElement(index_js_2.Box, { className: 'iui-carousel-navigation-left' },
|
|
44
44
|
React.createElement(PreviousButton, null)),
|
|
45
45
|
React.createElement(CarouselDotsList_js_1.CarouselDotsList, null),
|
|
@@ -54,11 +54,10 @@ const PreviousButton = React.forwardRef((props, ref) => {
|
|
|
54
54
|
}
|
|
55
55
|
const { slideCount, currentIndex, setCurrentIndex, keysPressed, scrollToSlide, } = context;
|
|
56
56
|
return (React.createElement(index_js_1.IconButton, { styleType: 'borderless', size: 'small', tabIndex: -1, "data-pressed": keysPressed['ArrowLeft'] || undefined, ref: ref, ...props, onClick: (e) => {
|
|
57
|
-
var _a;
|
|
58
57
|
const prevIndex = (slideCount + currentIndex - 1) % slideCount;
|
|
59
58
|
setCurrentIndex(prevIndex);
|
|
60
59
|
scrollToSlide.current(prevIndex, { instant: e.detail > 3 });
|
|
61
|
-
|
|
60
|
+
props?.onClick?.(e);
|
|
62
61
|
} },
|
|
63
62
|
React.createElement(index_js_2.SvgChevronLeft, null)));
|
|
64
63
|
});
|
|
@@ -70,11 +69,10 @@ const NextButton = React.forwardRef((props, ref) => {
|
|
|
70
69
|
}
|
|
71
70
|
const { slideCount, currentIndex, setCurrentIndex, keysPressed, scrollToSlide, } = context;
|
|
72
71
|
return (React.createElement(index_js_1.IconButton, { styleType: 'borderless', size: 'small', tabIndex: -1, "data-pressed": keysPressed['ArrowRight'] || undefined, ref: ref, ...props, onClick: (e) => {
|
|
73
|
-
var _a;
|
|
74
72
|
const nextIndex = (slideCount + currentIndex + 1) % slideCount;
|
|
75
73
|
setCurrentIndex(nextIndex);
|
|
76
74
|
scrollToSlide.current(nextIndex, { instant: e.detail > 3 });
|
|
77
|
-
|
|
75
|
+
props?.onClick?.(e);
|
|
78
76
|
} },
|
|
79
77
|
React.createElement(index_js_2.SvgChevronRight, null)));
|
|
80
78
|
});
|
|
@@ -45,28 +45,24 @@ exports.CarouselSlider = React.forwardRef((props, ref) => {
|
|
|
45
45
|
throw new Error('CarouselSlider must be used within Carousel');
|
|
46
46
|
}
|
|
47
47
|
const { setSlideCount, idPrefix, scrollToSlide, isManuallyUpdating } = context;
|
|
48
|
-
const items = React.useMemo(() =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
: child)) !== null && _a !== void 0 ? _a : [];
|
|
56
|
-
}, [children, idPrefix]);
|
|
48
|
+
const items = React.useMemo(() => React.Children.map(children, (child, index) => React.isValidElement(child)
|
|
49
|
+
? React.cloneElement(child, {
|
|
50
|
+
id: `${idPrefix}--slide-${index}`,
|
|
51
|
+
index,
|
|
52
|
+
})
|
|
53
|
+
: child) ?? [], [children, idPrefix]);
|
|
57
54
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
58
55
|
setSlideCount(items.length);
|
|
59
56
|
}, [items.length, setSlideCount]);
|
|
60
57
|
const sliderRef = React.useRef(null);
|
|
61
58
|
const refs = (0, index_js_1.useMergedRefs)(sliderRef, ref);
|
|
62
59
|
scrollToSlide.current = (slideIndex, { instant } = {}) => {
|
|
63
|
-
var _a, _b, _c;
|
|
64
60
|
isManuallyUpdating.current = true; // start manual update
|
|
65
|
-
const slideToShow =
|
|
61
|
+
const slideToShow = sliderRef.current?.children.item(slideIndex);
|
|
66
62
|
if (!sliderRef.current || !slideToShow) {
|
|
67
63
|
return;
|
|
68
64
|
}
|
|
69
|
-
const motionOk = (
|
|
65
|
+
const motionOk = (0, index_js_1.getWindow)()?.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
|
|
70
66
|
sliderRef.current.scrollTo({
|
|
71
67
|
left: slideToShow.offsetLeft - sliderRef.current.offsetLeft,
|
|
72
68
|
behavior: (instant || !motionOk ? 'instant' : 'smooth'), // scrollTo accepts 'instant' but ScrollBehavior type is wrong
|
|
@@ -75,11 +71,10 @@ exports.CarouselSlider = React.forwardRef((props, ref) => {
|
|
|
75
71
|
const scrollTimeout = React.useRef();
|
|
76
72
|
// reset isManuallyUpdating.current to false after the last scroll event
|
|
77
73
|
const handleOnScroll = React.useCallback(() => {
|
|
78
|
-
var _a, _b;
|
|
79
74
|
if (scrollTimeout.current) {
|
|
80
|
-
(
|
|
75
|
+
(0, index_js_1.getWindow)()?.clearTimeout(scrollTimeout.current);
|
|
81
76
|
}
|
|
82
|
-
scrollTimeout.current = (
|
|
77
|
+
scrollTimeout.current = (0, index_js_1.getWindow)()?.setTimeout(() => {
|
|
83
78
|
isManuallyUpdating.current = false;
|
|
84
79
|
}, 100);
|
|
85
80
|
}, [isManuallyUpdating]);
|
|
@@ -35,7 +35,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../ProgressIndicators/index.js");
|
|
37
37
|
const index_js_2 = require("../utils/index.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/checkbox.css");
|
|
39
38
|
/**
|
|
40
39
|
* Simple input checkbox
|
|
41
40
|
* @example
|
|
@@ -35,7 +35,6 @@ const React = __importStar(require("react"));
|
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
37
|
const index_js_2 = require("../Slider/index.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/color-picker.css");
|
|
39
38
|
const ColorPickerContext_js_1 = require("./ColorPickerContext.js");
|
|
40
39
|
const getVerticalPercentageOfRectangle = (rect, pointer) => {
|
|
41
40
|
const position = (0, index_js_1.getBoundedValue)(pointer, rect.top, rect.bottom);
|
|
@@ -51,7 +50,6 @@ const getHorizontalPercentageOfRectangle = (rect, pointer) => {
|
|
|
51
50
|
* and a set of sliders to adjust hue and alpha values.
|
|
52
51
|
*/
|
|
53
52
|
exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
54
|
-
var _a, _b, _c;
|
|
55
53
|
const { className, ...rest } = props;
|
|
56
54
|
const builderRef = React.useRef();
|
|
57
55
|
const refs = (0, index_js_1.useMergedRefs)(builderRef, ref);
|
|
@@ -59,7 +57,7 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
59
57
|
// Set values for slider
|
|
60
58
|
const hueSliderColor = React.useMemo(() => index_js_1.ColorValue.create({ h: hsvColor.h, s: 100, v: 100 }), [hsvColor.h]);
|
|
61
59
|
const sliderValue = React.useMemo(() => hsvColor.h, [hsvColor]);
|
|
62
|
-
const alphaValue = React.useMemo(() =>
|
|
60
|
+
const alphaValue = React.useMemo(() => (showAlpha ? hsvColor.a ?? 1 : 1), [hsvColor.a, showAlpha]);
|
|
63
61
|
// Set values for color square and color dot
|
|
64
62
|
const dotColorString = React.useMemo(() => activeColor.toHexString(), [activeColor]);
|
|
65
63
|
const [colorDotActive, setColorDotActive] = React.useState(false);
|
|
@@ -122,7 +120,7 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
122
120
|
event.preventDefault();
|
|
123
121
|
event.stopPropagation();
|
|
124
122
|
}, [colorDotActive, updateSquareValue]);
|
|
125
|
-
(0, index_js_1.useEventListener)('pointerup', handleSquarePointerUp,
|
|
123
|
+
(0, index_js_1.useEventListener)('pointerup', handleSquarePointerUp, builderRef.current?.ownerDocument);
|
|
126
124
|
const handleSquarePointerMove = React.useCallback((event) => {
|
|
127
125
|
if (!colorDotActive) {
|
|
128
126
|
return;
|
|
@@ -131,7 +129,7 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
131
129
|
event.stopPropagation();
|
|
132
130
|
updateSquareValue(event, 'onUpdate');
|
|
133
131
|
}, [colorDotActive, updateSquareValue]);
|
|
134
|
-
(0, index_js_1.useEventListener)('pointermove', handleSquarePointerMove,
|
|
132
|
+
(0, index_js_1.useEventListener)('pointermove', handleSquarePointerMove, builderRef.current?.ownerDocument);
|
|
135
133
|
const handleSquarePointerLeave = React.useCallback((event) => {
|
|
136
134
|
if (!colorDotActive) {
|
|
137
135
|
return;
|
|
@@ -139,7 +137,7 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
139
137
|
updateSquareValue(event, 'onChange');
|
|
140
138
|
setColorDotActive(false);
|
|
141
139
|
}, [colorDotActive, updateSquareValue]);
|
|
142
|
-
(0, index_js_1.useEventListener)('pointerleave', handleSquarePointerLeave,
|
|
140
|
+
(0, index_js_1.useEventListener)('pointerleave', handleSquarePointerLeave, builderRef.current?.ownerDocument);
|
|
143
141
|
const keysPressed = React.useRef({}); // keep track of which keys are currently pressed
|
|
144
142
|
// Arrow key navigation for color dot
|
|
145
143
|
const handleColorDotKeyDown = (event) => {
|
|
@@ -183,7 +181,7 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
183
181
|
keysPressed.current['ArrowRight']) {
|
|
184
182
|
return;
|
|
185
183
|
}
|
|
186
|
-
onChangeComplete
|
|
184
|
+
onChangeComplete?.(index_js_1.ColorValue.create(hsvColor));
|
|
187
185
|
break;
|
|
188
186
|
}
|
|
189
187
|
};
|
|
@@ -192,18 +190,16 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
|
|
|
192
190
|
'--iui-color-field-hue': hueColorString,
|
|
193
191
|
'--iui-color-picker-selected-color': dotColorString,
|
|
194
192
|
}, ref: squareRef, onPointerDown: (event) => {
|
|
195
|
-
var _a;
|
|
196
193
|
event.preventDefault();
|
|
197
194
|
updateSquareValue(event, 'onClick');
|
|
198
195
|
setColorDotActive(true);
|
|
199
|
-
|
|
196
|
+
colorDotRef.current?.focus();
|
|
200
197
|
} },
|
|
201
198
|
React.createElement(index_js_1.Box, { className: 'iui-color-dot', style: {
|
|
202
199
|
'--iui-color-dot-inset': `${squareTop.toString()}% auto auto ${squareLeft.toString()}%`,
|
|
203
200
|
}, onPointerDown: () => {
|
|
204
|
-
var _a;
|
|
205
201
|
setColorDotActive(true);
|
|
206
|
-
|
|
202
|
+
colorDotRef.current?.focus();
|
|
207
203
|
}, onKeyDown: handleColorDotKeyDown, onKeyUp: handleColorDotKeyUp, tabIndex: 0, ref: colorDotRef })),
|
|
208
204
|
React.createElement(index_js_2.Slider, { minLabel: '', maxLabel: '', values: [sliderValue], className: 'iui-hue-slider', trackDisplayMode: 'none', tooltipProps: () => ({ visible: false }), onChange: (values) => {
|
|
209
205
|
updateHueSlider(values[0], true);
|
|
@@ -37,7 +37,6 @@ const index_js_1 = require("../Buttons/index.js");
|
|
|
37
37
|
const index_js_2 = require("../Input/index.js");
|
|
38
38
|
const index_js_3 = require("../utils/index.js");
|
|
39
39
|
const ColorPickerContext_js_1 = require("./ColorPickerContext.js");
|
|
40
|
-
require("@itwin/itwinui-css/css/color-picker.css");
|
|
41
40
|
/**
|
|
42
41
|
* `ColorInputPanel` shows input fields to enter precise color values in the specified format.
|
|
43
42
|
* It also allows switching between the specified formats using a swap button.
|
|
@@ -48,7 +47,6 @@ require("@itwin/itwinui-css/css/color-picker.css");
|
|
|
48
47
|
* </ColorPicker>
|
|
49
48
|
*/
|
|
50
49
|
exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
51
|
-
var _a, _b, _c, _d, _f, _g, _h, _j;
|
|
52
50
|
const { defaultColorFormat, allowedColorFormats = ['hsl', 'rgb', 'hex'], className, ...rest } = props;
|
|
53
51
|
const inputsContainerRef = React.useRef(null);
|
|
54
52
|
const { activeColor, applyHsvColorChange, hsvColor, showAlpha } = (0, ColorPickerContext_js_1.useColorPickerContext)();
|
|
@@ -59,14 +57,13 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
59
57
|
// need to use state since input may have parsing error
|
|
60
58
|
const [input, setInput] = React.useState(['', '', '', '']);
|
|
61
59
|
React.useEffect(() => {
|
|
62
|
-
var _a, _b;
|
|
63
60
|
if (currentFormat === 'hsl') {
|
|
64
61
|
const hsl = activeColor.toHslColor();
|
|
65
62
|
setInput([
|
|
66
63
|
index_js_3.ColorValue.getFormattedColorNumber(hsvColor.h),
|
|
67
64
|
index_js_3.ColorValue.getFormattedColorNumber(hsl.s),
|
|
68
65
|
index_js_3.ColorValue.getFormattedColorNumber(hsl.l),
|
|
69
|
-
index_js_3.ColorValue.getFormattedColorNumber(
|
|
66
|
+
index_js_3.ColorValue.getFormattedColorNumber(hsl.a ?? activeColor.getAlpha() / 255, 2),
|
|
70
67
|
]);
|
|
71
68
|
}
|
|
72
69
|
else if (currentFormat === 'rgb') {
|
|
@@ -75,7 +72,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
75
72
|
rgb.r.toString(),
|
|
76
73
|
rgb.g.toString(),
|
|
77
74
|
rgb.b.toString(),
|
|
78
|
-
index_js_3.ColorValue.getFormattedColorNumber(
|
|
75
|
+
index_js_3.ColorValue.getFormattedColorNumber(rgb.a ?? activeColor.getAlpha() / 255, 2),
|
|
79
76
|
]);
|
|
80
77
|
}
|
|
81
78
|
else {
|
|
@@ -85,9 +82,8 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
85
82
|
}, [activeColor, hsvColor.h, currentFormat, showAlpha]);
|
|
86
83
|
const [validHexInput, setValidHexInput] = React.useState(true);
|
|
87
84
|
const swapColorFormat = React.useCallback(() => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
allowedColorFormats.length]) !== null && _a !== void 0 ? _a : allowedColorFormats[0];
|
|
85
|
+
const newFormat = allowedColorFormats[(allowedColorFormats.indexOf(currentFormat) + 1) %
|
|
86
|
+
allowedColorFormats.length] ?? allowedColorFormats[0];
|
|
91
87
|
setCurrentFormat(newFormat);
|
|
92
88
|
}, [currentFormat, allowedColorFormats]);
|
|
93
89
|
const isFocusInside = (focused) => !!(focused &&
|
|
@@ -168,7 +164,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
168
164
|
React.createElement(index_js_3.InputContainer, { status: Number(input[0]) < 0 || Number(input[0]) > 360
|
|
169
165
|
? 'negative'
|
|
170
166
|
: undefined },
|
|
171
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '359', step: '.1', placeholder: 'H', value:
|
|
167
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '359', step: '.1', placeholder: 'H', value: input[0] ?? '', onChange: (event) => {
|
|
172
168
|
setInput([event.target.value, input[1], input[2], input[3]]);
|
|
173
169
|
}, onKeyDown: (event) => {
|
|
174
170
|
if (event.key === 'Enter') {
|
|
@@ -184,7 +180,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
184
180
|
React.createElement(index_js_3.InputContainer, { status: Number(input[1]) < 0 || Number(input[1]) > 100
|
|
185
181
|
? 'negative'
|
|
186
182
|
: undefined },
|
|
187
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'S', value:
|
|
183
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'S', value: input[1] ?? '', onChange: (event) => {
|
|
188
184
|
setInput([input[0], event.target.value, input[2], input[3]]);
|
|
189
185
|
}, onKeyDown: (event) => {
|
|
190
186
|
if (event.key === 'Enter') {
|
|
@@ -200,7 +196,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
200
196
|
React.createElement(index_js_3.InputContainer, { status: Number(input[2]) < 0 || Number(input[2]) > 100
|
|
201
197
|
? 'negative'
|
|
202
198
|
: undefined },
|
|
203
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'L', value:
|
|
199
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'L', value: input[2] ?? '', onChange: (event) => {
|
|
204
200
|
setInput([input[0], input[1], event.target.value, input[3]]);
|
|
205
201
|
}, onKeyDown: (event) => {
|
|
206
202
|
if (event.key === 'Enter') {
|
|
@@ -216,7 +212,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
216
212
|
showAlpha && (React.createElement(index_js_3.InputContainer, { status: Number(input[3]) < 0 || Number(input[3]) > 1
|
|
217
213
|
? 'negative'
|
|
218
214
|
: undefined },
|
|
219
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '1', step: '.01', placeholder: 'A', value:
|
|
215
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '1', step: '.01', placeholder: 'A', value: input[3] ?? '', onChange: (event) => {
|
|
220
216
|
setInput([input[0], input[1], input[2], event.target.value]);
|
|
221
217
|
}, onKeyDown: (event) => {
|
|
222
218
|
if (event.key === 'Enter') {
|
|
@@ -233,7 +229,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
233
229
|
React.createElement(index_js_3.InputContainer, { status: Number(input[0]) < 0 || Number(input[0]) > 255
|
|
234
230
|
? 'negative'
|
|
235
231
|
: undefined },
|
|
236
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'R', value:
|
|
232
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'R', value: input[0] ?? '', onChange: (event) => {
|
|
237
233
|
setInput([event.target.value, input[1], input[2], input[3]]);
|
|
238
234
|
}, onKeyDown: (event) => {
|
|
239
235
|
if (event.key === 'Enter') {
|
|
@@ -249,7 +245,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
249
245
|
React.createElement(index_js_3.InputContainer, { status: Number(input[1]) < 0 || Number(input[1]) > 255
|
|
250
246
|
? 'negative'
|
|
251
247
|
: undefined },
|
|
252
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'G', value:
|
|
248
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'G', value: input[1] ?? '', onChange: (event) => {
|
|
253
249
|
setInput([input[0], event.target.value, input[2], input[3]]);
|
|
254
250
|
}, onKeyDown: (event) => {
|
|
255
251
|
if (event.key === 'Enter') {
|
|
@@ -265,7 +261,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
265
261
|
React.createElement(index_js_3.InputContainer, { status: Number(input[2]) < 0 || Number(input[2]) > 255
|
|
266
262
|
? 'negative'
|
|
267
263
|
: undefined },
|
|
268
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'B', value:
|
|
264
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '255', placeholder: 'B', value: input[2] ?? '', onChange: (event) => {
|
|
269
265
|
setInput([input[0], input[1], event.target.value, input[3]]);
|
|
270
266
|
}, onKeyDown: (event) => {
|
|
271
267
|
if (event.key === 'Enter') {
|
|
@@ -281,7 +277,7 @@ exports.ColorInputPanel = React.forwardRef((props, ref) => {
|
|
|
281
277
|
showAlpha && (React.createElement(index_js_3.InputContainer, { status: Number(input[3]) < 0 || Number(input[3]) > 1
|
|
282
278
|
? 'negative'
|
|
283
279
|
: undefined },
|
|
284
|
-
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '1', step: '.01', placeholder: 'A', value:
|
|
280
|
+
React.createElement(index_js_2.Input, { size: 'small', type: 'number', min: '0', max: '1', step: '.01', placeholder: 'A', value: input[3] ?? '', onChange: (event) => {
|
|
285
281
|
setInput([input[0], input[1], input[2], event.target.value]);
|
|
286
282
|
}, onKeyDown: (event) => {
|
|
287
283
|
if (event.key === 'Enter') {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ColorValue } from '../utils/index.js';
|
|
3
3
|
import type { ColorType, PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/color-picker.css';
|
|
5
4
|
export declare type ColorPaletteProps = {
|
|
6
5
|
/**
|
|
7
6
|
* Label shown above the palette.
|
|
@@ -37,7 +37,6 @@ const index_js_1 = require("../utils/index.js");
|
|
|
37
37
|
const ColorPicker_js_1 = require("./ColorPicker.js");
|
|
38
38
|
const ColorSwatch_js_1 = require("./ColorSwatch.js");
|
|
39
39
|
const ColorPickerContext_js_1 = require("./ColorPickerContext.js");
|
|
40
|
-
require("@itwin/itwinui-css/css/color-picker.css");
|
|
41
40
|
/**
|
|
42
41
|
* `ColorPalette` is used to show a group of `ColorSwatch` components.
|
|
43
42
|
* @example
|
|
@@ -55,9 +54,8 @@ exports.ColorPalette = React.forwardRef((props, ref) => {
|
|
|
55
54
|
const [focusedIndex, setFocusedIndex] = React.useState();
|
|
56
55
|
// callback ref to set tabindex=0 on first child if none of the swatches are tabbable
|
|
57
56
|
const setDefaultTabIndex = (el) => {
|
|
58
|
-
var _a;
|
|
59
57
|
if (el && !el.querySelector('[tabindex="0"]')) {
|
|
60
|
-
|
|
58
|
+
el.firstElementChild?.setAttribute('tabindex', '0');
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
const paletteRef = React.useRef(null);
|
|
@@ -71,7 +69,7 @@ exports.ColorPalette = React.forwardRef((props, ref) => {
|
|
|
71
69
|
if (!swatches.length) {
|
|
72
70
|
return;
|
|
73
71
|
}
|
|
74
|
-
const currentIndex = swatches.findIndex((swatch) =>
|
|
72
|
+
const currentIndex = swatches.findIndex((swatch) => swatch === paletteRef.current?.ownerDocument.activeElement);
|
|
75
73
|
if (currentIndex < 0) {
|
|
76
74
|
return;
|
|
77
75
|
}
|
|
@@ -113,10 +111,9 @@ exports.ColorPalette = React.forwardRef((props, ref) => {
|
|
|
113
111
|
};
|
|
114
112
|
// call focus() when focusedIndex changes
|
|
115
113
|
React.useEffect(() => {
|
|
116
|
-
var _a;
|
|
117
114
|
if (focusedIndex != null) {
|
|
118
115
|
const swatches = (0, index_js_1.getFocusableElements)(paletteRef.current);
|
|
119
|
-
|
|
116
|
+
swatches[focusedIndex]?.focus();
|
|
120
117
|
}
|
|
121
118
|
}, [focusedIndex]);
|
|
122
119
|
return (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-color-palette-wrapper', className), ref: ref, ...rest },
|
|
@@ -128,7 +125,7 @@ exports.ColorPalette = React.forwardRef((props, ref) => {
|
|
|
128
125
|
const color = (0, ColorPicker_js_1.getColorValue)(_color);
|
|
129
126
|
return (React.createElement(ColorSwatch_js_1.ColorSwatch, { key: index, color: color, onClick: (event) => {
|
|
130
127
|
event.preventDefault();
|
|
131
|
-
onChangeComplete
|
|
128
|
+
onChangeComplete?.(color);
|
|
132
129
|
setActiveColor(color);
|
|
133
130
|
}, isActive: color.equals(activeColor) }));
|
|
134
131
|
}))));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import '@itwin/itwinui-css/css/color-picker.css';
|
|
3
2
|
import { ColorValue } from '../utils/index.js';
|
|
4
3
|
import type { ColorType, PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
5
4
|
export declare const getColorValue: (color: ColorType | ColorValue | undefined) => ColorValue;
|
|
@@ -32,7 +32,6 @@ exports.ColorPicker = exports.getColorValue = void 0;
|
|
|
32
32
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
require("@itwin/itwinui-css/css/color-picker.css");
|
|
36
35
|
const index_js_1 = require("../utils/index.js");
|
|
37
36
|
const classnames_1 = __importDefault(require("classnames"));
|
|
38
37
|
const ColorPickerContext_js_1 = require("./ColorPickerContext.js");
|
|
@@ -85,13 +84,13 @@ exports.ColorPicker = React.forwardRef((props, forwardedRef) => {
|
|
|
85
84
|
const applyHsvColorChange = React.useCallback((newColor, selectionChanged, newColorValue) => {
|
|
86
85
|
// save the HSV values
|
|
87
86
|
setHsvColor(newColor);
|
|
88
|
-
const newActiveColor = newColorValue
|
|
87
|
+
const newActiveColor = newColorValue ?? index_js_1.ColorValue.create(newColor);
|
|
89
88
|
// Only update selected color when dragging is done
|
|
90
89
|
if (selectionChanged) {
|
|
91
|
-
onChangeComplete
|
|
90
|
+
onChangeComplete?.(newActiveColor);
|
|
92
91
|
}
|
|
93
92
|
else {
|
|
94
|
-
onChange
|
|
93
|
+
onChange?.(newActiveColor);
|
|
95
94
|
}
|
|
96
95
|
activeColorTbgr.current = newActiveColor.toTbgr();
|
|
97
96
|
// this converts it to store in tbgr
|
|
@@ -33,7 +33,6 @@ exports.ColorSwatch = 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/color-picker.css");
|
|
37
36
|
const index_js_1 = require("../utils/index.js");
|
|
38
37
|
const ColorPicker_js_1 = require("./ColorPicker.js");
|
|
39
38
|
/**
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import type { SelectOption } from '../Select/index.js';
|
|
3
3
|
import type { Input } from '../Input/Input.js';
|
|
4
4
|
import type { PopoverProps, InputContainerProps, CommonProps } from '../utils/index.js';
|
|
5
|
-
import 'tippy.js/animations/shift-away.css';
|
|
6
5
|
declare type ActionType = 'added' | 'removed';
|
|
7
6
|
declare type MultipleOnChangeProps<T> = {
|
|
8
7
|
value: T;
|