@carbon/react 1.58.0-rc.0 → 1.58.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 +1114 -957
- package/es/components/Accordion/Accordion.d.ts +1 -1
- package/es/components/Accordion/index.d.ts +2 -2
- package/es/components/Button/index.d.ts +2 -1
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/index.d.ts +2 -2
- package/es/components/FormLabel/index.d.ts +2 -2
- package/es/components/Grid/Column.d.ts +2 -2
- package/es/components/Grid/GridTypes.d.ts +1 -2
- package/es/components/Grid/index.d.ts +3 -1
- package/es/components/InlineLoading/index.d.ts +2 -2
- package/es/components/Loading/index.d.ts +2 -2
- package/es/components/Modal/index.d.ts +2 -2
- package/es/components/NumberInput/NumberInput.d.ts +11 -0
- package/es/components/NumberInput/NumberInput.js +2 -2
- package/es/components/NumberInput/index.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +10 -6
- package/es/components/OverflowMenu/index.d.ts +13 -0
- package/es/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/es/components/ProgressBar/index.d.ts +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/es/components/ProgressIndicator/index.d.ts +2 -0
- package/es/components/StructuredList/index.d.ts +2 -0
- package/es/components/Switch/Switch.d.ts +1 -1
- package/es/components/Switch/index.d.ts +2 -2
- package/es/components/Tab/index.d.ts +2 -1
- package/es/components/Tag/DismissibleTag.d.ts +9 -9
- package/es/components/Tag/DismissibleTag.js +34 -9
- package/es/components/Tag/OperationalTag.d.ts +9 -9
- package/es/components/Tag/OperationalTag.js +45 -9
- package/es/components/Tag/SelectableTag.d.ts +9 -9
- package/es/components/Tag/SelectableTag.js +46 -10
- package/es/components/Tag/Tag.js +31 -5
- package/es/components/TextArea/index.d.ts +2 -2
- package/es/components/TextInput/index.d.ts +4 -2
- package/es/components/TileGroup/index.d.ts +2 -2
- package/es/components/Tooltip/Tooltip.js +16 -5
- package/es/components/Tooltip/index.d.ts +2 -2
- package/es/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/es/components/UnorderedList/index.d.ts +1 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/index.d.ts +2 -2
- package/lib/components/Button/index.d.ts +2 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/index.d.ts +2 -2
- package/lib/components/FormLabel/index.d.ts +2 -2
- package/lib/components/Grid/Column.d.ts +2 -2
- package/lib/components/Grid/GridTypes.d.ts +1 -2
- package/lib/components/Grid/index.d.ts +3 -1
- package/lib/components/InlineLoading/index.d.ts +2 -2
- package/lib/components/Loading/index.d.ts +2 -2
- package/lib/components/Modal/index.d.ts +2 -2
- package/lib/components/NumberInput/NumberInput.d.ts +11 -0
- package/lib/components/NumberInput/NumberInput.js +2 -2
- package/lib/components/NumberInput/index.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +10 -6
- package/lib/components/OverflowMenu/index.d.ts +13 -0
- package/lib/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/lib/components/ProgressBar/index.d.ts +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +2 -2
- package/lib/components/ProgressIndicator/index.d.ts +2 -0
- package/lib/components/StructuredList/index.d.ts +2 -0
- package/lib/components/Switch/Switch.d.ts +1 -1
- package/lib/components/Switch/index.d.ts +2 -2
- package/lib/components/Tab/index.d.ts +2 -1
- package/lib/components/Tag/DismissibleTag.d.ts +9 -9
- package/lib/components/Tag/DismissibleTag.js +33 -8
- package/lib/components/Tag/OperationalTag.d.ts +9 -9
- package/lib/components/Tag/OperationalTag.js +44 -8
- package/lib/components/Tag/SelectableTag.d.ts +9 -9
- package/lib/components/Tag/SelectableTag.js +45 -9
- package/lib/components/Tag/Tag.js +30 -4
- package/lib/components/TextArea/index.d.ts +2 -2
- package/lib/components/TextInput/index.d.ts +4 -2
- package/lib/components/TileGroup/index.d.ts +2 -2
- package/lib/components/Tooltip/Tooltip.js +16 -5
- package/lib/components/Tooltip/index.d.ts +2 -2
- package/lib/components/UnorderedList/UnorderedList.d.ts +1 -1
- package/lib/components/UnorderedList/index.d.ts +1 -0
- package/package.json +5 -5
|
@@ -9,10 +9,6 @@ import React, { ReactNode } from 'react';
|
|
|
9
9
|
import { PolymorphicProps } from '../../types/common';
|
|
10
10
|
import { SIZES } from './Tag';
|
|
11
11
|
export interface SelectableTagBaseProps {
|
|
12
|
-
/**
|
|
13
|
-
* Provide content to be rendered inside of a `SelectableTag`
|
|
14
|
-
*/
|
|
15
|
-
children?: React.ReactNode;
|
|
16
12
|
/**
|
|
17
13
|
* Provide a custom className that is applied to the containing <span>
|
|
18
14
|
*/
|
|
@@ -43,15 +39,15 @@ export interface SelectableTagBaseProps {
|
|
|
43
39
|
* **Experimental:** Provide a `Slug` component to be rendered inside the `SelectableTag` component
|
|
44
40
|
*/
|
|
45
41
|
slug?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Provide text to be rendered inside of a the tag.
|
|
44
|
+
*/
|
|
45
|
+
text?: string;
|
|
46
46
|
}
|
|
47
47
|
export type SelectableTagProps<T extends React.ElementType> = PolymorphicProps<T, SelectableTagBaseProps>;
|
|
48
48
|
declare const SelectableTag: {
|
|
49
|
-
<T extends React.ElementType<any>>({
|
|
49
|
+
<T extends React.ElementType<any>>({ className, disabled, id, renderIcon, selected, slug, size, text, ...other }: SelectableTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
50
50
|
propTypes: {
|
|
51
|
-
/**
|
|
52
|
-
* Provide content to be rendered inside of a `SelectableTag`
|
|
53
|
-
*/
|
|
54
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
55
51
|
/**
|
|
56
52
|
* Provide a custom className that is applied to the containing <span>
|
|
57
53
|
*/
|
|
@@ -82,6 +78,10 @@ declare const SelectableTag: {
|
|
|
82
78
|
* **Experimental:** Provide a `Slug` component to be rendered inside the `SelectableTag` component
|
|
83
79
|
*/
|
|
84
80
|
slug: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
81
|
+
/**
|
|
82
|
+
* Provide text to be rendered inside of a the tag.
|
|
83
|
+
*/
|
|
84
|
+
text: PropTypes.Requireable<string>;
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
export default SelectableTag;
|
|
@@ -7,16 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { useState } from 'react';
|
|
10
|
+
import React__default, { useState, useLayoutEffect } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import Tag, { SIZES } from './Tag.js';
|
|
15
|
+
import '../Tooltip/DefinitionTooltip.js';
|
|
16
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
17
|
+
import '../Text/index.js';
|
|
18
|
+
import { Text } from '../Text/Text.js';
|
|
15
19
|
|
|
16
20
|
const getInstanceId = setupGetInstanceId();
|
|
17
21
|
const SelectableTag = _ref => {
|
|
18
22
|
let {
|
|
19
|
-
children,
|
|
20
23
|
className,
|
|
21
24
|
disabled,
|
|
22
25
|
id,
|
|
@@ -24,6 +27,7 @@ const SelectableTag = _ref => {
|
|
|
24
27
|
selected = false,
|
|
25
28
|
slug,
|
|
26
29
|
size,
|
|
30
|
+
text,
|
|
27
31
|
...other
|
|
28
32
|
} = _ref;
|
|
29
33
|
const prefix = usePrefix();
|
|
@@ -32,6 +36,16 @@ const SelectableTag = _ref => {
|
|
|
32
36
|
const tagClasses = cx(`${prefix}--tag--selectable`, className, {
|
|
33
37
|
[`${prefix}--tag--selectable-selected`]: selectedTag
|
|
34
38
|
});
|
|
39
|
+
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
40
|
+
const isEllipsisActive = element => {
|
|
41
|
+
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
42
|
+
return element.offsetWidth < element.scrollWidth;
|
|
43
|
+
};
|
|
44
|
+
useLayoutEffect(() => {
|
|
45
|
+
const elementTagId = document.querySelector(`#${tagId}`);
|
|
46
|
+
const newElement = elementTagId?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
47
|
+
isEllipsisActive(newElement);
|
|
48
|
+
}, [prefix, tagId]);
|
|
35
49
|
let normalizedSlug;
|
|
36
50
|
if (slug && slug['type']?.displayName === 'Slug') {
|
|
37
51
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
@@ -39,6 +53,7 @@ const SelectableTag = _ref => {
|
|
|
39
53
|
kind: 'inline'
|
|
40
54
|
});
|
|
41
55
|
}
|
|
56
|
+
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
42
57
|
|
|
43
58
|
// Removing onClick from the spread operator
|
|
44
59
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -46,6 +61,26 @@ const SelectableTag = _ref => {
|
|
|
46
61
|
onClick,
|
|
47
62
|
...otherProps
|
|
48
63
|
} = other;
|
|
64
|
+
if (isEllipsisApplied) {
|
|
65
|
+
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
66
|
+
label: text,
|
|
67
|
+
align: "bottom",
|
|
68
|
+
className: tooltipClasses,
|
|
69
|
+
leaveDelayMs: 0,
|
|
70
|
+
onMouseEnter: false
|
|
71
|
+
}, /*#__PURE__*/React__default.createElement(Tag, _extends({
|
|
72
|
+
slug: slug,
|
|
73
|
+
size: size,
|
|
74
|
+
renderIcon: renderIcon,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
className: tagClasses,
|
|
77
|
+
id: tagId,
|
|
78
|
+
onClick: () => setSelectedTag(!selectedTag)
|
|
79
|
+
}, otherProps), /*#__PURE__*/React__default.createElement(Text, {
|
|
80
|
+
title: text,
|
|
81
|
+
className: `${prefix}--tag__label`
|
|
82
|
+
}, text), normalizedSlug));
|
|
83
|
+
}
|
|
49
84
|
return /*#__PURE__*/React__default.createElement(Tag, _extends({
|
|
50
85
|
slug: slug,
|
|
51
86
|
size: size,
|
|
@@ -54,15 +89,12 @@ const SelectableTag = _ref => {
|
|
|
54
89
|
className: tagClasses,
|
|
55
90
|
id: tagId,
|
|
56
91
|
onClick: () => setSelectedTag(!selectedTag)
|
|
57
|
-
}, otherProps), /*#__PURE__*/React__default.createElement(
|
|
58
|
-
|
|
59
|
-
|
|
92
|
+
}, otherProps), normalizedSlug, /*#__PURE__*/React__default.createElement(Text, {
|
|
93
|
+
title: text,
|
|
94
|
+
className: `${prefix}--tag__label`
|
|
95
|
+
}, text));
|
|
60
96
|
};
|
|
61
97
|
SelectableTag.propTypes = {
|
|
62
|
-
/**
|
|
63
|
-
* Provide content to be rendered inside of a `SelectableTag`
|
|
64
|
-
*/
|
|
65
|
-
children: PropTypes.node,
|
|
66
98
|
/**
|
|
67
99
|
* Provide a custom className that is applied to the containing <span>
|
|
68
100
|
*/
|
|
@@ -92,7 +124,11 @@ SelectableTag.propTypes = {
|
|
|
92
124
|
/**
|
|
93
125
|
* **Experimental:** Provide a `Slug` component to be rendered inside the `SelectableTag` component
|
|
94
126
|
*/
|
|
95
|
-
slug: PropTypes.node
|
|
127
|
+
slug: PropTypes.node,
|
|
128
|
+
/**
|
|
129
|
+
* Provide text to be rendered inside of a the tag.
|
|
130
|
+
*/
|
|
131
|
+
text: PropTypes.string
|
|
96
132
|
};
|
|
97
133
|
|
|
98
134
|
export { SelectableTag as default };
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default from 'react';
|
|
10
|
+
import React__default, { useState, useLayoutEffect } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { Close } from '@carbon/icons-react';
|
|
13
13
|
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import '../Text/index.js';
|
|
16
16
|
import deprecate from '../../prop-types/deprecate.js';
|
|
17
|
+
import { DefinitionTooltip } from '../Tooltip/DefinitionTooltip.js';
|
|
18
|
+
import '../Tooltip/Tooltip.js';
|
|
17
19
|
import { Text } from '../Text/Text.js';
|
|
18
20
|
|
|
19
21
|
var _Close;
|
|
@@ -58,6 +60,16 @@ const Tag = _ref => {
|
|
|
58
60
|
} = _ref;
|
|
59
61
|
const prefix = usePrefix();
|
|
60
62
|
const tagId = id || `tag-${getInstanceId()}`;
|
|
63
|
+
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
64
|
+
const isEllipsisActive = element => {
|
|
65
|
+
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
66
|
+
return element.offsetWidth < element.scrollWidth;
|
|
67
|
+
};
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
const elementTagId = document.querySelector(`#${tagId}`);
|
|
70
|
+
const newElement = elementTagId?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
71
|
+
isEllipsisActive(newElement);
|
|
72
|
+
}, [prefix, tagId]);
|
|
61
73
|
const conditions = [`${prefix}--tag--selectable`, `${prefix}--tag--filter`, `${prefix}--tag--operational`];
|
|
62
74
|
const isInteractiveTag = conditions.some(el => className?.includes(el));
|
|
63
75
|
const tagClasses = cx(`${prefix}--tag`, className, {
|
|
@@ -67,7 +79,7 @@ const Tag = _ref => {
|
|
|
67
79
|
// TODO: V12 - Remove this class
|
|
68
80
|
[`${prefix}--layout--size-${size}`]: size,
|
|
69
81
|
[`${prefix}--tag--${type}`]: type,
|
|
70
|
-
[`${prefix}--tag--interactive`]: other.onClick && !isInteractiveTag
|
|
82
|
+
[`${prefix}--tag--interactive`]: other.onClick && !isInteractiveTag && isEllipsisApplied
|
|
71
83
|
});
|
|
72
84
|
const typeText = type !== undefined && type in Object.keys(TYPES) ? TYPES[type] : '';
|
|
73
85
|
const handleClose = event => {
|
|
@@ -93,8 +105,8 @@ const Tag = _ref => {
|
|
|
93
105
|
}, other), CustomIconElement && size !== 'sm' ? /*#__PURE__*/React__default.createElement("div", {
|
|
94
106
|
className: `${prefix}--tag__custom-icon`
|
|
95
107
|
}, /*#__PURE__*/React__default.createElement(CustomIconElement, null)) : '', /*#__PURE__*/React__default.createElement(Text, {
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
title: typeof children === 'string' ? children : undefined,
|
|
109
|
+
className: `${prefix}--tag__label`
|
|
98
110
|
}, children !== null && children !== undefined ? children : typeText), normalizedSlug, /*#__PURE__*/React__default.createElement("button", {
|
|
99
111
|
type: "button",
|
|
100
112
|
className: `${prefix}--tag__close-icon`,
|
|
@@ -105,13 +117,27 @@ const Tag = _ref => {
|
|
|
105
117
|
}, _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, null))));
|
|
106
118
|
}
|
|
107
119
|
const ComponentTag = BaseComponent ?? (other.onClick || className?.includes(`${prefix}--tag--operational`) ? 'button' : 'div');
|
|
120
|
+
const labelClasses = cx({
|
|
121
|
+
[`${prefix}--tag__label`]: !isInteractiveTag,
|
|
122
|
+
[`${prefix}--tag--${type}`]: type && !isInteractiveTag
|
|
123
|
+
});
|
|
108
124
|
return /*#__PURE__*/React__default.createElement(ComponentTag, _extends({
|
|
109
125
|
disabled: disabled,
|
|
110
126
|
className: tagClasses,
|
|
111
127
|
id: tagId
|
|
112
128
|
}, other), CustomIconElement && size !== 'sm' ? /*#__PURE__*/React__default.createElement("div", {
|
|
113
129
|
className: `${prefix}--tag__custom-icon`
|
|
114
|
-
}, /*#__PURE__*/React__default.createElement(CustomIconElement, null)) : '', /*#__PURE__*/React__default.createElement(
|
|
130
|
+
}, /*#__PURE__*/React__default.createElement(CustomIconElement, null)) : '', isEllipsisApplied && !isInteractiveTag ? /*#__PURE__*/React__default.createElement(DefinitionTooltip, {
|
|
131
|
+
openOnHover: false,
|
|
132
|
+
definition: children !== null && children !== undefined ? children : typeText,
|
|
133
|
+
className: `${prefix}--definition--tooltip--tag`
|
|
134
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
135
|
+
title: children !== null && children !== undefined ? children : typeText,
|
|
136
|
+
className: labelClasses
|
|
137
|
+
}, children !== null && children !== undefined ? children : typeText)) : /*#__PURE__*/React__default.createElement(Text, {
|
|
138
|
+
title: children !== null && children !== undefined ? children : typeText,
|
|
139
|
+
className: labelClasses
|
|
140
|
+
}, children !== null && children !== undefined ? children : typeText), normalizedSlug);
|
|
115
141
|
};
|
|
116
142
|
Tag.propTypes = {
|
|
117
143
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import TextArea from './TextArea';
|
|
7
|
+
import TextArea, { type TextAreaProps } from './TextArea';
|
|
8
8
|
export { default as TextAreaSkeleton } from './TextArea.Skeleton';
|
|
9
9
|
export default TextArea;
|
|
10
|
-
export { TextArea };
|
|
10
|
+
export { TextArea, type TextAreaProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import TextInput from './TextInput';
|
|
1
|
+
import TextInput, { type TextInputProps } from './TextInput';
|
|
2
|
+
import { type TextInputSkeletonProps } from './TextInput.Skeleton';
|
|
2
3
|
export { default as TextInputSkeleton } from './TextInput.Skeleton';
|
|
3
4
|
export default TextInput;
|
|
4
|
-
export {
|
|
5
|
+
export { type TextInputSkeletonProps };
|
|
6
|
+
export { TextInput, type TextInputProps };
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import TileGroup from './TileGroup';
|
|
7
|
+
import TileGroup, { type TileGroupProps } from './TileGroup';
|
|
8
8
|
export default TileGroup;
|
|
9
|
-
export { TileGroup };
|
|
9
|
+
export { TileGroup, type TileGroupProps };
|
|
@@ -37,18 +37,22 @@ function Tooltip(_ref) {
|
|
|
37
37
|
const tooltipRef = useRef(null);
|
|
38
38
|
const [open, setOpen] = useDelayedState(defaultOpen);
|
|
39
39
|
const [isDragging, setIsDragging] = useState(false);
|
|
40
|
+
const [focusByMouse, setFocusByMouse] = useState(false);
|
|
40
41
|
const [isPointerIntersecting, setIsPointerIntersecting] = useState(false);
|
|
41
42
|
const id = useId('tooltip');
|
|
42
43
|
const prefix = usePrefix();
|
|
43
44
|
const child = React__default.Children.only(children);
|
|
44
45
|
const triggerProps = {
|
|
45
|
-
onFocus: () => setOpen(true),
|
|
46
|
-
onBlur: () =>
|
|
46
|
+
onFocus: () => !focusByMouse && setOpen(true),
|
|
47
|
+
onBlur: () => {
|
|
48
|
+
setOpen(false);
|
|
49
|
+
setFocusByMouse(false);
|
|
50
|
+
},
|
|
47
51
|
onClick: () => closeOnActivation && setOpen(false),
|
|
48
52
|
// This should be placed on the trigger in case the element is disabled
|
|
49
53
|
onMouseEnter,
|
|
50
54
|
onMouseLeave,
|
|
51
|
-
onMouseDown
|
|
55
|
+
onMouseDown,
|
|
52
56
|
onMouseMove: onMouseMove,
|
|
53
57
|
onTouchStart: onDragStart
|
|
54
58
|
};
|
|
@@ -80,8 +84,15 @@ function Tooltip(_ref) {
|
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
function onMouseEnter() {
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
// Interactive Tags should not support onMouseEnter
|
|
88
|
+
if (!rest?.onMouseEnter?.()) {
|
|
89
|
+
setIsPointerIntersecting(true);
|
|
90
|
+
setOpen(true, enterDelayMs);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function onMouseDown() {
|
|
94
|
+
setFocusByMouse(true);
|
|
95
|
+
onDragStart();
|
|
85
96
|
}
|
|
86
97
|
function onMouseLeave() {
|
|
87
98
|
setIsPointerIntersecting(false);
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { DefinitionTooltip } from './DefinitionTooltip';
|
|
8
|
-
import { Tooltip } from './Tooltip';
|
|
9
|
-
export { DefinitionTooltip, Tooltip };
|
|
8
|
+
import { Tooltip, type TooltipProps } from './Tooltip';
|
|
9
|
+
export { DefinitionTooltip, Tooltip, type TooltipProps };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { type ComponentProps } from 'react';
|
|
9
|
-
interface UnorderedListProps extends ComponentProps<'ul'> {
|
|
9
|
+
export interface UnorderedListProps extends ComponentProps<'ul'> {
|
|
10
10
|
nested?: boolean | undefined;
|
|
11
11
|
isExpressive?: boolean | undefined;
|
|
12
12
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Accordion from './Accordion';
|
|
7
|
+
import Accordion, { type AccordionProps } from './Accordion';
|
|
8
8
|
export default Accordion;
|
|
9
|
-
export { Accordion };
|
|
9
|
+
export { Accordion, type AccordionProps };
|
|
10
10
|
export { default as AccordionItem } from './AccordionItem';
|
|
11
11
|
export { default as AccordionSkeleton } from './Accordion.Skeleton';
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import Button from './Button';
|
|
8
|
+
import { type ButtonProps } from './Button';
|
|
8
9
|
export default Button;
|
|
9
|
-
export { Button };
|
|
10
|
+
export { Button, type ButtonProps };
|
|
10
11
|
export * from './Button';
|
|
11
12
|
export { default as ButtonSkeleton } from './Button.Skeleton';
|
|
@@ -138,7 +138,7 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
|
|
|
138
138
|
}
|
|
139
139
|
export type DropdownTranslationKey = ListBoxMenuIconTranslationKey;
|
|
140
140
|
type DropdownComponentProps<ItemType> = React.PropsWithoutRef<React.PropsWithChildren<DropdownProps<ItemType>> & React.RefAttributes<HTMLButtonElement>>;
|
|
141
|
-
interface DropdownComponent {
|
|
141
|
+
export interface DropdownComponent {
|
|
142
142
|
<ItemType>(props: DropdownComponentProps<ItemType>): React.ReactElement | null;
|
|
143
143
|
}
|
|
144
144
|
declare const _default: DropdownComponent;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Dropdown, { type DropdownTranslationKey, type OnChangeData } from './Dropdown';
|
|
7
|
+
import Dropdown, { type DropdownTranslationKey, type OnChangeData, type DropdownProps } from './Dropdown';
|
|
8
8
|
export type { DropdownTranslationKey, OnChangeData };
|
|
9
|
-
export { Dropdown };
|
|
9
|
+
export { Dropdown, type DropdownProps };
|
|
10
10
|
export { default as DropdownSkeleton } from './Dropdown.Skeleton';
|
|
11
11
|
export default Dropdown;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import FormLabel from './FormLabel';
|
|
7
|
+
import FormLabel, { type FormLabelProps } from './FormLabel';
|
|
8
8
|
export default FormLabel;
|
|
9
|
-
export { FormLabel };
|
|
9
|
+
export { FormLabel, type FormLabelProps };
|
|
@@ -8,14 +8,14 @@ import React from 'react';
|
|
|
8
8
|
import { PolymorphicProps } from '../../types/common';
|
|
9
9
|
type ColumnSpanPercent = '25%' | '50%' | '75%' | '100%';
|
|
10
10
|
type ColumnSpanSimple = boolean | number | ColumnSpanPercent;
|
|
11
|
-
interface ColumnSpanObject {
|
|
11
|
+
export interface ColumnSpanObject {
|
|
12
12
|
span?: ColumnSpanSimple;
|
|
13
13
|
offset?: number;
|
|
14
14
|
start?: number;
|
|
15
15
|
end?: number;
|
|
16
16
|
}
|
|
17
17
|
export type ColumnSpan = ColumnSpanSimple | ColumnSpanObject;
|
|
18
|
-
interface ColumnBaseProps {
|
|
18
|
+
export interface ColumnBaseProps {
|
|
19
19
|
/**
|
|
20
20
|
* Pass in content that will be rendered within the `Column`
|
|
21
21
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
8
|
import { PolymorphicProps } from '../../types/common';
|
|
9
|
-
interface GridBaseProps {
|
|
9
|
+
export interface GridBaseProps {
|
|
10
10
|
/**
|
|
11
11
|
* Pass in content that will be rendered within the `Grid`
|
|
12
12
|
*/
|
|
@@ -34,4 +34,3 @@ export type GridProps<T extends React.ElementType> = PolymorphicProps<T, GridBas
|
|
|
34
34
|
export interface GridComponent {
|
|
35
35
|
<T extends React.ElementType>(props: GridProps<T>, context?: any): React.ReactElement<any, any> | null;
|
|
36
36
|
}
|
|
37
|
-
export {};
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import { type GridProps } from './GridTypes';
|
|
8
|
+
export { type GridProps };
|
|
7
9
|
export { FlexGrid } from './FlexGrid';
|
|
8
10
|
export { Grid } from './Grid';
|
|
9
11
|
export { default as Row } from './Row';
|
|
10
|
-
export { default as Column } from './Column';
|
|
12
|
+
export { default as Column, type ColumnProps } from './Column';
|
|
11
13
|
export { ColumnHang } from './ColumnHang';
|
|
12
14
|
export { GridSettings } from './GridContext';
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import InlineLoading from './InlineLoading';
|
|
7
|
+
import InlineLoading, { type InlineLoadingProps } from './InlineLoading';
|
|
8
8
|
export default InlineLoading;
|
|
9
|
-
export { InlineLoading };
|
|
9
|
+
export { InlineLoading, type InlineLoadingProps };
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Loading from './Loading';
|
|
7
|
+
import Loading, { type LoadingProps } from './Loading';
|
|
8
8
|
export default Loading;
|
|
9
|
-
export { Loading };
|
|
9
|
+
export { Loading, type LoadingProps };
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import Modal from './Modal';
|
|
7
|
+
import Modal, { type ModalProps } from './Modal';
|
|
8
8
|
export default Modal;
|
|
9
|
-
export { Modal };
|
|
9
|
+
export { Modal, type ModalProps };
|
|
@@ -133,4 +133,15 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
133
133
|
warnText?: ReactNode;
|
|
134
134
|
}
|
|
135
135
|
declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
136
|
+
export interface Label {
|
|
137
|
+
disabled?: boolean;
|
|
138
|
+
hideLabel?: boolean;
|
|
139
|
+
id?: string;
|
|
140
|
+
label?: ReactNode;
|
|
141
|
+
}
|
|
142
|
+
export interface HelperTextProps {
|
|
143
|
+
id?: string;
|
|
144
|
+
description?: ReactNode;
|
|
145
|
+
disabled?: boolean;
|
|
146
|
+
}
|
|
136
147
|
export { NumberInput };
|
|
@@ -397,7 +397,7 @@ NumberInput.propTypes = {
|
|
|
397
397
|
*/
|
|
398
398
|
warnText: PropTypes__default["default"].node
|
|
399
399
|
};
|
|
400
|
-
|
|
400
|
+
const Label = _ref => {
|
|
401
401
|
let {
|
|
402
402
|
disabled,
|
|
403
403
|
id,
|
|
@@ -418,7 +418,7 @@ function Label(_ref) {
|
|
|
418
418
|
}, label);
|
|
419
419
|
}
|
|
420
420
|
return null;
|
|
421
|
-
}
|
|
421
|
+
};
|
|
422
422
|
Label.propTypes = {
|
|
423
423
|
disabled: PropTypes__default["default"].bool,
|
|
424
424
|
hideLabel: PropTypes__default["default"].bool,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, { ComponentType } from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* @param {Element} menuBody The menu body with the menu arrow.
|
|
11
11
|
* @param {string} direction The floating menu direction.
|
|
@@ -17,14 +17,18 @@ export declare const getMenuOffset: (menuBody: any, direction: any, trigger: any
|
|
|
17
17
|
top: number;
|
|
18
18
|
} | undefined;
|
|
19
19
|
interface Offset {
|
|
20
|
-
top
|
|
21
|
-
left
|
|
20
|
+
top?: number | null | undefined;
|
|
21
|
+
left?: number | null | undefined;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type IconProps = {
|
|
24
|
+
className?: string;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
};
|
|
27
|
+
export interface OverflowMenuProps {
|
|
24
28
|
/**
|
|
25
29
|
* Specify a label to be read by screen readers on the container node
|
|
26
30
|
*/
|
|
27
|
-
['aria-label']
|
|
31
|
+
['aria-label']?: string;
|
|
28
32
|
/**
|
|
29
33
|
* Deprecated, please use `aria-label` instead.
|
|
30
34
|
* Specify a label to be read by screen readers on the container note.
|
|
@@ -99,7 +103,7 @@ interface OverflowMenuProps {
|
|
|
99
103
|
/**
|
|
100
104
|
* Function called to override icon rendering.
|
|
101
105
|
*/
|
|
102
|
-
renderIcon?:
|
|
106
|
+
renderIcon?: ComponentType<IconProps>;
|
|
103
107
|
/**
|
|
104
108
|
* Specify a CSS selector that matches the DOM element that should
|
|
105
109
|
* be focused when the OverflowMenu opens
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { type OverflowMenuProps } from './OverflowMenu';
|
|
8
|
+
declare function OverflowMenu(props: any): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace OverflowMenu {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export default OverflowMenu;
|
|
13
|
+
export { OverflowMenu, type OverflowMenuProps };
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import ProgressBar from './ProgressBar';
|
|
7
|
+
import ProgressBar, { type ProgressBarProps } from './ProgressBar';
|
|
8
8
|
export default ProgressBar;
|
|
9
|
-
export { ProgressBar };
|
|
9
|
+
export { ProgressBar, type ProgressBarProps };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
9
|
+
export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
10
10
|
/**
|
|
11
11
|
* Provide `<ProgressStep>` components to be rendered in the
|
|
12
12
|
* `<ProgressIndicator>`
|
|
@@ -63,7 +63,7 @@ declare namespace ProgressIndicator {
|
|
|
63
63
|
vertical: PropTypes.Requireable<boolean>;
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
interface ProgressStepProps {
|
|
66
|
+
export interface ProgressStepProps {
|
|
67
67
|
/**
|
|
68
68
|
* Provide an optional className to be applied to the containing `<li>` node
|
|
69
69
|
*/
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import { type ProgressIndicatorProps, type ProgressStepProps } from './ProgressIndicator';
|
|
7
8
|
export { default as ProgressIndicatorSkeleton } from './ProgressIndicator.Skeleton';
|
|
8
9
|
export * from './ProgressIndicator';
|
|
10
|
+
export { type ProgressIndicatorProps, type ProgressStepProps };
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import { type StructuredListWrapperProps } from './StructuredList';
|
|
7
8
|
export * from './StructuredList';
|
|
8
9
|
export { default as StructuredListSkeleton, type StructuredListSkeletonProps, } from './StructuredList.Skeleton';
|
|
10
|
+
export { type StructuredListWrapperProps };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
8
|
-
interface SwitchEventHandlersParams {
|
|
8
|
+
export interface SwitchEventHandlersParams {
|
|
9
9
|
index?: number;
|
|
10
10
|
name?: string | number;
|
|
11
11
|
text?: string;
|