@itwin/itwinui-react 3.0.0-dev.6 → 3.0.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/cjs/core/Alert/Alert.d.ts +20 -9
- package/cjs/core/Alert/Alert.js +48 -10
- package/cjs/core/Avatar/Avatar.d.ts +3 -2
- package/cjs/core/Avatar/Avatar.js +21 -19
- package/cjs/core/AvatarGroup/AvatarGroup.js +3 -8
- package/cjs/core/ButtonGroup/ButtonGroup.js +41 -36
- package/cjs/core/Buttons/Button/Button.d.ts +15 -2
- package/cjs/core/Buttons/Button/Button.js +23 -9
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +27 -38
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/cjs/core/Buttons/SplitButton/SplitButton.js +25 -13
- package/cjs/core/Carousel/Carousel.d.ts +6 -4
- package/cjs/core/Carousel/Carousel.js +2 -2
- package/cjs/core/Carousel/CarouselDot.js +1 -3
- package/cjs/core/Carousel/CarouselNavigation.d.ts +6 -4
- package/cjs/core/ColorPicker/ColorBuilder.js +2 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +172 -231
- package/cjs/core/ComboBox/ComboBox.js +3 -3
- package/cjs/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +3 -22
- package/cjs/core/ComboBox/ComboBoxInput.js +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxMenu.js +5 -5
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +8 -6
- package/cjs/core/ComboBox/helpers.d.ts +1 -2
- package/cjs/core/DatePicker/DatePicker.d.ts +30 -8
- package/cjs/core/DatePicker/DatePicker.js +47 -6
- package/cjs/core/Dialog/Dialog.js +10 -17
- package/cjs/core/Dialog/DialogContext.d.ts +3 -4
- package/cjs/core/Dialog/DialogMain.js +5 -5
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +39 -18
- package/cjs/core/FileUpload/FileUpload.d.ts +4 -0
- package/cjs/core/FileUpload/FileUpload.js +24 -3
- package/cjs/core/Header/HeaderBasicButton.js +3 -16
- package/cjs/core/Header/HeaderDropdownButton.js +1 -1
- package/cjs/core/Header/HeaderSplitButton.js +3 -4
- package/cjs/core/Input/Input.d.ts +4 -0
- package/cjs/core/Input/Input.js +2 -1
- package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
- package/cjs/core/InputGrid/InputGrid.js +39 -0
- package/cjs/core/InputGrid/index.d.ts +3 -0
- package/cjs/core/InputGrid/index.js +15 -0
- package/cjs/core/InputGroup/InputGroup.d.ts +13 -0
- package/cjs/core/InputGroup/InputGroup.js +35 -9
- package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
- package/cjs/core/InputWithDecorations/index.d.ts +3 -0
- package/cjs/core/InputWithDecorations/index.js +15 -0
- package/cjs/core/Label/Label.d.ts +5 -0
- package/cjs/core/Label/Label.js +2 -0
- package/cjs/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/cjs/core/LabeledInput/LabeledInput.js +52 -29
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/cjs/core/LabeledSelect/LabeledSelect.js +36 -17
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +12 -45
- package/cjs/core/Menu/Menu.d.ts +1 -1
- package/cjs/core/Menu/Menu.js +1 -1
- package/cjs/core/Menu/MenuDivider.d.ts +2 -1
- package/cjs/core/Menu/MenuDivider.js +1 -1
- package/cjs/core/Menu/MenuItem.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.js +1 -0
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/cjs/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/cjs/core/SearchBox/SearchBox.js +1 -1
- package/cjs/core/Select/Select.d.ts +4 -0
- package/cjs/core/Select/Select.js +12 -11
- package/cjs/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/cjs/core/SideNavigation/SideNavigation.js +42 -9
- package/cjs/core/Slider/Slider.d.ts +24 -0
- package/cjs/core/Slider/Slider.js +58 -10
- package/cjs/core/Slider/Thumb.js +3 -2
- package/cjs/core/Slider/Track.d.ts +1 -1
- package/cjs/core/Slider/Track.js +17 -6
- package/cjs/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/cjs/core/StatusMessage/StatusMessage.js +23 -9
- package/cjs/core/Stepper/Stepper.d.ts +26 -1
- package/cjs/core/Stepper/Stepper.js +35 -6
- package/cjs/core/Stepper/StepperStep.d.ts +17 -0
- package/cjs/core/Stepper/StepperStep.js +33 -8
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +23 -10
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
- package/cjs/core/Stepper/WorkflowDiagramStep.js +9 -2
- package/cjs/core/Table/SubRowExpander.js +3 -1
- package/cjs/core/Table/Table.js +0 -1
- package/cjs/core/Table/TableCell.js +1 -1
- package/cjs/core/Table/TablePaginator.js +1 -3
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +46 -18
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/cjs/core/Tabs/Tab.js +1 -2
- package/cjs/core/Textarea/Textarea.d.ts +7 -1
- package/cjs/core/Textarea/Textarea.js +6 -11
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +23 -3
- package/cjs/core/ThemeProvider/ThemeProvider.js +56 -23
- package/cjs/core/Tile/Tile.d.ts +142 -17
- package/cjs/core/Tile/Tile.js +107 -16
- package/cjs/core/Toast/Toast.d.ts +12 -4
- package/cjs/core/Toast/Toast.js +24 -13
- package/cjs/core/Tooltip/Tooltip.d.ts +35 -28
- package/cjs/core/Tooltip/Tooltip.js +116 -118
- package/cjs/core/TransferList/TransferList.js +4 -12
- package/cjs/core/Tree/TreeNode.js +1 -1
- package/cjs/core/index.d.ts +2 -0
- package/cjs/core/index.js +20 -4
- package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
- package/cjs/core/utils/components/ButtonBase.js +46 -0
- package/cjs/core/utils/components/Icon.d.ts +5 -0
- package/cjs/core/utils/components/Icon.js +8 -1
- package/cjs/core/utils/components/InputContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputContainer.js +14 -34
- package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/cjs/core/utils/components/InputFlexContainer.js +3 -1
- package/cjs/core/utils/components/Popover.js +5 -3
- package/cjs/core/utils/components/Portal.d.ts +27 -0
- package/cjs/core/utils/components/Portal.js +43 -0
- package/cjs/core/utils/components/VirtualScroll.js +4 -4
- package/cjs/core/utils/components/index.d.ts +2 -0
- package/cjs/core/utils/components/index.js +2 -0
- package/cjs/core/utils/functions/colors.d.ts +1 -1
- package/cjs/core/utils/functions/colors.js +1 -13
- package/cjs/core/utils/functions/index.d.ts +1 -0
- package/cjs/core/utils/functions/index.js +1 -0
- package/cjs/core/utils/functions/react.d.ts +8 -0
- package/cjs/core/utils/functions/react.js +40 -0
- package/cjs/core/utils/hooks/index.d.ts +1 -0
- package/cjs/core/utils/hooks/index.js +1 -0
- package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
- package/cjs/core/utils/hooks/useControlledState.js +39 -0
- package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
- package/cjs/styles.js +11 -35
- package/esm/core/Alert/Alert.d.ts +20 -9
- package/esm/core/Alert/Alert.js +49 -10
- package/esm/core/Avatar/Avatar.d.ts +3 -2
- package/esm/core/Avatar/Avatar.js +21 -17
- package/esm/core/AvatarGroup/AvatarGroup.js +3 -8
- package/esm/core/ButtonGroup/ButtonGroup.js +41 -36
- package/esm/core/Buttons/Button/Button.d.ts +15 -2
- package/esm/core/Buttons/Button/Button.js +18 -10
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -1
- package/esm/core/Buttons/IconButton/IconButton.d.ts +5 -1
- package/esm/core/Buttons/IconButton/IconButton.js +25 -37
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
- package/esm/core/Buttons/SplitButton/SplitButton.js +31 -14
- package/esm/core/Carousel/Carousel.d.ts +6 -4
- package/esm/core/Carousel/Carousel.js +8 -3
- package/esm/core/Carousel/CarouselDot.js +2 -4
- package/esm/core/Carousel/CarouselNavigation.d.ts +6 -4
- package/esm/core/ColorPicker/ColorBuilder.js +2 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +173 -232
- package/esm/core/ComboBox/ComboBox.js +3 -3
- package/esm/core/ComboBox/ComboBoxDropdown.js +4 -9
- package/esm/core/ComboBox/ComboBoxEndIcon.js +4 -25
- package/esm/core/ComboBox/ComboBoxInput.js +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxMenu.js +5 -5
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.js +9 -7
- package/esm/core/ComboBox/helpers.d.ts +1 -2
- package/esm/core/DatePicker/DatePicker.d.ts +30 -8
- package/esm/core/DatePicker/DatePicker.js +33 -6
- package/esm/core/Dialog/Dialog.js +11 -23
- package/esm/core/Dialog/DialogContext.d.ts +3 -4
- package/esm/core/Dialog/DialogMain.js +5 -5
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
- package/esm/core/ExpandableBlock/ExpandableBlock.js +41 -20
- package/esm/core/FileUpload/FileUpload.d.ts +4 -0
- package/esm/core/FileUpload/FileUpload.js +26 -3
- package/esm/core/Header/HeaderBasicButton.js +4 -17
- package/esm/core/Header/HeaderDropdownButton.js +1 -1
- package/esm/core/Header/HeaderSplitButton.js +9 -5
- package/esm/core/Input/Input.d.ts +4 -0
- package/esm/core/Input/Input.js +2 -1
- package/esm/core/InputGrid/InputGrid.d.ts +25 -0
- package/esm/core/InputGrid/InputGrid.js +35 -0
- package/esm/core/InputGrid/index.d.ts +3 -0
- package/esm/core/InputGrid/index.js +6 -0
- package/esm/core/InputGroup/InputGroup.d.ts +13 -0
- package/esm/core/InputGroup/InputGroup.js +34 -10
- package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
- package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
- package/esm/core/InputWithDecorations/index.d.ts +3 -0
- package/esm/core/InputWithDecorations/index.js +6 -0
- package/esm/core/Label/Label.d.ts +5 -0
- package/esm/core/Label/Label.js +2 -0
- package/esm/core/LabeledInput/LabeledInput.d.ts +22 -16
- package/esm/core/LabeledInput/LabeledInput.js +53 -29
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +17 -7
- package/esm/core/LabeledSelect/LabeledSelect.js +37 -18
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
- package/esm/core/LabeledTextarea/LabeledTextarea.js +14 -45
- package/esm/core/Menu/Menu.d.ts +1 -1
- package/esm/core/Menu/Menu.js +1 -1
- package/esm/core/Menu/MenuDivider.d.ts +2 -1
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +1 -1
- package/esm/core/Menu/MenuItem.js +1 -0
- package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.js +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
- package/esm/core/ProgressIndicators/ProgressLinear.js +9 -1
- package/esm/core/SearchBox/SearchBox.js +1 -1
- package/esm/core/Select/Select.d.ts +4 -0
- package/esm/core/Select/Select.js +12 -11
- package/esm/core/SideNavigation/SideNavigation.d.ts +16 -0
- package/esm/core/SideNavigation/SideNavigation.js +33 -9
- package/esm/core/Slider/Slider.d.ts +24 -0
- package/esm/core/Slider/Slider.js +43 -10
- package/esm/core/Slider/Thumb.js +3 -2
- package/esm/core/Slider/Track.d.ts +1 -1
- package/esm/core/Slider/Track.js +14 -6
- package/esm/core/StatusMessage/StatusMessage.d.ts +12 -2
- package/esm/core/StatusMessage/StatusMessage.js +23 -16
- package/esm/core/Stepper/Stepper.d.ts +26 -1
- package/esm/core/Stepper/Stepper.js +32 -6
- package/esm/core/Stepper/StepperStep.d.ts +17 -0
- package/esm/core/Stepper/StepperStep.js +27 -8
- package/esm/core/Stepper/WorkflowDiagram.d.ts +11 -1
- package/esm/core/Stepper/WorkflowDiagram.js +10 -7
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
- package/esm/core/Stepper/WorkflowDiagramStep.js +6 -2
- package/esm/core/Table/SubRowExpander.js +3 -1
- package/esm/core/Table/Table.js +0 -1
- package/esm/core/Table/TableCell.js +1 -1
- package/esm/core/Table/TablePaginator.js +2 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +45 -17
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
- package/esm/core/Tabs/Tab.js +2 -3
- package/esm/core/Textarea/Textarea.d.ts +7 -1
- package/esm/core/Textarea/Textarea.js +6 -11
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +23 -3
- package/esm/core/ThemeProvider/ThemeProvider.js +65 -24
- package/esm/core/Tile/Tile.d.ts +142 -17
- package/esm/core/Tile/Tile.js +107 -16
- package/esm/core/Toast/Toast.d.ts +12 -4
- package/esm/core/Toast/Toast.js +26 -13
- package/esm/core/Tooltip/Tooltip.d.ts +35 -28
- package/esm/core/Tooltip/Tooltip.js +119 -116
- package/esm/core/TransferList/TransferList.js +4 -9
- package/esm/core/Tree/TreeNode.js +1 -1
- package/esm/core/index.d.ts +2 -0
- package/esm/core/index.js +2 -0
- package/esm/core/utils/components/ButtonBase.d.ts +14 -0
- package/esm/core/utils/components/ButtonBase.js +42 -0
- package/esm/core/utils/components/Icon.d.ts +5 -0
- package/esm/core/utils/components/Icon.js +8 -1
- package/esm/core/utils/components/InputContainer.d.ts +0 -1
- package/esm/core/utils/components/InputContainer.js +14 -30
- package/esm/core/utils/components/InputFlexContainer.d.ts +1 -0
- package/esm/core/utils/components/InputFlexContainer.js +3 -1
- package/esm/core/utils/components/Popover.js +5 -3
- package/esm/core/utils/components/Portal.d.ts +27 -0
- package/esm/core/utils/components/Portal.js +36 -0
- package/esm/core/utils/components/VirtualScroll.js +4 -4
- package/esm/core/utils/components/index.d.ts +2 -0
- package/esm/core/utils/components/index.js +2 -0
- package/esm/core/utils/functions/colors.d.ts +1 -1
- package/esm/core/utils/functions/colors.js +1 -13
- package/esm/core/utils/functions/index.d.ts +1 -0
- package/esm/core/utils/functions/index.js +1 -0
- package/esm/core/utils/functions/react.d.ts +8 -0
- package/esm/core/utils/functions/react.js +35 -0
- package/esm/core/utils/hooks/index.d.ts +1 -0
- package/esm/core/utils/hooks/index.js +1 -0
- package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
- package/esm/core/utils/hooks/useControlledState.js +34 -0
- package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
- package/esm/styles.js +11 -35
- package/package.json +3 -3
- package/styles.css +49 -46
|
@@ -7,25 +7,38 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
10
11
|
const index_js_1 = require('../utils/index.js');
|
|
11
12
|
const WorkflowDiagramStep_js_1 = require('./WorkflowDiagramStep.js');
|
|
12
13
|
exports.WorkflowDiagram = React.forwardRef(
|
|
13
14
|
// TODO: Remove this ref cast. ref and rest props should be applied on the same element
|
|
14
15
|
(props, ref) => {
|
|
15
|
-
const { steps, ...rest } = props;
|
|
16
|
+
const { steps, className, contentProps, wrapperProps, ...rest } = props;
|
|
16
17
|
return React.createElement(
|
|
17
18
|
index_js_1.Box,
|
|
18
|
-
{ ref: ref },
|
|
19
|
+
{ as: 'div', ...wrapperProps, ref: ref },
|
|
19
20
|
React.createElement(
|
|
20
21
|
index_js_1.Box,
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
{
|
|
23
|
+
as: 'ol',
|
|
24
|
+
className: (0, classnames_1.default)(
|
|
25
|
+
'iui-workflow-diagram',
|
|
26
|
+
className,
|
|
27
|
+
),
|
|
28
|
+
...rest,
|
|
29
|
+
},
|
|
30
|
+
steps.map((s, index) => {
|
|
31
|
+
const thisContentProps = contentProps?.(index);
|
|
32
|
+
return React.createElement(
|
|
33
|
+
WorkflowDiagramStep_js_1.WorkflowDiagramStep,
|
|
34
|
+
{
|
|
35
|
+
contentProps: thisContentProps,
|
|
36
|
+
key: index,
|
|
37
|
+
title: s.name,
|
|
38
|
+
description: s.description,
|
|
39
|
+
},
|
|
40
|
+
);
|
|
41
|
+
}),
|
|
29
42
|
),
|
|
30
43
|
);
|
|
31
44
|
},
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CommonProps } from '../utils/index.js';
|
|
3
3
|
import type { StepperStepProps } from './StepperStep.js';
|
|
4
|
-
export type WorkflowDiagramStepProps =
|
|
4
|
+
export type WorkflowDiagramStepProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Allows props to be passed for diagram content.
|
|
7
|
+
*/
|
|
8
|
+
contentProps?: React.ComponentProps<'span'>;
|
|
9
|
+
} & Pick<StepperStepProps, 'title' | 'description'> & Omit<CommonProps, 'title'>;
|
|
5
10
|
export declare const WorkflowDiagramStep: (props: WorkflowDiagramStepProps) => React.JSX.Element;
|
|
@@ -11,7 +11,7 @@ const React = tslib_1.__importStar(require('react'));
|
|
|
11
11
|
const index_js_1 = require('../Tooltip/index.js');
|
|
12
12
|
const index_js_2 = require('../utils/index.js');
|
|
13
13
|
const WorkflowDiagramStep = (props) => {
|
|
14
|
-
const { title, description, className, style, ...rest } = props;
|
|
14
|
+
const { title, description, className, style, contentProps, ...rest } = props;
|
|
15
15
|
const stepShape = React.createElement(
|
|
16
16
|
index_js_2.Box,
|
|
17
17
|
{
|
|
@@ -25,7 +25,14 @@ const WorkflowDiagramStep = (props) => {
|
|
|
25
25
|
},
|
|
26
26
|
React.createElement(
|
|
27
27
|
index_js_2.Box,
|
|
28
|
-
{
|
|
28
|
+
{
|
|
29
|
+
as: 'span',
|
|
30
|
+
...contentProps,
|
|
31
|
+
className: (0, classnames_1.default)(
|
|
32
|
+
'iui-workflow-diagram-content',
|
|
33
|
+
contentProps?.className,
|
|
34
|
+
),
|
|
35
|
+
},
|
|
29
36
|
title,
|
|
30
37
|
),
|
|
31
38
|
);
|
|
@@ -19,8 +19,10 @@ const SubRowExpander = (props) => {
|
|
|
19
19
|
: React.createElement(
|
|
20
20
|
index_js_2.IconButton,
|
|
21
21
|
{
|
|
22
|
+
'aria-label': 'Toggle sub row',
|
|
23
|
+
'aria-expanded': cell.row.isExpanded ? 'true' : 'false',
|
|
22
24
|
style: {
|
|
23
|
-
|
|
25
|
+
marginInlineEnd:
|
|
24
26
|
density === 'default' || density === undefined ? 8 : 4,
|
|
25
27
|
},
|
|
26
28
|
className: 'iui-table-row-expander',
|
package/cjs/core/Table/Table.js
CHANGED
|
@@ -45,7 +45,7 @@ const TableCell = (props) => {
|
|
|
45
45
|
}
|
|
46
46
|
const multiplier = 26 + expanderMargin; // 26 = expander width
|
|
47
47
|
return {
|
|
48
|
-
|
|
48
|
+
paddingInlineStart: cellPadding + dynamicMargin * multiplier,
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
const cellElementProps = cell.getCellProps({
|
|
@@ -82,11 +82,9 @@ const TablePaginator = (props) => {
|
|
|
82
82
|
const pageButton = React.useCallback(
|
|
83
83
|
(index, tabIndex = index === focusedIndex ? 0 : -1) =>
|
|
84
84
|
React.createElement(
|
|
85
|
-
index_js_4.
|
|
85
|
+
index_js_4.ButtonBase,
|
|
86
86
|
{
|
|
87
|
-
as: 'button',
|
|
88
87
|
key: index,
|
|
89
|
-
type: 'button',
|
|
90
88
|
className: (0, classnames_1.default)(
|
|
91
89
|
'iui-table-paginator-page-button',
|
|
92
90
|
{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { LabeledInput } from '../../../LabeledInput/index.js';
|
|
2
3
|
import type { PolymorphicForwardRefComponent } from '../../../utils/index.js';
|
|
3
|
-
import {
|
|
4
|
+
import type { DatePickerLocalizedNames } from '../../../DatePicker/DatePicker.js';
|
|
4
5
|
export type DatePickerInputProps = {
|
|
5
6
|
date?: Date;
|
|
6
7
|
onChange: (date?: Date) => void;
|
|
@@ -14,6 +15,10 @@ export type DatePickerInputProps = {
|
|
|
14
15
|
* The 'to' date for the 'from' DatePickerInput or the 'from' date for the 'to' DatePickerInput
|
|
15
16
|
*/
|
|
16
17
|
selectedDate?: Date;
|
|
18
|
+
/**
|
|
19
|
+
* Months, short days and days localized names for DatePicker
|
|
20
|
+
*/
|
|
21
|
+
localizedNames?: DatePickerLocalizedNames;
|
|
17
22
|
} & Omit<React.ComponentProps<typeof LabeledInput>, 'value' | 'onChange' | 'svgIcon' | 'displayStyle'>;
|
|
18
23
|
declare const DatePickerInput: PolymorphicForwardRefComponent<"input", DatePickerInputProps>;
|
|
19
24
|
export default DatePickerInput;
|
|
@@ -7,17 +7,27 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
8
|
const React = tslib_1.__importStar(require('react'));
|
|
9
9
|
const index_js_1 = require('../../../utils/index.js');
|
|
10
|
-
const index_js_2 = require('../../../
|
|
11
|
-
const index_js_3 = require('../../../
|
|
12
|
-
const index_js_4 = require('../../../
|
|
10
|
+
const index_js_2 = require('../../../DatePicker/index.js');
|
|
11
|
+
const index_js_3 = require('../../../InputGrid/index.js');
|
|
12
|
+
const index_js_4 = require('../../../Label/index.js');
|
|
13
|
+
const index_js_5 = require('../../../InputWithDecorations/index.js');
|
|
13
14
|
const DatePickerInput = React.forwardRef((props, forwardedRef) => {
|
|
15
|
+
const uid = (0, index_js_1.useId)();
|
|
14
16
|
const {
|
|
15
17
|
onChange,
|
|
16
18
|
date,
|
|
17
19
|
parseInput,
|
|
18
20
|
formatDate,
|
|
21
|
+
label,
|
|
22
|
+
required,
|
|
23
|
+
disabled,
|
|
19
24
|
isFromOrTo,
|
|
20
25
|
selectedDate,
|
|
26
|
+
wrapperProps,
|
|
27
|
+
labelProps,
|
|
28
|
+
inputWrapperProps,
|
|
29
|
+
id = uid,
|
|
30
|
+
localizedNames,
|
|
21
31
|
...rest
|
|
22
32
|
} = props;
|
|
23
33
|
const isDateDisabled = (date) => {
|
|
@@ -61,11 +71,12 @@ const DatePickerInput = React.forwardRef((props, forwardedRef) => {
|
|
|
61
71
|
return React.createElement(
|
|
62
72
|
index_js_1.Popover,
|
|
63
73
|
{
|
|
64
|
-
content: React.createElement(
|
|
74
|
+
content: React.createElement(index_js_2.DatePicker, {
|
|
65
75
|
date: date,
|
|
66
76
|
onChange: onDateSelected,
|
|
67
77
|
setFocus: true,
|
|
68
78
|
isDateDisabled: isDateDisabled,
|
|
79
|
+
localizedNames: localizedNames,
|
|
69
80
|
}),
|
|
70
81
|
placement: 'bottom',
|
|
71
82
|
visible: isVisible,
|
|
@@ -76,23 +87,40 @@ const DatePickerInput = React.forwardRef((props, forwardedRef) => {
|
|
|
76
87
|
},
|
|
77
88
|
appendTo: 'parent',
|
|
78
89
|
},
|
|
79
|
-
React.createElement(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onClick: close,
|
|
85
|
-
svgIcon: React.createElement(
|
|
86
|
-
index_js_4.IconButton,
|
|
90
|
+
React.createElement(
|
|
91
|
+
index_js_3.InputGrid,
|
|
92
|
+
{ labelPlacement: 'inline', ...wrapperProps },
|
|
93
|
+
React.createElement(
|
|
94
|
+
index_js_4.Label,
|
|
87
95
|
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
as: 'label',
|
|
97
|
+
required: required,
|
|
98
|
+
disabled: disabled,
|
|
99
|
+
htmlFor: id,
|
|
100
|
+
...labelProps,
|
|
91
101
|
},
|
|
92
|
-
|
|
102
|
+
label,
|
|
93
103
|
),
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
React.createElement(
|
|
105
|
+
index_js_5.InputWithDecorations,
|
|
106
|
+
{ ...inputWrapperProps },
|
|
107
|
+
React.createElement(index_js_5.InputWithDecorations.Input, {
|
|
108
|
+
id: id,
|
|
109
|
+
value: inputValue,
|
|
110
|
+
onChange: onInputChange,
|
|
111
|
+
onClick: close,
|
|
112
|
+
required: required,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
ref: forwardedRef,
|
|
115
|
+
...rest,
|
|
116
|
+
}),
|
|
117
|
+
React.createElement(
|
|
118
|
+
index_js_5.InputWithDecorations.Button,
|
|
119
|
+
{ onClick: () => setIsVisible((v) => !v), ref: buttonRef },
|
|
120
|
+
React.createElement(index_js_1.SvgCalendar, null),
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
),
|
|
96
124
|
);
|
|
97
125
|
});
|
|
98
126
|
exports.default = DatePickerInput;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { FilterButtonBarTranslation } from '../FilterButtonBar.js';
|
|
3
3
|
import type { TableFilterProps } from '../types.js';
|
|
4
|
+
import type { DatePickerLocalizedNames } from '../../../DatePicker/DatePicker.js';
|
|
4
5
|
export type DateRangeTranslation = {
|
|
5
6
|
from: string;
|
|
6
7
|
to: string;
|
|
8
|
+
datePicker?: DatePickerLocalizedNames;
|
|
7
9
|
};
|
|
8
10
|
export type DateRangeFilterProps<T extends Record<string, unknown>> = TableFilterProps<T> & {
|
|
9
11
|
formatDate?: (date: Date) => string;
|
|
@@ -110,6 +110,7 @@ const DateRangeFilter = (props) => {
|
|
|
110
110
|
placeholder: placeholder,
|
|
111
111
|
selectedDate: to,
|
|
112
112
|
isFromOrTo: 'from',
|
|
113
|
+
localizedNames: translatedStrings.datePicker,
|
|
113
114
|
}),
|
|
114
115
|
React.createElement(DatePickerInput_js_1.default, {
|
|
115
116
|
label: translatedStrings.to,
|
|
@@ -121,6 +122,7 @@ const DateRangeFilter = (props) => {
|
|
|
121
122
|
placeholder: placeholder,
|
|
122
123
|
selectedDate: from,
|
|
123
124
|
isFromOrTo: 'to',
|
|
125
|
+
localizedNames: translatedStrings.datePicker,
|
|
124
126
|
}),
|
|
125
127
|
React.createElement(FilterButtonBar_js_1.FilterButtonBar, {
|
|
126
128
|
setFilter: () => setFilter([from, to]),
|
package/cjs/core/Tabs/Tab.js
CHANGED
|
@@ -28,9 +28,8 @@ exports.Tab = React.forwardRef((props, forwardedRef) => {
|
|
|
28
28
|
...rest
|
|
29
29
|
} = props;
|
|
30
30
|
return React.createElement(
|
|
31
|
-
index_js_1.
|
|
31
|
+
index_js_1.ButtonBase,
|
|
32
32
|
{
|
|
33
|
-
as: 'button',
|
|
34
33
|
className: (0, classnames_1.default)(
|
|
35
34
|
'iui-tab',
|
|
36
35
|
{ 'iui-active': active },
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
|
+
export type TextareaProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Status of textarea.
|
|
5
|
+
*/
|
|
6
|
+
status?: 'positive' | 'warning' | 'negative';
|
|
7
|
+
};
|
|
2
8
|
/**
|
|
3
9
|
* Basic textarea component
|
|
4
10
|
* @example
|
|
5
11
|
* <Textarea placeholder='This is a textarea' />
|
|
6
12
|
* <Textarea disabled={true} placeholder='This is a disabled textarea' />
|
|
7
13
|
*/
|
|
8
|
-
export declare const Textarea: PolymorphicForwardRefComponent<"textarea",
|
|
14
|
+
export declare const Textarea: PolymorphicForwardRefComponent<"textarea", TextareaProps>;
|
|
9
15
|
export default Textarea;
|
|
@@ -6,25 +6,20 @@ const tslib_1 = require('tslib');
|
|
|
6
6
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
|
-
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
10
9
|
const React = tslib_1.__importStar(require('react'));
|
|
11
|
-
const index_js_1 = require('../
|
|
10
|
+
const index_js_1 = require('../Input/index.js');
|
|
12
11
|
/**
|
|
13
12
|
* Basic textarea component
|
|
14
13
|
* @example
|
|
15
14
|
* <Textarea placeholder='This is a textarea' />
|
|
16
15
|
* <Textarea disabled={true} placeholder='This is a disabled textarea' />
|
|
17
16
|
*/
|
|
18
|
-
exports.Textarea = React.forwardRef((props,
|
|
19
|
-
|
|
20
|
-
const textAreaRef = React.useRef(null);
|
|
21
|
-
const refs = (0, index_js_1.useMergedRefs)(ref, textAreaRef);
|
|
22
|
-
return React.createElement(index_js_1.Box, {
|
|
17
|
+
exports.Textarea = React.forwardRef((props, forwardedRef) => {
|
|
18
|
+
return React.createElement(index_js_1.Input, {
|
|
23
19
|
as: 'textarea',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...rest,
|
|
20
|
+
rows: 3,
|
|
21
|
+
ref: forwardedRef,
|
|
22
|
+
...props,
|
|
28
23
|
});
|
|
29
24
|
});
|
|
30
25
|
exports.default = exports.Textarea;
|
|
@@ -3,5 +3,5 @@ import type { ThemeOptions, ThemeType } from './ThemeProvider.js';
|
|
|
3
3
|
export declare const ThemeContext: React.Context<{
|
|
4
4
|
theme?: ThemeType | undefined;
|
|
5
5
|
themeOptions?: ThemeOptions | undefined;
|
|
6
|
-
|
|
6
|
+
portalContainer?: HTMLElement | null | undefined;
|
|
7
7
|
} | undefined>;
|
|
@@ -44,11 +44,31 @@ type RootProps = {
|
|
|
44
44
|
type ThemeProviderOwnProps = Pick<RootProps, 'theme'> & {
|
|
45
45
|
themeOptions?: RootProps['themeOptions'];
|
|
46
46
|
children: Required<React.ReactNode>;
|
|
47
|
+
/**
|
|
48
|
+
* The element used as the portal for floating elements (Tooltip, Toast, DropdownMenu, Dialog, etc).
|
|
49
|
+
*
|
|
50
|
+
* Defaults to a `<div>` rendered at the end of the ThemeProvider.
|
|
51
|
+
*
|
|
52
|
+
* When passing an element, it is recommended to use state.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* const [myPortal, setMyPortal] = React.useState(null);
|
|
56
|
+
*
|
|
57
|
+
* <div ref={setMyPortal} />
|
|
58
|
+
* <ThemeProvider
|
|
59
|
+
* portalContainer={myPortal}
|
|
60
|
+
* >
|
|
61
|
+
* ...
|
|
62
|
+
* </ThemeProvider>
|
|
63
|
+
*/
|
|
64
|
+
portalContainer?: HTMLElement;
|
|
47
65
|
};
|
|
48
66
|
/**
|
|
49
|
-
* This component provides global
|
|
50
|
-
* that it is wrapping around.
|
|
51
|
-
*
|
|
67
|
+
* This component provides global state and applies theme to the entire tree
|
|
68
|
+
* that it is wrapping around.
|
|
69
|
+
*
|
|
70
|
+
* The `theme` prop defaults to "inherit", which looks upwards for closest ThemeProvider
|
|
71
|
+
* and falls back to "light" theme if one is not found.
|
|
52
72
|
*
|
|
53
73
|
* If you want to theme the entire app, you should use this component at the root. You can also
|
|
54
74
|
* use this component to apply a different theme to only a part of the tree.
|
|
@@ -7,14 +7,17 @@ const tslib_1 = require('tslib');
|
|
|
7
7
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
8
8
|
*--------------------------------------------------------------------------------------------*/
|
|
9
9
|
const React = tslib_1.__importStar(require('react'));
|
|
10
|
+
const ReactDOM = tslib_1.__importStar(require('react-dom'));
|
|
10
11
|
const classnames_1 = tslib_1.__importDefault(require('classnames'));
|
|
11
12
|
const index_js_1 = require('../utils/index.js');
|
|
12
13
|
const ThemeContext_js_1 = require('./ThemeContext.js');
|
|
13
14
|
const Toaster_js_1 = require('../Toast/Toaster.js');
|
|
14
15
|
/**
|
|
15
|
-
* This component provides global
|
|
16
|
-
* that it is wrapping around.
|
|
17
|
-
*
|
|
16
|
+
* This component provides global state and applies theme to the entire tree
|
|
17
|
+
* that it is wrapping around.
|
|
18
|
+
*
|
|
19
|
+
* The `theme` prop defaults to "inherit", which looks upwards for closest ThemeProvider
|
|
20
|
+
* and falls back to "light" theme if one is not found.
|
|
18
21
|
*
|
|
19
22
|
* If you want to theme the entire app, you should use this component at the root. You can also
|
|
20
23
|
* use this component to apply a different theme to only a part of the tree.
|
|
@@ -37,18 +40,22 @@ const Toaster_js_1 = require('../Toast/Toaster.js');
|
|
|
37
40
|
* <App />
|
|
38
41
|
* </ThemeProvider>
|
|
39
42
|
*/
|
|
40
|
-
exports.ThemeProvider = React.forwardRef((props,
|
|
41
|
-
const {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
exports.ThemeProvider = React.forwardRef((props, forwardedRef) => {
|
|
44
|
+
const {
|
|
45
|
+
theme: themeProp = 'inherit',
|
|
46
|
+
children,
|
|
47
|
+
themeOptions,
|
|
48
|
+
portalContainer: portalContainerProp,
|
|
49
|
+
...rest
|
|
50
|
+
} = props;
|
|
51
|
+
const [portalContainer, setPortalContainer] = (0,
|
|
52
|
+
index_js_1.useControlledState)(null, portalContainerProp);
|
|
53
|
+
const [parentTheme, rootRef] = useParentTheme();
|
|
54
|
+
const theme = themeProp === 'inherit' ? parentTheme || 'light' : themeProp;
|
|
55
|
+
const shouldApplyBackground = themeOptions?.applyBackground ?? !parentTheme;
|
|
49
56
|
const contextValue = React.useMemo(
|
|
50
|
-
() => ({ theme, themeOptions,
|
|
51
|
-
[theme, themeOptions],
|
|
57
|
+
() => ({ theme, themeOptions, portalContainer }),
|
|
58
|
+
[theme, themeOptions, portalContainer],
|
|
52
59
|
);
|
|
53
60
|
return React.createElement(
|
|
54
61
|
ThemeContext_js_1.ThemeContext.Provider,
|
|
@@ -59,23 +66,29 @@ exports.ThemeProvider = React.forwardRef((props, ref) => {
|
|
|
59
66
|
theme: theme,
|
|
60
67
|
shouldApplyBackground: shouldApplyBackground,
|
|
61
68
|
themeOptions: themeOptions,
|
|
62
|
-
ref:
|
|
69
|
+
ref: (0, index_js_1.useMergedRefs)(forwardedRef, rootRef),
|
|
63
70
|
...rest,
|
|
64
71
|
},
|
|
65
72
|
React.createElement(
|
|
66
73
|
Toaster_js_1.ToastProvider,
|
|
67
74
|
null,
|
|
68
75
|
children,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
portalContainerProp
|
|
77
|
+
? ReactDOM.createPortal(
|
|
78
|
+
React.createElement(Toaster_js_1.Toaster, null),
|
|
79
|
+
portalContainerProp,
|
|
80
|
+
)
|
|
81
|
+
: React.createElement(
|
|
82
|
+
'div',
|
|
83
|
+
{ ref: setPortalContainer },
|
|
84
|
+
React.createElement(Toaster_js_1.Toaster, null),
|
|
85
|
+
),
|
|
74
86
|
),
|
|
75
87
|
),
|
|
76
88
|
);
|
|
77
89
|
});
|
|
78
90
|
exports.default = exports.ThemeProvider;
|
|
91
|
+
// ----------------------------------------------------------------------------
|
|
79
92
|
const Root = React.forwardRef((props, forwardedRef) => {
|
|
80
93
|
const {
|
|
81
94
|
theme,
|
|
@@ -85,8 +98,6 @@ const Root = React.forwardRef((props, forwardedRef) => {
|
|
|
85
98
|
className,
|
|
86
99
|
...rest
|
|
87
100
|
} = props;
|
|
88
|
-
const ref = React.useRef(null);
|
|
89
|
-
const mergedRefs = (0, index_js_1.useMergedRefs)(ref, forwardedRef);
|
|
90
101
|
const prefersDark = (0, index_js_1.useMediaQuery)(
|
|
91
102
|
'(prefers-color-scheme: dark)',
|
|
92
103
|
);
|
|
@@ -105,9 +116,31 @@ const Root = React.forwardRef((props, forwardedRef) => {
|
|
|
105
116
|
),
|
|
106
117
|
'data-iui-theme': shouldApplyDark ? 'dark' : 'light',
|
|
107
118
|
'data-iui-contrast': shouldApplyHC ? 'high' : 'default',
|
|
108
|
-
ref:
|
|
119
|
+
ref: forwardedRef,
|
|
109
120
|
...rest,
|
|
110
121
|
},
|
|
111
122
|
children,
|
|
112
123
|
);
|
|
113
124
|
});
|
|
125
|
+
// ----------------------------------------------------------------------------
|
|
126
|
+
/**
|
|
127
|
+
* Returns theme from either parent context or by reading the closest
|
|
128
|
+
* data-iui-theme attribute if context is not found.
|
|
129
|
+
*/
|
|
130
|
+
const useParentTheme = () => {
|
|
131
|
+
const parentContext = React.useContext(ThemeContext_js_1.ThemeContext);
|
|
132
|
+
const rootRef = React.useRef(null);
|
|
133
|
+
const [parentThemeState, setParentTheme] = React.useState(
|
|
134
|
+
parentContext?.theme,
|
|
135
|
+
);
|
|
136
|
+
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
137
|
+
setParentTheme(
|
|
138
|
+
(old) =>
|
|
139
|
+
old ||
|
|
140
|
+
rootRef.current?.parentElement
|
|
141
|
+
?.closest('[data-iui-theme]')
|
|
142
|
+
?.getAttribute('data-iui-theme'),
|
|
143
|
+
);
|
|
144
|
+
}, []);
|
|
145
|
+
return [parentContext?.theme ?? parentThemeState, rootRef];
|
|
146
|
+
};
|