@carbon/react 1.70.0 → 1.71.0
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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +972 -947
- package/es/components/AILabel/index.js +15 -15
- package/es/components/Checkbox/Checkbox.d.ts +5 -0
- package/es/components/Checkbox/Checkbox.js +16 -7
- package/es/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +16 -7
- package/es/components/CodeSnippet/CodeSnippet.d.ts +5 -2
- package/es/components/CodeSnippet/CodeSnippet.js +40 -1
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +19 -22
- package/es/components/ComboButton/index.js +40 -1
- package/es/components/ComposedModal/ComposedModal.d.ts +5 -0
- package/es/components/ComposedModal/ComposedModal.js +16 -10
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +2 -2
- package/es/components/ContentSwitcher/ContentSwitcher.js +1 -1
- package/es/components/Copy/Copy.d.ts +5 -2
- package/es/components/Copy/Copy.js +40 -1
- package/es/components/CopyButton/CopyButton.d.ts +5 -2
- package/es/components/CopyButton/CopyButton.js +40 -1
- package/es/components/DataTable/TableSelectRow.js +14 -6
- package/es/components/DataTable/TableToolbarSearch.js +1 -1
- package/es/components/DataTable/stories/examples/TableToolbarFilter.d.ts +1 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/es/components/DatePickerInput/DatePickerInput.d.ts +6 -1
- package/es/components/DatePickerInput/DatePickerInput.js +16 -10
- package/es/components/Dropdown/Dropdown.d.ts +5 -0
- package/es/components/Dropdown/Dropdown.js +132 -92
- package/es/components/FeatureFlags/index.js +1 -2
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -0
- package/es/components/FluidSelect/FluidSelect.d.ts +4 -0
- package/es/components/FluidSelect/FluidSelect.js +5 -1
- package/es/components/FluidTextArea/FluidTextArea.d.ts +4 -0
- package/es/components/FluidTextArea/FluidTextArea.js +5 -1
- package/es/components/FluidTextInput/FluidPasswordInput.d.ts +4 -0
- package/es/components/FluidTextInput/FluidPasswordInput.js +5 -1
- package/es/components/FluidTextInput/FluidTextInput.d.ts +4 -0
- package/es/components/FluidTextInput/FluidTextInput.js +5 -1
- package/es/components/FluidTimePicker/FluidTimePicker.d.ts +4 -0
- package/es/components/FluidTimePicker/FluidTimePicker.js +23 -7
- package/es/components/IconButton/index.d.ts +4 -1
- package/es/components/IconButton/index.js +40 -1
- package/es/components/InlineCheckbox/InlineCheckbox.d.ts +50 -0
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -6
- package/es/components/InlineCheckbox/index.d.ts +9 -0
- package/es/components/LayoutDirection/LayoutDirection.d.ts +44 -0
- package/es/components/LayoutDirection/LayoutDirectionContext.d.ts +10 -0
- package/es/components/LayoutDirection/useLayoutDirection.d.ts +12 -0
- package/es/components/Menu/MenuItem.js +0 -3
- package/es/components/Modal/Modal.d.ts +5 -0
- package/es/components/Modal/Modal.js +16 -10
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -2
- package/es/components/MultiSelect/MultiSelect.js +1 -1
- package/es/components/Notification/Notification.d.ts +9 -2
- package/es/components/Notification/Notification.js +16 -2
- package/es/components/NumberInput/NumberInput.d.ts +5 -0
- package/es/components/NumberInput/NumberInput.js +17 -9
- package/es/components/OverflowMenu/next/index.js +40 -1
- package/es/components/Pagination/Pagination.js +1 -1
- package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/es/components/PaginationNav/PaginationNav.js +22 -5
- package/es/components/RadioButton/RadioButton.d.ts +5 -0
- package/es/components/RadioButton/RadioButton.js +16 -7
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +5 -0
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -7
- package/es/components/RadioTile/RadioTile.d.ts +5 -0
- package/es/components/RadioTile/RadioTile.js +17 -8
- package/es/components/Tabs/Tabs.js +46 -29
- package/es/components/Tag/DismissibleTag.d.ts +11 -2
- package/es/components/Tag/DismissibleTag.js +13 -5
- package/es/components/Tag/Tag.d.ts +5 -0
- package/es/components/Tag/Tag.js +14 -7
- package/es/components/TextArea/TextArea.d.ts +5 -0
- package/es/components/TextArea/TextArea.js +15 -7
- package/es/components/TextInput/TextInput.d.ts +5 -0
- package/es/components/TextInput/TextInput.js +15 -7
- package/es/components/Tile/Tile.d.ts +21 -1
- package/es/components/Tile/Tile.js +68 -48
- package/es/components/UIShell/SideNavMenuItem.d.ts +5 -1
- package/es/components/UIShell/SideNavMenuItem.js +7 -2
- package/lib/components/AILabel/index.js +15 -15
- package/lib/components/Checkbox/Checkbox.d.ts +5 -0
- package/lib/components/Checkbox/Checkbox.js +16 -7
- package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -7
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +5 -2
- package/lib/components/CodeSnippet/CodeSnippet.js +40 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +19 -22
- package/lib/components/ComboButton/index.js +40 -1
- package/lib/components/ComposedModal/ComposedModal.d.ts +5 -0
- package/lib/components/ComposedModal/ComposedModal.js +16 -10
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +2 -2
- package/lib/components/ContentSwitcher/ContentSwitcher.js +1 -1
- package/lib/components/Copy/Copy.d.ts +5 -2
- package/lib/components/Copy/Copy.js +40 -1
- package/lib/components/CopyButton/CopyButton.d.ts +5 -2
- package/lib/components/CopyButton/CopyButton.js +40 -1
- package/lib/components/DataTable/TableSelectRow.js +14 -6
- package/lib/components/DataTable/TableToolbarSearch.js +1 -1
- package/lib/components/DataTable/stories/examples/TableToolbarFilter.d.ts +1 -1
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +6 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +16 -10
- package/lib/components/Dropdown/Dropdown.d.ts +5 -0
- package/lib/components/Dropdown/Dropdown.js +131 -91
- package/lib/components/FeatureFlags/index.js +1 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -0
- package/lib/components/FluidSelect/FluidSelect.d.ts +4 -0
- package/lib/components/FluidSelect/FluidSelect.js +5 -1
- package/lib/components/FluidTextArea/FluidTextArea.d.ts +4 -0
- package/lib/components/FluidTextArea/FluidTextArea.js +5 -1
- package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +4 -0
- package/lib/components/FluidTextInput/FluidPasswordInput.js +5 -1
- package/lib/components/FluidTextInput/FluidTextInput.d.ts +4 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +5 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.d.ts +4 -0
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -7
- package/lib/components/IconButton/index.d.ts +4 -1
- package/lib/components/IconButton/index.js +40 -1
- package/lib/components/InlineCheckbox/InlineCheckbox.d.ts +50 -0
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -6
- package/lib/components/InlineCheckbox/index.d.ts +9 -0
- package/lib/components/LayoutDirection/LayoutDirection.d.ts +44 -0
- package/lib/components/LayoutDirection/LayoutDirectionContext.d.ts +10 -0
- package/lib/components/LayoutDirection/useLayoutDirection.d.ts +12 -0
- package/lib/components/Menu/MenuItem.js +0 -3
- package/lib/components/Modal/Modal.d.ts +5 -0
- package/lib/components/Modal/Modal.js +16 -10
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -2
- package/lib/components/MultiSelect/MultiSelect.js +1 -1
- package/lib/components/Notification/Notification.d.ts +9 -2
- package/lib/components/Notification/Notification.js +16 -2
- package/lib/components/NumberInput/NumberInput.d.ts +5 -0
- package/lib/components/NumberInput/NumberInput.js +17 -9
- package/lib/components/OverflowMenu/next/index.js +40 -1
- package/lib/components/Pagination/Pagination.js +1 -1
- package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/lib/components/PaginationNav/PaginationNav.js +22 -5
- package/lib/components/RadioButton/RadioButton.d.ts +5 -0
- package/lib/components/RadioButton/RadioButton.js +16 -7
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +5 -0
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +16 -7
- package/lib/components/RadioTile/RadioTile.d.ts +5 -0
- package/lib/components/RadioTile/RadioTile.js +17 -8
- package/lib/components/Tabs/Tabs.js +46 -29
- package/lib/components/Tag/DismissibleTag.d.ts +11 -2
- package/lib/components/Tag/DismissibleTag.js +13 -5
- package/lib/components/Tag/Tag.d.ts +5 -0
- package/lib/components/Tag/Tag.js +14 -7
- package/lib/components/TextArea/TextArea.d.ts +5 -0
- package/lib/components/TextArea/TextArea.js +15 -7
- package/lib/components/TextInput/TextInput.d.ts +5 -0
- package/lib/components/TextInput/TextInput.js +15 -7
- package/lib/components/Tile/Tile.d.ts +21 -1
- package/lib/components/Tile/Tile.js +67 -47
- package/lib/components/UIShell/SideNavMenuItem.d.ts +5 -1
- package/lib/components/UIShell/SideNavMenuItem.js +7 -2
- package/package.json +5 -5
|
@@ -31,8 +31,8 @@ const AILabelContent = /*#__PURE__*/React__default.forwardRef(function AILabelCo
|
|
|
31
31
|
item.type?.displayName === 'AILabelActions';
|
|
32
32
|
});
|
|
33
33
|
const aiLabelContentClasses = cx(className, {
|
|
34
|
-
[`${prefix}--
|
|
35
|
-
[`${prefix}--
|
|
34
|
+
[`${prefix}--ai-label-content`]: true,
|
|
35
|
+
[`${prefix}--ai-label-content--with-actions`]: hasAILabelActions
|
|
36
36
|
});
|
|
37
37
|
return /*#__PURE__*/React__default.createElement(ToggletipContent, {
|
|
38
38
|
className: aiLabelContentClasses
|
|
@@ -41,11 +41,11 @@ const AILabelContent = /*#__PURE__*/React__default.forwardRef(function AILabelCo
|
|
|
41
41
|
AILabelContent.displayName = 'AILabelContent';
|
|
42
42
|
AILabelContent.propTypes = {
|
|
43
43
|
/**
|
|
44
|
-
* Specify the content you want rendered inside the
|
|
44
|
+
* Specify the content you want rendered inside the AILabel ToggleTip
|
|
45
45
|
*/
|
|
46
46
|
children: PropTypes.node,
|
|
47
47
|
/**
|
|
48
|
-
* Specify an optional className to be added to the
|
|
48
|
+
* Specify an optional className to be added to the AILabel callout
|
|
49
49
|
*/
|
|
50
50
|
className: PropTypes.string
|
|
51
51
|
};
|
|
@@ -57,7 +57,7 @@ const AILabelActions = /*#__PURE__*/React__default.forwardRef(function AILabelAc
|
|
|
57
57
|
} = _ref2;
|
|
58
58
|
const prefix = usePrefix();
|
|
59
59
|
const aiLabelActionsClasses = cx(className, {
|
|
60
|
-
[`${prefix}--
|
|
60
|
+
[`${prefix}--ai-label-actions`]: true
|
|
61
61
|
});
|
|
62
62
|
return /*#__PURE__*/React__default.createElement(ToggletipActions, {
|
|
63
63
|
className: aiLabelActionsClasses
|
|
@@ -66,11 +66,11 @@ const AILabelActions = /*#__PURE__*/React__default.forwardRef(function AILabelAc
|
|
|
66
66
|
AILabelActions.displayName = 'AILabelActions';
|
|
67
67
|
AILabelActions.propTypes = {
|
|
68
68
|
/**
|
|
69
|
-
* Specify the content you want rendered inside the
|
|
69
|
+
* Specify the content you want rendered inside the AILabel callout toolbar
|
|
70
70
|
*/
|
|
71
71
|
children: PropTypes.node,
|
|
72
72
|
/**
|
|
73
|
-
* Specify an optional className to be added to the
|
|
73
|
+
* Specify an optional className to be added to the AILabel toolbar
|
|
74
74
|
*/
|
|
75
75
|
className: PropTypes.string
|
|
76
76
|
};
|
|
@@ -104,14 +104,14 @@ const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, r
|
|
|
104
104
|
const prefix = usePrefix();
|
|
105
105
|
const id = useId('AILabel');
|
|
106
106
|
const aiLabelClasses = cx(className, {
|
|
107
|
-
[`${prefix}--
|
|
108
|
-
[`${prefix}--
|
|
107
|
+
[`${prefix}--ai-label`]: true,
|
|
108
|
+
[`${prefix}--ai-label--revert`]: revertActive
|
|
109
109
|
});
|
|
110
110
|
const aiLabelButtonClasses = cx({
|
|
111
|
-
[`${prefix}--
|
|
112
|
-
[`${prefix}--
|
|
113
|
-
[`${prefix}--
|
|
114
|
-
[`${prefix}--
|
|
111
|
+
[`${prefix}--ai-label__button`]: true,
|
|
112
|
+
[`${prefix}--ai-label__button--${size}`]: size,
|
|
113
|
+
[`${prefix}--ai-label__button--${kind}`]: kind,
|
|
114
|
+
[`${prefix}--ai-label__button--inline-with-content`]: kind === 'inline' && (aiTextLabel || textLabel)
|
|
115
115
|
});
|
|
116
116
|
const handleOnRevertClick = evt => {
|
|
117
117
|
if (onRevertClick) {
|
|
@@ -135,9 +135,9 @@ const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, r
|
|
|
135
135
|
className: aiLabelButtonClasses,
|
|
136
136
|
label: ariaLabelText
|
|
137
137
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
138
|
-
className: `${prefix}--
|
|
138
|
+
className: `${prefix}--ai-label__text`
|
|
139
139
|
}, aiText), kind === 'inline' && (aiTextLabel || textLabel) && /*#__PURE__*/React__default.createElement("span", {
|
|
140
|
-
className: `${prefix}--
|
|
140
|
+
className: `${prefix}--ai-label__additional-text`
|
|
141
141
|
}, aiTextLabel || textLabel)), children));
|
|
142
142
|
});
|
|
143
143
|
AILabel.displayName = 'AILabel';
|
|
@@ -16,6 +16,10 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
16
16
|
* exposing to the user
|
|
17
17
|
*/
|
|
18
18
|
labelText: NonNullable<ReactNode>;
|
|
19
|
+
/**
|
|
20
|
+
* **Experimental**: Provide a `decorator` component to be rendered inside the `Checkbox` component
|
|
21
|
+
*/
|
|
22
|
+
decorator?: ReactNode;
|
|
19
23
|
/**
|
|
20
24
|
* Specify whether the underlying input should be checked by default
|
|
21
25
|
*/
|
|
@@ -45,6 +49,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
45
49
|
*/
|
|
46
50
|
invalidText?: ReactNode;
|
|
47
51
|
/**
|
|
52
|
+
* @deprecated please use decorator instead.
|
|
48
53
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
49
54
|
*/
|
|
50
55
|
slug?: ReactNode;
|
|
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import '../Text/index.js';
|
|
13
|
+
import deprecate from '../../prop-types/deprecate.js';
|
|
13
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
15
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
15
16
|
import { useId } from '../../internal/useId.js';
|
|
@@ -19,6 +20,7 @@ import { Text } from '../Text/Text.js';
|
|
|
19
20
|
const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
20
21
|
let {
|
|
21
22
|
className,
|
|
23
|
+
decorator,
|
|
22
24
|
helperText,
|
|
23
25
|
id,
|
|
24
26
|
labelText,
|
|
@@ -48,15 +50,16 @@ const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
48
50
|
[`${prefix}--checkbox-wrapper--readonly`]: readOnly,
|
|
49
51
|
[`${prefix}--checkbox-wrapper--invalid`]: !readOnly && invalid,
|
|
50
52
|
[`${prefix}--checkbox-wrapper--warning`]: showWarning,
|
|
51
|
-
[`${prefix}--checkbox-wrapper--slug`]: slug
|
|
53
|
+
[`${prefix}--checkbox-wrapper--slug`]: slug,
|
|
54
|
+
[`${prefix}--checkbox-wrapper--decorator`]: decorator
|
|
52
55
|
});
|
|
53
56
|
const innerLabelClasses = cx(`${prefix}--checkbox-label-text`, {
|
|
54
57
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
55
58
|
});
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
58
|
-
const size =
|
|
59
|
-
|
|
59
|
+
let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
|
|
60
|
+
if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
|
|
61
|
+
const size = normalizedDecorator.props?.['kind'] === 'inline' ? 'md' : 'mini';
|
|
62
|
+
normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
|
|
60
63
|
size
|
|
61
64
|
});
|
|
62
65
|
}
|
|
@@ -105,7 +108,9 @@ const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
105
108
|
title: title
|
|
106
109
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
107
110
|
className: innerLabelClasses
|
|
108
|
-
}, labelText,
|
|
111
|
+
}, labelText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
|
|
112
|
+
className: `${prefix}--checkbox-wrapper-inner--decorator`
|
|
113
|
+
}, normalizedDecorator) : '')), /*#__PURE__*/React__default.createElement("div", {
|
|
109
114
|
className: `${prefix}--checkbox__validation-msg`
|
|
110
115
|
}, !readOnly && invalid && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
111
116
|
className: `${prefix}--checkbox__invalid-icon`
|
|
@@ -126,6 +131,10 @@ Checkbox.propTypes = {
|
|
|
126
131
|
* Specify an optional className to be applied to the <label> node
|
|
127
132
|
*/
|
|
128
133
|
className: PropTypes.string,
|
|
134
|
+
/**
|
|
135
|
+
* **Experimental**: Provide a decorator component to be rendered inside the `Checkbox` component
|
|
136
|
+
*/
|
|
137
|
+
decorator: PropTypes.node,
|
|
129
138
|
/**
|
|
130
139
|
* Specify whether the underlying input should be checked by default
|
|
131
140
|
*/
|
|
@@ -176,7 +185,7 @@ Checkbox.propTypes = {
|
|
|
176
185
|
/**
|
|
177
186
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
178
187
|
*/
|
|
179
|
-
slug: PropTypes.node,
|
|
188
|
+
slug: deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
180
189
|
/**
|
|
181
190
|
* Specify a title for the <label> node for the Checkbox
|
|
182
191
|
*/
|
|
@@ -8,6 +8,7 @@ import React, { ReactNode } from 'react';
|
|
|
8
8
|
export interface CheckboxGroupProps {
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
className?: string;
|
|
11
|
+
decorator?: ReactNode;
|
|
11
12
|
helperText?: ReactNode;
|
|
12
13
|
invalid?: boolean;
|
|
13
14
|
invalidText?: ReactNode;
|
|
@@ -15,6 +16,10 @@ export interface CheckboxGroupProps {
|
|
|
15
16
|
orientation?: 'horizontal' | 'vertical';
|
|
16
17
|
legendText: ReactNode;
|
|
17
18
|
readOnly?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* * @deprecated please use decorator instead.
|
|
21
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
22
|
+
*/
|
|
18
23
|
slug?: ReactNode;
|
|
19
24
|
warn?: boolean;
|
|
20
25
|
warnText?: ReactNode;
|
|
@@ -9,6 +9,7 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
+
import deprecate from '../../prop-types/deprecate.js';
|
|
12
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
14
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
14
15
|
import { useId } from '../../internal/useId.js';
|
|
@@ -17,6 +18,7 @@ const CheckboxGroup = _ref => {
|
|
|
17
18
|
let {
|
|
18
19
|
children,
|
|
19
20
|
className,
|
|
21
|
+
decorator,
|
|
20
22
|
helperText,
|
|
21
23
|
invalid,
|
|
22
24
|
invalidText,
|
|
@@ -43,13 +45,14 @@ const CheckboxGroup = _ref => {
|
|
|
43
45
|
[`${prefix}--checkbox-group--readonly`]: readOnly,
|
|
44
46
|
[`${prefix}--checkbox-group--invalid`]: !readOnly && invalid,
|
|
45
47
|
[`${prefix}--checkbox-group--warning`]: showWarning,
|
|
46
|
-
[`${prefix}--checkbox-group--slug`]: slug
|
|
48
|
+
[`${prefix}--checkbox-group--slug`]: slug,
|
|
49
|
+
[`${prefix}--checkbox-group--decorator`]: decorator
|
|
47
50
|
});
|
|
48
51
|
|
|
49
|
-
//
|
|
50
|
-
let
|
|
51
|
-
if (
|
|
52
|
-
|
|
52
|
+
// AILabel always size `mini`
|
|
53
|
+
let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
|
|
54
|
+
if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
|
|
55
|
+
normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
|
|
53
56
|
size: 'mini',
|
|
54
57
|
kind: 'default'
|
|
55
58
|
});
|
|
@@ -63,7 +66,9 @@ const CheckboxGroup = _ref => {
|
|
|
63
66
|
}, rest), /*#__PURE__*/React__default.createElement("legend", {
|
|
64
67
|
className: `${prefix}--label`,
|
|
65
68
|
id: legendId || rest['aria-labelledby']
|
|
66
|
-
}, legendText,
|
|
69
|
+
}, legendText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
|
|
70
|
+
className: `${prefix}--checkbox-group-inner--decorator`
|
|
71
|
+
}, normalizedDecorator) : ''), children, /*#__PURE__*/React__default.createElement("div", {
|
|
67
72
|
className: `${prefix}--checkbox-group__validation-msg`
|
|
68
73
|
}, !readOnly && invalid && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
69
74
|
className: `${prefix}--checkbox__invalid-icon`
|
|
@@ -84,6 +89,10 @@ CheckboxGroup.propTypes = {
|
|
|
84
89
|
* Provide a custom className to be applied to the containing <fieldset> node
|
|
85
90
|
*/
|
|
86
91
|
className: PropTypes.string,
|
|
92
|
+
/**
|
|
93
|
+
* **Experimental**: Provide a decorator component to be rendered inside the `CheckboxGroup` component
|
|
94
|
+
*/
|
|
95
|
+
decorator: PropTypes.node,
|
|
87
96
|
/**
|
|
88
97
|
* Provide text for the form group for additional help
|
|
89
98
|
*/
|
|
@@ -116,7 +125,7 @@ CheckboxGroup.propTypes = {
|
|
|
116
125
|
/**
|
|
117
126
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `CheckboxGroup` component
|
|
118
127
|
*/
|
|
119
|
-
slug: PropTypes.node,
|
|
128
|
+
slug: deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
120
129
|
/**
|
|
121
130
|
* Specify whether the form group is currently in warning state
|
|
122
131
|
*/
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { PropsWithChildren } from 'react';
|
|
9
|
+
export type DeprecatedCodeSnippetAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
|
|
10
|
+
export type NewCodeSnippetAlignmnet = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
|
|
11
|
+
export type CodeSnippetAlignment = DeprecatedCodeSnippetAlignment | NewCodeSnippetAlignmnet;
|
|
9
12
|
export interface CodeSnippetProps {
|
|
10
13
|
/**
|
|
11
14
|
* Specify how the trigger should align with the tooltip
|
|
12
15
|
*/
|
|
13
|
-
align?:
|
|
16
|
+
align?: CodeSnippetAlignment;
|
|
14
17
|
/**
|
|
15
18
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
16
19
|
*/
|
|
@@ -106,7 +109,7 @@ declare namespace CodeSnippet {
|
|
|
106
109
|
/**
|
|
107
110
|
* Specify how the trigger should align with the tooltip
|
|
108
111
|
*/
|
|
109
|
-
align:
|
|
112
|
+
align: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
|
|
110
113
|
/**
|
|
111
114
|
* Specify a label to be read by screen readers on the containing textbox
|
|
112
115
|
* node
|
|
@@ -19,12 +19,26 @@ import uniqueId from '../../tools/uniqueId.js';
|
|
|
19
19
|
import copy from 'copy-to-clipboard';
|
|
20
20
|
import deprecate from '../../prop-types/deprecate.js';
|
|
21
21
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
22
|
+
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
22
23
|
|
|
23
24
|
const rowHeightInPixels = 16;
|
|
24
25
|
const defaultMaxCollapsedNumberOfRows = 15;
|
|
25
26
|
const defaultMaxExpandedNumberOfRows = 0;
|
|
26
27
|
const defaultMinCollapsedNumberOfRows = 3;
|
|
27
28
|
const defaultMinExpandedNumberOfRows = 16;
|
|
29
|
+
const propMappingFunction = deprecatedValue => {
|
|
30
|
+
const mapping = {
|
|
31
|
+
'top-left': 'top-start',
|
|
32
|
+
'top-right': 'top-end',
|
|
33
|
+
'bottom-left': 'bottom-start',
|
|
34
|
+
'bottom-right': 'bottom-end',
|
|
35
|
+
'left-bottom': 'left-end',
|
|
36
|
+
'left-top': 'left-start',
|
|
37
|
+
'right-bottom': 'right-end',
|
|
38
|
+
'right-top': 'right-start'
|
|
39
|
+
};
|
|
40
|
+
return mapping[deprecatedValue];
|
|
41
|
+
};
|
|
28
42
|
function CodeSnippet(_ref) {
|
|
29
43
|
let {
|
|
30
44
|
align = 'bottom',
|
|
@@ -232,7 +246,32 @@ CodeSnippet.propTypes = {
|
|
|
232
246
|
/**
|
|
233
247
|
* Specify how the trigger should align with the tooltip
|
|
234
248
|
*/
|
|
235
|
-
align: PropTypes.oneOf(['top', 'top-left',
|
|
249
|
+
align: deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
250
|
+
// deprecated use top-start instead
|
|
251
|
+
'top-right',
|
|
252
|
+
// deprecated use top-end instead
|
|
253
|
+
|
|
254
|
+
'bottom', 'bottom-left',
|
|
255
|
+
// deprecated use bottom-start instead
|
|
256
|
+
'bottom-right',
|
|
257
|
+
// deprecated use bottom-end instead
|
|
258
|
+
|
|
259
|
+
'left', 'left-bottom',
|
|
260
|
+
// deprecated use left-end instead
|
|
261
|
+
'left-top',
|
|
262
|
+
// deprecated use left-start instead
|
|
263
|
+
|
|
264
|
+
'right', 'right-bottom',
|
|
265
|
+
// deprecated use right-end instead
|
|
266
|
+
'right-top',
|
|
267
|
+
// deprecated use right-start instead
|
|
268
|
+
|
|
269
|
+
// new values to match floating-ui
|
|
270
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
271
|
+
//allowed prop values
|
|
272
|
+
['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
273
|
+
//optional mapper function
|
|
274
|
+
propMappingFunction),
|
|
236
275
|
/**
|
|
237
276
|
* Specify a label to be read by screen readers on the containing textbox
|
|
238
277
|
* node
|
|
@@ -226,7 +226,6 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
226
226
|
selectedItem: selectedItemProp,
|
|
227
227
|
prevSelectedItem: prevSelectedItemProp.current
|
|
228
228
|
});
|
|
229
|
-
|
|
230
229
|
// selectedItem has been updated externally, need to update state and call onChange
|
|
231
230
|
if (inputValue !== currentInputValue) {
|
|
232
231
|
setInputValue(currentInputValue);
|
|
@@ -435,30 +434,12 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
435
434
|
} = _ref4;
|
|
436
435
|
const normalizedInput = inputValue || '';
|
|
437
436
|
setInputValue(normalizedInput);
|
|
438
|
-
if (selectedItemProp && !inputValue) {
|
|
439
|
-
// ensure onChange is called when selectedItem is cleared
|
|
440
|
-
onChange({
|
|
441
|
-
selectedItem,
|
|
442
|
-
inputValue: normalizedInput
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
437
|
setHighlightedIndex(indexToHighlight(normalizedInput));
|
|
446
438
|
},
|
|
447
|
-
|
|
448
|
-
let {
|
|
449
|
-
selectedItem
|
|
450
|
-
} = _ref5;
|
|
451
|
-
// only call onChange if new selection is updated from previous
|
|
452
|
-
if (!isEqual(selectedItem, selectedItemProp)) {
|
|
453
|
-
onChange({
|
|
454
|
-
selectedItem
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
onHighlightedIndexChange: _ref6 => {
|
|
439
|
+
onHighlightedIndexChange: _ref5 => {
|
|
459
440
|
let {
|
|
460
441
|
highlightedIndex
|
|
461
|
-
} =
|
|
442
|
+
} = _ref5;
|
|
462
443
|
if (highlightedIndex > -1 && typeof window !== undefined) {
|
|
463
444
|
const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
|
|
464
445
|
const highlightedItem = itemArray[highlightedIndex];
|
|
@@ -470,11 +451,27 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
470
451
|
}
|
|
471
452
|
}
|
|
472
453
|
},
|
|
454
|
+
onStateChange: _ref6 => {
|
|
455
|
+
let {
|
|
456
|
+
type,
|
|
457
|
+
selectedItem: newSelectedItem
|
|
458
|
+
} = _ref6;
|
|
459
|
+
if (type === '__item_click__' && !isEqual(selectedItemProp, newSelectedItem)) {
|
|
460
|
+
onChange({
|
|
461
|
+
selectedItem: newSelectedItem
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
if (type === '__function_select_item__' || type === '__input_keydown_enter__') {
|
|
465
|
+
onChange({
|
|
466
|
+
selectedItem: newSelectedItem
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
},
|
|
473
470
|
initialSelectedItem: initialSelectedItem,
|
|
474
471
|
inputId: id,
|
|
475
472
|
stateReducer,
|
|
476
473
|
isItemDisabled(item, _index) {
|
|
477
|
-
return item
|
|
474
|
+
return item?.disabled;
|
|
478
475
|
},
|
|
479
476
|
...downshiftProps
|
|
480
477
|
});
|
|
@@ -22,6 +22,7 @@ import { flip, size, useFloating, autoUpdate } from '@floating-ui/react';
|
|
|
22
22
|
import { hide } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js';
|
|
23
23
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
24
24
|
import mergeRefs from '../../tools/mergeRefs.js';
|
|
25
|
+
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
25
26
|
|
|
26
27
|
var _ChevronDown;
|
|
27
28
|
const defaultTranslations = {
|
|
@@ -32,6 +33,19 @@ const defaultTranslations = {
|
|
|
32
33
|
* Message ids that will be passed to translateWithId().
|
|
33
34
|
*/
|
|
34
35
|
|
|
36
|
+
const propMappingFunction = deprecatedValue => {
|
|
37
|
+
const mapping = {
|
|
38
|
+
'top-left': 'top-start',
|
|
39
|
+
'top-right': 'top-end',
|
|
40
|
+
'bottom-left': 'bottom-start',
|
|
41
|
+
'bottom-right': 'bottom-end',
|
|
42
|
+
'left-bottom': 'left-end',
|
|
43
|
+
'left-top': 'left-start',
|
|
44
|
+
'right-bottom': 'right-end',
|
|
45
|
+
'right-top': 'right-start'
|
|
46
|
+
};
|
|
47
|
+
return mapping[deprecatedValue];
|
|
48
|
+
};
|
|
35
49
|
function defaultTranslateWithId(messageId) {
|
|
36
50
|
return defaultTranslations[messageId];
|
|
37
51
|
}
|
|
@@ -191,7 +205,32 @@ ComboButton.propTypes = {
|
|
|
191
205
|
/**
|
|
192
206
|
* Specify how the trigger tooltip should be aligned.
|
|
193
207
|
*/
|
|
194
|
-
tooltipAlignment: PropTypes.oneOf(['top', 'top-left',
|
|
208
|
+
tooltipAlignment: deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
209
|
+
// deprecated use top-start instead
|
|
210
|
+
'top-right',
|
|
211
|
+
// deprecated use top-end instead
|
|
212
|
+
|
|
213
|
+
'bottom', 'bottom-left',
|
|
214
|
+
// deprecated use bottom-start instead
|
|
215
|
+
'bottom-right',
|
|
216
|
+
// deprecated use bottom-end instead
|
|
217
|
+
|
|
218
|
+
'left', 'left-bottom',
|
|
219
|
+
// deprecated use left-end instead
|
|
220
|
+
'left-top',
|
|
221
|
+
// deprecated use left-start instead
|
|
222
|
+
|
|
223
|
+
'right', 'right-bottom',
|
|
224
|
+
// deprecated use right-end instead
|
|
225
|
+
'right-top',
|
|
226
|
+
// deprecated use right-start instead
|
|
227
|
+
|
|
228
|
+
// new values to match floating-ui
|
|
229
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
230
|
+
//allowed prop values
|
|
231
|
+
['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
|
|
232
|
+
//optional mapper function
|
|
233
|
+
propMappingFunction),
|
|
195
234
|
/**
|
|
196
235
|
* Optional method that takes in a message id and returns an
|
|
197
236
|
* internationalized string.
|
|
@@ -39,6 +39,10 @@ export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
39
39
|
* Note that this prop is not applied if you render primary/danger button by yourself
|
|
40
40
|
*/
|
|
41
41
|
danger?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* **Experimental**: Provide a `decorator` component to be rendered inside the `ComposedModal` component
|
|
44
|
+
*/
|
|
45
|
+
decorator?: ReactNode;
|
|
42
46
|
/**
|
|
43
47
|
* Specify whether the Modal content should have any inner padding.
|
|
44
48
|
*/
|
|
@@ -70,6 +74,7 @@ export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
70
74
|
selectorsFloatingMenus?: string[];
|
|
71
75
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
72
76
|
/**
|
|
77
|
+
* @deprecated please use `decorator` instead.
|
|
73
78
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `ComposedModal` component
|
|
74
79
|
*/
|
|
75
80
|
slug?: ReactNode;
|
|
@@ -22,6 +22,7 @@ import wrapFocus, { wrapFocusWithoutSentinels, elementOrParentIsFloatingMenu } f
|
|
|
22
22
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
23
23
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
24
24
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
25
|
+
import deprecate from '../../prop-types/deprecate.js';
|
|
25
26
|
import { match } from '../../internal/keyboard/match.js';
|
|
26
27
|
import { Escape, Tab } from '../../internal/keyboard/keys.js';
|
|
27
28
|
|
|
@@ -98,6 +99,7 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
|
|
|
98
99
|
className: customClassName,
|
|
99
100
|
containerClassName,
|
|
100
101
|
danger,
|
|
102
|
+
decorator,
|
|
101
103
|
isFullWidth,
|
|
102
104
|
onClose,
|
|
103
105
|
onKeyDown,
|
|
@@ -189,7 +191,8 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
|
|
|
189
191
|
const modalClass = cx(`${prefix}--modal`, {
|
|
190
192
|
'is-visible': isOpen,
|
|
191
193
|
[`${prefix}--modal--danger`]: danger,
|
|
192
|
-
[`${prefix}--modal--slug`]: slug
|
|
194
|
+
[`${prefix}--modal--slug`]: slug,
|
|
195
|
+
[`${prefix}--modal--decorator`]: decorator
|
|
193
196
|
}, customClassName);
|
|
194
197
|
const containerClass = cx(`${prefix}--modal-container`, size && `${prefix}--modal-container--${size}`, isFullWidth && `${prefix}--modal-container--full-width`, containerClassName);
|
|
195
198
|
|
|
@@ -248,10 +251,10 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
|
|
|
248
251
|
}
|
|
249
252
|
}, [open, selectorPrimaryFocus, isOpen]);
|
|
250
253
|
|
|
251
|
-
//
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
254
|
-
|
|
254
|
+
// AILabel is always size `sm`
|
|
255
|
+
let normalizedDecorator = /*#__PURE__*/React__default.isValidElement(slug ?? decorator) ? slug ?? decorator : null;
|
|
256
|
+
if (normalizedDecorator && normalizedDecorator['type']?.displayName === 'AILabel') {
|
|
257
|
+
normalizedDecorator = /*#__PURE__*/React__default.cloneElement(normalizedDecorator, {
|
|
255
258
|
size: 'sm'
|
|
256
259
|
});
|
|
257
260
|
}
|
|
@@ -277,7 +280,9 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
|
|
|
277
280
|
}, "Focus sentinel"), /*#__PURE__*/React__default.createElement("div", {
|
|
278
281
|
ref: innerModal,
|
|
279
282
|
className: `${prefix}--modal-container-body`
|
|
280
|
-
},
|
|
283
|
+
}, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default.createElement("div", {
|
|
284
|
+
className: `${prefix}--modal--inner__decorator`
|
|
285
|
+
}, normalizedDecorator) : '', childrenWithProps), !focusTrapWithoutSentinels && /*#__PURE__*/React__default.createElement("button", {
|
|
281
286
|
type: "button",
|
|
282
287
|
ref: endSentinel,
|
|
283
288
|
className: `${prefix}--visually-hidden`
|
|
@@ -309,6 +314,10 @@ ComposedModal.propTypes = {
|
|
|
309
314
|
* Note that this prop is not applied if you render primary/danger button by yourself
|
|
310
315
|
*/
|
|
311
316
|
danger: PropTypes.bool,
|
|
317
|
+
/**
|
|
318
|
+
* **Experimental**: Provide a `decorator` component to be rendered inside the `ComposedModal` component
|
|
319
|
+
*/
|
|
320
|
+
decorator: PropTypes.node,
|
|
312
321
|
/**
|
|
313
322
|
* Specify whether the Modal content should have any inner padding.
|
|
314
323
|
*/
|
|
@@ -348,10 +357,7 @@ ComposedModal.propTypes = {
|
|
|
348
357
|
* Specify the size variant.
|
|
349
358
|
*/
|
|
350
359
|
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
351
|
-
|
|
352
|
-
* **Experimental**: Provide a `Slug` component to be rendered inside the `ComposedModal` component
|
|
353
|
-
*/
|
|
354
|
-
slug: PropTypes.node
|
|
360
|
+
slug: deprecate(PropTypes.node, 'The `slug` prop for `ComposedModal` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.')
|
|
355
361
|
};
|
|
356
362
|
|
|
357
363
|
export { ModalBody, ComposedModal as default };
|
|
@@ -38,7 +38,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
38
38
|
*/
|
|
39
39
|
selectedIndex: number;
|
|
40
40
|
/**
|
|
41
|
-
* Choose whether or not to automatically change selection on focus
|
|
41
|
+
* Choose whether or not to automatically change selection on focus when left/right arrow pressed. Defaults to 'automatic'
|
|
42
42
|
*/
|
|
43
43
|
selectionMode?: 'automatic' | 'manual';
|
|
44
44
|
/**
|
|
@@ -82,7 +82,7 @@ export default class ContentSwitcher extends React.Component<ContentSwitcherProp
|
|
|
82
82
|
*/
|
|
83
83
|
selectedIndex: PropTypes.Requireable<number>;
|
|
84
84
|
/**
|
|
85
|
-
* Choose whether or not to automatically change selection on focus
|
|
85
|
+
* Choose whether or not to automatically change selection on focus when left/right arrow pressed. Defaults to 'automatic'
|
|
86
86
|
*/
|
|
87
87
|
selectionMode: PropTypes.Requireable<string>;
|
|
88
88
|
/**
|
|
@@ -163,7 +163,7 @@ _defineProperty(ContentSwitcher, "propTypes", {
|
|
|
163
163
|
*/
|
|
164
164
|
selectedIndex: PropTypes.number,
|
|
165
165
|
/**
|
|
166
|
-
* Choose whether or not to automatically change selection on focus
|
|
166
|
+
* Choose whether or not to automatically change selection on focus when left/right arrow pressed. Defaults to 'automatic'
|
|
167
167
|
*/
|
|
168
168
|
selectionMode: PropTypes.oneOf(['automatic', 'manual']),
|
|
169
169
|
/**
|
|
@@ -6,11 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React, { AnimationEventHandler, MouseEventHandler, PropsWithChildren } from 'react';
|
|
9
|
+
export type DeprecatedCopyAlignment = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top';
|
|
10
|
+
export type NewCopyAlignment = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-end' | 'left-start' | 'right-end' | 'right-start';
|
|
11
|
+
export type CopyAlignment = DeprecatedCopyAlignment | NewCopyAlignment;
|
|
9
12
|
interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
13
|
/**
|
|
11
14
|
* Specify how the trigger should align with the tooltip
|
|
12
15
|
*/
|
|
13
|
-
align?:
|
|
16
|
+
align?: CopyAlignment;
|
|
14
17
|
/**
|
|
15
18
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
16
19
|
*/
|
|
@@ -45,7 +48,7 @@ declare namespace Copy {
|
|
|
45
48
|
/**
|
|
46
49
|
* Specify how the trigger should align with the tooltip
|
|
47
50
|
*/
|
|
48
|
-
align:
|
|
51
|
+
align: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
|
|
49
52
|
/**
|
|
50
53
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
51
54
|
*/
|