@itwin/itwinui-react 1.48.1 → 2.0.0-dev.1
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 +4 -22
- package/cjs/core/Alert/Alert.d.ts +7 -6
- package/cjs/core/Alert/Alert.js +13 -8
- package/cjs/core/Avatar/Avatar.d.ts +69 -0
- package/cjs/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +15 -11
- package/cjs/core/Avatar/index.d.ts +4 -0
- package/cjs/core/{UserIcon → Avatar}/index.js +5 -4
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +70 -0
- package/cjs/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +23 -19
- package/cjs/core/AvatarGroup/index.d.ts +4 -0
- package/cjs/core/{UserIconGroup → AvatarGroup}/index.js +5 -4
- package/cjs/core/Badge/Badge.js +2 -4
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/cjs/core/Buttons/Button/Button.js +5 -14
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -3
- package/cjs/core/Buttons/IconButton/IconButton.js +3 -9
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +1 -2
- package/cjs/core/Buttons/SplitButton/SplitButton.js +4 -8
- package/cjs/core/Carousel/CarouselNavigation.js +3 -4
- package/cjs/core/Checkbox/Checkbox.d.ts +1 -29
- package/cjs/core/Checkbox/Checkbox.js +3 -3
- package/cjs/core/ColorPicker/ColorBuilder.js +16 -27
- package/cjs/core/ColorPicker/ColorInputPanel.js +1 -2
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +1 -6
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -2
- package/cjs/core/ComboBox/ComboBoxMenu.js +2 -4
- package/cjs/core/DatePicker/DatePicker.js +4 -8
- package/cjs/core/Dialog/Dialog.d.ts +4 -4
- package/cjs/core/Dialog/Dialog.js +1 -1
- package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/cjs/core/Dialog/DialogBackdrop.js +5 -2
- package/cjs/core/Dialog/DialogMain.d.ts +1 -1
- package/cjs/core/Dialog/DialogMain.js +7 -1
- package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBar.js +1 -2
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +5 -6
- package/cjs/core/FileUpload/FileUploadTemplate.js +1 -2
- package/cjs/core/Header/Header.d.ts +16 -6
- package/cjs/core/Header/Header.js +9 -12
- package/cjs/core/Header/HeaderBasicButton.d.ts +6 -0
- package/cjs/core/Header/HeaderBasicButton.js +52 -0
- package/cjs/core/Header/HeaderBreadcrumbs.js +6 -5
- package/cjs/core/Header/HeaderButton.d.ts +3 -2
- package/cjs/core/Header/HeaderButton.js +10 -18
- package/cjs/core/Header/HeaderDropdownButton.d.ts +6 -0
- package/cjs/core/Header/HeaderDropdownButton.js +53 -0
- package/cjs/core/Header/HeaderLogo.js +3 -3
- package/cjs/core/Header/HeaderSplitButton.d.ts +6 -0
- package/cjs/core/Header/HeaderSplitButton.js +54 -0
- package/cjs/core/InformationPanel/InformationPanelHeader.js +1 -2
- package/cjs/core/Input/Input.d.ts +1 -1
- package/cjs/core/Input/Input.js +3 -4
- package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
- package/cjs/core/InputGroup/InputGroup.js +1 -1
- package/cjs/core/Label/Label.d.ts +1 -1
- package/cjs/core/Label/Label.js +1 -1
- package/cjs/core/LabeledInput/LabeledInput.d.ts +2 -2
- package/cjs/core/LabeledInput/LabeledInput.js +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +1 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/cjs/core/Menu/MenuItem.js +1 -2
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +2 -4
- package/cjs/core/Radio/Radio.d.ts +1 -29
- package/cjs/core/Radio/Radio.js +3 -3
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +1 -1
- package/cjs/core/Select/Select.d.ts +1 -1
- package/cjs/core/Select/Select.js +10 -14
- package/cjs/core/Select/SelectTag.d.ts +1 -1
- package/cjs/core/Select/SelectTag.js +1 -1
- package/cjs/core/SideNavigation/SideNavigation.js +1 -2
- package/cjs/core/SideNavigation/SidenavButton.js +1 -2
- package/cjs/core/Stepper/Stepper.d.ts +40 -0
- package/cjs/core/{Wizard/Wizard.js → Stepper/Stepper.js} +11 -28
- package/cjs/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
- package/cjs/core/{Wizard/Step.js → Stepper/StepperStep.js} +10 -10
- package/cjs/core/Stepper/Wizard.d.ts +46 -0
- package/cjs/core/Stepper/Wizard.js +55 -0
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +6 -0
- package/cjs/core/Stepper/WorkflowDiagram.js +43 -0
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
- package/cjs/core/Stepper/WorkflowDiagramStep.js +42 -0
- package/cjs/core/Stepper/index.d.ts +8 -0
- package/cjs/core/{Wizard → Stepper}/index.js +5 -1
- package/cjs/core/Surface/Surface.d.ts +0 -2
- package/cjs/core/Surface/Surface.js +10 -10
- package/cjs/core/Table/SubRowExpander.js +3 -3
- package/cjs/core/Table/Table.d.ts +5 -4
- package/cjs/core/Table/Table.js +30 -23
- package/cjs/core/Table/TableCell.js +4 -4
- package/cjs/core/Table/TablePaginator.js +16 -19
- package/cjs/core/Table/TableRowMemoized.d.ts +2 -0
- package/cjs/core/Table/TableRowMemoized.js +10 -13
- package/cjs/core/Table/cells/DefaultCell.js +4 -9
- package/cjs/core/Table/columns/actionColumn.js +3 -3
- package/cjs/core/Table/columns/expanderColumn.js +3 -3
- package/cjs/core/Table/filters/BaseFilter.js +1 -1
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -2
- package/cjs/core/Table/filters/FilterToggle.js +2 -4
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +4 -4
- package/cjs/core/Table/hooks/useResizeColumns.js +110 -106
- package/cjs/core/Tabs/Tab.d.ts +0 -8
- package/cjs/core/Tabs/Tab.js +1 -5
- package/cjs/core/Tabs/Tabs.d.ts +32 -12
- package/cjs/core/Tabs/Tabs.js +16 -12
- package/cjs/core/Tabs/index.d.ts +4 -4
- package/cjs/core/Tabs/index.js +2 -2
- package/cjs/core/Tag/Tag.js +1 -2
- package/cjs/core/Textarea/Textarea.d.ts +1 -1
- package/cjs/core/Textarea/Textarea.js +2 -2
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +27 -17
- package/cjs/core/ThemeProvider/ThemeProvider.js +64 -7
- package/cjs/core/Tile/Tile.d.ts +19 -1
- package/cjs/core/Tile/Tile.js +36 -16
- package/cjs/core/Toast/Toast.d.ts +3 -3
- package/cjs/core/Toast/Toast.js +4 -5
- package/cjs/core/Toast/ToastWrapper.d.ts +1 -1
- package/cjs/core/Toast/ToastWrapper.js +1 -1
- package/cjs/core/Tree/TreeNode.js +1 -7
- package/cjs/core/Tree/TreeNodeExpander.js +2 -2
- package/cjs/core/Typography/Body/Body.d.ts +5 -3
- package/cjs/core/Typography/Body/Body.js +2 -3
- package/cjs/core/Typography/Headline/Headline.d.ts +2 -3
- package/cjs/core/Typography/Headline/Headline.js +2 -3
- package/cjs/core/Typography/Leading/Leading.d.ts +2 -3
- package/cjs/core/Typography/Leading/Leading.js +2 -3
- package/cjs/core/Typography/Small/Small.d.ts +2 -3
- package/cjs/core/Typography/Small/Small.js +2 -3
- package/cjs/core/Typography/Subheading/Subheading.d.ts +2 -3
- package/cjs/core/Typography/Subheading/Subheading.js +2 -3
- package/cjs/core/Typography/Text/Text.d.ts +2 -0
- package/cjs/core/Typography/Text/Text.js +2 -0
- package/cjs/core/Typography/Title/Title.d.ts +2 -3
- package/cjs/core/Typography/Title/Title.js +2 -3
- package/cjs/core/index.d.ts +8 -8
- package/cjs/core/index.js +14 -10
- package/cjs/core/utils/components/Popover.d.ts +2 -2
- package/cjs/core/utils/components/Popover.js +1 -1
- package/cjs/core/utils/components/Resizer.d.ts +5 -0
- package/cjs/core/utils/components/Resizer.js +7 -1
- package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -0
- package/cjs/core/utils/components/VisuallyHidden.js +1 -0
- package/cjs/core/utils/components/index.d.ts +0 -1
- package/cjs/core/utils/components/index.js +0 -1
- package/cjs/core/utils/functions/colors.d.ts +12 -12
- package/cjs/core/utils/functions/colors.js +12 -12
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +17 -0
- package/cjs/core/utils/hooks/useMediaQuery.js +2 -1
- package/cjs/core/utils/hooks/useTheme.d.ts +20 -3
- package/cjs/core/utils/hooks/useTheme.js +57 -58
- package/cjs/core/utils/{components/icons.d.ts → icons/StatusIconMap.d.ts} +1 -1
- package/cjs/core/utils/icons/StatusIconMap.js +52 -0
- package/cjs/core/utils/icons/SvgCalendar.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCalendar.js +47 -0
- package/cjs/core/utils/icons/SvgCaretDownSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +47 -0
- package/cjs/core/utils/icons/SvgCaretRightSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +47 -0
- package/cjs/core/utils/icons/SvgCaretUpSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +47 -0
- package/cjs/core/utils/icons/SvgCheckmark.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCheckmark.js +47 -0
- package/cjs/core/utils/icons/SvgCheckmarkSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +47 -0
- package/cjs/core/utils/icons/SvgChevronLeft.d.ts +2 -0
- package/cjs/core/utils/icons/SvgChevronLeft.js +47 -0
- package/cjs/core/utils/icons/SvgChevronLeftDouble.d.ts +2 -0
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +47 -0
- package/cjs/core/utils/icons/SvgChevronRight.d.ts +2 -0
- package/cjs/core/utils/icons/SvgChevronRight.js +47 -0
- package/cjs/core/utils/icons/SvgChevronRightDouble.d.ts +2 -0
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +47 -0
- package/cjs/core/utils/icons/SvgClose.d.ts +2 -0
- package/cjs/core/utils/icons/SvgClose.js +47 -0
- package/cjs/core/utils/icons/SvgCloseSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgCloseSmall.js +47 -0
- package/cjs/core/utils/icons/SvgColumnManager.d.ts +2 -0
- package/cjs/core/utils/icons/SvgColumnManager.js +47 -0
- package/cjs/core/utils/icons/SvgFilter.d.ts +2 -0
- package/cjs/core/utils/icons/SvgFilter.js +47 -0
- package/cjs/core/utils/icons/SvgFilterHollow.d.ts +2 -0
- package/cjs/core/utils/icons/SvgFilterHollow.js +47 -0
- package/cjs/core/utils/icons/SvgImportantSmall.d.ts +2 -0
- package/cjs/core/utils/icons/SvgImportantSmall.js +47 -0
- package/cjs/core/utils/icons/SvgInfoCircular.d.ts +2 -0
- package/cjs/core/utils/icons/SvgInfoCircular.js +47 -0
- package/cjs/core/utils/icons/SvgMore.d.ts +2 -0
- package/cjs/core/utils/icons/SvgMore.js +47 -0
- package/cjs/core/utils/icons/SvgMoreVertical.d.ts +2 -0
- package/cjs/core/utils/icons/SvgMoreVertical.js +47 -0
- package/cjs/core/utils/icons/SvgNew.d.ts +2 -0
- package/cjs/core/utils/icons/SvgNew.js +47 -0
- package/cjs/core/utils/icons/SvgSmileyHappy.d.ts +2 -0
- package/cjs/core/utils/icons/SvgSmileyHappy.js +47 -0
- package/cjs/core/utils/icons/SvgSortDown.d.ts +2 -0
- package/cjs/core/utils/icons/SvgSortDown.js +47 -0
- package/cjs/core/utils/icons/SvgSortUp.d.ts +2 -0
- package/cjs/core/utils/icons/SvgSortUp.js +47 -0
- package/cjs/core/utils/icons/SvgStatusError.d.ts +2 -0
- package/cjs/core/utils/icons/SvgStatusError.js +47 -0
- package/cjs/core/utils/icons/SvgStatusSuccess.d.ts +2 -0
- package/cjs/core/utils/icons/SvgStatusSuccess.js +47 -0
- package/cjs/core/utils/icons/SvgStatusWarning.d.ts +2 -0
- package/cjs/core/utils/icons/SvgStatusWarning.js +47 -0
- package/cjs/core/utils/icons/SvgSwap.d.ts +2 -0
- package/cjs/core/utils/icons/SvgSwap.js +47 -0
- package/cjs/core/utils/icons/SvgUpload.d.ts +2 -0
- package/cjs/core/utils/icons/SvgUpload.js +47 -0
- package/cjs/core/utils/icons/index.d.ts +29 -0
- package/cjs/core/utils/icons/index.js +49 -0
- package/cjs/core/utils/index.d.ts +1 -0
- package/cjs/core/utils/index.js +1 -0
- package/esm/core/Alert/Alert.d.ts +7 -6
- package/esm/core/Alert/Alert.js +14 -9
- package/esm/core/Avatar/Avatar.d.ts +69 -0
- package/esm/core/{UserIcon/UserIcon.js → Avatar/Avatar.js} +13 -9
- package/esm/core/Avatar/index.d.ts +4 -0
- package/esm/core/{UserIcon → Avatar}/index.js +2 -2
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +70 -0
- package/esm/core/{UserIconGroup/UserIconGroup.js → AvatarGroup/AvatarGroup.js} +21 -17
- package/esm/core/AvatarGroup/index.d.ts +4 -0
- package/esm/core/{UserIconGroup → AvatarGroup}/index.js +2 -2
- package/esm/core/Badge/Badge.js +3 -5
- package/esm/core/Breadcrumbs/Breadcrumbs.js +1 -2
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/core/Buttons/Button/Button.js +5 -14
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +2 -4
- package/esm/core/Buttons/IconButton/IconButton.js +3 -9
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +2 -3
- package/esm/core/Buttons/SplitButton/SplitButton.js +5 -9
- package/esm/core/Carousel/CarouselNavigation.js +1 -2
- package/esm/core/Checkbox/Checkbox.d.ts +1 -29
- package/esm/core/Checkbox/Checkbox.js +3 -3
- package/esm/core/ColorPicker/ColorBuilder.js +17 -28
- package/esm/core/ColorPicker/ColorInputPanel.js +1 -2
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +2 -7
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -2
- package/esm/core/ComboBox/ComboBoxMenu.js +2 -4
- package/esm/core/DatePicker/DatePicker.js +1 -5
- package/esm/core/Dialog/Dialog.d.ts +4 -4
- package/esm/core/Dialog/Dialog.js +1 -1
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +5 -2
- package/esm/core/Dialog/DialogMain.d.ts +1 -1
- package/esm/core/Dialog/DialogMain.js +7 -1
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBar.js +1 -2
- package/esm/core/ExpandableBlock/ExpandableBlock.js +5 -6
- package/esm/core/FileUpload/FileUploadTemplate.js +1 -2
- package/esm/core/Header/Header.d.ts +16 -6
- package/esm/core/Header/Header.js +9 -12
- package/esm/core/Header/HeaderBasicButton.d.ts +6 -0
- package/esm/core/Header/HeaderBasicButton.js +46 -0
- package/esm/core/Header/HeaderBreadcrumbs.js +7 -6
- package/esm/core/Header/HeaderButton.d.ts +3 -2
- package/esm/core/Header/HeaderButton.js +10 -18
- package/esm/core/Header/HeaderDropdownButton.d.ts +6 -0
- package/esm/core/Header/HeaderDropdownButton.js +47 -0
- package/esm/core/Header/HeaderLogo.js +3 -3
- package/esm/core/Header/HeaderSplitButton.d.ts +6 -0
- package/esm/core/Header/HeaderSplitButton.js +48 -0
- package/esm/core/InformationPanel/InformationPanelHeader.js +1 -2
- package/esm/core/Input/Input.d.ts +1 -1
- package/esm/core/Input/Input.js +3 -4
- package/esm/core/InputGroup/InputGroup.d.ts +1 -1
- package/esm/core/InputGroup/InputGroup.js +1 -1
- package/esm/core/Label/Label.d.ts +1 -1
- package/esm/core/Label/Label.js +1 -1
- package/esm/core/LabeledInput/LabeledInput.d.ts +2 -2
- package/esm/core/LabeledInput/LabeledInput.js +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +1 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -1
- package/esm/core/Menu/MenuItem.js +1 -2
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +3 -5
- package/esm/core/Radio/Radio.d.ts +1 -29
- package/esm/core/Radio/Radio.js +3 -3
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +1 -1
- package/esm/core/Select/Select.d.ts +1 -1
- package/esm/core/Select/Select.js +10 -14
- package/esm/core/Select/SelectTag.d.ts +1 -1
- package/esm/core/Select/SelectTag.js +1 -1
- package/esm/core/SideNavigation/SideNavigation.js +1 -2
- package/esm/core/SideNavigation/SidenavButton.js +1 -2
- package/esm/core/Stepper/Stepper.d.ts +40 -0
- package/esm/core/{Wizard/Wizard.js → Stepper/Stepper.js} +10 -27
- package/esm/core/{Wizard/Step.d.ts → Stepper/StepperStep.d.ts} +6 -7
- package/esm/core/{Wizard/Step.js → Stepper/StepperStep.js} +8 -8
- package/esm/core/Stepper/Wizard.d.ts +46 -0
- package/esm/core/Stepper/Wizard.js +49 -0
- package/esm/core/Stepper/WorkflowDiagram.d.ts +6 -0
- package/esm/core/Stepper/WorkflowDiagram.js +37 -0
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +5 -0
- package/esm/core/Stepper/WorkflowDiagramStep.js +35 -0
- package/esm/core/Stepper/index.d.ts +8 -0
- package/esm/core/{Wizard → Stepper}/index.js +2 -0
- package/esm/core/Surface/Surface.d.ts +0 -2
- package/esm/core/Surface/Surface.js +11 -11
- package/esm/core/Table/SubRowExpander.js +2 -2
- package/esm/core/Table/Table.d.ts +5 -4
- package/esm/core/Table/Table.js +31 -24
- package/esm/core/Table/TableCell.js +4 -4
- package/esm/core/Table/TablePaginator.js +15 -18
- package/esm/core/Table/TableRowMemoized.d.ts +2 -0
- package/esm/core/Table/TableRowMemoized.js +10 -13
- package/esm/core/Table/cells/DefaultCell.js +4 -9
- package/esm/core/Table/columns/actionColumn.js +2 -2
- package/esm/core/Table/columns/expanderColumn.js +2 -2
- package/esm/core/Table/filters/BaseFilter.js +1 -1
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +1 -2
- package/esm/core/Table/filters/FilterToggle.js +2 -4
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +4 -4
- package/esm/core/Table/hooks/useResizeColumns.js +110 -106
- package/esm/core/Tabs/Tab.d.ts +0 -8
- package/esm/core/Tabs/Tab.js +0 -4
- package/esm/core/Tabs/Tabs.d.ts +32 -12
- package/esm/core/Tabs/Tabs.js +17 -13
- package/esm/core/Tabs/index.d.ts +4 -4
- package/esm/core/Tabs/index.js +2 -2
- package/esm/core/Tag/Tag.js +1 -2
- package/esm/core/Textarea/Textarea.d.ts +1 -1
- package/esm/core/Textarea/Textarea.js +2 -2
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +27 -17
- package/esm/core/ThemeProvider/ThemeProvider.js +64 -6
- package/esm/core/Tile/Tile.d.ts +19 -1
- package/esm/core/Tile/Tile.js +36 -16
- package/esm/core/Toast/Toast.d.ts +3 -3
- package/esm/core/Toast/Toast.js +4 -5
- package/esm/core/Toast/ToastWrapper.d.ts +1 -1
- package/esm/core/Toast/ToastWrapper.js +1 -1
- package/esm/core/Tree/TreeNode.js +2 -8
- package/esm/core/Tree/TreeNodeExpander.js +1 -1
- package/esm/core/Typography/Body/Body.d.ts +5 -3
- package/esm/core/Typography/Body/Body.js +2 -3
- package/esm/core/Typography/Headline/Headline.d.ts +2 -3
- package/esm/core/Typography/Headline/Headline.js +2 -3
- package/esm/core/Typography/Leading/Leading.d.ts +2 -3
- package/esm/core/Typography/Leading/Leading.js +2 -3
- package/esm/core/Typography/Small/Small.d.ts +2 -3
- package/esm/core/Typography/Small/Small.js +2 -3
- package/esm/core/Typography/Subheading/Subheading.d.ts +2 -3
- package/esm/core/Typography/Subheading/Subheading.js +2 -3
- package/esm/core/Typography/Text/Text.d.ts +2 -0
- package/esm/core/Typography/Text/Text.js +2 -0
- package/esm/core/Typography/Title/Title.d.ts +2 -3
- package/esm/core/Typography/Title/Title.js +2 -3
- package/esm/core/index.d.ts +8 -8
- package/esm/core/index.js +4 -4
- package/esm/core/utils/components/Popover.d.ts +2 -2
- package/esm/core/utils/components/Popover.js +1 -1
- package/esm/core/utils/components/Resizer.d.ts +5 -0
- package/esm/core/utils/components/Resizer.js +7 -1
- package/esm/core/utils/components/VisuallyHidden.d.ts +1 -0
- package/esm/core/utils/components/VisuallyHidden.js +1 -0
- package/esm/core/utils/components/index.d.ts +0 -1
- package/esm/core/utils/components/index.js +0 -1
- package/esm/core/utils/functions/colors.d.ts +12 -12
- package/esm/core/utils/functions/colors.js +12 -12
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.d.ts +7 -0
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/esm/core/utils/hooks/useMediaQuery.js +2 -1
- package/esm/core/utils/hooks/useTheme.d.ts +20 -3
- package/esm/core/utils/hooks/useTheme.js +56 -57
- package/esm/core/utils/{components/icons.d.ts → icons/StatusIconMap.d.ts} +1 -1
- package/esm/core/utils/{components/icons.js → icons/StatusIconMap.js} +5 -5
- package/esm/core/utils/icons/SvgCalendar.d.ts +2 -0
- package/esm/core/utils/icons/SvgCalendar.js +20 -0
- package/esm/core/utils/icons/SvgCaretDownSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgCaretDownSmall.js +20 -0
- package/esm/core/utils/icons/SvgCaretRightSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgCaretRightSmall.js +20 -0
- package/esm/core/utils/icons/SvgCaretUpSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgCaretUpSmall.js +20 -0
- package/esm/core/utils/icons/SvgCheckmark.d.ts +2 -0
- package/esm/core/utils/icons/SvgCheckmark.js +20 -0
- package/esm/core/utils/icons/SvgCheckmarkSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +20 -0
- package/esm/core/utils/icons/SvgChevronLeft.d.ts +2 -0
- package/esm/core/utils/icons/SvgChevronLeft.js +20 -0
- package/esm/core/utils/icons/SvgChevronLeftDouble.d.ts +2 -0
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +20 -0
- package/esm/core/utils/icons/SvgChevronRight.d.ts +2 -0
- package/esm/core/utils/icons/SvgChevronRight.js +20 -0
- package/esm/core/utils/icons/SvgChevronRightDouble.d.ts +2 -0
- package/esm/core/utils/icons/SvgChevronRightDouble.js +20 -0
- package/esm/core/utils/icons/SvgClose.d.ts +2 -0
- package/esm/core/utils/icons/SvgClose.js +20 -0
- package/esm/core/utils/icons/SvgCloseSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgCloseSmall.js +20 -0
- package/esm/core/utils/icons/SvgColumnManager.d.ts +2 -0
- package/esm/core/utils/icons/SvgColumnManager.js +20 -0
- package/esm/core/utils/icons/SvgFilter.d.ts +2 -0
- package/esm/core/utils/icons/SvgFilter.js +20 -0
- package/esm/core/utils/icons/SvgFilterHollow.d.ts +2 -0
- package/esm/core/utils/icons/SvgFilterHollow.js +20 -0
- package/esm/core/utils/icons/SvgImportantSmall.d.ts +2 -0
- package/esm/core/utils/icons/SvgImportantSmall.js +20 -0
- package/esm/core/utils/icons/SvgInfoCircular.d.ts +2 -0
- package/esm/core/utils/icons/SvgInfoCircular.js +20 -0
- package/esm/core/utils/icons/SvgMore.d.ts +2 -0
- package/esm/core/utils/icons/SvgMore.js +20 -0
- package/esm/core/utils/icons/SvgMoreVertical.d.ts +2 -0
- package/esm/core/utils/icons/SvgMoreVertical.js +20 -0
- package/esm/core/utils/icons/SvgNew.d.ts +2 -0
- package/esm/core/utils/icons/SvgNew.js +20 -0
- package/esm/core/utils/icons/SvgSmileyHappy.d.ts +2 -0
- package/esm/core/utils/icons/SvgSmileyHappy.js +20 -0
- package/esm/core/utils/icons/SvgSortDown.d.ts +2 -0
- package/esm/core/utils/icons/SvgSortDown.js +20 -0
- package/esm/core/utils/icons/SvgSortUp.d.ts +2 -0
- package/esm/core/utils/icons/SvgSortUp.js +20 -0
- package/esm/core/utils/icons/SvgStatusError.d.ts +2 -0
- package/esm/core/utils/icons/SvgStatusError.js +20 -0
- package/esm/core/utils/icons/SvgStatusSuccess.d.ts +2 -0
- package/esm/core/utils/icons/SvgStatusSuccess.js +20 -0
- package/esm/core/utils/icons/SvgStatusWarning.d.ts +2 -0
- package/esm/core/utils/icons/SvgStatusWarning.js +20 -0
- package/esm/core/utils/icons/SvgSwap.d.ts +2 -0
- package/esm/core/utils/icons/SvgSwap.js +20 -0
- package/esm/core/utils/icons/SvgUpload.d.ts +2 -0
- package/esm/core/utils/icons/SvgUpload.js +20 -0
- package/esm/core/utils/icons/index.d.ts +29 -0
- package/esm/core/utils/icons/index.js +33 -0
- package/esm/core/utils/index.d.ts +1 -0
- package/esm/core/utils/index.js +1 -0
- package/package.json +3 -3
- package/cjs/core/UserIcon/UserIcon.d.ts +0 -57
- package/cjs/core/UserIcon/index.d.ts +0 -4
- package/cjs/core/UserIconGroup/UserIconGroup.d.ts +0 -62
- package/cjs/core/UserIconGroup/index.d.ts +0 -4
- package/cjs/core/Wizard/Wizard.d.ts +0 -54
- package/cjs/core/Wizard/index.d.ts +0 -4
- package/cjs/core/utils/components/icons.js +0 -32
- package/esm/core/UserIcon/UserIcon.d.ts +0 -57
- package/esm/core/UserIcon/index.d.ts +0 -4
- package/esm/core/UserIconGroup/UserIconGroup.d.ts +0 -62
- package/esm/core/UserIconGroup/index.d.ts +0 -4
- package/esm/core/Wizard/Wizard.d.ts +0 -54
- package/esm/core/Wizard/index.d.ts +0 -4
package/README.md
CHANGED
|
@@ -50,9 +50,7 @@ Yes, that's really all you need as you can see in this live interactive demo:
|
|
|
50
50
|
|
|
51
51
|
## Theming
|
|
52
52
|
|
|
53
|
-
By default, all components use the light theme but we
|
|
54
|
-
|
|
55
|
-
- Use `ThemeProvider` in your root component where you can pass one of the following values:
|
|
53
|
+
By default, all components use the light theme, but we recommend wrapping your root element with `ThemeProvider`. You can pass one of the following values to its `theme` prop:
|
|
56
54
|
- `light` (default)
|
|
57
55
|
- `dark`
|
|
58
56
|
- `os` (which respects the color scheme of the operating system)
|
|
@@ -62,29 +60,13 @@ import { ThemeProvider } from '@itwin/itwinui-react';
|
|
|
62
60
|
|
|
63
61
|
const App = () => (
|
|
64
62
|
<>
|
|
65
|
-
<ThemeProvider theme='dark'
|
|
66
|
-
|
|
63
|
+
<ThemeProvider theme='dark'>
|
|
64
|
+
{/* Your components go here. */}
|
|
65
|
+
</ThemeProvider>
|
|
67
66
|
</>
|
|
68
67
|
);
|
|
69
68
|
```
|
|
70
69
|
|
|
71
|
-
- The `useTheme` hook also provides the same functionality as `ThemeProvider`.
|
|
72
|
-
|
|
73
|
-
```jsx
|
|
74
|
-
import { useTheme } from '@itwin/itwinui-react';
|
|
75
|
-
|
|
76
|
-
const App = () => {
|
|
77
|
-
useTheme('dark');
|
|
78
|
-
return (
|
|
79
|
-
<>
|
|
80
|
-
// Your code goes here.
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
*Note: You only need to use one of these methods, and it only needs to be done once.*
|
|
87
|
-
|
|
88
70
|
---
|
|
89
71
|
|
|
90
72
|
## FAQ
|
|
@@ -15,11 +15,6 @@ export declare type AlertProps = {
|
|
|
15
15
|
* Props for the clickable text. Used for providing `href` and other attributes.
|
|
16
16
|
*/
|
|
17
17
|
clickableTextProps?: React.ComponentPropsWithRef<'a'>;
|
|
18
|
-
/**
|
|
19
|
-
* Action handler for the clickable text.
|
|
20
|
-
* @deprecated `clickableTextProps` should be used instead.
|
|
21
|
-
*/
|
|
22
|
-
onClick?: () => void;
|
|
23
18
|
/**
|
|
24
19
|
* Action handler for close.
|
|
25
20
|
*/
|
|
@@ -41,7 +36,13 @@ export declare type AlertProps = {
|
|
|
41
36
|
* <Alert type='positive'>This is a positive alert.</Alert>
|
|
42
37
|
* <Alert type='warning'>This is a warning alert.</Alert>
|
|
43
38
|
* <Alert type='negative'>This is a negative alert.</Alert>
|
|
44
|
-
* <Alert
|
|
39
|
+
* <Alert
|
|
40
|
+
* type='positive'
|
|
41
|
+
* clickableText="I am a clickable text"
|
|
42
|
+
* clickableTextProps={{ href: 'https://www.example.com' }}
|
|
43
|
+
* >
|
|
44
|
+
* This is a positive alert with a clickable text
|
|
45
|
+
* </Alert>
|
|
45
46
|
*/
|
|
46
47
|
export declare const Alert: (props: AlertProps) => JSX.Element;
|
|
47
48
|
export default Alert;
|
package/cjs/core/Alert/Alert.js
CHANGED
|
@@ -30,12 +30,10 @@ exports.Alert = void 0;
|
|
|
30
30
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
31
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
32
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
var CloseSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CloseSmall"));
|
|
34
33
|
var classnames_1 = __importDefault(require("classnames"));
|
|
35
34
|
var react_1 = __importDefault(require("react"));
|
|
36
35
|
var utils_1 = require("../utils");
|
|
37
36
|
require("@itwin/itwinui-css/css/alert.css");
|
|
38
|
-
var IconButton_1 = require("../Buttons/IconButton");
|
|
39
37
|
/**
|
|
40
38
|
* A small box to quickly grab user attention and communicate a brief message
|
|
41
39
|
* @example
|
|
@@ -43,19 +41,26 @@ var IconButton_1 = require("../Buttons/IconButton");
|
|
|
43
41
|
* <Alert type='positive'>This is a positive alert.</Alert>
|
|
44
42
|
* <Alert type='warning'>This is a warning alert.</Alert>
|
|
45
43
|
* <Alert type='negative'>This is a negative alert.</Alert>
|
|
46
|
-
* <Alert
|
|
44
|
+
* <Alert
|
|
45
|
+
* type='positive'
|
|
46
|
+
* clickableText="I am a clickable text"
|
|
47
|
+
* clickableTextProps={{ href: 'https://www.example.com' }}
|
|
48
|
+
* >
|
|
49
|
+
* This is a positive alert with a clickable text
|
|
50
|
+
* </Alert>
|
|
47
51
|
*/
|
|
48
52
|
var Alert = function (props) {
|
|
49
|
-
var children = props.children, className = props.className, _a = props.type, type = _a === void 0 ? 'informational' : _a, clickableText = props.clickableText, clickableTextProps = props.clickableTextProps,
|
|
53
|
+
var children = props.children, className = props.className, _a = props.type, type = _a === void 0 ? 'informational' : _a, clickableText = props.clickableText, clickableTextProps = props.clickableTextProps, onClose = props.onClose, style = props.style, _b = props.isSticky, isSticky = _b === void 0 ? false : _b, rest = __rest(props, ["children", "className", "type", "clickableText", "clickableTextProps", "onClose", "style", "isSticky"]);
|
|
50
54
|
(0, utils_1.useTheme)();
|
|
51
55
|
var StatusIcon = utils_1.StatusIconMap[type];
|
|
52
|
-
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)(
|
|
56
|
+
return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)("iui-alert-".concat(type), { 'iui-sticky': isSticky }, className), style: style }, rest),
|
|
53
57
|
react_1.default.createElement(StatusIcon, { className: 'iui-alert-icon' }),
|
|
54
58
|
react_1.default.createElement("span", { className: 'iui-alert-message' },
|
|
55
59
|
children,
|
|
56
|
-
clickableText && (react_1.default.createElement("a", __assign({
|
|
57
|
-
onClose && (react_1.default.createElement(
|
|
58
|
-
react_1.default.createElement(
|
|
60
|
+
clickableText && (react_1.default.createElement("a", __assign({}, clickableTextProps, { className: (0, classnames_1.default)('iui-alert-link', clickableTextProps === null || clickableTextProps === void 0 ? void 0 : clickableTextProps.className) }), clickableText))),
|
|
61
|
+
onClose && (react_1.default.createElement("button", { onClick: onClose, "aria-label": 'Close', type: 'button', className: 'iui-alert-button' },
|
|
62
|
+
react_1.default.createElement("span", { className: 'iui-alert-button-icon', "aria-hidden": true },
|
|
63
|
+
react_1.default.createElement(utils_1.SvgCloseSmall, null))))));
|
|
59
64
|
};
|
|
60
65
|
exports.Alert = Alert;
|
|
61
66
|
exports.default = exports.Alert;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonProps } from '../utils';
|
|
3
|
+
import '@itwin/itwinui-css/css/avatar.css';
|
|
4
|
+
export declare type AvatarStatus = 'online' | 'busy' | 'away' | 'offline';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Since v2, this has been renamed to `AvatarStatus` (Use with `Avatar`)
|
|
7
|
+
*/
|
|
8
|
+
export declare type UserIconStatus = AvatarStatus;
|
|
9
|
+
export declare type StatusTitles = {
|
|
10
|
+
[key in Exclude<AvatarStatus, ''>]: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type AvatarProps = {
|
|
13
|
+
/**
|
|
14
|
+
* Size of a avatar.
|
|
15
|
+
* @default 'small'
|
|
16
|
+
*/
|
|
17
|
+
size?: 'small' | 'medium' | 'large' | 'x-large';
|
|
18
|
+
/**
|
|
19
|
+
* Status/Availability of a user.
|
|
20
|
+
*/
|
|
21
|
+
status?: AvatarStatus;
|
|
22
|
+
/**
|
|
23
|
+
* Text which will appear when hovering over the icon.
|
|
24
|
+
*/
|
|
25
|
+
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Abbreviation to be displayed.
|
|
28
|
+
*/
|
|
29
|
+
abbreviation?: string;
|
|
30
|
+
/**
|
|
31
|
+
* User image to be displayed. MUST be an <img> element!
|
|
32
|
+
*/
|
|
33
|
+
image?: JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Color of the icon. You can use `getUserColor` function to generate color from user name or email.
|
|
36
|
+
* @default 'white'
|
|
37
|
+
*/
|
|
38
|
+
backgroundColor?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Translated status messages shown on hover.
|
|
41
|
+
*/
|
|
42
|
+
translatedStatusTitles?: StatusTitles;
|
|
43
|
+
} & Omit<CommonProps, 'title'>;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Since v2, this has been renamed to `AvatarProps` (Use with `Avatar`)
|
|
46
|
+
*/
|
|
47
|
+
export declare type UserIconProps = AvatarProps;
|
|
48
|
+
export declare const defaultStatusTitles: StatusTitles;
|
|
49
|
+
/**
|
|
50
|
+
* Basic avatar component
|
|
51
|
+
* @example
|
|
52
|
+
* <caption>Small icon with abbreviation</caption>
|
|
53
|
+
* <Avatar size='small' title='Terry Rivers' abbreviation='TR' backgroundColor='green'/>
|
|
54
|
+
* @example
|
|
55
|
+
* <caption>Medium icon with image</caption>
|
|
56
|
+
* <Avatar size='medium' title='Terry Rivers' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
57
|
+
* @example
|
|
58
|
+
* <caption>Large icon with status</caption>
|
|
59
|
+
* <Avatar size='large' title='Terry Rivers' abbreviation='TR' backgroundColor='green' status='online' />
|
|
60
|
+
* @example
|
|
61
|
+
* <caption>X-large icon with image</caption>
|
|
62
|
+
* <Avatar size='x-large' title='Terry Rivers' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
63
|
+
*/
|
|
64
|
+
export declare const Avatar: (props: AvatarProps) => JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Since v2, this has been renamed to `Avatar`
|
|
67
|
+
*/
|
|
68
|
+
export declare const UserIcon: (props: AvatarProps) => JSX.Element;
|
|
69
|
+
export default Avatar;
|
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.UserIcon = exports.defaultStatusTitles = void 0;
|
|
28
|
+
exports.UserIcon = exports.Avatar = exports.defaultStatusTitles = void 0;
|
|
29
29
|
/*---------------------------------------------------------------------------------------------
|
|
30
30
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
31
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -33,7 +33,7 @@ exports.UserIcon = exports.defaultStatusTitles = void 0;
|
|
|
33
33
|
var classnames_1 = __importDefault(require("classnames"));
|
|
34
34
|
var react_1 = __importDefault(require("react"));
|
|
35
35
|
var utils_1 = require("../utils");
|
|
36
|
-
require("@itwin/itwinui-css/css/
|
|
36
|
+
require("@itwin/itwinui-css/css/avatar.css");
|
|
37
37
|
exports.defaultStatusTitles = {
|
|
38
38
|
away: 'Away',
|
|
39
39
|
busy: 'Busy',
|
|
@@ -41,30 +41,34 @@ exports.defaultStatusTitles = {
|
|
|
41
41
|
online: 'Online',
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
* Basic
|
|
44
|
+
* Basic avatar component
|
|
45
45
|
* @example
|
|
46
46
|
* <caption>Small icon with abbreviation</caption>
|
|
47
|
-
* <
|
|
47
|
+
* <Avatar size='small' title='Terry Rivers' abbreviation='TR' backgroundColor='green'/>
|
|
48
48
|
* @example
|
|
49
49
|
* <caption>Medium icon with image</caption>
|
|
50
|
-
* <
|
|
50
|
+
* <Avatar size='medium' title='Terry Rivers' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
51
51
|
* @example
|
|
52
52
|
* <caption>Large icon with status</caption>
|
|
53
|
-
* <
|
|
53
|
+
* <Avatar size='large' title='Terry Rivers' abbreviation='TR' backgroundColor='green' status='online' />
|
|
54
54
|
* @example
|
|
55
55
|
* <caption>X-large icon with image</caption>
|
|
56
|
-
* <
|
|
56
|
+
* <Avatar size='x-large' title='Terry Rivers' abbreviation='TR' backgroundColor='green' image={<img src="https://cdn.example.com/user/profile/pic.png" />}/>
|
|
57
57
|
*/
|
|
58
|
-
var
|
|
58
|
+
var Avatar = function (props) {
|
|
59
59
|
var _a, _b;
|
|
60
60
|
var _c = props.size, size = _c === void 0 ? 'small' : _c, status = props.status, abbreviation = props.abbreviation, image = props.image, _d = props.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, title = props.title, translatedStatusTitles = props.translatedStatusTitles, className = props.className, style = props.style, rest = __rest(props, ["size", "status", "abbreviation", "image", "backgroundColor", "title", "translatedStatusTitles", "className", "style"]);
|
|
61
61
|
(0, utils_1.useTheme)();
|
|
62
62
|
var statusTitles = __assign(__assign({}, exports.defaultStatusTitles), translatedStatusTitles);
|
|
63
|
-
return (react_1.default.createElement("span", __assign({ className: (0, classnames_1.default)('iui-
|
|
63
|
+
return (react_1.default.createElement("span", __assign({ className: (0, classnames_1.default)('iui-avatar', (_a = {}, _a["iui-".concat(size)] = size !== 'medium', _a), className), title: title, style: style }, rest), image !== null && image !== void 0 ? image : (react_1.default.createElement("abbr", { className: 'iui-initials', style: { backgroundColor: backgroundColor } }, abbreviation === null || abbreviation === void 0 ? void 0 : abbreviation.substring(0, 2))),
|
|
64
64
|
react_1.default.createElement("span", { className: 'iui-stroke' }),
|
|
65
65
|
status && (react_1.default.createElement("span", { title: statusTitles[status], className: (0, classnames_1.default)('iui-status', (_b = {},
|
|
66
66
|
_b["iui-".concat(status)] = !!status,
|
|
67
67
|
_b)), "aria-label": statusTitles[status] }))));
|
|
68
68
|
};
|
|
69
|
-
exports.
|
|
70
|
-
|
|
69
|
+
exports.Avatar = Avatar;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Since v2, this has been renamed to `Avatar`
|
|
72
|
+
*/
|
|
73
|
+
exports.UserIcon = exports.Avatar;
|
|
74
|
+
exports.default = exports.Avatar;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserIcon = void 0;
|
|
3
|
+
exports.UserIcon = exports.Avatar = 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
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
exports
|
|
8
|
+
var Avatar_1 = require("./Avatar");
|
|
9
|
+
Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return Avatar_1.Avatar; } });
|
|
10
|
+
Object.defineProperty(exports, "UserIcon", { enumerable: true, get: function () { return Avatar_1.UserIcon; } });
|
|
11
|
+
exports.default = './Avatar';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonProps } from '../utils';
|
|
3
|
+
import '@itwin/itwinui-css/css/avatar.css';
|
|
4
|
+
export declare type AvatarGroupProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Max number of avatars unstacked.
|
|
7
|
+
* @default 5
|
|
8
|
+
*/
|
|
9
|
+
maxIcons?: number;
|
|
10
|
+
/**
|
|
11
|
+
* If true, group will be stacked to take less space.
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
stacked?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, group will be animated on hover.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
animated?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Size of avatars and count avatars.
|
|
22
|
+
* @default 'small'
|
|
23
|
+
*/
|
|
24
|
+
iconSize?: 'small' | 'medium' | 'large' | 'x-large';
|
|
25
|
+
/**
|
|
26
|
+
* Avatars in the group.
|
|
27
|
+
*/
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Count Avatar props.
|
|
31
|
+
*/
|
|
32
|
+
countIconProps?: React.ComponentPropsWithRef<'div'>;
|
|
33
|
+
} & Omit<CommonProps, 'title'>;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Since v2, this has been renamed to `AvatarGroupProps` (Use with `AvatarGroup`)
|
|
36
|
+
*/
|
|
37
|
+
export declare type UserIconGroupProps = AvatarGroupProps;
|
|
38
|
+
/**
|
|
39
|
+
* Group Avatars together.
|
|
40
|
+
*
|
|
41
|
+
* Avatars stacking is based on `maxAvatars` count. If you provide 8 Avatars and keep default 5 `maxAvatars` count,
|
|
42
|
+
* this component will show 5 Avatars and Count Avatar with "3" in it.
|
|
43
|
+
*
|
|
44
|
+
* You can add custom Count Avatar behavior by using `countAvatarProps`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <AvatarGroup avatarSize='medium'>
|
|
48
|
+
* <Avatar
|
|
49
|
+
* abbreviation="TR"
|
|
50
|
+
* backgroundColor={getUserColor("Terry Rivers")}
|
|
51
|
+
* title="Terry Rivers"
|
|
52
|
+
* />
|
|
53
|
+
* <Avatar
|
|
54
|
+
* abbreviation="RM"
|
|
55
|
+
* backgroundColor={getUserColor("Robin Mercer")}
|
|
56
|
+
* title="Robin Mercer"
|
|
57
|
+
* />
|
|
58
|
+
* <Avatar
|
|
59
|
+
* abbreviation="JM"
|
|
60
|
+
* backgroundColor={getUserColor("Jean Mullins")}
|
|
61
|
+
* title="Jean Mullins"
|
|
62
|
+
* />
|
|
63
|
+
* </AvatarGroup>
|
|
64
|
+
*/
|
|
65
|
+
export declare const AvatarGroup: (props: AvatarGroupProps) => JSX.Element;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Since v2, this has been renamed to `AvatarGroup`
|
|
68
|
+
*/
|
|
69
|
+
export declare const UserIconGroup: (props: AvatarGroupProps) => JSX.Element;
|
|
70
|
+
export default AvatarGroup;
|
|
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.UserIconGroup = void 0;
|
|
28
|
+
exports.UserIconGroup = exports.AvatarGroup = void 0;
|
|
29
29
|
/*---------------------------------------------------------------------------------------------
|
|
30
30
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
31
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -33,42 +33,42 @@ exports.UserIconGroup = void 0;
|
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
34
|
var classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
var utils_1 = require("../utils");
|
|
36
|
-
require("@itwin/itwinui-css/css/
|
|
36
|
+
require("@itwin/itwinui-css/css/avatar.css");
|
|
37
37
|
/**
|
|
38
|
-
* Group
|
|
38
|
+
* Group Avatars together.
|
|
39
39
|
*
|
|
40
|
-
*
|
|
41
|
-
* this component will show 5
|
|
40
|
+
* Avatars stacking is based on `maxAvatars` count. If you provide 8 Avatars and keep default 5 `maxAvatars` count,
|
|
41
|
+
* this component will show 5 Avatars and Count Avatar with "3" in it.
|
|
42
42
|
*
|
|
43
|
-
* You can add custom
|
|
43
|
+
* You can add custom Count Avatar behavior by using `countAvatarProps`.
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
|
-
* <
|
|
47
|
-
* <
|
|
46
|
+
* <AvatarGroup avatarSize='medium'>
|
|
47
|
+
* <Avatar
|
|
48
48
|
* abbreviation="TR"
|
|
49
49
|
* backgroundColor={getUserColor("Terry Rivers")}
|
|
50
50
|
* title="Terry Rivers"
|
|
51
51
|
* />
|
|
52
|
-
* <
|
|
52
|
+
* <Avatar
|
|
53
53
|
* abbreviation="RM"
|
|
54
54
|
* backgroundColor={getUserColor("Robin Mercer")}
|
|
55
55
|
* title="Robin Mercer"
|
|
56
56
|
* />
|
|
57
|
-
* <
|
|
57
|
+
* <Avatar
|
|
58
58
|
* abbreviation="JM"
|
|
59
59
|
* backgroundColor={getUserColor("Jean Mullins")}
|
|
60
60
|
* title="Jean Mullins"
|
|
61
61
|
* />
|
|
62
|
-
* </
|
|
62
|
+
* </AvatarGroup>
|
|
63
63
|
*/
|
|
64
|
-
var
|
|
64
|
+
var AvatarGroup = function (props) {
|
|
65
65
|
var _a;
|
|
66
66
|
var maxLength = 99;
|
|
67
67
|
var children = props.children, _b = props.animated, animated = _b === void 0 ? false : _b, _c = props.stacked, stacked = _c === void 0 ? true : _c, _d = props.maxIcons, maxIcons = _d === void 0 ? 5 : _d, _e = props.iconSize, iconSize = _e === void 0 ? 'small' : _e, countIconProps = props.countIconProps, className = props.className, rest = __rest(props, ["children", "animated", "stacked", "maxIcons", "iconSize", "countIconProps", "className"]);
|
|
68
68
|
var childrenArray = react_1.default.Children.toArray(children);
|
|
69
69
|
var childrenLength = childrenArray.length;
|
|
70
70
|
(0, utils_1.useTheme)();
|
|
71
|
-
var
|
|
71
|
+
var getAvatarList = function (count) {
|
|
72
72
|
return childrenArray.slice(0, count).map(function (child) {
|
|
73
73
|
return react_1.default.cloneElement(child, {
|
|
74
74
|
status: undefined,
|
|
@@ -77,18 +77,22 @@ var UserIconGroup = function (props) {
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
80
|
-
react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-
|
|
80
|
+
react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-avatar-list', {
|
|
81
81
|
'iui-animated': animated,
|
|
82
82
|
'iui-stacked': stacked,
|
|
83
83
|
}, className) }, rest),
|
|
84
|
-
childrenArray.length <= maxIcons + 1 &&
|
|
84
|
+
childrenArray.length <= maxIcons + 1 && getAvatarList(maxIcons + 1),
|
|
85
85
|
childrenArray.length > maxIcons + 1 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
86
|
-
|
|
87
|
-
react_1.default.createElement("div", __assign({}, countIconProps, { className: (0, classnames_1.default)('iui-
|
|
86
|
+
getAvatarList(maxIcons),
|
|
87
|
+
react_1.default.createElement("div", __assign({}, countIconProps, { className: (0, classnames_1.default)('iui-avatar', (_a = {}, _a["iui-".concat(iconSize)] = iconSize !== 'medium', _a), 'iui-avatar-count', countIconProps === null || countIconProps === void 0 ? void 0 : countIconProps.className) }),
|
|
88
88
|
react_1.default.createElement("abbr", { className: 'iui-initials' }, childrenLength <= maxLength
|
|
89
89
|
? "".concat(childrenLength - maxIcons)
|
|
90
90
|
: "".concat(maxLength, "+")),
|
|
91
91
|
react_1.default.createElement("span", { className: 'iui-stroke' })))))));
|
|
92
92
|
};
|
|
93
|
-
exports.
|
|
94
|
-
|
|
93
|
+
exports.AvatarGroup = AvatarGroup;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Since v2, this has been renamed to `AvatarGroup`
|
|
96
|
+
*/
|
|
97
|
+
exports.UserIconGroup = exports.AvatarGroup;
|
|
98
|
+
exports.default = exports.AvatarGroup;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserIconGroup = void 0;
|
|
3
|
+
exports.UserIconGroup = exports.AvatarGroup = 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
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
exports
|
|
8
|
+
var AvatarGroup_1 = require("./AvatarGroup");
|
|
9
|
+
Object.defineProperty(exports, "AvatarGroup", { enumerable: true, get: function () { return AvatarGroup_1.AvatarGroup; } });
|
|
10
|
+
Object.defineProperty(exports, "UserIconGroup", { enumerable: true, get: function () { return AvatarGroup_1.UserIconGroup; } });
|
|
11
|
+
exports.default = './AvatarGroup';
|
package/cjs/core/Badge/Badge.js
CHANGED
|
@@ -62,12 +62,10 @@ var getBadgeColorValue = function (color) {
|
|
|
62
62
|
* <Badge backgroundColor="positive">Label</Badge>
|
|
63
63
|
*/
|
|
64
64
|
var Badge = function (props) {
|
|
65
|
-
var _a, _b, _c;
|
|
66
65
|
var backgroundColor = props.backgroundColor, style = props.style, className = props.className, children = props.children, rest = __rest(props, ["backgroundColor", "style", "className", "children"]);
|
|
67
66
|
(0, utils_1.useTheme)();
|
|
68
|
-
var _style = backgroundColor
|
|
69
|
-
|
|
70
|
-
? __assign({ '--iui-badge-background-color': getBadgeColorValue(backgroundColor) }, style) : __assign({ backgroundColor: getBadgeColorValue(backgroundColor) }, style);
|
|
67
|
+
var _style = backgroundColor
|
|
68
|
+
? __assign({ '--iui-badge-background-color': getBadgeColorValue(backgroundColor) }, style) : __assign({}, style);
|
|
71
69
|
return (react_1.default.createElement("span", __assign({ className: (0, classnames_1.default)('iui-badge', className), style: _style }, rest), children));
|
|
72
70
|
};
|
|
73
71
|
exports.Badge = Badge;
|
|
@@ -33,7 +33,6 @@ exports.Breadcrumbs = void 0;
|
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
34
|
var classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
var utils_1 = require("../utils");
|
|
36
|
-
var ChevronRight_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/ChevronRight"));
|
|
37
36
|
require("@itwin/itwinui-css/css/breadcrumbs.css");
|
|
38
37
|
/**
|
|
39
38
|
* A breadcrumb trail is used as a navigational aid to help users keep track
|
|
@@ -94,6 +93,6 @@ var ListItem = function (_a) {
|
|
|
94
93
|
};
|
|
95
94
|
var Separator = function (_a) {
|
|
96
95
|
var separator = _a.separator;
|
|
97
|
-
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : react_1.default.createElement(
|
|
96
|
+
return (react_1.default.createElement("li", { className: 'iui-breadcrumbs-separator', "aria-hidden": true }, separator !== null && separator !== void 0 ? separator : react_1.default.createElement(utils_1.SvgChevronRight, null)));
|
|
98
97
|
};
|
|
99
98
|
exports.default = exports.Breadcrumbs;
|
|
@@ -54,5 +54,5 @@ export declare type ButtonGroupProps = {
|
|
|
54
54
|
* {buttons}
|
|
55
55
|
* </ButtonGroup>
|
|
56
56
|
*/
|
|
57
|
-
export declare const ButtonGroup: React.ForwardRefExoticComponent<Pick<ButtonGroupProps, "
|
|
57
|
+
export declare const ButtonGroup: React.ForwardRefExoticComponent<Pick<ButtonGroupProps, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "orientation" | "overflowButton" | "overflowPlacement"> & React.RefAttributes<HTMLDivElement>>;
|
|
58
58
|
export default ButtonGroup;
|
|
@@ -44,20 +44,11 @@ require("@itwin/itwinui-css/css/button.css");
|
|
|
44
44
|
* <Button startIcon={<SvgAdd />}>New</Button>
|
|
45
45
|
*/
|
|
46
46
|
exports.Button = react_1.default.forwardRef(function (props, ref) {
|
|
47
|
-
var _a;
|
|
48
|
-
var children = props.children, className = props.className, size = props.size, style = props.style, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, _c = props.type, type = _c === void 0 ? 'button' : _c, startIcon = props.startIcon, endIcon = props.endIcon, _d = props.as, Element = _d === void 0 ? 'button' : _d, rest = __rest(props, ["children", "className", "size", "style", "styleType", "type", "startIcon", "endIcon", "as"]);
|
|
47
|
+
var children = props.children, className = props.className, size = props.size, style = props.style, _a = props.styleType, styleType = _a === void 0 ? 'default' : _a, _b = props.type, type = _b === void 0 ? 'button' : _b, startIcon = props.startIcon, endIcon = props.endIcon, _c = props.as, Element = _c === void 0 ? 'button' : _c, rest = __rest(props, ["children", "className", "size", "style", "styleType", "type", "startIcon", "endIcon", "as"]);
|
|
49
48
|
(0, utils_1.useTheme)();
|
|
50
|
-
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
react_1.default.cloneElement(startIcon, {
|
|
55
|
-
className: (0, classnames_1.default)('iui-button-icon', startIcon.props.className),
|
|
56
|
-
}),
|
|
57
|
-
children && react_1.default.createElement("span", { className: 'iui-button-label' }, children),
|
|
58
|
-
endIcon &&
|
|
59
|
-
react_1.default.cloneElement(endIcon, {
|
|
60
|
-
className: (0, classnames_1.default)('iui-button-icon', endIcon.props.className),
|
|
61
|
-
})));
|
|
49
|
+
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', className), "data-iui-variant": styleType !== 'default' ? styleType : undefined, "data-iui-size": size, style: style, type: type }, rest),
|
|
50
|
+
startIcon && (react_1.default.createElement("span", { className: 'iui-button-icon', "aria-hidden": true }, startIcon)),
|
|
51
|
+
children && react_1.default.createElement("span", null, children),
|
|
52
|
+
endIcon && (react_1.default.createElement("span", { className: 'iui-button-icon', "aria-hidden": true }, endIcon))));
|
|
62
53
|
});
|
|
63
54
|
exports.default = exports.Button;
|
|
@@ -34,8 +34,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
34
34
|
var classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
var Button_1 = require("../Button");
|
|
36
36
|
var DropdownMenu_1 = require("../../DropdownMenu");
|
|
37
|
-
var CaretDownSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall"));
|
|
38
|
-
var CaretUpSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CaretUpSmall"));
|
|
39
37
|
var utils_1 = require("../../utils");
|
|
40
38
|
require("@itwin/itwinui-css/css/button.css");
|
|
41
39
|
/**
|
|
@@ -60,6 +58,6 @@ exports.DropdownButton = react_1.default.forwardRef(function (props, ref) {
|
|
|
60
58
|
}
|
|
61
59
|
}, [children, size, styleType]);
|
|
62
60
|
return (react_1.default.createElement(DropdownMenu_1.DropdownMenu, { menuItems: menuItems, style: { minWidth: menuWidth }, onShow: function () { return setIsMenuOpen(true); }, onHide: function () { return setIsMenuOpen(false); } },
|
|
63
|
-
react_1.default.createElement(Button_1.Button, __assign({ className: (0, classnames_1.default)('iui-dropdown', className), size: size, styleType: styleType, endIcon: isMenuOpen ? (react_1.default.createElement(
|
|
61
|
+
react_1.default.createElement(Button_1.Button, __assign({ className: (0, classnames_1.default)('iui-button-dropdown', className), size: size, styleType: styleType, endIcon: isMenuOpen ? (react_1.default.createElement(utils_1.SvgCaretUpSmall, { "aria-hidden": true })) : (react_1.default.createElement(utils_1.SvgCaretDownSmall, { "aria-hidden": true })), ref: refs, "aria-label": 'Dropdown' }, rest), children)));
|
|
64
62
|
});
|
|
65
63
|
exports.default = exports.DropdownButton;
|
|
@@ -41,15 +41,9 @@ require("@itwin/itwinui-css/css/button.css");
|
|
|
41
41
|
* <IconButton styleType='borderless'><SvgAdd /></IconButton>
|
|
42
42
|
*/
|
|
43
43
|
exports.IconButton = react_1.default.forwardRef(function (props, ref) {
|
|
44
|
-
var _a;
|
|
45
|
-
var isActive = props.isActive, children = props.children, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, size = props.size, _c = props.type, type = _c === void 0 ? 'button' : _c, className = props.className, _d = props.as, Element = _d === void 0 ? 'button' : _d, rest = __rest(props, ["isActive", "children", "styleType", "size", "type", "className", "as"]);
|
|
44
|
+
var isActive = props.isActive, children = props.children, _a = props.styleType, styleType = _a === void 0 ? 'default' : _a, size = props.size, _b = props.type, type = _b === void 0 ? 'button' : _b, className = props.className, _c = props.as, Element = _c === void 0 ? 'button' : _c, rest = __rest(props, ["isActive", "children", "styleType", "size", "type", "className", "as"]);
|
|
46
45
|
(0, utils_1.useTheme)();
|
|
47
|
-
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-"
|
|
48
|
-
|
|
49
|
-
_a['iui-active'] = isActive,
|
|
50
|
-
_a), className), type: type }, rest), react_1.default.cloneElement(children, {
|
|
51
|
-
className: (0, classnames_1.default)('iui-button-icon', children.props.className),
|
|
52
|
-
'aria-hidden': true,
|
|
53
|
-
})));
|
|
46
|
+
return (react_1.default.createElement(Element, __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', className), "data-iui-variant": styleType !== 'default' ? styleType : undefined, "data-iui-size": size, "data-iui-active": isActive, type: type }, rest),
|
|
47
|
+
react_1.default.createElement("span", { className: 'iui-button-icon', "aria-hidden": true }, children)));
|
|
54
48
|
});
|
|
55
49
|
exports.default = exports.IconButton;
|
|
@@ -31,7 +31,6 @@ exports.IdeasButton = void 0;
|
|
|
31
31
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
32
|
*--------------------------------------------------------------------------------------------*/
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var SmileyHappy_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/SmileyHappy"));
|
|
35
34
|
var utils_1 = require("../../utils");
|
|
36
35
|
var Button_1 = require("../Button");
|
|
37
36
|
/**
|
|
@@ -42,6 +41,6 @@ var Button_1 = require("../Button");
|
|
|
42
41
|
exports.IdeasButton = react_1.default.forwardRef(function (props, ref) {
|
|
43
42
|
var _a = props.feedbackLabel, feedbackLabel = _a === void 0 ? 'Feedback' : _a, onClick = props.onClick, rest = __rest(props, ["feedbackLabel", "onClick"]);
|
|
44
43
|
(0, utils_1.useTheme)();
|
|
45
|
-
return (react_1.default.createElement(Button_1.Button, __assign({ ref: ref,
|
|
44
|
+
return (react_1.default.createElement(Button_1.Button, __assign({ ref: ref, "data-iui-variant": 'idea', onClick: onClick, startIcon: react_1.default.createElement(utils_1.SvgSmileyHappy, { "aria-hidden": true }) }, rest), feedbackLabel));
|
|
46
45
|
});
|
|
47
46
|
exports.default = exports.IdeasButton;
|
|
@@ -35,8 +35,6 @@ var react_1 = __importDefault(require("react"));
|
|
|
35
35
|
var Button_1 = require("../Button");
|
|
36
36
|
var IconButton_1 = require("../IconButton");
|
|
37
37
|
var DropdownMenu_1 = require("../../DropdownMenu");
|
|
38
|
-
var CaretDownSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CaretDownSmall"));
|
|
39
|
-
var CaretUpSmall_1 = __importDefault(require("@itwin/itwinui-icons-react/cjs/icons/CaretUpSmall"));
|
|
40
38
|
var utils_1 = require("../../utils");
|
|
41
39
|
require("@itwin/itwinui-css/css/button.css");
|
|
42
40
|
/**
|
|
@@ -64,13 +62,11 @@ exports.SplitButton = react_1.default.forwardRef(function (props, forwardedRef)
|
|
|
64
62
|
setMenuWidth(ref.current.offsetWidth);
|
|
65
63
|
}
|
|
66
64
|
}, [children, size]);
|
|
67
|
-
return (react_1.default.createElement("span", { className: (0, classnames_1.default)(className, 'iui-button-split
|
|
65
|
+
return (react_1.default.createElement("span", { className: (0, classnames_1.default)(className, 'iui-button-split', {
|
|
68
66
|
'iui-disabled': props.disabled,
|
|
69
67
|
}), style: style, title: title, ref: ref },
|
|
70
|
-
react_1.default.createElement(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { placement: menuPlacement, menuItems: menuItems, style: { minWidth: menuWidth }, onShow: react_1.default.useCallback(function () { return setIsMenuOpen(true); }, []), onHide: react_1.default.useCallback(function () { return setIsMenuOpen(false); }, []) },
|
|
74
|
-
react_1.default.createElement(IconButton_1.IconButton, { styleType: styleType, size: size, disabled: props.disabled }, isMenuOpen ? react_1.default.createElement(CaretUpSmall_1.default, null) : react_1.default.createElement(CaretDownSmall_1.default, null))))));
|
|
68
|
+
react_1.default.createElement(Button_1.Button, __assign({ styleType: styleType, size: size, onClick: onClick, ref: forwardedRef }, rest), children),
|
|
69
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { placement: menuPlacement, menuItems: menuItems, style: { minWidth: menuWidth }, onShow: react_1.default.useCallback(function () { return setIsMenuOpen(true); }, []), onHide: react_1.default.useCallback(function () { return setIsMenuOpen(false); }, []) },
|
|
70
|
+
react_1.default.createElement(IconButton_1.IconButton, { styleType: styleType, size: size, disabled: props.disabled }, isMenuOpen ? react_1.default.createElement(utils_1.SvgCaretUpSmall, null) : react_1.default.createElement(utils_1.SvgCaretDownSmall, null)))));
|
|
75
71
|
});
|
|
76
72
|
exports.default = exports.SplitButton;
|