@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.3
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/README.md +10 -1
- package/cjs/core/Alert/Alert.js +8 -30
- package/cjs/core/Avatar/Avatar.js +10 -33
- package/cjs/core/AvatarGroup/AvatarGroup.js +18 -43
- package/cjs/core/Backdrop/Backdrop.js +6 -28
- package/cjs/core/Badge/Badge.js +13 -31
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +14 -40
- package/cjs/core/ButtonGroup/ButtonGroup.js +10 -32
- package/cjs/core/Buttons/Button/Button.js +6 -28
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +14 -36
- package/cjs/core/Buttons/IconButton/IconButton.js +6 -28
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +6 -28
- package/cjs/core/Buttons/SplitButton/SplitButton.js +14 -36
- package/cjs/core/Carousel/Carousel.js +38 -63
- package/cjs/core/Carousel/CarouselContext.js +1 -1
- package/cjs/core/Carousel/CarouselDot.js +6 -28
- package/cjs/core/Carousel/CarouselDotsList.js +33 -60
- package/cjs/core/Carousel/CarouselNavigation.js +22 -44
- package/cjs/core/Carousel/CarouselSlide.js +12 -34
- package/cjs/core/Carousel/CarouselSlider.js +26 -51
- package/cjs/core/Checkbox/Checkbox.js +18 -42
- package/cjs/core/ColorPicker/ColorBuilder.js +51 -73
- package/cjs/core/ColorPicker/ColorInputPanel.js +64 -88
- package/cjs/core/ColorPicker/ColorPalette.js +26 -50
- package/cjs/core/ColorPicker/ColorPicker.js +25 -49
- package/cjs/core/ColorPicker/ColorPickerContext.js +3 -3
- package/cjs/core/ColorPicker/ColorSwatch.js +13 -34
- package/cjs/core/ComboBox/ComboBox.js +67 -93
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxDropdown.js +13 -36
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +12 -34
- package/cjs/core/ComboBox/ComboBoxInput.js +28 -50
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +9 -31
- package/cjs/core/ComboBox/ComboBoxMenu.js +35 -60
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +11 -33
- package/cjs/core/ComboBox/helpers.js +11 -19
- package/cjs/core/DatePicker/DatePicker.js +87 -111
- package/cjs/core/Dialog/Dialog.js +28 -48
- package/cjs/core/Dialog/DialogBackdrop.js +16 -35
- package/cjs/core/Dialog/DialogButtonBar.js +6 -28
- package/cjs/core/Dialog/DialogContent.js +6 -28
- package/cjs/core/Dialog/DialogContext.js +2 -2
- package/cjs/core/Dialog/DialogDragContext.js +6 -15
- package/cjs/core/Dialog/DialogMain.js +52 -59
- package/cjs/core/Dialog/DialogTitleBar.js +14 -36
- package/cjs/core/Dialog/DialogTitleBarTitle.js +6 -28
- package/cjs/core/DropdownMenu/DropdownMenu.js +14 -36
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +12 -34
- package/cjs/core/Fieldset/Fieldset.js +9 -33
- package/cjs/core/FileUpload/FileUpload.js +13 -35
- package/cjs/core/FileUpload/FileUploadTemplate.js +4 -4
- package/cjs/core/Footer/Footer.js +21 -49
- package/cjs/core/Footer/FooterItem.js +6 -28
- package/cjs/core/Footer/FooterList.js +6 -28
- package/cjs/core/Footer/FooterSeparator.js +6 -28
- package/cjs/core/Header/Header.js +10 -32
- package/cjs/core/Header/HeaderBasicButton.js +6 -28
- package/cjs/core/Header/HeaderBreadcrumbs.js +9 -39
- package/cjs/core/Header/HeaderButton.js +22 -36
- package/cjs/core/Header/HeaderDropdownButton.js +14 -36
- package/cjs/core/Header/HeaderLogo.js +7 -29
- package/cjs/core/Header/HeaderSplitButton.js +13 -35
- package/cjs/core/InformationPanel/InformationPanel.js +15 -37
- package/cjs/core/InformationPanel/InformationPanelBody.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelContent.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelHeader.js +7 -29
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -28
- package/cjs/core/Input/Input.js +9 -31
- package/cjs/core/InputGroup/InputGroup.js +6 -28
- package/cjs/core/Label/Label.js +7 -29
- package/cjs/core/LabeledInput/LabeledInput.js +7 -29
- package/cjs/core/LabeledSelect/LabeledSelect.js +7 -29
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +7 -29
- package/cjs/core/Menu/Menu.js +18 -40
- package/cjs/core/Menu/MenuDivider.js +6 -28
- package/cjs/core/Menu/MenuExtraContent.js +6 -28
- package/cjs/core/Menu/MenuItem.js +17 -39
- package/cjs/core/Menu/MenuItemSkeleton.js +11 -30
- package/cjs/core/Modal/Modal.js +12 -30
- package/cjs/core/Modal/ModalButtonBar.js +1 -1
- package/cjs/core/Modal/ModalContent.js +1 -1
- package/cjs/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/cjs/core/NonIdealState/ErrorPage.js +144 -0
- package/cjs/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/cjs/core/NonIdealState/NonIdealState.js +32 -0
- package/{esm/core/ErrorPage → cjs/core/NonIdealState}/index.d.ts +3 -1
- package/cjs/core/{ErrorPage → NonIdealState}/index.js +4 -2
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +11 -34
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +13 -37
- package/cjs/core/Radio/Radio.js +10 -33
- package/cjs/core/RadioTiles/RadioTile.js +9 -31
- package/cjs/core/RadioTiles/RadioTileGroup.js +6 -28
- package/cjs/core/Select/Select.js +59 -72
- package/cjs/core/Select/SelectTag.js +6 -28
- package/cjs/core/SideNavigation/SideNavigation.js +14 -40
- package/cjs/core/SideNavigation/SidenavButton.js +8 -30
- package/cjs/core/SideNavigation/SidenavSubmenu.js +6 -28
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +6 -28
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +6 -28
- package/cjs/core/Slider/Slider.js +68 -96
- package/cjs/core/Slider/Thumb.js +20 -39
- package/cjs/core/Slider/Track.js +24 -44
- package/cjs/core/StatusMessage/StatusMessage.js +6 -7
- package/cjs/core/Stepper/Stepper.js +10 -34
- package/cjs/core/Stepper/StepperStep.js +15 -34
- package/cjs/core/Stepper/Wizard.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagram.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagramStep.js +6 -28
- package/cjs/core/Surface/Surface.js +11 -30
- package/cjs/core/Table/SubRowExpander.js +6 -6
- package/cjs/core/Table/Table.d.ts +19 -24
- package/cjs/core/Table/Table.js +189 -195
- package/cjs/core/Table/TableCell.js +29 -30
- package/cjs/core/Table/TablePaginator.js +52 -83
- package/cjs/core/Table/TableRowMemoized.d.ts +6 -10
- package/cjs/core/Table/TableRowMemoized.js +36 -60
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -4
- package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/cjs/core/Table/actionHandlers/selectHandler.js +35 -40
- package/cjs/core/Table/cells/DefaultCell.js +5 -27
- package/cjs/core/Table/cells/EditableCell.js +16 -40
- package/cjs/core/Table/columns/actionColumn.js +44 -62
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -5
- package/cjs/core/Table/columns/expanderColumn.js +12 -27
- package/cjs/core/Table/columns/selectionColumn.d.ts +2 -5
- package/cjs/core/Table/columns/selectionColumn.js +16 -37
- package/cjs/core/Table/filters/BaseFilter.js +6 -6
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +19 -41
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +20 -31
- package/cjs/core/Table/filters/FilterButtonBar.js +8 -19
- package/cjs/core/Table/filters/FilterToggle.js +15 -37
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +16 -29
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +11 -11
- package/cjs/core/Table/filters/customFilterFunctions.js +11 -13
- package/cjs/core/Table/filters/defaultFilterFunctions.js +62 -64
- package/cjs/core/Table/filters/tableFilters.js +7 -18
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +41 -53
- package/cjs/core/Table/hooks/useExpanderCell.js +17 -33
- package/cjs/core/Table/hooks/useResizeColumns.js +197 -205
- package/cjs/core/Table/hooks/useScrollToRow.js +11 -12
- package/cjs/core/Table/hooks/useSelectionCell.js +7 -18
- package/cjs/core/Table/hooks/useStickyColumns.js +28 -33
- package/cjs/core/Table/hooks/useSubRowFiltering.js +37 -57
- package/cjs/core/Table/hooks/useSubRowSelection.js +10 -12
- package/cjs/core/Table/utils.js +15 -26
- package/cjs/core/Tabs/Tab.js +6 -28
- package/cjs/core/Tabs/Tabs.js +45 -67
- package/cjs/core/Tag/Tag.js +8 -30
- package/cjs/core/Tag/TagContainer.js +9 -32
- package/cjs/core/Textarea/Textarea.js +9 -31
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/cjs/core/ThemeProvider/ThemeProvider.js +16 -37
- package/cjs/core/Tile/Tile.js +29 -58
- package/cjs/core/TimePicker/TimePicker.js +59 -97
- package/cjs/core/Toast/Toast.js +45 -65
- package/cjs/core/Toast/ToastWrapper.js +13 -24
- package/cjs/core/Toast/Toaster.js +87 -137
- package/cjs/core/Toast/index.js +2 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +10 -32
- package/cjs/core/Tooltip/Tooltip.js +6 -28
- package/cjs/core/Tree/Tree.js +58 -80
- package/cjs/core/Tree/TreeContext.js +3 -3
- package/cjs/core/Tree/TreeNode.js +21 -43
- package/cjs/core/Tree/TreeNodeExpander.js +7 -29
- package/cjs/core/Typography/Anchor/Anchor.js +5 -28
- package/cjs/core/Typography/Blockquote/Blockquote.js +6 -28
- package/cjs/core/Typography/Body/Body.js +7 -29
- package/cjs/core/Typography/Code/Code.js +6 -28
- package/cjs/core/Typography/Headline/Headline.js +6 -28
- package/cjs/core/Typography/Kbd/Kbd.js +6 -28
- package/cjs/core/Typography/Leading/Leading.js +6 -28
- package/cjs/core/Typography/Small/Small.js +6 -28
- package/cjs/core/Typography/Subheading/Subheading.js +6 -28
- package/cjs/core/Typography/Text/Text.js +11 -34
- package/cjs/core/Typography/Title/Title.js +6 -28
- package/cjs/core/index.d.ts +2 -2
- package/cjs/core/index.js +6 -5
- package/cjs/core/utils/color/ColorValue.js +146 -156
- package/cjs/core/utils/components/FocusTrap.js +14 -14
- package/cjs/core/utils/components/InputContainer.js +12 -36
- package/cjs/core/utils/components/MiddleTextTruncation.js +15 -31
- package/cjs/core/utils/components/Popover.d.ts +1 -1
- package/cjs/core/utils/components/Popover.js +57 -60
- package/cjs/core/utils/components/Resizer.js +51 -51
- package/cjs/core/utils/components/VirtualScroll.js +72 -89
- package/cjs/core/utils/components/VisuallyHidden.js +6 -28
- package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/cjs/core/utils/components/WithCSSTransition.js +18 -40
- package/cjs/core/utils/functions/colors.js +7 -7
- package/cjs/core/utils/functions/dom.js +7 -8
- package/cjs/core/utils/functions/focusable.js +11 -15
- package/cjs/core/utils/functions/numbers.js +5 -6
- package/cjs/core/utils/functions/styles.js +3 -3
- package/cjs/core/utils/hooks/useContainerWidth.js +9 -13
- package/cjs/core/utils/hooks/useDragAndDrop.js +32 -33
- package/cjs/core/utils/hooks/useEventListener.js +7 -7
- package/cjs/core/utils/hooks/useIntersection.js +9 -12
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/cjs/core/utils/hooks/useLatestRef.js +4 -4
- package/cjs/core/utils/hooks/useMediaQuery.js +9 -12
- package/cjs/core/utils/hooks/useMergedRefs.js +6 -23
- package/cjs/core/utils/hooks/useOverflow.js +26 -33
- package/cjs/core/utils/hooks/useResizeObserver.js +6 -9
- package/cjs/core/utils/hooks/useSafeContext.js +4 -4
- package/cjs/core/utils/hooks/useTheme.js +18 -20
- package/cjs/core/utils/icons/StatusIconMap.js +9 -20
- package/cjs/core/utils/icons/SvgCalendar.js +3 -14
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmark.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeft.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRight.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +3 -14
- package/cjs/core/utils/icons/SvgClose.js +3 -14
- package/cjs/core/utils/icons/SvgCloseSmall.js +3 -14
- package/cjs/core/utils/icons/SvgColumnManager.js +3 -14
- package/cjs/core/utils/icons/SvgFilter.js +3 -14
- package/cjs/core/utils/icons/SvgFilterHollow.js +3 -14
- package/cjs/core/utils/icons/SvgImportantSmall.js +3 -14
- package/cjs/core/utils/icons/SvgInfoCircular.js +3 -14
- package/cjs/core/utils/icons/SvgMore.js +3 -14
- package/cjs/core/utils/icons/SvgMoreVertical.js +3 -14
- package/cjs/core/utils/icons/SvgNew.js +3 -14
- package/cjs/core/utils/icons/SvgSmileyHappy.js +3 -14
- package/cjs/core/utils/icons/SvgSortDown.js +3 -14
- package/cjs/core/utils/icons/SvgSortUp.js +3 -14
- package/cjs/core/utils/icons/SvgStatusError.js +3 -14
- package/cjs/core/utils/icons/SvgStatusSuccess.js +3 -14
- package/cjs/core/utils/icons/SvgStatusWarning.js +3 -14
- package/cjs/core/utils/icons/SvgSwap.js +3 -14
- package/cjs/core/utils/icons/SvgUpload.js +3 -14
- package/cjs/types/react-table-config.d.ts +1 -1
- package/esm/core/Alert/Alert.js +5 -27
- package/esm/core/Avatar/Avatar.js +9 -32
- package/esm/core/AvatarGroup/AvatarGroup.js +16 -41
- package/esm/core/Backdrop/Backdrop.js +3 -25
- package/esm/core/Badge/Badge.js +10 -28
- package/esm/core/Breadcrumbs/Breadcrumbs.js +11 -37
- package/esm/core/ButtonGroup/ButtonGroup.js +7 -29
- package/esm/core/Buttons/Button/Button.js +3 -25
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +9 -31
- package/esm/core/Buttons/IconButton/IconButton.js +3 -25
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +3 -25
- package/esm/core/Buttons/SplitButton/SplitButton.js +8 -30
- package/esm/core/Carousel/Carousel.js +29 -54
- package/esm/core/Carousel/CarouselContext.js +1 -1
- package/esm/core/Carousel/CarouselDot.js +4 -26
- package/esm/core/Carousel/CarouselDotsList.js +28 -55
- package/esm/core/Carousel/CarouselNavigation.js +16 -38
- package/esm/core/Carousel/CarouselSlide.js +8 -30
- package/esm/core/Carousel/CarouselSlider.js +22 -47
- package/esm/core/Checkbox/Checkbox.js +14 -38
- package/esm/core/ColorPicker/ColorBuilder.js +46 -68
- package/esm/core/ColorPicker/ColorInputPanel.js +58 -82
- package/esm/core/ColorPicker/ColorPalette.js +20 -44
- package/esm/core/ColorPicker/ColorPicker.js +21 -45
- package/esm/core/ColorPicker/ColorPickerContext.js +3 -3
- package/esm/core/ColorPicker/ColorSwatch.js +9 -30
- package/esm/core/ComboBox/ComboBox.js +55 -81
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxDropdown.js +10 -33
- package/esm/core/ComboBox/ComboBoxEndIcon.js +8 -30
- package/esm/core/ComboBox/ComboBoxInput.js +24 -46
- package/esm/core/ComboBox/ComboBoxInputContainer.js +5 -27
- package/esm/core/ComboBox/ComboBoxMenu.js +29 -54
- package/esm/core/ComboBox/ComboBoxMenuItem.js +7 -29
- package/esm/core/ComboBox/helpers.js +13 -21
- package/esm/core/DatePicker/DatePicker.js +82 -106
- package/esm/core/Dialog/Dialog.js +19 -39
- package/esm/core/Dialog/DialogBackdrop.js +11 -30
- package/esm/core/Dialog/DialogButtonBar.js +3 -25
- package/esm/core/Dialog/DialogContent.js +3 -25
- package/esm/core/Dialog/DialogContext.js +2 -2
- package/esm/core/Dialog/DialogDragContext.js +6 -15
- package/esm/core/Dialog/DialogMain.js +45 -52
- package/esm/core/Dialog/DialogTitleBar.js +7 -29
- package/esm/core/Dialog/DialogTitleBarTitle.js +3 -25
- package/esm/core/DropdownMenu/DropdownMenu.js +11 -33
- package/esm/core/ExpandableBlock/ExpandableBlock.js +9 -31
- package/esm/core/Fieldset/Fieldset.js +6 -30
- package/esm/core/FileUpload/FileUpload.js +10 -32
- package/esm/core/FileUpload/FileUploadTemplate.js +2 -2
- package/esm/core/Footer/Footer.js +16 -44
- package/esm/core/Footer/FooterItem.js +3 -25
- package/esm/core/Footer/FooterList.js +3 -25
- package/esm/core/Footer/FooterSeparator.js +3 -25
- package/esm/core/Header/Header.js +5 -27
- package/esm/core/Header/HeaderBasicButton.js +3 -25
- package/esm/core/Header/HeaderBreadcrumbs.js +7 -37
- package/esm/core/Header/HeaderButton.js +16 -30
- package/esm/core/Header/HeaderDropdownButton.js +9 -31
- package/esm/core/Header/HeaderLogo.js +4 -26
- package/esm/core/Header/HeaderSplitButton.js +8 -30
- package/esm/core/InformationPanel/InformationPanel.js +12 -34
- package/esm/core/InformationPanel/InformationPanelBody.js +3 -25
- package/esm/core/InformationPanel/InformationPanelContent.js +3 -25
- package/esm/core/InformationPanel/InformationPanelHeader.js +3 -25
- package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -25
- package/esm/core/Input/Input.js +6 -28
- package/esm/core/InputGroup/InputGroup.js +4 -26
- package/esm/core/Label/Label.js +4 -26
- package/esm/core/LabeledInput/LabeledInput.js +4 -26
- package/esm/core/LabeledSelect/LabeledSelect.js +4 -26
- package/esm/core/LabeledTextarea/LabeledTextarea.js +4 -26
- package/esm/core/Menu/Menu.js +15 -37
- package/esm/core/Menu/MenuDivider.js +3 -25
- package/esm/core/Menu/MenuExtraContent.js +3 -25
- package/esm/core/Menu/MenuItem.js +13 -35
- package/esm/core/Menu/MenuItemSkeleton.js +8 -27
- package/esm/core/Modal/Modal.js +8 -26
- package/esm/core/Modal/ModalButtonBar.js +1 -1
- package/esm/core/Modal/ModalContent.js +1 -1
- package/esm/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/esm/core/NonIdealState/ErrorPage.js +137 -0
- package/esm/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/esm/core/NonIdealState/NonIdealState.js +25 -0
- package/{cjs/core/ErrorPage → esm/core/NonIdealState}/index.d.ts +3 -1
- package/esm/core/{ErrorPage → NonIdealState}/index.js +2 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +8 -31
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +10 -34
- package/esm/core/Radio/Radio.js +7 -30
- package/esm/core/RadioTiles/RadioTile.js +6 -28
- package/esm/core/RadioTiles/RadioTileGroup.js +3 -25
- package/esm/core/Select/Select.js +53 -66
- package/esm/core/Select/SelectTag.js +3 -25
- package/esm/core/SideNavigation/SideNavigation.js +9 -35
- package/esm/core/SideNavigation/SidenavButton.js +4 -26
- package/esm/core/SideNavigation/SidenavSubmenu.js +3 -25
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +3 -25
- package/esm/core/SkipToContentLink/SkipToContentLink.js +3 -25
- package/esm/core/Slider/Slider.js +63 -91
- package/esm/core/Slider/Thumb.js +17 -36
- package/esm/core/Slider/Track.js +23 -43
- package/esm/core/StatusMessage/StatusMessage.js +3 -4
- package/esm/core/Stepper/Stepper.js +7 -31
- package/esm/core/Stepper/StepperStep.js +12 -31
- package/esm/core/Stepper/Wizard.js +3 -25
- package/esm/core/Stepper/WorkflowDiagram.js +3 -25
- package/esm/core/Stepper/WorkflowDiagramStep.js +3 -25
- package/esm/core/Surface/Surface.js +8 -27
- package/esm/core/Table/SubRowExpander.js +3 -3
- package/esm/core/Table/Table.d.ts +19 -24
- package/esm/core/Table/Table.js +177 -183
- package/esm/core/Table/TableCell.js +23 -24
- package/esm/core/Table/TablePaginator.js +46 -77
- package/esm/core/Table/TableRowMemoized.d.ts +6 -10
- package/esm/core/Table/TableRowMemoized.js +32 -56
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -4
- package/esm/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/esm/core/Table/actionHandlers/selectHandler.js +35 -40
- package/esm/core/Table/cells/DefaultCell.js +3 -25
- package/esm/core/Table/cells/EditableCell.js +14 -38
- package/esm/core/Table/columns/actionColumn.js +34 -52
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -5
- package/esm/core/Table/columns/expanderColumn.js +9 -24
- package/esm/core/Table/columns/selectionColumn.d.ts +2 -5
- package/esm/core/Table/columns/selectionColumn.js +14 -35
- package/esm/core/Table/filters/BaseFilter.js +3 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +14 -36
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +15 -26
- package/esm/core/Table/filters/FilterButtonBar.js +4 -15
- package/esm/core/Table/filters/FilterToggle.js +11 -33
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +11 -24
- package/esm/core/Table/filters/TextFilter/TextFilter.js +6 -6
- package/esm/core/Table/filters/customFilterFunctions.js +12 -14
- package/esm/core/Table/filters/defaultFilterFunctions.js +63 -65
- package/esm/core/Table/filters/tableFilters.js +4 -15
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +40 -52
- package/esm/core/Table/hooks/useExpanderCell.js +15 -31
- package/esm/core/Table/hooks/useResizeColumns.js +196 -204
- package/esm/core/Table/hooks/useScrollToRow.js +10 -11
- package/esm/core/Table/hooks/useSelectionCell.js +6 -17
- package/esm/core/Table/hooks/useStickyColumns.js +27 -32
- package/esm/core/Table/hooks/useSubRowFiltering.js +35 -55
- package/esm/core/Table/hooks/useSubRowSelection.js +9 -11
- package/esm/core/Table/utils.js +15 -26
- package/esm/core/Tabs/Tab.js +3 -25
- package/esm/core/Tabs/Tabs.js +41 -63
- package/esm/core/Tag/Tag.js +4 -26
- package/esm/core/Tag/TagContainer.js +6 -29
- package/esm/core/Textarea/Textarea.js +6 -28
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/esm/core/ThemeProvider/ThemeProvider.js +15 -36
- package/esm/core/Tile/Tile.js +23 -52
- package/esm/core/TimePicker/TimePicker.js +56 -94
- package/esm/core/Toast/Toast.js +41 -61
- package/esm/core/Toast/ToastWrapper.js +10 -21
- package/esm/core/Toast/Toaster.js +83 -134
- package/esm/core/Toast/index.js +1 -1
- package/esm/core/ToggleSwitch/ToggleSwitch.js +7 -29
- package/esm/core/Tooltip/Tooltip.js +3 -25
- package/esm/core/Tree/Tree.js +54 -76
- package/esm/core/Tree/TreeContext.js +3 -3
- package/esm/core/Tree/TreeNode.js +16 -38
- package/esm/core/Tree/TreeNodeExpander.js +3 -25
- package/esm/core/Typography/Anchor/Anchor.js +2 -25
- package/esm/core/Typography/Blockquote/Blockquote.js +3 -25
- package/esm/core/Typography/Body/Body.js +4 -26
- package/esm/core/Typography/Code/Code.js +3 -25
- package/esm/core/Typography/Headline/Headline.js +3 -25
- package/esm/core/Typography/Kbd/Kbd.js +4 -26
- package/esm/core/Typography/Leading/Leading.js +3 -25
- package/esm/core/Typography/Small/Small.js +3 -25
- package/esm/core/Typography/Subheading/Subheading.js +3 -25
- package/esm/core/Typography/Text/Text.js +8 -31
- package/esm/core/Typography/Title/Title.js +3 -25
- package/esm/core/index.d.ts +2 -2
- package/esm/core/index.js +1 -1
- package/esm/core/utils/color/ColorValue.js +145 -156
- package/esm/core/utils/components/FocusTrap.js +11 -11
- package/esm/core/utils/components/InputContainer.js +10 -34
- package/esm/core/utils/components/MiddleTextTruncation.js +13 -29
- package/esm/core/utils/components/Popover.d.ts +1 -1
- package/esm/core/utils/components/Popover.js +54 -57
- package/esm/core/utils/components/Resizer.js +49 -49
- package/esm/core/utils/components/VirtualScroll.js +69 -86
- package/esm/core/utils/components/VisuallyHidden.js +3 -25
- package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/esm/core/utils/components/WithCSSTransition.js +16 -38
- package/esm/core/utils/functions/colors.js +8 -8
- package/esm/core/utils/functions/dom.js +7 -8
- package/esm/core/utils/functions/focusable.js +11 -15
- package/esm/core/utils/functions/numbers.js +5 -6
- package/esm/core/utils/functions/styles.js +3 -3
- package/esm/core/utils/hooks/useContainerWidth.js +6 -10
- package/esm/core/utils/hooks/useDragAndDrop.js +28 -29
- package/esm/core/utils/hooks/useEventListener.js +6 -6
- package/esm/core/utils/hooks/useIntersection.js +7 -10
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/esm/core/utils/hooks/useLatestRef.js +3 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -9
- package/esm/core/utils/hooks/useMergedRefs.js +5 -22
- package/esm/core/utils/hooks/useOverflow.js +23 -30
- package/esm/core/utils/hooks/useResizeObserver.js +4 -7
- package/esm/core/utils/hooks/useSafeContext.js +3 -3
- package/esm/core/utils/hooks/useTheme.js +14 -16
- package/esm/core/utils/icons/StatusIconMap.js +5 -16
- package/esm/core/utils/icons/SvgCalendar.js +2 -13
- package/esm/core/utils/icons/SvgCaretDownSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretRightSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretUpSmall.js +2 -13
- package/esm/core/utils/icons/SvgCheckmark.js +2 -13
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeft.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +2 -13
- package/esm/core/utils/icons/SvgChevronRight.js +2 -13
- package/esm/core/utils/icons/SvgChevronRightDouble.js +2 -13
- package/esm/core/utils/icons/SvgClose.js +2 -13
- package/esm/core/utils/icons/SvgCloseSmall.js +2 -13
- package/esm/core/utils/icons/SvgColumnManager.js +2 -13
- package/esm/core/utils/icons/SvgFilter.js +2 -13
- package/esm/core/utils/icons/SvgFilterHollow.js +2 -13
- package/esm/core/utils/icons/SvgImportantSmall.js +2 -13
- package/esm/core/utils/icons/SvgInfoCircular.js +2 -13
- package/esm/core/utils/icons/SvgMore.js +2 -13
- package/esm/core/utils/icons/SvgMoreVertical.js +2 -13
- package/esm/core/utils/icons/SvgNew.js +2 -13
- package/esm/core/utils/icons/SvgSmileyHappy.js +2 -13
- package/esm/core/utils/icons/SvgSortDown.js +2 -13
- package/esm/core/utils/icons/SvgSortUp.js +2 -13
- package/esm/core/utils/icons/SvgStatusError.js +2 -13
- package/esm/core/utils/icons/SvgStatusSuccess.js +2 -13
- package/esm/core/utils/icons/SvgStatusWarning.js +2 -13
- package/esm/core/utils/icons/SvgSwap.js +2 -13
- package/esm/core/utils/icons/SvgUpload.js +2 -13
- package/esm/types/react-table-config.d.ts +1 -1
- package/package.json +3 -3
- package/cjs/core/ErrorPage/ErrorPage.js +0 -168
- package/esm/core/ErrorPage/ErrorPage.js +0 -161
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,27 +8,27 @@ exports.MenuItem = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const utils_1 = require("../utils");
|
|
36
14
|
require("@itwin/itwinui-css/css/menu.css");
|
|
37
|
-
|
|
15
|
+
const Menu_1 = require("./Menu");
|
|
38
16
|
/**
|
|
39
17
|
* Context used to provide menu item ref to sub-menu items.
|
|
40
18
|
*/
|
|
41
|
-
|
|
19
|
+
const MenuItemContext = react_1.default.createContext({ ref: undefined });
|
|
42
20
|
/**
|
|
43
21
|
* Basic menu item component. Should be used inside `Menu` component for each item.
|
|
44
22
|
*/
|
|
45
|
-
exports.MenuItem = react_1.default.forwardRef(
|
|
46
|
-
|
|
23
|
+
exports.MenuItem = react_1.default.forwardRef((props, ref) => {
|
|
24
|
+
const { children, isSelected, disabled, value, onClick, sublabel, size = !!sublabel ? 'large' : 'default', icon, badge, className, style, role = 'menuitem', subMenuItems = [], ...rest } = props;
|
|
47
25
|
(0, utils_1.useTheme)();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
const menuItemRef = react_1.default.useRef(null);
|
|
27
|
+
const refs = (0, utils_1.useMergedRefs)(menuItemRef, ref);
|
|
28
|
+
const { ref: parentMenuItemRef } = react_1.default.useContext(MenuItemContext);
|
|
29
|
+
const subMenuRef = react_1.default.useRef(null);
|
|
30
|
+
const [isSubmenuVisible, setIsSubmenuVisible] = react_1.default.useState(false);
|
|
31
|
+
const onKeyDown = (event) => {
|
|
54
32
|
var _a;
|
|
55
33
|
if (event.altKey) {
|
|
56
34
|
return;
|
|
@@ -81,17 +59,17 @@ exports.MenuItem = react_1.default.forwardRef(function (props, ref) {
|
|
|
81
59
|
break;
|
|
82
60
|
}
|
|
83
61
|
};
|
|
84
|
-
|
|
62
|
+
const listItem = (react_1.default.createElement("li", { className: (0, classnames_1.default)('iui-menu-item', {
|
|
85
63
|
'iui-large': size === 'large',
|
|
86
64
|
'iui-active': isSelected,
|
|
87
65
|
'iui-disabled': disabled,
|
|
88
|
-
}, className), onClick:
|
|
66
|
+
}, className), onClick: () => !disabled && (onClick === null || onClick === void 0 ? void 0 : onClick(value)), ref: refs, style: style, role: role, tabIndex: disabled || role === 'presentation' ? undefined : -1, "aria-selected": isSelected, "aria-haspopup": subMenuItems.length > 0, "aria-disabled": disabled, onKeyDown: onKeyDown, onMouseEnter: () => setIsSubmenuVisible(true), onMouseLeave: (e) => {
|
|
89
67
|
var _a;
|
|
90
68
|
if (!(e.relatedTarget instanceof Node) ||
|
|
91
69
|
!((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))) {
|
|
92
70
|
setIsSubmenuVisible(false);
|
|
93
71
|
}
|
|
94
|
-
}
|
|
72
|
+
}, ...rest },
|
|
95
73
|
icon &&
|
|
96
74
|
react_1.default.cloneElement(icon, {
|
|
97
75
|
className: (0, classnames_1.default)(icon.props.className, 'iui-icon'),
|
|
@@ -105,7 +83,7 @@ exports.MenuItem = react_1.default.forwardRef(function (props, ref) {
|
|
|
105
83
|
className: (0, classnames_1.default)(badge.props.className, 'iui-icon'),
|
|
106
84
|
})));
|
|
107
85
|
return subMenuItems.length === 0 ? (listItem) : (react_1.default.createElement(MenuItemContext.Provider, { value: { ref: menuItemRef } },
|
|
108
|
-
react_1.default.createElement(utils_1.Popover, { placement: 'right-start', visible: isSubmenuVisible, appendTo: 'parent', content: react_1.default.createElement("div", { onMouseLeave:
|
|
86
|
+
react_1.default.createElement(utils_1.Popover, { placement: 'right-start', visible: isSubmenuVisible, appendTo: 'parent', content: react_1.default.createElement("div", { onMouseLeave: () => setIsSubmenuVisible(false), onBlur: (e) => {
|
|
109
87
|
var _a, _b;
|
|
110
88
|
!!(e.relatedTarget instanceof Node) &&
|
|
111
89
|
!((_a = subMenuRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget)) &&
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,19 +8,22 @@ exports.MenuItemSkeleton = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const utils_1 = require("../utils");
|
|
36
14
|
require("@itwin/itwinui-css/css/menu.css");
|
|
37
15
|
/**
|
|
38
16
|
* Menu item that uses skeletons to indicate loading state.
|
|
39
17
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
const MenuItemSkeleton = (props) => {
|
|
19
|
+
const { hasSublabel, hasIcon, contentWidth, translatedStrings = { loading: 'Loading…' }, className, style, ...rest } = props;
|
|
42
20
|
(0, utils_1.useTheme)();
|
|
43
|
-
return (react_1.default.createElement("li",
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
return (react_1.default.createElement("li", { className: (0, classnames_1.default)('iui-menu-item', 'iui-menu-item-skeleton', { 'iui-large': hasSublabel }, className), style: {
|
|
22
|
+
...{
|
|
23
|
+
'--iui-menu-item-content-skeleton-max-width': contentWidth,
|
|
24
|
+
},
|
|
25
|
+
...style,
|
|
26
|
+
}, ...rest },
|
|
46
27
|
hasIcon && react_1.default.createElement("div", { className: 'iui-icon iui-skeleton', "aria-hidden": true }),
|
|
47
28
|
react_1.default.createElement("span", { className: 'iui-content' },
|
|
48
29
|
react_1.default.createElement("div", { className: 'iui-menu-label iui-skeleton', "aria-hidden": true }),
|
package/cjs/core/Modal/Modal.js
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,11 +8,11 @@ exports.Modal = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
13
|
+
const utils_1 = require("../utils");
|
|
36
14
|
require("@itwin/itwinui-css/css/dialog.css");
|
|
37
|
-
|
|
15
|
+
const Dialog_1 = require("../Dialog");
|
|
38
16
|
/**
|
|
39
17
|
* Modal component which can wrap any content.
|
|
40
18
|
* @example
|
|
@@ -56,13 +34,17 @@ var Dialog_1 = require("../Dialog");
|
|
|
56
34
|
* </ModalButtonBar>
|
|
57
35
|
* </Modal>
|
|
58
36
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
37
|
+
const Modal = (props) => {
|
|
38
|
+
const { isOpen = false, isDismissible = true, closeOnEsc = true, closeOnExternalClick = true, onClose, title, children, modalRootId = 'iui-react-portal-container', ownerDocument = (0, utils_1.getDocument)(), ...rest } = props;
|
|
61
39
|
(0, utils_1.useTheme)();
|
|
62
|
-
|
|
40
|
+
const [container, setContainer] = react_1.default.useState();
|
|
41
|
+
react_1.default.useEffect(() => {
|
|
42
|
+
setContainer((0, utils_1.getContainer)(modalRootId, ownerDocument));
|
|
43
|
+
return () => setContainer(undefined);
|
|
44
|
+
}, [ownerDocument, modalRootId]);
|
|
63
45
|
return !!container ? (react_dom_1.default.createPortal(react_1.default.createElement(Dialog_1.Dialog, { isOpen: isOpen, closeOnEsc: closeOnEsc, closeOnExternalClick: closeOnExternalClick, isDismissible: isDismissible, onClose: onClose, preventDocumentScroll: true, trapFocus: true, setFocus: true },
|
|
64
46
|
react_1.default.createElement(Dialog_1.Dialog.Backdrop, null),
|
|
65
|
-
react_1.default.createElement(Dialog_1.Dialog.Main,
|
|
47
|
+
react_1.default.createElement(Dialog_1.Dialog.Main, { "aria-modal": true, ...rest },
|
|
66
48
|
react_1.default.createElement(Dialog_1.Dialog.TitleBar, { titleText: title }),
|
|
67
49
|
children)), container)) : (react_1.default.createElement(react_1.default.Fragment, null));
|
|
68
50
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ModalButtonBar = void 0;
|
|
4
|
-
|
|
4
|
+
const DialogButtonBar_1 = require("../Dialog/DialogButtonBar");
|
|
5
5
|
/**
|
|
6
6
|
* Container for Buttons in modal.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ModalContent = void 0;
|
|
4
|
-
|
|
4
|
+
const DialogContent_1 = require("../Dialog/DialogContent");
|
|
5
5
|
/**
|
|
6
6
|
* Container for content in `Modal`.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonProps } from '../utils';
|
|
3
|
-
|
|
3
|
+
/** @deprecated Use `NonIdealState` instead. */
|
|
4
4
|
export declare type ErrorPageType = '300' | '301' | '302' | '303' | '304' | '305' | '307' | '308' | '401' | '403' | '404' | '408' | '500' | '502' | '503' | '504' | 'generic';
|
|
5
|
+
/** @deprecated Use `NonIdealState` instead. */
|
|
5
6
|
export declare type ErrorTypeTranslations = {
|
|
6
7
|
badGateway: string;
|
|
7
8
|
error: string;
|
|
@@ -13,6 +14,7 @@ export declare type ErrorTypeTranslations = {
|
|
|
13
14
|
timedOut?: string;
|
|
14
15
|
unauthorized: string;
|
|
15
16
|
};
|
|
17
|
+
/** @deprecated Use `NonIdealState` instead. */
|
|
16
18
|
export declare type ErrorPageProps = {
|
|
17
19
|
/**
|
|
18
20
|
* Type of error controls image and default text
|
|
@@ -50,6 +52,8 @@ export declare type ErrorPageProps = {
|
|
|
50
52
|
translatedErrorMessages?: ErrorTypeTranslations;
|
|
51
53
|
} & Omit<CommonProps, 'title'>;
|
|
52
54
|
/**
|
|
55
|
+
* @deprecated Use `NonIdealState` instead for a smaller client bundle.
|
|
56
|
+
*
|
|
53
57
|
* A stylized display to communicate common http errors.
|
|
54
58
|
* @example
|
|
55
59
|
* <ErrorPage errorType='401' />
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ErrorPage = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const Button_1 = require("../Buttons/Button");
|
|
13
|
+
const NonIdealState_1 = require("./NonIdealState");
|
|
14
|
+
const itwinui_illustrations_react_1 = require("@itwin/itwinui-illustrations-react");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `NonIdealState` instead for a smaller client bundle.
|
|
17
|
+
*
|
|
18
|
+
* A stylized display to communicate common http errors.
|
|
19
|
+
* @example
|
|
20
|
+
* <ErrorPage errorType='401' />
|
|
21
|
+
*/
|
|
22
|
+
const ErrorPage = (props) => {
|
|
23
|
+
const { errorType, errorName, errorMessage, primaryButtonHandle, primaryButtonLabel, secondaryButtonHandle, secondaryButtonLabel, translatedErrorMessages, ...rest } = props;
|
|
24
|
+
const defaultErrorMessages = {
|
|
25
|
+
badGateway: 'Bad gateway',
|
|
26
|
+
error: 'Error',
|
|
27
|
+
forbidden: 'Forbidden',
|
|
28
|
+
internalServerError: 'Internal server error',
|
|
29
|
+
redirect: 'Redirect',
|
|
30
|
+
pageNotFound: 'Page not found',
|
|
31
|
+
serviceUnavailable: 'Service unavailable',
|
|
32
|
+
timedOut: 'Timed out',
|
|
33
|
+
unauthorized: 'Unauthorized',
|
|
34
|
+
...translatedErrorMessages,
|
|
35
|
+
};
|
|
36
|
+
function getErrorIcon() {
|
|
37
|
+
switch (errorType) {
|
|
38
|
+
case '300':
|
|
39
|
+
case '301':
|
|
40
|
+
case '302':
|
|
41
|
+
case '303':
|
|
42
|
+
case '304':
|
|
43
|
+
case '305':
|
|
44
|
+
case '307':
|
|
45
|
+
case '308': {
|
|
46
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.SvgRedirect, null);
|
|
47
|
+
}
|
|
48
|
+
case '401': {
|
|
49
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg401, null);
|
|
50
|
+
}
|
|
51
|
+
case '403': {
|
|
52
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg403, null);
|
|
53
|
+
}
|
|
54
|
+
case '404': {
|
|
55
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg404, null);
|
|
56
|
+
}
|
|
57
|
+
case '408':
|
|
58
|
+
case '504': {
|
|
59
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.SvgTimedOut, null);
|
|
60
|
+
}
|
|
61
|
+
case '500': {
|
|
62
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg500, null);
|
|
63
|
+
}
|
|
64
|
+
case '502': {
|
|
65
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg502, null);
|
|
66
|
+
}
|
|
67
|
+
case '503': {
|
|
68
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.Svg503, null);
|
|
69
|
+
}
|
|
70
|
+
case 'generic':
|
|
71
|
+
default: {
|
|
72
|
+
return react_1.default.createElement(itwinui_illustrations_react_1.SvgError, null);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function getHeadingMessage() {
|
|
77
|
+
if (errorName) {
|
|
78
|
+
return errorName;
|
|
79
|
+
}
|
|
80
|
+
switch (errorType) {
|
|
81
|
+
case '300':
|
|
82
|
+
case '301':
|
|
83
|
+
case '302':
|
|
84
|
+
case '303':
|
|
85
|
+
case '304':
|
|
86
|
+
case '305':
|
|
87
|
+
case '307':
|
|
88
|
+
case '308': {
|
|
89
|
+
return defaultErrorMessages.redirect || '';
|
|
90
|
+
}
|
|
91
|
+
case '401': {
|
|
92
|
+
return defaultErrorMessages.unauthorized;
|
|
93
|
+
}
|
|
94
|
+
case '403': {
|
|
95
|
+
return defaultErrorMessages.forbidden;
|
|
96
|
+
}
|
|
97
|
+
case '404': {
|
|
98
|
+
return defaultErrorMessages.pageNotFound;
|
|
99
|
+
}
|
|
100
|
+
case '408':
|
|
101
|
+
case '504': {
|
|
102
|
+
return defaultErrorMessages.timedOut || '';
|
|
103
|
+
}
|
|
104
|
+
case '500': {
|
|
105
|
+
return defaultErrorMessages.internalServerError;
|
|
106
|
+
}
|
|
107
|
+
case '502': {
|
|
108
|
+
return defaultErrorMessages.badGateway;
|
|
109
|
+
}
|
|
110
|
+
case '503': {
|
|
111
|
+
return defaultErrorMessages.serviceUnavailable;
|
|
112
|
+
}
|
|
113
|
+
case 'generic':
|
|
114
|
+
default: {
|
|
115
|
+
return defaultErrorMessages.error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function getPrimaryButton() {
|
|
120
|
+
if (!primaryButtonHandle || !primaryButtonLabel) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
return (react_1.default.createElement(Button_1.Button, { styleType: 'high-visibility', onClick: primaryButtonHandle }, primaryButtonLabel));
|
|
124
|
+
}
|
|
125
|
+
function getSecondaryButton() {
|
|
126
|
+
if (!secondaryButtonHandle || !secondaryButtonLabel) {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
return (react_1.default.createElement(Button_1.Button, { styleType: 'default', onClick: secondaryButtonHandle }, secondaryButtonLabel));
|
|
130
|
+
}
|
|
131
|
+
function getActions() {
|
|
132
|
+
const primaryButton = getPrimaryButton();
|
|
133
|
+
const secondaryButton = getSecondaryButton();
|
|
134
|
+
if (!primaryButton && !secondaryButton) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
138
|
+
primaryButton,
|
|
139
|
+
secondaryButton));
|
|
140
|
+
}
|
|
141
|
+
return (react_1.default.createElement(NonIdealState_1.NonIdealState, { svg: getErrorIcon(), heading: getHeadingMessage(), description: errorMessage, actions: getActions(), ...rest }));
|
|
142
|
+
};
|
|
143
|
+
exports.ErrorPage = ErrorPage;
|
|
144
|
+
exports.default = exports.ErrorPage;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@itwin/itwinui-css/css/non-ideal-state.css';
|
|
3
|
+
export declare type NonIdealStateProps = {
|
|
4
|
+
/**
|
|
5
|
+
* An svg component, preferably from @itwin/itwinui-illustrations-react.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { Svg404 } from '@itwin/itwinui-illustrations-react';
|
|
9
|
+
* <NonIdealState svg={<Svg404 />} heading='Not found' />
|
|
10
|
+
*/
|
|
11
|
+
svg: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Primary heading for the error page
|
|
14
|
+
*/
|
|
15
|
+
heading?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Secondary text to explain the error
|
|
18
|
+
* Can include html in order to provide a hyperlink
|
|
19
|
+
* E.g. `Please visit <a href="https://www.bentley.com/help">our support page</a> for help.`
|
|
20
|
+
*/
|
|
21
|
+
description?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Actions to provide the user with a way to recover from the error.
|
|
24
|
+
* Typically should be a primary and secondary button.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <ErrorPage
|
|
28
|
+
* actions={
|
|
29
|
+
* <>
|
|
30
|
+
* <Button styleType={'high-visibility'}>Retry</Button>
|
|
31
|
+
* <Button>Contact us</Button>
|
|
32
|
+
* </>
|
|
33
|
+
* }
|
|
34
|
+
* />
|
|
35
|
+
*/
|
|
36
|
+
actions?: React.ReactNode;
|
|
37
|
+
} & React.ComponentPropsWithoutRef<'div'>;
|
|
38
|
+
/**
|
|
39
|
+
* A stylized display to communicate common http errors and other non-ideal states.
|
|
40
|
+
* Works well with svgs from @itwin/itwinui-illustrations-react.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <NonIdealState svg={<Svg404 />} heading='Not found' />
|
|
44
|
+
*/
|
|
45
|
+
export declare const NonIdealState: (props: NonIdealStateProps) => JSX.Element;
|
|
46
|
+
export default NonIdealState;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NonIdealState = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const utils_1 = require("../utils");
|
|
13
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
14
|
+
require("@itwin/itwinui-css/css/non-ideal-state.css");
|
|
15
|
+
/**
|
|
16
|
+
* A stylized display to communicate common http errors and other non-ideal states.
|
|
17
|
+
* Works well with svgs from @itwin/itwinui-illustrations-react.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <NonIdealState svg={<Svg404 />} heading='Not found' />
|
|
21
|
+
*/
|
|
22
|
+
const NonIdealState = (props) => {
|
|
23
|
+
const { className, svg, heading, description, actions, ...rest } = props;
|
|
24
|
+
(0, utils_1.useTheme)();
|
|
25
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-non-ideal-state', className), ...rest },
|
|
26
|
+
react_1.default.createElement("div", { className: 'iui-non-ideal-state-illustration' }, svg),
|
|
27
|
+
heading && react_1.default.createElement("div", { className: 'iui-non-ideal-state-title' }, heading),
|
|
28
|
+
description && (react_1.default.createElement("div", { className: 'iui-non-ideal-state-description' }, description)),
|
|
29
|
+
actions && react_1.default.createElement("div", { className: 'iui-non-ideal-state-actions' }, actions)));
|
|
30
|
+
};
|
|
31
|
+
exports.NonIdealState = NonIdealState;
|
|
32
|
+
exports.default = exports.NonIdealState;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ErrorPage } from './ErrorPage';
|
|
2
2
|
export type { ErrorPageProps, ErrorPageType, ErrorTypeTranslations, } from './ErrorPage';
|
|
3
|
-
|
|
3
|
+
export { NonIdealState } from './NonIdealState';
|
|
4
|
+
export type { NonIdealStateProps } from './NonIdealState';
|
|
5
|
+
declare const _default: "./NonIdealState";
|
|
4
6
|
export default _default;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorPage = void 0;
|
|
3
|
+
exports.NonIdealState = exports.ErrorPage = void 0;
|
|
4
4
|
/*---------------------------------------------------------------------------------------------
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
8
|
var ErrorPage_1 = require("./ErrorPage");
|
|
9
9
|
Object.defineProperty(exports, "ErrorPage", { enumerable: true, get: function () { return ErrorPage_1.ErrorPage; } });
|
|
10
|
-
|
|
10
|
+
var NonIdealState_1 = require("./NonIdealState");
|
|
11
|
+
Object.defineProperty(exports, "NonIdealState", { enumerable: true, get: function () { return NonIdealState_1.NonIdealState; } });
|
|
12
|
+
exports.default = './NonIdealState';
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,9 +8,9 @@ exports.ProgressLinear = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
36
14
|
require("@itwin/itwinui-css/css/progress-indicator.css");
|
|
37
15
|
/**
|
|
38
16
|
* Shows progress on a linear bar
|
|
@@ -49,20 +27,19 @@ require("@itwin/itwinui-css/css/progress-indicator.css");
|
|
|
49
27
|
* <ProgressLinear status='positive' labels={['Upload done!', <SvgStatusSuccessHollow />]} />
|
|
50
28
|
* <ProgressLinear status='negative' />
|
|
51
29
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _b = props.value, value = _b === void 0 ? 0 : _b, _c = props.indeterminate, indeterminate = _c === void 0 ? false : _c, _d = props.labels, labels = _d === void 0 ? [] : _d, _e = props.isAnimated, isAnimated = _e === void 0 ? false : _e, status = props.status, className = props.className, style = props.style, rest = __rest(props, ["value", "indeterminate", "labels", "isAnimated", "status", "className", "style"]);
|
|
30
|
+
const ProgressLinear = (props) => {
|
|
31
|
+
const { value = 0, indeterminate = false, labels = [], isAnimated = false, status, className, style, ...rest } = props;
|
|
55
32
|
(0, utils_1.useTheme)();
|
|
56
|
-
|
|
57
|
-
return (react_1.default.createElement("div",
|
|
58
|
-
|
|
59
|
-
|
|
33
|
+
const boundedValue = Math.min(100, Math.max(0, value));
|
|
34
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-progress-indicator-linear', {
|
|
35
|
+
[`iui-${status}`]: !!status,
|
|
36
|
+
}, className), style: style, ...rest },
|
|
60
37
|
react_1.default.createElement("div", { className: 'iui-track' },
|
|
61
38
|
react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-fill', {
|
|
62
39
|
'iui-determinate': !indeterminate && isAnimated,
|
|
63
40
|
'iui-indeterminate': indeterminate,
|
|
64
|
-
}), style: { width: indeterminate ? '100%' :
|
|
65
|
-
labels.length > 0 && (react_1.default.createElement("div", { className: 'iui-label' }, labels.map(
|
|
41
|
+
}), style: { width: indeterminate ? '100%' : `${boundedValue}%` } })),
|
|
42
|
+
labels.length > 0 && (react_1.default.createElement("div", { className: 'iui-label' }, labels.map((label, index) => (react_1.default.createElement("span", { key: index }, label)))))));
|
|
66
43
|
};
|
|
67
44
|
exports.ProgressLinear = ProgressLinear;
|
|
68
45
|
exports.default = exports.ProgressLinear;
|