@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
|
@@ -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("../Buttons/IconButton/index.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/searchbox.css");
|
|
39
38
|
const SearchBoxContext = React.createContext(undefined);
|
|
40
39
|
const SearchBoxComponent = React.forwardRef((props, ref) => {
|
|
41
40
|
const { size, expandable = false, isDisabled = false, onCollapse: onCollapseProp, onExpand: onExpandProp, isExpanded: isExpandedProp, children, inputProps, className, ...rest } = props;
|
|
@@ -44,16 +43,16 @@ const SearchBoxComponent = React.forwardRef((props, ref) => {
|
|
|
44
43
|
const inputRef = React.useRef(null);
|
|
45
44
|
const openButtonRef = React.useRef(null);
|
|
46
45
|
const [localExpanded, setLocalExpanded] = React.useState(isExpandedProp);
|
|
47
|
-
const isExpanded = isExpandedProp
|
|
46
|
+
const isExpanded = isExpandedProp ?? localExpanded;
|
|
48
47
|
const onCollapse = () => {
|
|
49
48
|
setLocalExpanded(false);
|
|
50
|
-
onCollapseProp
|
|
51
|
-
queueMicrotask(() =>
|
|
49
|
+
onCollapseProp?.();
|
|
50
|
+
queueMicrotask(() => openButtonRef.current?.focus({ preventScroll: true }));
|
|
52
51
|
};
|
|
53
52
|
const onExpand = () => {
|
|
54
53
|
setLocalExpanded(true);
|
|
55
|
-
onExpandProp
|
|
56
|
-
queueMicrotask(() =>
|
|
54
|
+
onExpandProp?.();
|
|
55
|
+
queueMicrotask(() => inputRef.current?.focus({ preventScroll: true }));
|
|
57
56
|
};
|
|
58
57
|
return (React.createElement(SearchBoxContext.Provider, { value: {
|
|
59
58
|
size,
|
|
@@ -67,7 +66,7 @@ const SearchBoxComponent = React.forwardRef((props, ref) => {
|
|
|
67
66
|
isExpanded,
|
|
68
67
|
expandable,
|
|
69
68
|
} },
|
|
70
|
-
React.createElement(index_js_1.InputFlexContainer, { ref: ref, className: (0, classnames_1.default)('iui-searchbox', { 'iui-expandable-searchbox': expandable }, className), "data-iui-size": size, isDisabled: isDisabled, "data-iui-expanded": isExpanded, ...rest }, children
|
|
69
|
+
React.createElement(index_js_1.InputFlexContainer, { ref: ref, className: (0, classnames_1.default)('iui-searchbox', { 'iui-expandable-searchbox': expandable }, className), "data-iui-size": size, isDisabled: isDisabled, "data-iui-expanded": isExpanded, ...rest }, children ?? (React.createElement(React.Fragment, null,
|
|
71
70
|
React.createElement(SearchBoxCollapsedState, null,
|
|
72
71
|
React.createElement(SearchBoxExpandButton, null)),
|
|
73
72
|
React.createElement(SearchBoxExpandedState, null,
|
|
@@ -81,7 +80,7 @@ const SearchBoxCollapsedState = ({ children, }) => {
|
|
|
81
80
|
if (!expandable || isExpanded) {
|
|
82
81
|
return null;
|
|
83
82
|
}
|
|
84
|
-
return React.createElement(React.Fragment, null, children
|
|
83
|
+
return React.createElement(React.Fragment, null, children ?? React.createElement(SearchBoxExpandButton, null));
|
|
85
84
|
};
|
|
86
85
|
SearchBoxCollapsedState.displayName = 'SearchBox.CollapsedState';
|
|
87
86
|
// ----------------------------------------------------------------------------
|
|
@@ -96,7 +95,7 @@ SearchBoxExpandedState.displayName = 'SearchBox.ExpandedState';
|
|
|
96
95
|
// ----------------------------------------------------------------------------
|
|
97
96
|
const SearchBoxIcon = React.forwardRef((props, ref) => {
|
|
98
97
|
const { className, children, ...rest } = props;
|
|
99
|
-
return (React.createElement(index_js_1.Icon, { "aria-hidden": true, className: (0, classnames_1.default)('iui-search-icon', className), ref: ref, ...rest }, children
|
|
98
|
+
return (React.createElement(index_js_1.Icon, { "aria-hidden": true, className: (0, classnames_1.default)('iui-search-icon', className), ref: ref, ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
100
99
|
});
|
|
101
100
|
SearchBoxIcon.displayName = 'SearchBox.Icon';
|
|
102
101
|
// ----------------------------------------------------------------------------
|
|
@@ -108,28 +107,28 @@ const SearchBoxInput = React.forwardRef((props, ref) => {
|
|
|
108
107
|
setInputId(idProp);
|
|
109
108
|
}
|
|
110
109
|
}, [idProp, inputId, setInputId]);
|
|
111
|
-
return (React.createElement(index_js_1.Box, { as: 'input', id: idProp
|
|
110
|
+
return (React.createElement(index_js_1.Box, { as: 'input', id: idProp ?? inputId, ref: (0, index_js_1.useMergedRefs)(ref, inputRef), role: 'searchbox', type: 'text', className: (0, classnames_1.default)('iui-search-input', className), disabled: isDisabled, ...rest }));
|
|
112
111
|
});
|
|
113
112
|
SearchBoxInput.displayName = 'SearchBox.Input';
|
|
114
113
|
// ----------------------------------------------------------------------------
|
|
115
114
|
const SearchBoxButton = React.forwardRef((props, ref) => {
|
|
116
115
|
const { children, ...rest } = props;
|
|
117
116
|
const { size: sizeContext, isDisabled } = (0, index_js_1.useSafeContext)(SearchBoxContext);
|
|
118
|
-
return (React.createElement(index_js_2.IconButton, { styleType: 'borderless', size: sizeContext, ref: ref, disabled: isDisabled, ...rest }, children
|
|
117
|
+
return (React.createElement(index_js_2.IconButton, { styleType: 'borderless', size: sizeContext, ref: ref, disabled: isDisabled, ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
119
118
|
});
|
|
120
119
|
SearchBoxButton.displayName = 'SearchBox.Button';
|
|
121
120
|
// ----------------------------------------------------------------------------
|
|
122
121
|
const SearchBoxCollapseButton = React.forwardRef((props, ref) => {
|
|
123
122
|
const { children, onClick: onClickProp, ...rest } = props;
|
|
124
123
|
const { onCollapse, size: sizeContext, isDisabled, } = (0, index_js_1.useSafeContext)(SearchBoxContext);
|
|
125
|
-
return (React.createElement(SearchBoxButton, { ref: ref, "aria-label": 'Close searchbox', size: sizeContext, disabled: isDisabled, onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, onCollapse), ...rest }, children
|
|
124
|
+
return (React.createElement(SearchBoxButton, { ref: ref, "aria-label": 'Close searchbox', size: sizeContext, disabled: isDisabled, onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, onCollapse), ...rest }, children ?? React.createElement(index_js_1.SvgCloseSmall, null)));
|
|
126
125
|
});
|
|
127
126
|
SearchBoxCollapseButton.displayName = 'SearchBox.CollapseButton';
|
|
128
127
|
// ----------------------------------------------------------------------------
|
|
129
128
|
const SearchBoxExpandButton = React.forwardRef((props, ref) => {
|
|
130
129
|
const { children, className, onClick: onClickProp, ...rest } = props;
|
|
131
130
|
const { onExpand, size: sizeContext, isDisabled, openButtonRef, } = (0, index_js_1.useSafeContext)(SearchBoxContext);
|
|
132
|
-
return (React.createElement(SearchBoxButton, { ref: (0, index_js_1.useMergedRefs)(ref, openButtonRef), className: (0, classnames_1.default)('iui-searchbox-open-button', className), "aria-label": 'Expand searchbox', size: sizeContext, disabled: isDisabled, onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, onExpand), ...rest }, children
|
|
131
|
+
return (React.createElement(SearchBoxButton, { ref: (0, index_js_1.useMergedRefs)(ref, openButtonRef), className: (0, classnames_1.default)('iui-searchbox-open-button', className), "aria-label": 'Expand searchbox', size: sizeContext, disabled: isDisabled, onClick: (0, index_js_1.mergeEventHandlers)(onClickProp, onExpand), ...rest }, children ?? React.createElement(index_js_1.SvgSearch, null)));
|
|
133
132
|
});
|
|
134
133
|
SearchBoxExpandButton.displayName = 'SearchBox.ExpandButton';
|
|
135
134
|
// ----------------------------------------------------------------------------
|
|
@@ -35,7 +35,6 @@ const React = __importStar(require("react"));
|
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
36
|
const index_js_1 = require("../Menu/index.js");
|
|
37
37
|
const index_js_2 = require("../utils/index.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/select.css");
|
|
39
38
|
const SelectTag_js_1 = __importDefault(require("./SelectTag.js"));
|
|
40
39
|
const SelectTagContainer_js_1 = __importDefault(require("./SelectTagContainer.js"));
|
|
41
40
|
const isMultipleEnabled = (variable, multiple) => {
|
|
@@ -95,24 +94,22 @@ const isSingleOnChange = (onChange, multiple) => {
|
|
|
95
94
|
* />
|
|
96
95
|
*/
|
|
97
96
|
const Select = (props) => {
|
|
98
|
-
var _a;
|
|
99
97
|
const uid = (0, index_js_2.useId)();
|
|
100
98
|
const { options, value, onChange, placeholder, disabled = false, size, setFocus = false, itemRenderer, selectedItemRenderer, className, style, menuClassName, menuStyle, onShow, onHide, popoverProps, multiple = false, triggerProps, ...rest } = props;
|
|
101
99
|
const [isOpenState, setIsOpen] = React.useState(false);
|
|
102
|
-
const isOpen =
|
|
100
|
+
const isOpen = popoverProps?.visible ?? isOpenState;
|
|
103
101
|
const [minWidth, setMinWidth] = React.useState(0);
|
|
104
102
|
const [liveRegionSelection, setLiveRegionSelection] = React.useState('');
|
|
105
103
|
const selectRef = React.useRef(null);
|
|
106
104
|
const toggleButtonRef = React.useRef(null);
|
|
107
105
|
const onShowHandler = React.useCallback((instance) => {
|
|
108
106
|
setIsOpen(true);
|
|
109
|
-
onShow
|
|
107
|
+
onShow?.(instance);
|
|
110
108
|
}, [onShow]);
|
|
111
109
|
const onHideHandler = React.useCallback((instance) => {
|
|
112
|
-
var _a;
|
|
113
110
|
setIsOpen(false);
|
|
114
|
-
|
|
115
|
-
onHide
|
|
111
|
+
selectRef.current?.focus({ preventScroll: true }); // move focus back to select button
|
|
112
|
+
onHide?.(instance);
|
|
116
113
|
}, [onHide]);
|
|
117
114
|
React.useEffect(() => {
|
|
118
115
|
if (selectRef.current && !disabled && setFocus) {
|
|
@@ -142,13 +139,12 @@ const Select = (props) => {
|
|
|
142
139
|
};
|
|
143
140
|
const menuItems = React.useMemo(() => {
|
|
144
141
|
return options.map((option, index) => {
|
|
145
|
-
var _a;
|
|
146
142
|
const isSelected = isMultipleEnabled(value, multiple)
|
|
147
|
-
?
|
|
143
|
+
? value?.includes(option.value) ?? false
|
|
148
144
|
: value === option.value;
|
|
149
145
|
const menuItem = itemRenderer ? (itemRenderer(option, { close: () => setIsOpen(false), isSelected })) : (React.createElement(index_js_1.MenuItem, null, option.label));
|
|
150
146
|
const { label, icon, startIcon: startIconProp, ...restOption } = option;
|
|
151
|
-
const startIcon = startIconProp
|
|
147
|
+
const startIcon = startIconProp ?? icon;
|
|
152
148
|
return React.cloneElement(menuItem, {
|
|
153
149
|
key: `${label}-${index}`,
|
|
154
150
|
isSelected,
|
|
@@ -158,11 +154,11 @@ const Select = (props) => {
|
|
|
158
154
|
return;
|
|
159
155
|
}
|
|
160
156
|
if (isSingleOnChange(onChange, multiple)) {
|
|
161
|
-
onChange
|
|
157
|
+
onChange?.(option.value);
|
|
162
158
|
setIsOpen(false);
|
|
163
159
|
}
|
|
164
160
|
else {
|
|
165
|
-
onChange
|
|
161
|
+
onChange?.(option.value, isSelected ? 'removed' : 'added');
|
|
166
162
|
}
|
|
167
163
|
// update live region
|
|
168
164
|
if (isMultipleEnabled(value, multiple)) {
|
|
@@ -179,7 +175,7 @@ const Select = (props) => {
|
|
|
179
175
|
},
|
|
180
176
|
ref: (el) => {
|
|
181
177
|
if (isSelected && !multiple) {
|
|
182
|
-
el
|
|
178
|
+
el?.scrollIntoView({ block: 'nearest' });
|
|
183
179
|
}
|
|
184
180
|
},
|
|
185
181
|
role: 'option',
|
|
@@ -205,15 +201,14 @@ const Select = (props) => {
|
|
|
205
201
|
maxWidth: `min(${minWidth * 2}px, 90vw)`,
|
|
206
202
|
...menuStyle,
|
|
207
203
|
}, id: `${uid}-menu`, key: `${uid}-menu` }, menuItems), placement: 'bottom-start', aria: { content: null }, onShow: onShowHandler, onHide: onHideHandler, ...popoverProps, visible: isOpen, onClickOutside: (_, { target }) => {
|
|
208
|
-
|
|
209
|
-
if (!((_a = toggleButtonRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))) {
|
|
204
|
+
if (!toggleButtonRef.current?.contains(target)) {
|
|
210
205
|
setIsOpen(false);
|
|
211
206
|
}
|
|
212
207
|
} },
|
|
213
208
|
React.createElement(index_js_2.Box, { tabIndex: 0, role: 'combobox', ref: selectRef, "data-iui-size": size, onClick: () => !disabled && setIsOpen((o) => !o), onKeyDown: (e) => !disabled && onKeyDown(e), "aria-disabled": disabled, "aria-autocomplete": 'none', "aria-expanded": isOpen, "aria-haspopup": 'listbox', "aria-controls": `${uid}-menu`, ...triggerProps, className: (0, classnames_1.default)('iui-select-button', {
|
|
214
209
|
'iui-placeholder': (!selectedItems || selectedItems.length === 0) && !!placeholder,
|
|
215
210
|
'iui-disabled': disabled,
|
|
216
|
-
}, triggerProps
|
|
211
|
+
}, triggerProps?.className) },
|
|
217
212
|
(!selectedItems || selectedItems.length === 0) && (React.createElement(index_js_2.Box, { as: 'span', className: 'iui-content' }, placeholder)),
|
|
218
213
|
isMultipleEnabled(selectedItems, multiple) ? (React.createElement(MultipleSelectButton, { selectedItems: selectedItems, selectedItemsRenderer: selectedItemRenderer, tagRenderer: tagRenderer })) : (React.createElement(SingleSelectButton, { selectedItem: selectedItems, selectedItemRenderer: selectedItemRenderer })))),
|
|
219
214
|
React.createElement(index_js_2.Box, { as: 'span', "aria-hidden": true, ref: toggleButtonRef, className: (0, classnames_1.default)('iui-end-icon', {
|
|
@@ -226,8 +221,7 @@ const Select = (props) => {
|
|
|
226
221
|
};
|
|
227
222
|
exports.Select = Select;
|
|
228
223
|
const SingleSelectButton = ({ selectedItem, selectedItemRenderer, }) => {
|
|
229
|
-
|
|
230
|
-
const startIcon = (_a = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.startIcon) !== null && _a !== void 0 ? _a : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.icon;
|
|
224
|
+
const startIcon = selectedItem?.startIcon ?? selectedItem?.icon;
|
|
231
225
|
return (React.createElement(React.Fragment, null,
|
|
232
226
|
selectedItem &&
|
|
233
227
|
selectedItemRenderer &&
|
|
@@ -34,7 +34,6 @@ exports.SelectTag = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/select.css");
|
|
38
37
|
/**
|
|
39
38
|
* Tag for showing selected value in `Select`.
|
|
40
39
|
* @private
|
|
@@ -36,7 +36,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
37
|
const index_js_2 = require("../Buttons/index.js");
|
|
38
38
|
const index_js_3 = require("../Tooltip/index.js");
|
|
39
|
-
require("@itwin/itwinui-css/css/side-navigation.css");
|
|
40
39
|
/**
|
|
41
40
|
* Left side navigation menu component.
|
|
42
41
|
* @example
|
|
@@ -59,7 +58,7 @@ exports.SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
59
58
|
}, [isExpanded]);
|
|
60
59
|
const ExpandButton = (React.createElement(index_js_2.IconButton, { className: 'iui-sidenav-button iui-expand', onClick: React.useCallback(() => {
|
|
61
60
|
_setIsExpanded((expanded) => !expanded);
|
|
62
|
-
onExpanderClick
|
|
61
|
+
onExpanderClick?.();
|
|
63
62
|
}, [onExpanderClick]) },
|
|
64
63
|
React.createElement(index_js_1.SvgChevronRight, null)));
|
|
65
64
|
return (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-side-navigation-wrapper', className), ref: forwardedRef, ...rest },
|
|
@@ -70,7 +69,7 @@ exports.SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
70
69
|
expanderPlacement === 'top' && ExpandButton,
|
|
71
70
|
React.createElement(index_js_1.Box, { className: 'iui-sidenav-content' },
|
|
72
71
|
React.createElement(index_js_1.Box, { className: 'iui-top' }, items.map((sidenavButton, index) => !_isExpanded ? (React.createElement(index_js_3.Tooltip, { content: sidenavButton.props.children, placement: 'right', key: index }, sidenavButton)) : (sidenavButton))),
|
|
73
|
-
React.createElement(index_js_1.Box, { className: 'iui-bottom' }, secondaryItems
|
|
72
|
+
React.createElement(index_js_1.Box, { className: 'iui-bottom' }, secondaryItems?.map((sidenavButton, index) => !_isExpanded ? (React.createElement(index_js_3.Tooltip, { content: sidenavButton.props.children, placement: 'right', key: index }, sidenavButton)) : (sidenavButton)))),
|
|
74
73
|
expanderPlacement === 'bottom' && ExpandButton),
|
|
75
74
|
submenu && (React.createElement(index_js_1.WithCSSTransition, { in: isSubmenuOpen, dimension: 'width', timeout: 200, classNames: 'iui' }, submenu))));
|
|
76
75
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
2
|
import type { ButtonProps } from '../Buttons/Button/Button.js';
|
|
3
|
-
import '@itwin/itwinui-css/css/side-navigation.css';
|
|
4
3
|
declare type SidenavButtonProps = {
|
|
5
4
|
/**
|
|
6
5
|
* Whether the sidenav button is active,
|
|
@@ -34,7 +34,6 @@ exports.SidenavButton = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../Buttons/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/side-navigation.css");
|
|
38
37
|
/**
|
|
39
38
|
* Wrapper around Button to be used as SideNavigation items.
|
|
40
39
|
* Label is hidden when sidenav is collapsed.
|
|
@@ -34,7 +34,6 @@ exports.SidenavSubmenu = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/side-navigation.css");
|
|
38
37
|
/**
|
|
39
38
|
* Subcomponent to be used in the `submenu` prop of `SideNavigation`.
|
|
40
39
|
* @example
|
|
@@ -34,7 +34,6 @@ exports.SidenavSubmenuHeader = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/side-navigation.css");
|
|
38
37
|
/**
|
|
39
38
|
* Header content for `SidenavSubmenu`. Supports truncated label and actions buttons.
|
|
40
39
|
* @example
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
3
|
-
import '@itwin/itwinui-css/css/skip-to-content.css';
|
|
4
3
|
declare type SkipToContentLinkProps = {
|
|
5
4
|
/**
|
|
6
5
|
* The id of the main content that the link directs to. Don't forget the #!
|
|
@@ -34,7 +34,6 @@ exports.SkipToContentLink = 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/skip-to-content.css");
|
|
38
37
|
/**
|
|
39
38
|
* `SkipToContentLink` is for screen reader and keyboard users and will not be visible unless tabbed to.
|
|
40
39
|
* Provides a shortcut to the main content of the page without navigating through the header, etc.
|
|
@@ -34,7 +34,6 @@ exports.Slider = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/slider.css");
|
|
38
37
|
const Track_js_1 = require("./Track.js");
|
|
39
38
|
const Thumb_js_1 = require("./Thumb.js");
|
|
40
39
|
const getPercentageOfRectangle = (rect, pointerX, pointerY, orientation) => {
|
|
@@ -72,10 +71,9 @@ const formatNumberValue = (value, step, numDecimals) => {
|
|
|
72
71
|
* Focus specified thumb on Slider control
|
|
73
72
|
*/
|
|
74
73
|
const focusThumb = (sliderContainer, activeIndex) => {
|
|
75
|
-
var _a;
|
|
76
74
|
const doc = sliderContainer.ownerDocument;
|
|
77
75
|
if (!sliderContainer.contains(doc.activeElement) ||
|
|
78
|
-
Number(
|
|
76
|
+
Number(doc.activeElement?.getAttribute('data-index')) !== activeIndex) {
|
|
79
77
|
const thumbToFocus = sliderContainer.querySelector(`[data-index="${activeIndex}"]`);
|
|
80
78
|
thumbToFocus && thumbToFocus.focus();
|
|
81
79
|
}
|
|
@@ -89,19 +87,18 @@ const focusThumb = (sliderContainer, activeIndex) => {
|
|
|
89
87
|
* thumbMode='allow-crossing' />
|
|
90
88
|
*/
|
|
91
89
|
exports.Slider = React.forwardRef((props, ref) => {
|
|
92
|
-
var _a, _b;
|
|
93
90
|
const { min = 0, max = 100, values, step = 1, setFocus = false, tooltipProps, disabled = false, tickLabels, minLabel, maxLabel, trackDisplayMode = 'auto', thumbMode = 'inhibit-crossing', onChange, onUpdate, thumbProps, className, railContainerProps, orientation = 'horizontal', ...rest } = props;
|
|
94
91
|
const [currentValues, setCurrentValues] = React.useState(values);
|
|
95
92
|
React.useEffect(() => {
|
|
96
93
|
setCurrentValues(values);
|
|
97
94
|
}, [values]);
|
|
98
|
-
const [minValueLabel, setMinValueLabel] = React.useState(() => minLabel
|
|
95
|
+
const [minValueLabel, setMinValueLabel] = React.useState(() => minLabel ?? min.toString());
|
|
99
96
|
React.useEffect(() => {
|
|
100
|
-
setMinValueLabel(minLabel
|
|
97
|
+
setMinValueLabel(minLabel ?? min.toString());
|
|
101
98
|
}, [minLabel, min]);
|
|
102
|
-
const [maxValueLabel, setMaxValueLabel] = React.useState(() => maxLabel
|
|
99
|
+
const [maxValueLabel, setMaxValueLabel] = React.useState(() => maxLabel ?? max.toString());
|
|
103
100
|
React.useEffect(() => {
|
|
104
|
-
setMaxValueLabel(maxLabel
|
|
101
|
+
setMaxValueLabel(maxLabel ?? max.toString());
|
|
105
102
|
}, [maxLabel, max]);
|
|
106
103
|
const [trackDisplay, setTrackDisplay] = React.useState(() => getDefaultTrackDisplay(trackDisplayMode, currentValues));
|
|
107
104
|
React.useEffect(() => {
|
|
@@ -141,11 +138,11 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
141
138
|
newValues[activeThumbIndex] = pointerValue;
|
|
142
139
|
setCurrentValues(newValues);
|
|
143
140
|
'onChange' === callbackType
|
|
144
|
-
? onChange
|
|
145
|
-
: onUpdate
|
|
141
|
+
? onChange?.(newValues)
|
|
142
|
+
: onUpdate?.(newValues);
|
|
146
143
|
}
|
|
147
144
|
else if ('onChange' === callbackType) {
|
|
148
|
-
onChange
|
|
145
|
+
onChange?.(currentValues);
|
|
149
146
|
}
|
|
150
147
|
}
|
|
151
148
|
}, [
|
|
@@ -173,12 +170,12 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
173
170
|
return;
|
|
174
171
|
}
|
|
175
172
|
if (keyboardReleased) {
|
|
176
|
-
onChange
|
|
173
|
+
onChange?.(currentValues); // currentValues since key up should not change value but only stop continuous value selection
|
|
177
174
|
}
|
|
178
175
|
else {
|
|
179
176
|
const newValues = [...currentValues]; // newValues since key down should change value
|
|
180
177
|
newValues[index] = value;
|
|
181
|
-
onUpdate
|
|
178
|
+
onUpdate?.(newValues);
|
|
182
179
|
setCurrentValues(newValues);
|
|
183
180
|
}
|
|
184
181
|
}, [currentValues, onUpdate, onChange]);
|
|
@@ -208,8 +205,8 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
208
205
|
const newValues = [...currentValues];
|
|
209
206
|
newValues[closestValueIndex] = pointerValue;
|
|
210
207
|
setCurrentValues(newValues);
|
|
211
|
-
onChange
|
|
212
|
-
onUpdate
|
|
208
|
+
onChange?.(newValues);
|
|
209
|
+
onUpdate?.(newValues);
|
|
213
210
|
focusThumb(containerRef.current, closestValueIndex);
|
|
214
211
|
event.preventDefault();
|
|
215
212
|
event.stopPropagation();
|
|
@@ -224,8 +221,8 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
224
221
|
onUpdate,
|
|
225
222
|
orientation,
|
|
226
223
|
]);
|
|
227
|
-
(0, index_js_1.useEventListener)('pointermove', handlePointerMove,
|
|
228
|
-
(0, index_js_1.useEventListener)('pointerup', handlePointerUp,
|
|
224
|
+
(0, index_js_1.useEventListener)('pointermove', handlePointerMove, containerRef.current?.ownerDocument);
|
|
225
|
+
(0, index_js_1.useEventListener)('pointerup', handlePointerUp, containerRef.current?.ownerDocument);
|
|
229
226
|
const tickMarkArea = React.useMemo(() => {
|
|
230
227
|
if (!tickLabels) {
|
|
231
228
|
return null;
|
|
@@ -253,10 +250,9 @@ exports.Slider = React.forwardRef((props, ref) => {
|
|
|
253
250
|
}), onPointerDown: handlePointerDownOnSlider, ...railContainerProps },
|
|
254
251
|
React.createElement(index_js_1.Box, { className: 'iui-slider-rail' }),
|
|
255
252
|
currentValues.map((thumbValue, index) => {
|
|
256
|
-
var _a;
|
|
257
253
|
const [minVal, maxVal] = getAllowableThumbRange(index);
|
|
258
|
-
const thisThumbProps = thumbProps
|
|
259
|
-
return (React.createElement(Thumb_js_1.Thumb, { key:
|
|
254
|
+
const thisThumbProps = thumbProps?.(index);
|
|
255
|
+
return (React.createElement(Thumb_js_1.Thumb, { key: thisThumbProps?.id ?? index, index: index, disabled: disabled, isActive: activeThumbIndex === index, onThumbActivated: onThumbActivated, onThumbValueChanged: onThumbValueChanged, minVal: minVal, maxVal: maxVal, value: thumbValue, tooltipProps: generateTooltipProps(index, thumbValue), thumbProps: thisThumbProps, step: step, sliderMin: min, sliderMax: max, orientation: orientation }));
|
|
260
256
|
}),
|
|
261
257
|
React.createElement(Track_js_1.Track, { trackDisplayMode: trackDisplay, sliderMin: min, sliderMax: max, values: currentValues, orientation: orientation }),
|
|
262
258
|
tickMarkArea),
|
package/cjs/core/Slider/Thumb.js
CHANGED
|
@@ -86,7 +86,7 @@ const Thumb = (props) => {
|
|
|
86
86
|
return (100.0 * (adjustedValue - sliderMin)) / (sliderMax - sliderMin);
|
|
87
87
|
}, [adjustedValue, sliderMax, sliderMin]);
|
|
88
88
|
const { style, className, ...rest } = thumbProps || {};
|
|
89
|
-
return (React.createElement(index_js_1.Tooltip, { placement: 'top', trigger:
|
|
89
|
+
return (React.createElement(index_js_1.Tooltip, { placement: 'top', trigger: tooltipProps?.visible == null ? 'mouseenter click focus' : undefined, ...tooltipProps },
|
|
90
90
|
React.createElement(index_js_2.Box, { ...rest, "data-index": index, ref: thumbRef, style: {
|
|
91
91
|
...style,
|
|
92
92
|
...(orientation === 'horizontal'
|
package/cjs/core/Slider/Track.js
CHANGED
|
@@ -29,6 +29,7 @@ exports.Track = void 0;
|
|
|
29
29
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
30
|
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
|
+
const index_js_1 = require("../utils/index.js");
|
|
32
33
|
function shouldDisplaySegment(segmentIndex, mode) {
|
|
33
34
|
if ('odd-segments' === mode && 0 === (segmentIndex + 1) % 2) {
|
|
34
35
|
return true;
|
|
@@ -75,7 +76,7 @@ const Track = (props) => {
|
|
|
75
76
|
? 100.0 -
|
|
76
77
|
(100.0 * (segment.right - sliderMin)) / (sliderMax - sliderMin)
|
|
77
78
|
: 100;
|
|
78
|
-
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement(
|
|
79
|
+
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement(index_js_1.Box, { className: 'iui-slider-track', style: {
|
|
79
80
|
...(orientation === 'horizontal'
|
|
80
81
|
? {
|
|
81
82
|
left: `${lowPercent}%`,
|
|
@@ -37,7 +37,7 @@ const index_js_1 = require("../utils/index.js");
|
|
|
37
37
|
* <StatusMessage startIcon={<SvgStar />}>This is the text</StatusMessage>
|
|
38
38
|
*/
|
|
39
39
|
const StatusMessage = ({ startIcon: userStartIcon, children, status, }) => {
|
|
40
|
-
const icon = userStartIcon
|
|
40
|
+
const icon = userStartIcon ?? (status && index_js_1.StatusIconMap[status]());
|
|
41
41
|
return (React.createElement(React.Fragment, null,
|
|
42
42
|
!!icon ? (React.createElement(index_js_1.Box, { as: 'span', className: 'iui-input-icon', "aria-hidden": true }, icon)) : null,
|
|
43
43
|
React.createElement(index_js_1.Box, { className: 'iui-message' }, children)));
|
|
@@ -30,14 +30,13 @@ exports.Stepper = void 0;
|
|
|
30
30
|
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
32
|
const index_js_1 = require("../utils/index.js");
|
|
33
|
-
require("@itwin/itwinui-css/css/stepper.css");
|
|
34
33
|
const StepperStep_js_1 = require("./StepperStep.js");
|
|
35
34
|
const defaultStepperLocalization = {
|
|
36
35
|
stepsCountLabel: (currentStep, totalSteps) => `Step ${currentStep} of ${totalSteps}:`,
|
|
37
36
|
};
|
|
38
37
|
exports.Stepper = React.forwardRef((props, ref) => {
|
|
39
38
|
const { currentStep, steps, type = 'default', localization = defaultStepperLocalization, onStepClick, ...rest } = props;
|
|
40
|
-
const boundedCurrentStep = Math.min(Math.max(0, currentStep
|
|
39
|
+
const boundedCurrentStep = Math.min(Math.max(0, currentStep ?? 0), steps.length - 1);
|
|
41
40
|
return (React.createElement(index_js_1.Box, { className: 'iui-stepper', ref: ref, ...rest },
|
|
42
41
|
React.createElement("ol", null, steps.map((s, index) => (React.createElement(StepperStep_js_1.StepperStep, { key: index, index: index, title: type === 'long' ? '' : s.name, currentStepNumber: boundedCurrentStep, totalSteps: steps.length, type: type, onClick: onStepClick, description: s.description })))),
|
|
43
42
|
type === 'long' && (React.createElement(index_js_1.Box, { className: 'iui-stepper-steps-label' },
|
|
@@ -42,7 +42,7 @@ exports.StepperStep = React.forwardRef((props, forwardedRef) => {
|
|
|
42
42
|
const isClickable = isPast && !!onClick;
|
|
43
43
|
const onCompletedClick = () => {
|
|
44
44
|
if (isClickable) {
|
|
45
|
-
onClick
|
|
45
|
+
onClick?.(index);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
const onKeyDown = (e) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
|
-
import '@itwin/itwinui-css/css/workflow-diagram.css';
|
|
3
2
|
import type { StepperProps } from './Stepper.js';
|
|
4
3
|
declare type WorkflowDiagramProps = Pick<StepperProps, 'steps'>;
|
|
5
4
|
export declare const WorkflowDiagram: PolymorphicForwardRefComponent<"ol", WorkflowDiagramProps>;
|
|
@@ -30,7 +30,6 @@ exports.WorkflowDiagram = void 0;
|
|
|
30
30
|
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
32
|
const index_js_1 = require("../utils/index.js");
|
|
33
|
-
require("@itwin/itwinui-css/css/workflow-diagram.css");
|
|
34
33
|
const WorkflowDiagramStep_js_1 = require("./WorkflowDiagramStep.js");
|
|
35
34
|
exports.WorkflowDiagram = React.forwardRef(
|
|
36
35
|
// TODO: Remove this ref cast. ref and rest props should be applied on the same element
|
|
@@ -34,7 +34,6 @@ exports.Surface = 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/surface.css");
|
|
38
37
|
/**
|
|
39
38
|
* Helper function that returns one of the preset surface elevation values.
|
|
40
39
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { CellProps, TableOptions, Row, TableState } from 'react-table';
|
|
3
3
|
import type { CommonProps } from '../utils/index.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
5
4
|
import type { TableFilterValue } from './filters/index.js';
|
|
6
5
|
export declare const tableResizeStartAction = "tableResizeStart";
|
|
7
6
|
export declare type TablePaginatorRendererProps = {
|