@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
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Icon } from '../utils/index.js';
|
|
2
3
|
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
3
4
|
import type { LabeledInputProps } from '../LabeledInput/LabeledInput.js';
|
|
5
|
+
import { InputGrid } from '../InputGrid/InputGrid.js';
|
|
4
6
|
type LabeledTextareaProps = {
|
|
5
7
|
/**
|
|
6
8
|
* Label for the textarea.
|
|
@@ -15,14 +17,22 @@ type LabeledTextareaProps = {
|
|
|
15
17
|
*/
|
|
16
18
|
status?: 'positive' | 'warning' | 'negative';
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* Pass props to wrapper element.
|
|
19
21
|
*/
|
|
20
|
-
|
|
22
|
+
wrapperProps?: React.ComponentProps<typeof InputGrid>;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* Passes properties for label.
|
|
23
25
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
labelProps?: React.ComponentProps<'label'>;
|
|
27
|
+
/**
|
|
28
|
+
* Passes properties for message content.
|
|
29
|
+
*/
|
|
30
|
+
messageContentProps?: React.ComponentPropsWithRef<'div'>;
|
|
31
|
+
/**
|
|
32
|
+
* Passes properties for svgIcon.
|
|
33
|
+
*/
|
|
34
|
+
iconProps?: React.ComponentProps<typeof Icon>;
|
|
35
|
+
} & Pick<LabeledInputProps, 'svgIcon' | 'displayStyle'>;
|
|
26
36
|
/**
|
|
27
37
|
* Textarea wrapper that allows for additional styling and labelling
|
|
28
38
|
* @example
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Icon } from '../utils/index.js';
|
|
7
|
+
import { InputGrid } from '../InputGrid/InputGrid.js';
|
|
8
|
+
import { LabeledInput } from '../LabeledInput/index.js';
|
|
8
9
|
/**
|
|
9
10
|
* Textarea wrapper that allows for additional styling and labelling
|
|
10
11
|
* @example
|
|
@@ -26,49 +27,17 @@ import { Textarea } from '../Textarea/index.js';
|
|
|
26
27
|
* status='negative'
|
|
27
28
|
* />
|
|
28
29
|
*/
|
|
29
|
-
export const LabeledTextarea = React.forwardRef((props,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
displayStyle = 'default',
|
|
41
|
-
iconDisplayStyle = displayStyle === 'default' ? 'block' : 'inline',
|
|
42
|
-
svgIcon,
|
|
43
|
-
required = false,
|
|
44
|
-
id = uid,
|
|
45
|
-
...textareaProps
|
|
46
|
-
} = props;
|
|
47
|
-
const icon = svgIcon ?? (status && StatusIconMap[status]());
|
|
48
|
-
return React.createElement(
|
|
49
|
-
InputContainer,
|
|
50
|
-
{
|
|
51
|
-
label: label,
|
|
52
|
-
disabled: disabled,
|
|
53
|
-
required: required,
|
|
54
|
-
status: status,
|
|
55
|
-
message: message,
|
|
56
|
-
icon: icon,
|
|
57
|
-
isLabelInline: displayStyle === 'inline',
|
|
58
|
-
isIconInline: iconDisplayStyle === 'inline',
|
|
59
|
-
className: className,
|
|
60
|
-
style: style,
|
|
61
|
-
inputId: id,
|
|
62
|
-
},
|
|
63
|
-
React.createElement(Textarea, {
|
|
64
|
-
disabled: disabled,
|
|
65
|
-
className: textareaClassName,
|
|
66
|
-
style: textareaStyle,
|
|
67
|
-
required: required,
|
|
68
|
-
id: id,
|
|
69
|
-
...textareaProps,
|
|
70
|
-
ref: ref,
|
|
71
|
-
}),
|
|
30
|
+
export const LabeledTextarea = React.forwardRef((props, forwardedRef) => {
|
|
31
|
+
return (
|
|
32
|
+
// ref types don't match but it's internal, so ts-ignore is ok here
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
React.createElement(LabeledInput, {
|
|
36
|
+
as: 'textarea',
|
|
37
|
+
rows: 3,
|
|
38
|
+
ref: forwardedRef,
|
|
39
|
+
...props,
|
|
40
|
+
})
|
|
72
41
|
);
|
|
73
42
|
});
|
|
74
43
|
export default LabeledTextarea;
|
package/esm/core/Menu/Menu.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ type MenuProps = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Basic menu component. Can be used for select or dropdown components.
|
|
19
19
|
*/
|
|
20
|
-
export declare const Menu: PolymorphicForwardRefComponent<"
|
|
20
|
+
export declare const Menu: PolymorphicForwardRefComponent<"div", MenuProps>;
|
|
21
21
|
export default Menu;
|
package/esm/core/Menu/Menu.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* Divider between menu items. Should be used inside `Menu`.
|
|
3
4
|
* @example
|
|
@@ -13,5 +14,5 @@
|
|
|
13
14
|
* ]}
|
|
14
15
|
* </Menu>
|
|
15
16
|
*/
|
|
16
|
-
export declare const MenuDivider: import("../utils/props.js").PolymorphicForwardRefComponent<
|
|
17
|
+
export declare const MenuDivider: import("../utils/props.js").PolymorphicForwardRefComponent<NonNullable<keyof JSX.IntrinsicElements>, {}>;
|
|
17
18
|
export default MenuDivider;
|
|
@@ -18,7 +18,7 @@ import { polymorphic } from '../utils/index.js';
|
|
|
18
18
|
* ]}
|
|
19
19
|
* </Menu>
|
|
20
20
|
*/
|
|
21
|
-
export const MenuDivider = polymorphic
|
|
21
|
+
export const MenuDivider = polymorphic('iui-menu-divider', {
|
|
22
22
|
role: 'separator',
|
|
23
23
|
});
|
|
24
24
|
export default MenuDivider;
|
|
@@ -64,5 +64,5 @@ export type MenuItemProps = {
|
|
|
64
64
|
/**
|
|
65
65
|
* Basic menu item component. Should be used inside `Menu` component for each item.
|
|
66
66
|
*/
|
|
67
|
-
export declare const MenuItem: PolymorphicForwardRefComponent<"
|
|
67
|
+
export declare const MenuItem: PolymorphicForwardRefComponent<"div", MenuItemProps>;
|
|
68
68
|
export default MenuItem;
|
|
@@ -26,5 +26,5 @@ type MenuItemSkeletonProps = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Menu item that uses skeletons to indicate loading state.
|
|
28
28
|
*/
|
|
29
|
-
export declare const MenuItemSkeleton: PolymorphicForwardRefComponent<"
|
|
29
|
+
export declare const MenuItemSkeleton: PolymorphicForwardRefComponent<"div", MenuItemSkeletonProps>;
|
|
30
30
|
export default MenuItemSkeleton;
|
|
@@ -24,6 +24,10 @@ type ProgressLinearProps = {
|
|
|
24
24
|
* Status of progress.
|
|
25
25
|
*/
|
|
26
26
|
status?: 'positive' | 'negative';
|
|
27
|
+
/**
|
|
28
|
+
* Pass props to ProgressLinear label group.
|
|
29
|
+
*/
|
|
30
|
+
labelGroupProps?: React.ComponentProps<'div'>;
|
|
27
31
|
};
|
|
28
32
|
/**
|
|
29
33
|
* Shows progress on a linear bar
|
|
@@ -28,6 +28,7 @@ export const ProgressLinear = React.forwardRef((props, forwardedRef) => {
|
|
|
28
28
|
isAnimated = false,
|
|
29
29
|
status,
|
|
30
30
|
className,
|
|
31
|
+
labelGroupProps,
|
|
31
32
|
...rest
|
|
32
33
|
} = props;
|
|
33
34
|
const boundedValue = getBoundedValue(value ?? 100, 0, 100);
|
|
@@ -47,7 +48,14 @@ export const ProgressLinear = React.forwardRef((props, forwardedRef) => {
|
|
|
47
48
|
labels.length > 0 &&
|
|
48
49
|
React.createElement(
|
|
49
50
|
Box,
|
|
50
|
-
{
|
|
51
|
+
{
|
|
52
|
+
as: 'div',
|
|
53
|
+
...labelGroupProps,
|
|
54
|
+
className: cx(
|
|
55
|
+
'iui-progress-indicator-linear-label',
|
|
56
|
+
labelGroupProps?.className,
|
|
57
|
+
),
|
|
58
|
+
},
|
|
51
59
|
labels.map((label, index) =>
|
|
52
60
|
React.createElement('span', { key: index }, label),
|
|
53
61
|
),
|
|
@@ -93,6 +93,10 @@ export type SelectProps<T> = {
|
|
|
93
93
|
* Modify size of select.
|
|
94
94
|
*/
|
|
95
95
|
size?: 'small' | 'large';
|
|
96
|
+
/**
|
|
97
|
+
* Status of select.
|
|
98
|
+
*/
|
|
99
|
+
status?: 'positive' | 'warning' | 'negative';
|
|
96
100
|
/**
|
|
97
101
|
* Custom renderer for an item in the dropdown list. `MenuItem` item props are going to be populated if not provided.
|
|
98
102
|
*/
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
useId,
|
|
12
12
|
AutoclearingHiddenLiveRegion,
|
|
13
13
|
Box,
|
|
14
|
+
SvgCheckmark,
|
|
15
|
+
Icon,
|
|
14
16
|
} from '../utils/index.js';
|
|
15
17
|
import SelectTag from './SelectTag.js';
|
|
16
18
|
import SelectTagContainer from './SelectTagContainer.js';
|
|
@@ -90,6 +92,7 @@ export const Select = (props) => {
|
|
|
90
92
|
popoverProps,
|
|
91
93
|
multiple = false,
|
|
92
94
|
triggerProps,
|
|
95
|
+
status,
|
|
93
96
|
...rest
|
|
94
97
|
} = props;
|
|
95
98
|
const [isOpenState, setIsOpen] = React.useState(false);
|
|
@@ -97,7 +100,6 @@ export const Select = (props) => {
|
|
|
97
100
|
const [minWidth, setMinWidth] = React.useState(0);
|
|
98
101
|
const [liveRegionSelection, setLiveRegionSelection] = React.useState('');
|
|
99
102
|
const selectRef = React.useRef(null);
|
|
100
|
-
const toggleButtonRef = React.useRef(null);
|
|
101
103
|
const onShowHandler = React.useCallback(
|
|
102
104
|
(instance) => {
|
|
103
105
|
setIsOpen(true);
|
|
@@ -148,6 +150,9 @@ export const Select = (props) => {
|
|
|
148
150
|
key: `${label}-${index}`,
|
|
149
151
|
isSelected,
|
|
150
152
|
startIcon: startIcon,
|
|
153
|
+
endIcon: isSelected
|
|
154
|
+
? React.createElement(SvgCheckmark, { 'aria-hidden': true })
|
|
155
|
+
: null,
|
|
151
156
|
onClick: () => {
|
|
152
157
|
if (option.disabled) {
|
|
153
158
|
return;
|
|
@@ -210,8 +215,8 @@ export const Select = (props) => {
|
|
|
210
215
|
role: 'listbox',
|
|
211
216
|
className: cx('iui-scroll', menuClassName),
|
|
212
217
|
style: {
|
|
213
|
-
minWidth,
|
|
214
|
-
|
|
218
|
+
minInlineSize: minWidth,
|
|
219
|
+
maxInlineSize: `min(${minWidth * 2}px, 90vw)`,
|
|
215
220
|
...menuStyle,
|
|
216
221
|
},
|
|
217
222
|
id: `${uid}-menu`,
|
|
@@ -225,10 +230,8 @@ export const Select = (props) => {
|
|
|
225
230
|
onHide: onHideHandler,
|
|
226
231
|
...popoverProps,
|
|
227
232
|
visible: isOpen,
|
|
228
|
-
onClickOutside: (
|
|
229
|
-
|
|
230
|
-
setIsOpen(false);
|
|
231
|
-
}
|
|
233
|
+
onClickOutside: () => {
|
|
234
|
+
setIsOpen(false);
|
|
232
235
|
},
|
|
233
236
|
},
|
|
234
237
|
React.createElement(
|
|
@@ -238,6 +241,7 @@ export const Select = (props) => {
|
|
|
238
241
|
role: 'combobox',
|
|
239
242
|
ref: selectRef,
|
|
240
243
|
'data-iui-size': size,
|
|
244
|
+
'data-iui-status': status,
|
|
241
245
|
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
242
246
|
onKeyDown: (e) => !disabled && onKeyDown(e),
|
|
243
247
|
'aria-disabled': disabled,
|
|
@@ -275,17 +279,14 @@ export const Select = (props) => {
|
|
|
275
279
|
),
|
|
276
280
|
),
|
|
277
281
|
React.createElement(
|
|
278
|
-
|
|
282
|
+
Icon,
|
|
279
283
|
{
|
|
280
284
|
as: 'span',
|
|
281
285
|
'aria-hidden': true,
|
|
282
|
-
ref: toggleButtonRef,
|
|
283
286
|
className: cx('iui-end-icon', {
|
|
284
|
-
'iui-actionable': !disabled,
|
|
285
287
|
'iui-disabled': disabled,
|
|
286
288
|
'iui-open': isOpen,
|
|
287
289
|
}),
|
|
288
|
-
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
289
290
|
},
|
|
290
291
|
React.createElement(SvgCaretDownSmall, null),
|
|
291
292
|
),
|
|
@@ -48,6 +48,22 @@ type SideNavigationProps = {
|
|
|
48
48
|
* @default false
|
|
49
49
|
*/
|
|
50
50
|
isSubmenuOpen?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Passes props for SideNav wrapper.
|
|
53
|
+
*/
|
|
54
|
+
wrapperProps?: React.ComponentProps<'div'>;
|
|
55
|
+
/**
|
|
56
|
+
* Passes props for SideNav content.
|
|
57
|
+
*/
|
|
58
|
+
contentProps?: React.ComponentProps<'div'>;
|
|
59
|
+
/**
|
|
60
|
+
* Passes props for SideNav top.
|
|
61
|
+
*/
|
|
62
|
+
topProps?: React.ComponentProps<'div'>;
|
|
63
|
+
/**
|
|
64
|
+
* Passes props for SideNav bottom.
|
|
65
|
+
*/
|
|
66
|
+
bottomProps?: React.ComponentProps<'div'>;
|
|
51
67
|
};
|
|
52
68
|
/**
|
|
53
69
|
* Left side navigation menu component.
|
|
@@ -31,6 +31,10 @@ export const SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
31
31
|
onExpanderClick,
|
|
32
32
|
submenu,
|
|
33
33
|
isSubmenuOpen = false,
|
|
34
|
+
wrapperProps,
|
|
35
|
+
contentProps,
|
|
36
|
+
topProps,
|
|
37
|
+
bottomProps,
|
|
34
38
|
...rest
|
|
35
39
|
} = props;
|
|
36
40
|
const [_isExpanded, _setIsExpanded] = React.useState(isExpanded);
|
|
@@ -40,6 +44,8 @@ export const SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
40
44
|
const ExpandButton = React.createElement(
|
|
41
45
|
IconButton,
|
|
42
46
|
{
|
|
47
|
+
label: 'Toggle icon labels',
|
|
48
|
+
'aria-expanded': _isExpanded,
|
|
43
49
|
className: 'iui-sidenav-button iui-expand',
|
|
44
50
|
onClick: React.useCallback(() => {
|
|
45
51
|
_setIsExpanded((expanded) => !expanded);
|
|
@@ -51,25 +57,39 @@ export const SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
51
57
|
return React.createElement(
|
|
52
58
|
Box,
|
|
53
59
|
{
|
|
54
|
-
|
|
60
|
+
...wrapperProps,
|
|
61
|
+
className: cx('iui-side-navigation-wrapper', wrapperProps?.className),
|
|
55
62
|
ref: forwardedRef,
|
|
56
|
-
...rest,
|
|
57
63
|
},
|
|
58
64
|
React.createElement(
|
|
59
65
|
Box,
|
|
60
66
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
'iui-
|
|
64
|
-
|
|
67
|
+
as: 'div',
|
|
68
|
+
className: cx(
|
|
69
|
+
'iui-side-navigation',
|
|
70
|
+
{
|
|
71
|
+
'iui-expanded': _isExpanded,
|
|
72
|
+
'iui-collapsed': !_isExpanded,
|
|
73
|
+
},
|
|
74
|
+
className,
|
|
75
|
+
),
|
|
76
|
+
...rest,
|
|
65
77
|
},
|
|
66
78
|
expanderPlacement === 'top' && ExpandButton,
|
|
67
79
|
React.createElement(
|
|
68
80
|
Box,
|
|
69
|
-
{
|
|
81
|
+
{
|
|
82
|
+
as: 'div',
|
|
83
|
+
...contentProps,
|
|
84
|
+
className: cx('iui-sidenav-content', contentProps?.className),
|
|
85
|
+
},
|
|
70
86
|
React.createElement(
|
|
71
87
|
Box,
|
|
72
|
-
{
|
|
88
|
+
{
|
|
89
|
+
as: 'div',
|
|
90
|
+
...topProps,
|
|
91
|
+
className: cx('iui-top', topProps?.className),
|
|
92
|
+
},
|
|
73
93
|
items.map((sidenavButton, index) =>
|
|
74
94
|
!_isExpanded
|
|
75
95
|
? React.createElement(
|
|
@@ -86,7 +106,11 @@ export const SideNavigation = React.forwardRef((props, forwardedRef) => {
|
|
|
86
106
|
),
|
|
87
107
|
React.createElement(
|
|
88
108
|
Box,
|
|
89
|
-
{
|
|
109
|
+
{
|
|
110
|
+
as: 'div',
|
|
111
|
+
...bottomProps,
|
|
112
|
+
className: cx('iui-bottom', bottomProps?.className),
|
|
113
|
+
},
|
|
90
114
|
secondaryItems?.map((sidenavButton, index) =>
|
|
91
115
|
!_isExpanded
|
|
92
116
|
? React.createElement(
|
|
@@ -68,6 +68,30 @@ export type SliderProps = {
|
|
|
68
68
|
* Additional props for container `<div>` that hold the slider rail, thumbs, and tracks.
|
|
69
69
|
*/
|
|
70
70
|
railContainerProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
71
|
+
/**
|
|
72
|
+
* Allows props to be passed for slider-min
|
|
73
|
+
*/
|
|
74
|
+
minProps?: React.ComponentProps<'span'>;
|
|
75
|
+
/**
|
|
76
|
+
* Allows props to be passed for slider-max
|
|
77
|
+
*/
|
|
78
|
+
maxProps?: React.ComponentProps<'span'>;
|
|
79
|
+
/**
|
|
80
|
+
* Allows props to be passed for slider-rail
|
|
81
|
+
*/
|
|
82
|
+
railProps?: React.ComponentProps<'div'>;
|
|
83
|
+
/**
|
|
84
|
+
* Allows props to be passed for slider-track
|
|
85
|
+
*/
|
|
86
|
+
trackProps?: React.ComponentProps<'div'>;
|
|
87
|
+
/**
|
|
88
|
+
* Allows props to be passed for slider-tick
|
|
89
|
+
*/
|
|
90
|
+
tickProps?: React.ComponentProps<'span'>;
|
|
91
|
+
/**
|
|
92
|
+
* Allows props to be passed for slider-ticks
|
|
93
|
+
*/
|
|
94
|
+
ticksProps?: React.ComponentProps<'div'>;
|
|
71
95
|
/**
|
|
72
96
|
* Defines the allowed behavior when moving Thumbs when multiple Thumbs are
|
|
73
97
|
* shown. It controls if a Thumb movement should be limited to only move in
|
|
@@ -79,6 +79,12 @@ export const Slider = React.forwardRef((props, ref) => {
|
|
|
79
79
|
thumbProps,
|
|
80
80
|
className,
|
|
81
81
|
railContainerProps,
|
|
82
|
+
minProps,
|
|
83
|
+
maxProps,
|
|
84
|
+
railProps,
|
|
85
|
+
trackProps,
|
|
86
|
+
tickProps,
|
|
87
|
+
ticksProps,
|
|
82
88
|
orientation = 'horizontal',
|
|
83
89
|
...rest
|
|
84
90
|
} = props;
|
|
@@ -263,18 +269,27 @@ export const Slider = React.forwardRef((props, ref) => {
|
|
|
263
269
|
if (Array.isArray(tickLabels)) {
|
|
264
270
|
return React.createElement(
|
|
265
271
|
Box,
|
|
266
|
-
{
|
|
272
|
+
{
|
|
273
|
+
as: 'div',
|
|
274
|
+
...ticksProps,
|
|
275
|
+
className: cx('iui-slider-ticks', ticksProps?.className),
|
|
276
|
+
},
|
|
267
277
|
tickLabels.map((label, index) =>
|
|
268
278
|
React.createElement(
|
|
269
279
|
Box,
|
|
270
|
-
{
|
|
280
|
+
{
|
|
281
|
+
as: 'span',
|
|
282
|
+
...tickProps,
|
|
283
|
+
key: index,
|
|
284
|
+
className: cx('iui-slider-tick', tickProps?.className),
|
|
285
|
+
},
|
|
271
286
|
label,
|
|
272
287
|
),
|
|
273
288
|
),
|
|
274
289
|
);
|
|
275
290
|
}
|
|
276
291
|
return tickLabels;
|
|
277
|
-
}, [tickLabels]);
|
|
292
|
+
}, [tickLabels, tickProps, ticksProps]);
|
|
278
293
|
const generateTooltipProps = React.useCallback(
|
|
279
294
|
(index, val) => {
|
|
280
295
|
const outProps = tooltipProps ? tooltipProps(index, val, step) : {};
|
|
@@ -302,20 +317,33 @@ export const Slider = React.forwardRef((props, ref) => {
|
|
|
302
317
|
minValueLabel &&
|
|
303
318
|
React.createElement(
|
|
304
319
|
Box,
|
|
305
|
-
{
|
|
320
|
+
{
|
|
321
|
+
as: 'span',
|
|
322
|
+
...minProps,
|
|
323
|
+
className: cx('iui-slider-min', minProps?.className),
|
|
324
|
+
},
|
|
306
325
|
minValueLabel,
|
|
307
326
|
),
|
|
308
327
|
React.createElement(
|
|
309
328
|
Box,
|
|
310
329
|
{
|
|
330
|
+
as: 'div',
|
|
311
331
|
ref: containerRef,
|
|
312
|
-
className: cx('iui-slider-container', {
|
|
313
|
-
'iui-grabbing': undefined !== activeThumbIndex,
|
|
314
|
-
}),
|
|
315
|
-
onPointerDown: handlePointerDownOnSlider,
|
|
316
332
|
...railContainerProps,
|
|
333
|
+
className: cx(
|
|
334
|
+
'iui-slider-container',
|
|
335
|
+
{
|
|
336
|
+
'iui-grabbing': undefined !== activeThumbIndex,
|
|
337
|
+
},
|
|
338
|
+
railContainerProps?.className,
|
|
339
|
+
),
|
|
340
|
+
onPointerDown: handlePointerDownOnSlider,
|
|
317
341
|
},
|
|
318
|
-
React.createElement(Box, {
|
|
342
|
+
React.createElement(Box, {
|
|
343
|
+
as: 'div',
|
|
344
|
+
...railProps,
|
|
345
|
+
className: cx('iui-slider-rail', railProps?.className),
|
|
346
|
+
}),
|
|
319
347
|
currentValues.map((thumbValue, index) => {
|
|
320
348
|
const [minVal, maxVal] = getAllowableThumbRange(index);
|
|
321
349
|
const thisThumbProps = thumbProps?.(index);
|
|
@@ -343,13 +371,18 @@ export const Slider = React.forwardRef((props, ref) => {
|
|
|
343
371
|
sliderMax: max,
|
|
344
372
|
values: currentValues,
|
|
345
373
|
orientation: orientation,
|
|
374
|
+
...trackProps,
|
|
346
375
|
}),
|
|
347
376
|
tickMarkArea,
|
|
348
377
|
),
|
|
349
378
|
maxValueLabel &&
|
|
350
379
|
React.createElement(
|
|
351
380
|
Box,
|
|
352
|
-
{
|
|
381
|
+
{
|
|
382
|
+
as: 'span',
|
|
383
|
+
...maxProps,
|
|
384
|
+
className: cx('iui-slider-max', maxProps?.className),
|
|
385
|
+
},
|
|
353
386
|
maxValueLabel,
|
|
354
387
|
),
|
|
355
388
|
);
|
package/esm/core/Slider/Thumb.js
CHANGED
|
@@ -88,6 +88,7 @@ export const Thumb = (props) => {
|
|
|
88
88
|
{
|
|
89
89
|
placement: 'top',
|
|
90
90
|
autoUpdateOptions: { animationFrame: true },
|
|
91
|
+
ariaStrategy: 'none',
|
|
91
92
|
...tooltipProps,
|
|
92
93
|
},
|
|
93
94
|
React.createElement(Box, {
|
|
@@ -97,8 +98,8 @@ export const Thumb = (props) => {
|
|
|
97
98
|
style: {
|
|
98
99
|
...style,
|
|
99
100
|
...(orientation === 'horizontal'
|
|
100
|
-
? {
|
|
101
|
-
: {
|
|
101
|
+
? { insetInlineStart: `${lowPercent}%` }
|
|
102
|
+
: { insetBlockEnd: `${lowPercent}%` }),
|
|
102
103
|
},
|
|
103
104
|
className: cx('iui-slider-thumb', { 'iui-active': isActive }, className),
|
|
104
105
|
role: 'slider',
|
|
@@ -6,7 +6,7 @@ export type TrackProps = {
|
|
|
6
6
|
sliderMax: number;
|
|
7
7
|
values: number[];
|
|
8
8
|
orientation: SliderProps['orientation'];
|
|
9
|
-
}
|
|
9
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
10
10
|
/**
|
|
11
11
|
* Track displays color segments above Rail. Which, if any, segments that are
|
|
12
12
|
* colorized is based on `trackDisplayMode`.
|
package/esm/core/Slider/Track.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import cx from 'classnames';
|
|
6
7
|
import { Box } from '../utils/index.js';
|
|
7
8
|
function shouldDisplaySegment(segmentIndex, mode) {
|
|
8
9
|
if ('odd-segments' === mode && 0 === (segmentIndex + 1) % 2) {
|
|
@@ -37,7 +38,14 @@ function generateSegments(values, min, max) {
|
|
|
37
38
|
* colorized is based on `trackDisplayMode`.
|
|
38
39
|
*/
|
|
39
40
|
export const Track = (props) => {
|
|
40
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
className,
|
|
43
|
+
trackDisplayMode,
|
|
44
|
+
sliderMin,
|
|
45
|
+
sliderMax,
|
|
46
|
+
values,
|
|
47
|
+
orientation,
|
|
48
|
+
} = props;
|
|
41
49
|
const [segments, setSegments] = React.useState(() =>
|
|
42
50
|
generateSegments(values, sliderMin, sliderMax),
|
|
43
51
|
);
|
|
@@ -63,16 +71,16 @@ export const Track = (props) => {
|
|
|
63
71
|
{ key: index },
|
|
64
72
|
shouldDisplaySegment(index, trackDisplayMode)
|
|
65
73
|
? React.createElement(Box, {
|
|
66
|
-
className: 'iui-slider-track',
|
|
74
|
+
className: cx('iui-slider-track', className),
|
|
67
75
|
style: {
|
|
68
76
|
...(orientation === 'horizontal'
|
|
69
77
|
? {
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
insetInlineStart: `${lowPercent}%`,
|
|
79
|
+
insetInlineEnd: `${highPercent}%`,
|
|
72
80
|
}
|
|
73
81
|
: {
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
insetBlockStart: `${highPercent}%`,
|
|
83
|
+
insetBlockEnd: `${lowPercent}%`,
|
|
76
84
|
}),
|
|
77
85
|
},
|
|
78
86
|
})
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Icon } from '../utils/index.js';
|
|
3
|
+
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
|
|
2
4
|
type StatusMessageProps = {
|
|
3
5
|
/**
|
|
4
6
|
* Custom icon to be displayed at the beginning.
|
|
@@ -13,12 +15,20 @@ type StatusMessageProps = {
|
|
|
13
15
|
* Status of the message.
|
|
14
16
|
*/
|
|
15
17
|
status?: 'positive' | 'warning' | 'negative';
|
|
18
|
+
/**
|
|
19
|
+
* Passes props to icon
|
|
20
|
+
*/
|
|
21
|
+
iconProps?: React.ComponentProps<typeof Icon>;
|
|
22
|
+
/**
|
|
23
|
+
* Passes props to content
|
|
24
|
+
*/
|
|
25
|
+
contentProps?: React.ComponentPropsWithRef<'div'>;
|
|
16
26
|
};
|
|
17
27
|
/**
|
|
18
|
-
* Component to display icon and text below the
|
|
28
|
+
* Component to display icon and text below the form field.
|
|
19
29
|
* @example
|
|
20
30
|
* <StatusMessage>This is the text</StatusMessage>
|
|
21
31
|
* <StatusMessage startIcon={<SvgStar />}>This is the text</StatusMessage>
|
|
22
32
|
*/
|
|
23
|
-
export declare const StatusMessage:
|
|
33
|
+
export declare const StatusMessage: PolymorphicForwardRefComponent<"div", StatusMessageProps>;
|
|
24
34
|
export default StatusMessage;
|