@carbon/react 1.53.0-rc.0 → 1.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1075 -1110
- package/es/components/AiSkeleton/AiSkeletonIcon.js +39 -0
- package/es/components/AiSkeleton/AiSkeletonPlaceholder.js +37 -0
- package/es/components/AiSkeleton/AiSkeletonText.js +51 -0
- package/es/components/Copy/Copy.d.ts +74 -0
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.d.ts +9 -0
- package/es/components/CopyButton/CopyButton.d.ts +71 -0
- package/es/components/CopyButton/index.d.ts +9 -0
- package/es/components/OverflowMenu/OverflowMenu.js +13 -1
- package/es/components/Slug/index.js +1 -11
- package/es/index.d.ts +1 -0
- package/es/index.js +5 -2
- package/lib/components/AiSkeleton/AiSkeletonIcon.js +49 -0
- package/lib/components/AiSkeleton/AiSkeletonPlaceholder.js +47 -0
- package/lib/components/AiSkeleton/AiSkeletonText.js +61 -0
- package/lib/components/Copy/Copy.d.ts +74 -0
- package/lib/components/Copy/Copy.js +1 -1
- package/lib/components/Copy/index.d.ts +9 -0
- package/lib/components/CopyButton/CopyButton.d.ts +71 -0
- package/lib/components/CopyButton/index.d.ts +9 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +13 -1
- package/lib/components/Slug/index.js +1 -11
- package/lib/index.d.ts +1 -0
- package/lib/index.js +10 -4
- package/package.json +8 -8
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import SkeletonIcon from '../SkeletonIcon/SkeletonIcon.js';
|
|
14
|
+
|
|
15
|
+
const AiSkeletonIcon = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const AiSkeletonIconClasses = cx(className, {
|
|
22
|
+
[`${prefix}--skeleton__icon--ai`]: true
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(SkeletonIcon, _extends({
|
|
25
|
+
className: AiSkeletonIconClasses
|
|
26
|
+
}, rest));
|
|
27
|
+
};
|
|
28
|
+
AiSkeletonIcon.propTypes = {
|
|
29
|
+
/**
|
|
30
|
+
* Specify an optional className to add.
|
|
31
|
+
*/
|
|
32
|
+
className: PropTypes.string,
|
|
33
|
+
/**
|
|
34
|
+
* The CSS styles.
|
|
35
|
+
*/
|
|
36
|
+
style: PropTypes.object
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { AiSkeletonIcon as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import React__default from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import SkeletonPlaceholder from '../SkeletonPlaceholder/SkeletonPlaceholder.js';
|
|
14
|
+
|
|
15
|
+
const AiSkeletonPlaceholder = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
...other
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const AiSkeletonPlaceholderClasses = cx({
|
|
22
|
+
className,
|
|
23
|
+
[`${prefix}--skeleton__placeholder--ai`]: true
|
|
24
|
+
}, className);
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(SkeletonPlaceholder, _extends({
|
|
26
|
+
className: AiSkeletonPlaceholderClasses
|
|
27
|
+
}, other));
|
|
28
|
+
};
|
|
29
|
+
AiSkeletonPlaceholder.propTypes = {
|
|
30
|
+
/**
|
|
31
|
+
* Add a custom class to the component
|
|
32
|
+
* to set the height and width
|
|
33
|
+
*/
|
|
34
|
+
className: PropTypes.string
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { AiSkeletonPlaceholder as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import SkeletonText from '../SkeletonText/SkeletonText.js';
|
|
14
|
+
|
|
15
|
+
const AiSkeletonText = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
20
|
+
const prefix = usePrefix();
|
|
21
|
+
const aiSkeletonTextClasses = cx(className, {
|
|
22
|
+
[`${prefix}--skeleton__text--ai`]: true
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(SkeletonText, _extends({
|
|
25
|
+
className: aiSkeletonTextClasses
|
|
26
|
+
}, rest));
|
|
27
|
+
};
|
|
28
|
+
AiSkeletonText.propTypes = {
|
|
29
|
+
/**
|
|
30
|
+
* Specify an optional className to be applied to the container node
|
|
31
|
+
*/
|
|
32
|
+
className: PropTypes.string,
|
|
33
|
+
/**
|
|
34
|
+
* generates skeleton text at a larger size
|
|
35
|
+
*/
|
|
36
|
+
heading: PropTypes.bool,
|
|
37
|
+
/**
|
|
38
|
+
* the number of lines shown if paragraph is true
|
|
39
|
+
*/
|
|
40
|
+
lineCount: PropTypes.number,
|
|
41
|
+
/**
|
|
42
|
+
* will generate multiple lines of text
|
|
43
|
+
*/
|
|
44
|
+
paragraph: PropTypes.bool,
|
|
45
|
+
/**
|
|
46
|
+
* width (in px or %) of single line of text or max-width of paragraph lines
|
|
47
|
+
*/
|
|
48
|
+
width: PropTypes.string
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { AiSkeletonText as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
8
|
+
import React, { AnimationEventHandler, MouseEventHandler, PropsWithChildren } from 'react';
|
|
9
|
+
interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
/**
|
|
11
|
+
* Specify how the trigger should align with the tooltip
|
|
12
|
+
*/
|
|
13
|
+
align?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
|
|
14
|
+
/**
|
|
15
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
20
|
+
* content is copied
|
|
21
|
+
*/
|
|
22
|
+
feedback?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Specify the time it takes for the feedback message to timeout
|
|
25
|
+
*/
|
|
26
|
+
feedbackTimeout?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Specify an optional `onAnimationEnd` handler that is called when the underlying
|
|
29
|
+
* animation ends
|
|
30
|
+
*/
|
|
31
|
+
onAnimationEnd?: AnimationEventHandler<HTMLButtonElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
34
|
+
* `<button>` is clicked
|
|
35
|
+
*/
|
|
36
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
37
|
+
}
|
|
38
|
+
declare function Copy({ align, children, className, feedback, feedbackTimeout, onAnimationEnd, onClick, ...other }: PropsWithChildren<CopyProps>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare namespace Copy {
|
|
40
|
+
var propTypes: {
|
|
41
|
+
/**
|
|
42
|
+
* Specify how the trigger should align with the tooltip
|
|
43
|
+
*/
|
|
44
|
+
align: PropTypes.Requireable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Pass in content to be rendered in the underlying `<button>`
|
|
47
|
+
*/
|
|
48
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
49
|
+
/**
|
|
50
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
51
|
+
*/
|
|
52
|
+
className: PropTypes.Requireable<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
55
|
+
* content is copied
|
|
56
|
+
*/
|
|
57
|
+
feedback: PropTypes.Requireable<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Specify the time it takes for the feedback message to timeout
|
|
60
|
+
*/
|
|
61
|
+
feedbackTimeout: PropTypes.Requireable<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Specify an optional `onAnimationEnd` handler that is called when the underlying
|
|
64
|
+
* animation ends
|
|
65
|
+
*/
|
|
66
|
+
onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
67
|
+
/**
|
|
68
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
69
|
+
* `<button>` is clicked
|
|
70
|
+
*/
|
|
71
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export default Copy;
|
|
@@ -57,7 +57,7 @@ function Copy(_ref) {
|
|
|
57
57
|
onClick: composeEventHandlers([onClick, handleClick]),
|
|
58
58
|
onAnimationEnd: composeEventHandlers([onAnimationEnd, handleAnimationEnd])
|
|
59
59
|
}, other, {
|
|
60
|
-
"aria-label": !children && (animation ? feedback : other['aria-label']) ||
|
|
60
|
+
"aria-label": !children && (animation ? feedback : other['aria-label']) || undefined
|
|
61
61
|
}), children);
|
|
62
62
|
}
|
|
63
63
|
Copy.propTypes = {
|
|
@@ -0,0 +1,71 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
8
|
+
import { MouseEventHandler } from 'react';
|
|
9
|
+
import { ButtonProps } from '../Button';
|
|
10
|
+
export interface CopyButtonProps extends ButtonProps<'button'> {
|
|
11
|
+
/**
|
|
12
|
+
* Specify how the trigger should align with the tooltip
|
|
13
|
+
*/
|
|
14
|
+
align?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
|
|
15
|
+
/**
|
|
16
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
21
|
+
* content is copied
|
|
22
|
+
*/
|
|
23
|
+
feedback?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specify the time it takes for the feedback message to timeout
|
|
26
|
+
*/
|
|
27
|
+
feedbackTimeout?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Provide a description for the icon representing the copy action that can
|
|
30
|
+
* be read by screen readers
|
|
31
|
+
*/
|
|
32
|
+
iconDescription?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
35
|
+
* `<button>` is clicked
|
|
36
|
+
*/
|
|
37
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
38
|
+
}
|
|
39
|
+
declare function CopyButton({ align, feedback, feedbackTimeout, iconDescription, className, onClick, ...other }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare namespace CopyButton {
|
|
41
|
+
var propTypes: {
|
|
42
|
+
/**
|
|
43
|
+
* Specify how the trigger should align with the tooltip
|
|
44
|
+
*/
|
|
45
|
+
align: PropTypes.Requireable<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
48
|
+
*/
|
|
49
|
+
className: PropTypes.Requireable<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
52
|
+
* content is copied
|
|
53
|
+
*/
|
|
54
|
+
feedback: PropTypes.Requireable<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Specify the time it takes for the feedback message to timeout
|
|
57
|
+
*/
|
|
58
|
+
feedbackTimeout: PropTypes.Requireable<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Provide a description for the icon representing the copy action that can
|
|
61
|
+
* be read by screen readers
|
|
62
|
+
*/
|
|
63
|
+
iconDescription: PropTypes.Requireable<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
66
|
+
* `<button>` is clicked
|
|
67
|
+
*/
|
|
68
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export default CopyButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 CopyButton from './CopyButton';
|
|
8
|
+
export default CopyButton;
|
|
9
|
+
export { CopyButton };
|
|
@@ -118,6 +118,9 @@ class OverflowMenu extends Component {
|
|
|
118
118
|
const {
|
|
119
119
|
onClick = noopFn
|
|
120
120
|
} = this.props;
|
|
121
|
+
this.setState({
|
|
122
|
+
click: true
|
|
123
|
+
});
|
|
121
124
|
evt.stopPropagation();
|
|
122
125
|
if (!this._menuBody || !this._menuBody.contains(evt.target)) {
|
|
123
126
|
this.setState({
|
|
@@ -127,6 +130,15 @@ class OverflowMenu extends Component {
|
|
|
127
130
|
}
|
|
128
131
|
});
|
|
129
132
|
_defineProperty(this, "closeMenuAndFocus", () => {
|
|
133
|
+
let wasClicked = this.state.click;
|
|
134
|
+
let wasOpen = this.state.open;
|
|
135
|
+
this.closeMenu(() => {
|
|
136
|
+
if (wasOpen && !wasClicked) {
|
|
137
|
+
this.focusMenuEl();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
_defineProperty(this, "closeMenuOnEscape", () => {
|
|
130
142
|
let wasOpen = this.state.open;
|
|
131
143
|
this.closeMenu(() => {
|
|
132
144
|
if (wasOpen) {
|
|
@@ -141,7 +153,7 @@ class OverflowMenu extends Component {
|
|
|
141
153
|
|
|
142
154
|
// Close the overflow menu on escape
|
|
143
155
|
if (matches(evt, [Escape])) {
|
|
144
|
-
this.
|
|
156
|
+
this.closeMenuOnEscape();
|
|
145
157
|
|
|
146
158
|
// Stop the esc keypress from bubbling out and closing something it shouldn't
|
|
147
159
|
evt.stopPropagation();
|
|
@@ -76,7 +76,6 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
|
|
|
76
76
|
autoAlign = true,
|
|
77
77
|
children,
|
|
78
78
|
className,
|
|
79
|
-
dotType,
|
|
80
79
|
kind = 'default',
|
|
81
80
|
onRevertClick,
|
|
82
81
|
revertActive,
|
|
@@ -89,11 +88,6 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
|
|
|
89
88
|
const id = useId('slug');
|
|
90
89
|
const slugClasses = cx(className, {
|
|
91
90
|
[`${prefix}--slug`]: true,
|
|
92
|
-
[`${prefix}--slug--hollow`]: kind === 'hollow' || dotType === 'hollow',
|
|
93
|
-
// Need to come up with a better name; explainable?
|
|
94
|
-
// Need to be able to target the non-hollow variant another way
|
|
95
|
-
// other than using `:not` all over the styles
|
|
96
|
-
[`${prefix}--slug--enabled`]: kind !== 'hollow' && dotType !== 'hollow',
|
|
97
91
|
[`${prefix}--slug--revert`]: revertActive
|
|
98
92
|
});
|
|
99
93
|
const slugButtonClasses = cx({
|
|
@@ -155,14 +149,10 @@ Slug.propTypes = {
|
|
|
155
149
|
* Specify an optional className to be added to the AI slug
|
|
156
150
|
*/
|
|
157
151
|
className: PropTypes.string,
|
|
158
|
-
/**
|
|
159
|
-
* Specify the type of dot that should be rendered in front of the inline variant
|
|
160
|
-
*/
|
|
161
|
-
dotType: PropTypes.oneOf(['default', 'hollow']),
|
|
162
152
|
/**
|
|
163
153
|
* Specify the type of Slug, from the following list of types:
|
|
164
154
|
*/
|
|
165
|
-
kind: PropTypes.oneOf(['default', '
|
|
155
|
+
kind: PropTypes.oneOf(['default', 'inline']),
|
|
166
156
|
/**
|
|
167
157
|
* Callback function that fires when the revert button is clicked
|
|
168
158
|
*/
|
package/es/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ export * from './components/Popover';
|
|
|
116
116
|
export * from './components/ProgressBar';
|
|
117
117
|
export { Slug as unstable__Slug, SlugContent as unstable__SlugContent, SlugActions as unstable__SlugActions, } from './components/Slug';
|
|
118
118
|
export { ChatButton as unstable__ChatButton, ChatButtonSkeleton as unstable__ChatButtonSkeleton, } from './components/ChatButton';
|
|
119
|
+
export { AiSkeletonText as unstable__AiSkeletonText, AiSkeletonIcon as unstable__AiSkeletonIcon, AiSkeletonPlaceholder as unstable__AiSkeletonPlaceholder, } from './components/AiSkeleton';
|
|
119
120
|
export * from './components/Stack';
|
|
120
121
|
export * from './components/Tooltip';
|
|
121
122
|
export { Text as unstable_Text, TextDirection as unstable_TextDirection, } from './components/Text';
|
package/es/index.js
CHANGED
|
@@ -25,6 +25,8 @@ export { default as ComposedModal, ModalBody } from './components/ComposedModal/
|
|
|
25
25
|
export { ModalHeader } from './components/ComposedModal/ModalHeader.js';
|
|
26
26
|
export { ModalFooter } from './components/ComposedModal/ModalFooter.js';
|
|
27
27
|
export { default as ContentSwitcher } from './components/ContentSwitcher/index.js';
|
|
28
|
+
export { default as Copy } from './components/Copy/Copy.js';
|
|
29
|
+
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
28
30
|
export { default as DangerButton } from './components/DangerButton/DangerButton.js';
|
|
29
31
|
import './components/DataTable/index.js';
|
|
30
32
|
export { default as DataTableSkeleton } from './components/DataTableSkeleton/DataTableSkeleton.js';
|
|
@@ -149,6 +151,9 @@ export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/Overflow
|
|
|
149
151
|
export { Popover, PopoverContent } from './components/Popover/index.js';
|
|
150
152
|
export { default as ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
151
153
|
export { Slug as unstable__Slug, SlugActions as unstable__SlugActions, SlugContent as unstable__SlugContent } from './components/Slug/index.js';
|
|
154
|
+
export { default as unstable__AiSkeletonPlaceholder } from './components/AiSkeleton/AiSkeletonPlaceholder.js';
|
|
155
|
+
export { default as unstable__AiSkeletonIcon } from './components/AiSkeleton/AiSkeletonIcon.js';
|
|
156
|
+
export { default as unstable__AiSkeletonText } from './components/AiSkeleton/AiSkeletonText.js';
|
|
152
157
|
export { HStack, VStack } from './components/Stack/index.js';
|
|
153
158
|
export { DefinitionTooltip } from './components/Tooltip/DefinitionTooltip.js';
|
|
154
159
|
export { Tooltip } from './components/Tooltip/Tooltip.js';
|
|
@@ -169,8 +174,6 @@ export { default as CodeSnippet } from './components/CodeSnippet/CodeSnippet.js'
|
|
|
169
174
|
export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
|
|
170
175
|
export { default as ContainedList } from './components/ContainedList/ContainedList.js';
|
|
171
176
|
export { default as useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
172
|
-
export { default as Copy } from './components/Copy/Copy.js';
|
|
173
|
-
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
174
177
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
175
178
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
176
179
|
export { default as TextInput } from './components/TextInput/TextInput.js';
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var SkeletonIcon = require('../SkeletonIcon/SkeletonIcon.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
const AiSkeletonIcon = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
className,
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
30
|
+
const prefix = usePrefix.usePrefix();
|
|
31
|
+
const AiSkeletonIconClasses = cx__default["default"](className, {
|
|
32
|
+
[`${prefix}--skeleton__icon--ai`]: true
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(SkeletonIcon["default"], _rollupPluginBabelHelpers["extends"]({
|
|
35
|
+
className: AiSkeletonIconClasses
|
|
36
|
+
}, rest));
|
|
37
|
+
};
|
|
38
|
+
AiSkeletonIcon.propTypes = {
|
|
39
|
+
/**
|
|
40
|
+
* Specify an optional className to add.
|
|
41
|
+
*/
|
|
42
|
+
className: PropTypes__default["default"].string,
|
|
43
|
+
/**
|
|
44
|
+
* The CSS styles.
|
|
45
|
+
*/
|
|
46
|
+
style: PropTypes__default["default"].object
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports["default"] = AiSkeletonIcon;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var PropTypes = require('prop-types');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var SkeletonPlaceholder = require('../SkeletonPlaceholder/SkeletonPlaceholder.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
const AiSkeletonPlaceholder = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
className,
|
|
28
|
+
...other
|
|
29
|
+
} = _ref;
|
|
30
|
+
const prefix = usePrefix.usePrefix();
|
|
31
|
+
const AiSkeletonPlaceholderClasses = cx__default["default"]({
|
|
32
|
+
className,
|
|
33
|
+
[`${prefix}--skeleton__placeholder--ai`]: true
|
|
34
|
+
}, className);
|
|
35
|
+
return /*#__PURE__*/React__default["default"].createElement(SkeletonPlaceholder["default"], _rollupPluginBabelHelpers["extends"]({
|
|
36
|
+
className: AiSkeletonPlaceholderClasses
|
|
37
|
+
}, other));
|
|
38
|
+
};
|
|
39
|
+
AiSkeletonPlaceholder.propTypes = {
|
|
40
|
+
/**
|
|
41
|
+
* Add a custom class to the component
|
|
42
|
+
* to set the height and width
|
|
43
|
+
*/
|
|
44
|
+
className: PropTypes__default["default"].string
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports["default"] = AiSkeletonPlaceholder;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
+
var PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var SkeletonText = require('../SkeletonText/SkeletonText.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
const AiSkeletonText = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
className,
|
|
28
|
+
...rest
|
|
29
|
+
} = _ref;
|
|
30
|
+
const prefix = usePrefix.usePrefix();
|
|
31
|
+
const aiSkeletonTextClasses = cx__default["default"](className, {
|
|
32
|
+
[`${prefix}--skeleton__text--ai`]: true
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(SkeletonText["default"], _rollupPluginBabelHelpers["extends"]({
|
|
35
|
+
className: aiSkeletonTextClasses
|
|
36
|
+
}, rest));
|
|
37
|
+
};
|
|
38
|
+
AiSkeletonText.propTypes = {
|
|
39
|
+
/**
|
|
40
|
+
* Specify an optional className to be applied to the container node
|
|
41
|
+
*/
|
|
42
|
+
className: PropTypes__default["default"].string,
|
|
43
|
+
/**
|
|
44
|
+
* generates skeleton text at a larger size
|
|
45
|
+
*/
|
|
46
|
+
heading: PropTypes__default["default"].bool,
|
|
47
|
+
/**
|
|
48
|
+
* the number of lines shown if paragraph is true
|
|
49
|
+
*/
|
|
50
|
+
lineCount: PropTypes__default["default"].number,
|
|
51
|
+
/**
|
|
52
|
+
* will generate multiple lines of text
|
|
53
|
+
*/
|
|
54
|
+
paragraph: PropTypes__default["default"].bool,
|
|
55
|
+
/**
|
|
56
|
+
* width (in px or %) of single line of text or max-width of paragraph lines
|
|
57
|
+
*/
|
|
58
|
+
width: PropTypes__default["default"].string
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports["default"] = AiSkeletonText;
|
|
@@ -0,0 +1,74 @@
|
|
|
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 PropTypes from 'prop-types';
|
|
8
|
+
import React, { AnimationEventHandler, MouseEventHandler, PropsWithChildren } from 'react';
|
|
9
|
+
interface CopyProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
/**
|
|
11
|
+
* Specify how the trigger should align with the tooltip
|
|
12
|
+
*/
|
|
13
|
+
align?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
|
|
14
|
+
/**
|
|
15
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
20
|
+
* content is copied
|
|
21
|
+
*/
|
|
22
|
+
feedback?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Specify the time it takes for the feedback message to timeout
|
|
25
|
+
*/
|
|
26
|
+
feedbackTimeout?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Specify an optional `onAnimationEnd` handler that is called when the underlying
|
|
29
|
+
* animation ends
|
|
30
|
+
*/
|
|
31
|
+
onAnimationEnd?: AnimationEventHandler<HTMLButtonElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
34
|
+
* `<button>` is clicked
|
|
35
|
+
*/
|
|
36
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
37
|
+
}
|
|
38
|
+
declare function Copy({ align, children, className, feedback, feedbackTimeout, onAnimationEnd, onClick, ...other }: PropsWithChildren<CopyProps>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare namespace Copy {
|
|
40
|
+
var propTypes: {
|
|
41
|
+
/**
|
|
42
|
+
* Specify how the trigger should align with the tooltip
|
|
43
|
+
*/
|
|
44
|
+
align: PropTypes.Requireable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Pass in content to be rendered in the underlying `<button>`
|
|
47
|
+
*/
|
|
48
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
49
|
+
/**
|
|
50
|
+
* Specify an optional className to be applied to the underlying `<button>`
|
|
51
|
+
*/
|
|
52
|
+
className: PropTypes.Requireable<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Specify the string that is displayed when the button is clicked and the
|
|
55
|
+
* content is copied
|
|
56
|
+
*/
|
|
57
|
+
feedback: PropTypes.Requireable<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Specify the time it takes for the feedback message to timeout
|
|
60
|
+
*/
|
|
61
|
+
feedbackTimeout: PropTypes.Requireable<number>;
|
|
62
|
+
/**
|
|
63
|
+
* Specify an optional `onAnimationEnd` handler that is called when the underlying
|
|
64
|
+
* animation ends
|
|
65
|
+
*/
|
|
66
|
+
onAnimationEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
67
|
+
/**
|
|
68
|
+
* Specify an optional `onClick` handler that is called when the underlying
|
|
69
|
+
* `<button>` is clicked
|
|
70
|
+
*/
|
|
71
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export default Copy;
|
|
@@ -68,7 +68,7 @@ function Copy(_ref) {
|
|
|
68
68
|
onClick: events.composeEventHandlers([onClick, handleClick]),
|
|
69
69
|
onAnimationEnd: events.composeEventHandlers([onAnimationEnd, handleAnimationEnd])
|
|
70
70
|
}, other, {
|
|
71
|
-
"aria-label": !children && (animation ? feedback : other['aria-label']) ||
|
|
71
|
+
"aria-label": !children && (animation ? feedback : other['aria-label']) || undefined
|
|
72
72
|
}), children);
|
|
73
73
|
}
|
|
74
74
|
Copy.propTypes = {
|