@carbon/react 1.59.0 → 1.60.0-rc.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 +1054 -972
- package/es/_virtual/_rollupPluginBabelHelpers.js +23 -34
- package/es/components/Button/ButtonBase.d.ts +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.d.ts +27 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +5 -5
- package/es/components/ComboBox/ComboBox.d.ts +6 -0
- package/es/components/ComboBox/ComboBox.js +36 -3
- package/es/components/ComboButton/index.d.ts +1 -1
- package/es/components/ComposedModal/ModalHeader.js +0 -1
- package/es/components/DataTable/DataTable.d.ts +3 -0
- package/es/components/DataTable/DataTable.js +4 -1
- package/es/components/DataTable/TableSelectAll.d.ts +14 -3
- package/es/components/DataTable/TableSelectAll.js +10 -3
- package/es/components/DataTable/TableSelectRow.d.ts +16 -4
- package/es/components/DataTable/TableSelectRow.js +11 -4
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +0 -1
- package/es/components/DatePicker/index.d.ts +2 -2
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/index.d.ts +2 -2
- package/es/components/FileUploader/FileUploaderItem.js +7 -4
- package/es/components/Heading/index.d.ts +1 -1
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/ListBox/ListBoxMenu.js +0 -1
- package/es/components/Menu/Menu.d.ts +1 -0
- package/es/components/Menu/Menu.js +13 -10
- package/es/components/MenuButton/index.d.ts +2 -1
- package/es/components/MenuButton/index.js +50 -29
- package/es/components/MultiSelect/MultiSelect.js +0 -1
- package/es/components/Popover/index.js +0 -1
- package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/es/components/RadioButton/RadioButton.d.ts +2 -2
- package/es/components/RadioButton/index.d.ts +2 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -3
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +8 -10
- package/es/components/RadioButtonGroup/index.d.ts +2 -1
- package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/es/components/Tabs/Tabs.js +7 -4
- package/es/components/Tag/DismissibleTag.d.ts +1 -1
- package/es/components/Tag/OperationalTag.d.ts +1 -1
- package/es/components/Tag/SelectableTag.d.ts +1 -1
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Text/index.d.ts +2 -2
- package/es/components/TextArea/TextArea.js +1 -0
- package/es/components/Toggletip/index.d.ts +1 -1
- package/es/components/Tooltip/DefinitionTooltip.js +22 -1
- package/es/components/UIShell/Content.d.ts +4 -7
- package/es/components/UIShell/Link.d.ts +1 -1
- package/es/components/UIShell/Link.js +1 -0
- package/es/components/UIShell/SideNav.js +1 -0
- package/es/components/UIShell/SwitcherItem.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/_virtual/_rollupPluginBabelHelpers.js +23 -34
- package/lib/components/Button/ButtonBase.d.ts +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +27 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +5 -5
- package/lib/components/ComboBox/ComboBox.d.ts +6 -0
- package/lib/components/ComboBox/ComboBox.js +35 -2
- package/lib/components/ComboButton/index.d.ts +1 -1
- package/lib/components/ComposedModal/ModalHeader.js +0 -1
- package/lib/components/DataTable/DataTable.d.ts +3 -0
- package/lib/components/DataTable/DataTable.js +4 -1
- package/lib/components/DataTable/TableSelectAll.d.ts +14 -3
- package/lib/components/DataTable/TableSelectAll.js +10 -3
- package/lib/components/DataTable/TableSelectRow.d.ts +16 -4
- package/lib/components/DataTable/TableSelectRow.js +11 -4
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +0 -1
- package/lib/components/DatePicker/index.d.ts +2 -2
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/index.d.ts +2 -2
- package/lib/components/FileUploader/FileUploaderItem.js +7 -4
- package/lib/components/Heading/index.d.ts +1 -1
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/ListBox/ListBoxMenu.js +0 -1
- package/lib/components/Menu/Menu.d.ts +1 -0
- package/lib/components/Menu/Menu.js +13 -10
- package/lib/components/MenuButton/index.d.ts +2 -1
- package/lib/components/MenuButton/index.js +46 -25
- package/lib/components/MultiSelect/MultiSelect.js +0 -1
- package/lib/components/Popover/index.js +0 -1
- package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/components/RadioButton/index.d.ts +2 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -3
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +8 -10
- package/lib/components/RadioButtonGroup/index.d.ts +2 -1
- package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/lib/components/Tabs/Tabs.js +7 -4
- package/lib/components/Tag/DismissibleTag.d.ts +1 -1
- package/lib/components/Tag/OperationalTag.d.ts +1 -1
- package/lib/components/Tag/SelectableTag.d.ts +1 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Text/index.d.ts +2 -2
- package/lib/components/TextArea/TextArea.js +1 -0
- package/lib/components/Toggletip/index.d.ts +1 -1
- package/lib/components/Tooltip/DefinitionTooltip.js +22 -1
- package/lib/components/UIShell/Content.d.ts +4 -7
- package/lib/components/UIShell/Link.d.ts +1 -1
- package/lib/components/UIShell/Link.js +1 -0
- package/lib/components/UIShell/SideNav.js +1 -0
- package/lib/components/UIShell/SwitcherItem.d.ts +1 -1
- package/lib/index.js +2 -2
- package/package.json +10 -9
|
@@ -20,8 +20,9 @@ var Menu = require('../Menu/Menu.js');
|
|
|
20
20
|
require('../Menu/MenuItem.js');
|
|
21
21
|
var useAttachedMenu = require('../../internal/useAttachedMenu.js');
|
|
22
22
|
var useId = require('../../internal/useId.js');
|
|
23
|
-
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
24
23
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
24
|
+
var react = require('@floating-ui/react');
|
|
25
|
+
var mergeRefs = require('../../tools/mergeRefs.js');
|
|
25
26
|
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
27
28
|
|
|
@@ -29,7 +30,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
29
30
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
30
31
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
31
32
|
|
|
32
|
-
const spacing = 0; // top and bottom spacing between the button and the menu. in px
|
|
33
33
|
const validButtonKinds = ['primary', 'tertiary', 'ghost'];
|
|
34
34
|
const defaultButtonKind = 'primary';
|
|
35
35
|
const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton(_ref, forwardRef) {
|
|
@@ -47,35 +47,57 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton(_ref, forwa
|
|
|
47
47
|
const id = useId.useId('MenuButton');
|
|
48
48
|
const prefix = usePrefix.usePrefix();
|
|
49
49
|
const triggerRef = React.useRef(null);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const middlewares = [react.flip({
|
|
51
|
+
crossAxis: false
|
|
52
|
+
})];
|
|
53
|
+
if (menuAlignment === 'bottom' || menuAlignment === 'top') {
|
|
54
|
+
middlewares.push(react.size({
|
|
55
|
+
apply(_ref2) {
|
|
56
|
+
let {
|
|
57
|
+
rects,
|
|
58
|
+
elements
|
|
59
|
+
} = _ref2;
|
|
60
|
+
Object.assign(elements.floating.style, {
|
|
61
|
+
width: `${rects.reference.width}px`
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
const {
|
|
67
|
+
refs,
|
|
68
|
+
floatingStyles,
|
|
69
|
+
placement,
|
|
70
|
+
middlewareData
|
|
71
|
+
} = react.useFloating({
|
|
72
|
+
placement: menuAlignment,
|
|
73
|
+
// The floating element is positioned relative to its nearest
|
|
74
|
+
// containing block (usually the viewport). It will in many cases also
|
|
75
|
+
// “break” the floating element out of a clipping ancestor.
|
|
76
|
+
// https://floating-ui.com/docs/misc#clipping
|
|
77
|
+
strategy: 'fixed',
|
|
78
|
+
// Middleware order matters, arrow should be last
|
|
79
|
+
middleware: middlewares,
|
|
80
|
+
whileElementsMounted: react.autoUpdate
|
|
81
|
+
});
|
|
82
|
+
const ref = mergeRefs["default"](forwardRef, triggerRef);
|
|
53
83
|
const {
|
|
54
84
|
open,
|
|
55
|
-
x,
|
|
56
|
-
y,
|
|
57
85
|
handleClick: hookOnClick,
|
|
58
86
|
handleMousedown,
|
|
59
87
|
handleClose
|
|
60
88
|
} = useAttachedMenu.useAttachedMenu(triggerRef);
|
|
89
|
+
React.useLayoutEffect(() => {
|
|
90
|
+
Object.keys(floatingStyles).forEach(style => {
|
|
91
|
+
if (refs.floating.current) {
|
|
92
|
+
refs.floating.current.style[style] = floatingStyles[style];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}, [floatingStyles, refs.floating, middlewareData, placement, open]);
|
|
61
96
|
function handleClick() {
|
|
62
97
|
if (triggerRef.current) {
|
|
63
|
-
const {
|
|
64
|
-
width: w
|
|
65
|
-
} = triggerRef.current.getBoundingClientRect();
|
|
66
|
-
setWidth(w);
|
|
67
98
|
hookOnClick();
|
|
68
99
|
}
|
|
69
100
|
}
|
|
70
|
-
function handleOpen() {
|
|
71
|
-
if (menuRef.current) {
|
|
72
|
-
menuRef.current.style.inlineSize = `${width}px`;
|
|
73
|
-
menuRef.current.style.minInlineSize = `${width}px`;
|
|
74
|
-
if (menuAlignment !== 'bottom' && menuAlignment !== 'top') {
|
|
75
|
-
menuRef.current.style.inlineSize = `fit-content`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
101
|
const containerClasses = cx__default["default"](`${prefix}--menu-button__container`, className);
|
|
80
102
|
const triggerClasses = cx__default["default"](`${prefix}--menu-button__trigger`, {
|
|
81
103
|
[`${prefix}--menu-button__trigger--open`]: open
|
|
@@ -86,6 +108,7 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton(_ref, forwa
|
|
|
86
108
|
"aria-owns": open ? id : undefined,
|
|
87
109
|
className: containerClasses
|
|
88
110
|
}), /*#__PURE__*/React__default["default"].createElement(Button["default"], {
|
|
111
|
+
ref: refs.setReference,
|
|
89
112
|
className: triggerClasses,
|
|
90
113
|
size: size,
|
|
91
114
|
tabIndex: tabIndex,
|
|
@@ -101,16 +124,14 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton(_ref, forwa
|
|
|
101
124
|
containerRef: triggerRef,
|
|
102
125
|
menuAlignment: menuAlignment,
|
|
103
126
|
className: menuClasses,
|
|
104
|
-
ref:
|
|
127
|
+
ref: refs.setFloating,
|
|
105
128
|
id: id,
|
|
129
|
+
legacyAutoalign: false,
|
|
106
130
|
label: label,
|
|
107
131
|
mode: "basic",
|
|
108
132
|
size: size,
|
|
109
133
|
open: open,
|
|
110
|
-
onClose: handleClose
|
|
111
|
-
onOpen: handleOpen,
|
|
112
|
-
x: x,
|
|
113
|
-
y: [y[0] - spacing, y[1] + spacing]
|
|
134
|
+
onClose: handleClose
|
|
114
135
|
}, children));
|
|
115
136
|
});
|
|
116
137
|
MenuButton.propTypes = {
|
|
@@ -142,7 +142,6 @@ const Popover = /*#__PURE__*/React__default["default"].forwardRef(function Popov
|
|
|
142
142
|
whileElementsMounted: react.autoUpdate
|
|
143
143
|
} : {} // When autoAlign is turned off, floating-ui will not be used
|
|
144
144
|
);
|
|
145
|
-
|
|
146
145
|
const value = React.useMemo(() => {
|
|
147
146
|
return {
|
|
148
147
|
floating,
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const PrimaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const PrimaryButton: <T extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default PrimaryButton;
|
|
@@ -49,7 +49,7 @@ export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
49
49
|
* Provide an optional `onChange` hook that is called each time the value of
|
|
50
50
|
* the underlying `<input>` changes
|
|
51
51
|
*/
|
|
52
|
-
onChange?: (value:
|
|
52
|
+
onChange?: (value: RadioButtonProps['value'], name: RadioButtonProps['name'], event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
53
53
|
/**
|
|
54
54
|
* Provide a handler that is invoked when a user clicks on the control
|
|
55
55
|
*/
|
|
@@ -67,5 +67,5 @@ export interface RadioButtonProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
67
67
|
*/
|
|
68
68
|
required?: boolean;
|
|
69
69
|
}
|
|
70
|
-
declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<
|
|
70
|
+
declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
71
71
|
export default RadioButton;
|
|
@@ -4,6 +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 RadioButton from './RadioButton';
|
|
7
|
+
import RadioButton, { RadioButtonProps } from './RadioButton';
|
|
8
8
|
export default RadioButton;
|
|
9
9
|
export { RadioButton };
|
|
10
|
+
export type { RadioButtonProps };
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
|
+
import type { RadioButtonProps } from '../RadioButton';
|
|
8
9
|
export declare const RadioButtonGroupContext: React.Context<null>;
|
|
9
10
|
type ExcludedAttributes = 'onChange';
|
|
10
11
|
export interface RadioButtonGroupProps extends Omit<React.InputHTMLAttributes<HTMLFieldSetElement>, ExcludedAttributes> {
|
|
@@ -19,7 +20,7 @@ export interface RadioButtonGroupProps extends Omit<React.InputHTMLAttributes<HT
|
|
|
19
20
|
/**
|
|
20
21
|
* Specify the `<RadioButton>` to be selected by default
|
|
21
22
|
*/
|
|
22
|
-
defaultSelected?:
|
|
23
|
+
defaultSelected?: RadioButtonProps['value'];
|
|
23
24
|
/**
|
|
24
25
|
* Specify whether the group is disabled
|
|
25
26
|
*/
|
|
@@ -53,7 +54,7 @@ export interface RadioButtonGroupProps extends Omit<React.InputHTMLAttributes<HT
|
|
|
53
54
|
* Provide an optional `onChange` hook that is called whenever the value of
|
|
54
55
|
* the group changes
|
|
55
56
|
*/
|
|
56
|
-
onChange?: (selection:
|
|
57
|
+
onChange?: (selection: RadioButtonProps['value'], name: RadioButtonGroupProps['name'], event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
57
58
|
/**
|
|
58
59
|
* Provide where radio buttons should be placed
|
|
59
60
|
*/
|
|
@@ -77,7 +78,7 @@ export interface RadioButtonGroupProps extends Omit<React.InputHTMLAttributes<HT
|
|
|
77
78
|
/**
|
|
78
79
|
* Specify the value that is currently selected in the group
|
|
79
80
|
*/
|
|
80
|
-
valueSelected?:
|
|
81
|
+
valueSelected?: RadioButtonProps['value'];
|
|
81
82
|
/**
|
|
82
83
|
* `true` to specify if input selection in group is required.
|
|
83
84
|
*/
|
|
@@ -65,23 +65,21 @@ const RadioButtonGroup = /*#__PURE__*/React__default["default"].forwardRef((prop
|
|
|
65
65
|
}
|
|
66
66
|
function getRadioButtons() {
|
|
67
67
|
const mappedChildren = React__default["default"].Children.map(children, radioButton => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
68
|
+
if (!radioButton) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
71
|
const newProps = {
|
|
72
72
|
name: name,
|
|
73
|
-
key: value,
|
|
74
|
-
value: value,
|
|
73
|
+
key: radioButton.props.value,
|
|
74
|
+
value: radioButton.props.value,
|
|
75
75
|
onChange: handleOnChange,
|
|
76
|
-
checked: value === selected,
|
|
76
|
+
checked: radioButton.props.value === selected,
|
|
77
77
|
required: required
|
|
78
78
|
};
|
|
79
|
-
if (!selected && radioButton
|
|
79
|
+
if (!selected && radioButton.props.checked) {
|
|
80
80
|
newProps.checked = true;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/React__default["default"].cloneElement(radioButton, newProps);
|
|
84
|
-
}
|
|
82
|
+
return /*#__PURE__*/React__default["default"].cloneElement(radioButton, newProps);
|
|
85
83
|
});
|
|
86
84
|
return mappedChildren;
|
|
87
85
|
}
|
|
@@ -4,6 +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 RadioButtonGroup from './RadioButtonGroup';
|
|
7
|
+
import RadioButtonGroup, { RadioButtonGroupProps } from './RadioButtonGroup';
|
|
8
8
|
export default RadioButtonGroup;
|
|
9
9
|
export { RadioButtonGroup };
|
|
10
|
+
export type { RadioButtonGroupProps };
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const SecondaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const SecondaryButton: <T extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default SecondaryButton;
|
|
@@ -262,13 +262,14 @@ function TabList(_ref2) {
|
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
React.useEffect(() => {
|
|
265
|
-
|
|
265
|
+
//adding 1 in calculation for firefox support
|
|
266
|
+
setIsNextButtonVisible(ref.current ? scrollLeft + buttonWidth + ref.current.clientWidth + 1 < ref.current.scrollWidth : false);
|
|
266
267
|
if (dismissable) {
|
|
267
268
|
if (ref.current) {
|
|
268
269
|
setIsScrollable(ref.current.scrollWidth > ref.current.clientWidth);
|
|
269
270
|
}
|
|
270
271
|
}
|
|
271
|
-
}, [scrollLeft, children, dismissable]);
|
|
272
|
+
}, [scrollLeft, children, dismissable, isScrollable]);
|
|
272
273
|
useEffectOnce.useEffectOnce(() => {
|
|
273
274
|
if (tabs.current[selectedIndex]?.disabled) {
|
|
274
275
|
const activeTabs = tabs.current.filter(tab => {
|
|
@@ -282,11 +283,13 @@ function TabList(_ref2) {
|
|
|
282
283
|
});
|
|
283
284
|
useIsomorphicEffect["default"](() => {
|
|
284
285
|
if (ref.current) {
|
|
285
|
-
|
|
286
|
+
//adding 1 in calculation for firefox support
|
|
287
|
+
setIsScrollable(ref.current.scrollWidth > ref.current.clientWidth + 1);
|
|
286
288
|
}
|
|
287
289
|
function handler() {
|
|
288
290
|
if (ref.current) {
|
|
289
|
-
|
|
291
|
+
//adding 1 in calculation for firefox support
|
|
292
|
+
setIsScrollable(ref.current.scrollWidth > ref.current.clientWidth + 1);
|
|
290
293
|
}
|
|
291
294
|
}
|
|
292
295
|
const debouncedHandler = debounce__default["default"](handler, 200);
|
|
@@ -54,7 +54,7 @@ export interface DismissibleTagBaseProps {
|
|
|
54
54
|
}
|
|
55
55
|
export type DismissibleTagProps<T extends React.ElementType> = PolymorphicProps<T, DismissibleTagBaseProps>;
|
|
56
56
|
declare const DismissibleTag: {
|
|
57
|
-
<T extends React.ElementType<any>>({ className, disabled, id, renderIcon, title, onClose, slug, size, text, type, ...other }: DismissibleTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
<T extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>({ className, disabled, id, renderIcon, title, onClose, slug, size, text, type, ...other }: DismissibleTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
propTypes: {
|
|
59
59
|
/**
|
|
60
60
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -59,7 +59,7 @@ export interface OperationalTagBaseProps {
|
|
|
59
59
|
}
|
|
60
60
|
export type OperationalTagProps<T extends React.ElementType> = PolymorphicProps<T, OperationalTagBaseProps>;
|
|
61
61
|
declare const OperationalTag: {
|
|
62
|
-
<T extends React.ElementType<any>>({ className, disabled, id, renderIcon, slug, size, text, type, ...other }: OperationalTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
<T extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>({ className, disabled, id, renderIcon, slug, size, text, type, ...other }: OperationalTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
63
63
|
propTypes: {
|
|
64
64
|
/**
|
|
65
65
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -46,7 +46,7 @@ export interface SelectableTagBaseProps {
|
|
|
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>>({ className, disabled, id, renderIcon, selected, slug, size, text, ...other }: SelectableTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
<T extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>({ className, disabled, id, renderIcon, selected, slug, size, text, ...other }: SelectableTagProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
50
50
|
propTypes: {
|
|
51
51
|
/**
|
|
52
52
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -74,6 +74,6 @@ export interface TagBaseProps {
|
|
|
74
74
|
type?: keyof typeof TYPES;
|
|
75
75
|
}
|
|
76
76
|
export type TagProps<T extends React.ElementType> = PolymorphicProps<T, TagBaseProps>;
|
|
77
|
-
declare const Tag: React.ForwardRefExoticComponent<Omit<TagProps<React.ElementType<any>>, "ref"> & React.RefAttributes<HTMLElement | undefined>>;
|
|
77
|
+
declare const Tag: React.ForwardRefExoticComponent<Omit<TagProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLElement | undefined>>;
|
|
78
78
|
export declare const types: string[];
|
|
79
79
|
export default Tag;
|
|
@@ -9,10 +9,10 @@ import { Text, TextBaseProps, TextProps } from './Text';
|
|
|
9
9
|
export { TextDirection, Text };
|
|
10
10
|
export type { TextBaseProps, TextProps, TextDirectionProps, GetTextDirection, TextDir, };
|
|
11
11
|
export declare const Label: {
|
|
12
|
-
(props: TextProps<import("react").ElementType<any>>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
(props: TextProps<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
export declare const Legend: {
|
|
16
|
-
(props: TextProps<import("react").ElementType<any>>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
(props: TextProps<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
@@ -164,6 +164,7 @@ const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwa
|
|
|
164
164
|
};
|
|
165
165
|
const formItemClasses = cx__default["default"](`${prefix}--form-item`, className);
|
|
166
166
|
const textAreaWrapperClasses = cx__default["default"](`${prefix}--text-area__wrapper`, {
|
|
167
|
+
[`${prefix}--text-area__wrapper--cols`]: other.cols,
|
|
167
168
|
[`${prefix}--text-area__wrapper--readonly`]: other.readOnly,
|
|
168
169
|
[`${prefix}--text-area__wrapper--warn`]: warn,
|
|
169
170
|
[`${prefix}--text-area__wrapper--slug`]: slug
|
|
@@ -89,7 +89,7 @@ export type ToggleTipButtonProps<T extends React.ElementType> = PolymorphicProps
|
|
|
89
89
|
* `ToggletipButton` controls the visibility of the Toggletip through mouse
|
|
90
90
|
* clicks and keyboard interactions.
|
|
91
91
|
*/
|
|
92
|
-
export declare const ToggletipButton: React.ForwardRefExoticComponent<Omit<ToggleTipButtonProps<React.ElementType<any>>, "ref"> & React.RefAttributes<unknown>>;
|
|
92
|
+
export declare const ToggletipButton: React.ForwardRefExoticComponent<Omit<ToggleTipButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
|
|
93
93
|
interface ToggletipContentProps {
|
|
94
94
|
children?: ReactNode;
|
|
95
95
|
className?: string | undefined;
|
|
@@ -84,7 +84,28 @@ DefinitionTooltip.propTypes = {
|
|
|
84
84
|
/**
|
|
85
85
|
* Specify how the trigger should align with the tooltip
|
|
86
86
|
*/
|
|
87
|
-
align: PropTypes__default["default"].oneOf(['top', 'top-left',
|
|
87
|
+
align: PropTypes__default["default"].oneOf(['top', 'top-left',
|
|
88
|
+
// deprecated use top-start instead
|
|
89
|
+
'top-right',
|
|
90
|
+
// deprecated use top-end instead
|
|
91
|
+
|
|
92
|
+
'bottom', 'bottom-left',
|
|
93
|
+
// deprecated use bottom-start instead
|
|
94
|
+
'bottom-right',
|
|
95
|
+
// deprecated use bottom-end instead
|
|
96
|
+
|
|
97
|
+
'left', 'left-bottom',
|
|
98
|
+
// deprecated use left-end instead
|
|
99
|
+
'left-top',
|
|
100
|
+
// deprecated use left-start instead
|
|
101
|
+
|
|
102
|
+
'right', 'right-bottom',
|
|
103
|
+
// deprecated use right-end instead
|
|
104
|
+
'right-top',
|
|
105
|
+
// deprecated use right-start instead
|
|
106
|
+
|
|
107
|
+
// new values to match floating-ui
|
|
108
|
+
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
88
109
|
/**
|
|
89
110
|
* The `children` prop will be used as the value that is being defined
|
|
90
111
|
*/
|
|
@@ -29,7 +29,7 @@ declare const Content: {
|
|
|
29
29
|
suppressHydrationWarning?: boolean | undefined;
|
|
30
30
|
accessKey?: string | undefined;
|
|
31
31
|
autoFocus?: boolean | undefined;
|
|
32
|
-
contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
|
|
32
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
33
33
|
contextMenu?: string | undefined;
|
|
34
34
|
dir?: string | undefined;
|
|
35
35
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -37,7 +37,6 @@ declare const Content: {
|
|
|
37
37
|
id?: string | undefined;
|
|
38
38
|
lang?: string | undefined;
|
|
39
39
|
nonce?: string | undefined;
|
|
40
|
-
placeholder?: string | undefined;
|
|
41
40
|
slot?: string | undefined;
|
|
42
41
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
43
42
|
style?: React.CSSProperties | undefined;
|
|
@@ -69,7 +68,7 @@ declare const Content: {
|
|
|
69
68
|
results?: number | undefined;
|
|
70
69
|
security?: string | undefined;
|
|
71
70
|
unselectable?: "on" | "off" | undefined;
|
|
72
|
-
inputMode?: "search" | "
|
|
71
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
73
72
|
is?: string | undefined;
|
|
74
73
|
"aria-activedescendant"?: string | undefined;
|
|
75
74
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -83,7 +82,7 @@ declare const Content: {
|
|
|
83
82
|
"aria-colindextext"?: string | undefined;
|
|
84
83
|
"aria-colspan"?: number | undefined;
|
|
85
84
|
"aria-controls"?: string | undefined;
|
|
86
|
-
"aria-current"?: boolean | "
|
|
85
|
+
"aria-current"?: boolean | "true" | "false" | "time" | "page" | "step" | "location" | "date" | undefined;
|
|
87
86
|
"aria-describedby"?: string | undefined;
|
|
88
87
|
"aria-description"?: string | undefined;
|
|
89
88
|
"aria-details"?: string | undefined;
|
|
@@ -93,7 +92,7 @@ declare const Content: {
|
|
|
93
92
|
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
94
93
|
"aria-flowto"?: string | undefined;
|
|
95
94
|
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
96
|
-
"aria-haspopup"?: boolean | "
|
|
95
|
+
"aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
|
|
97
96
|
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
98
97
|
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
99
98
|
"aria-keyshortcuts"?: string | undefined;
|
|
@@ -266,9 +265,7 @@ declare const Content: {
|
|
|
266
265
|
onPointerCancel?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
267
266
|
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
268
267
|
onPointerEnter?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
269
|
-
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
270
268
|
onPointerLeave?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
271
|
-
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
272
269
|
onPointerOver?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
273
270
|
onPointerOverCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
274
271
|
onPointerOut?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
@@ -21,7 +21,7 @@ export type LinkProps<E extends ElementType> = PolymorphicProps<E, LinkBaseProps
|
|
|
21
21
|
* in their own components to support use-cases like `react-router` or
|
|
22
22
|
* `@reach/router`
|
|
23
23
|
*/
|
|
24
|
-
declare const Link: (<E extends React.ElementType<any> = "a">(props: LinkProps<E>) => JSX.Element) & {
|
|
24
|
+
declare const Link: (<E extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "a">(props: LinkProps<E>) => JSX.Element) & {
|
|
25
25
|
displayName?: string | undefined;
|
|
26
26
|
propTypes?: React.WeakValidationMap<LinkProps<any>> | undefined;
|
|
27
27
|
};
|
|
@@ -21,6 +21,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
21
21
|
|
|
22
22
|
// Note: Maybe we should use `as` instead of `element`? `as` appears to be
|
|
23
23
|
// standard and is used in other places in this project.
|
|
24
|
+
|
|
24
25
|
function LinkRenderFunction(_ref, ref) {
|
|
25
26
|
let {
|
|
26
27
|
element,
|
|
@@ -32,6 +32,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
32
32
|
|
|
33
33
|
// TO-DO: comment back in when footer is added for rails
|
|
34
34
|
// import SideNavFooter from './SideNavFooter';
|
|
35
|
+
|
|
35
36
|
const SideNavContext = /*#__PURE__*/React.createContext({});
|
|
36
37
|
function SideNavRenderFunction(_ref, ref) {
|
|
37
38
|
let {
|
|
@@ -57,5 +57,5 @@ interface SwitcherItemWithAriaLabelledBy extends BaseSwitcherItemProps {
|
|
|
57
57
|
'aria-labelledby': string;
|
|
58
58
|
}
|
|
59
59
|
type SwitcherItemProps = SwitcherItemWithAriaLabel | SwitcherItemWithAriaLabelledBy;
|
|
60
|
-
declare const SwitcherItem: React.ForwardRefExoticComponent<SwitcherItemProps & React.RefAttributes<React.ElementType<any>>>;
|
|
60
|
+
declare const SwitcherItem: React.ForwardRefExoticComponent<SwitcherItemProps & React.RefAttributes<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
61
61
|
export default SwitcherItem;
|
package/lib/index.js
CHANGED
|
@@ -185,7 +185,6 @@ var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
|
185
185
|
var FluidTextInput_Skeleton = require('./components/FluidTextInput/FluidTextInput.Skeleton.js');
|
|
186
186
|
var PageSelector = require('./components/Pagination/experimental/PageSelector.js');
|
|
187
187
|
var Pagination = require('./components/Pagination/experimental/Pagination.js');
|
|
188
|
-
var CheckboxGroup = require('./components/CheckboxGroup/CheckboxGroup.js');
|
|
189
188
|
var ContainedListItem = require('./components/ContainedList/ContainedListItem/ContainedListItem.js');
|
|
190
189
|
var ContainedList = require('./components/ContainedList/ContainedList.js');
|
|
191
190
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
@@ -212,6 +211,7 @@ var ChatButton = require('./components/ChatButton/ChatButton.js');
|
|
|
212
211
|
var ChatButton_Skeleton = require('./components/ChatButton/ChatButton.Skeleton.js');
|
|
213
212
|
var Text = require('./components/Text/Text.js');
|
|
214
213
|
var TextDirection = require('./components/Text/TextDirection.js');
|
|
214
|
+
var CheckboxGroup = require('./components/CheckboxGroup/CheckboxGroup.js');
|
|
215
215
|
var DataTable = require('./components/DataTable/DataTable.js');
|
|
216
216
|
var Table = require('./components/DataTable/Table.js');
|
|
217
217
|
var TableActionList = require('./components/DataTable/TableActionList.js');
|
|
@@ -457,7 +457,6 @@ exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
|
457
457
|
exports.unstable__FluidTextInputSkeleton = FluidTextInput_Skeleton["default"];
|
|
458
458
|
exports.unstable_PageSelector = PageSelector["default"];
|
|
459
459
|
exports.unstable_Pagination = Pagination["default"];
|
|
460
|
-
exports.CheckboxGroup = CheckboxGroup["default"];
|
|
461
460
|
exports.ContainedListItem = ContainedListItem["default"];
|
|
462
461
|
exports.ContainedList = ContainedList["default"];
|
|
463
462
|
exports.useContextMenu = useContextMenu["default"];
|
|
@@ -484,6 +483,7 @@ exports.unstable__ChatButton = ChatButton["default"];
|
|
|
484
483
|
exports.unstable__ChatButtonSkeleton = ChatButton_Skeleton["default"];
|
|
485
484
|
exports.unstable_Text = Text.Text;
|
|
486
485
|
exports.unstable_TextDirection = TextDirection.TextDirection;
|
|
486
|
+
exports.CheckboxGroup = CheckboxGroup["default"];
|
|
487
487
|
exports.DataTable = DataTable["default"];
|
|
488
488
|
exports.Table = Table.Table;
|
|
489
489
|
exports.TableActionList = TableActionList["default"];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.60.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.18.3",
|
|
51
51
|
"@carbon/feature-flags": "^0.20.0",
|
|
52
|
-
"@carbon/icons-react": "^11.
|
|
53
|
-
"@carbon/layout": "^11.
|
|
54
|
-
"@carbon/styles": "^1.
|
|
52
|
+
"@carbon/icons-react": "^11.44.0-rc.0",
|
|
53
|
+
"@carbon/layout": "^11.23.0-rc.0",
|
|
54
|
+
"@carbon/styles": "^1.60.0-rc.0",
|
|
55
|
+
"@figma/code-connect": "^0.1.2",
|
|
55
56
|
"@floating-ui/react": "^0.26.0",
|
|
56
57
|
"@ibm/telemetry-js": "^1.5.0",
|
|
57
58
|
"classnames": "2.5.1",
|
|
@@ -81,9 +82,9 @@
|
|
|
81
82
|
"@babel/preset-react": "^7.22.3",
|
|
82
83
|
"@babel/preset-typescript": "^7.21.5",
|
|
83
84
|
"@carbon/test-utils": "^10.30.0",
|
|
84
|
-
"@carbon/themes": "^11.
|
|
85
|
+
"@carbon/themes": "^11.37.0-rc.0",
|
|
85
86
|
"@rollup/plugin-babel": "^6.0.0",
|
|
86
|
-
"@rollup/plugin-commonjs": "^
|
|
87
|
+
"@rollup/plugin-commonjs": "^26.0.0",
|
|
87
88
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
88
89
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
89
90
|
"@storybook/addon-a11y": "^7.1.0",
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
"@storybook/react": "^7.1.0",
|
|
96
97
|
"@storybook/react-webpack5": "^7.1.0",
|
|
97
98
|
"@storybook/theming": "^7.1.0",
|
|
98
|
-
"@types/react-is": "~18.
|
|
99
|
+
"@types/react-is": "~18.3.0",
|
|
99
100
|
"autoprefixer": "^10.4.0",
|
|
100
101
|
"babel-loader": "^9.0.0",
|
|
101
102
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"browserify-zlib": "^0.2.0",
|
|
104
105
|
"browserslist-config-carbon": "^11.2.0",
|
|
105
106
|
"clipboardy": "^2.1.0",
|
|
106
|
-
"css-loader": "^
|
|
107
|
+
"css-loader": "^7.0.0",
|
|
107
108
|
"enquirer": "^2.3.6",
|
|
108
109
|
"fast-glob": "^3.2.7",
|
|
109
110
|
"fs-extra": "^11.0.0",
|
|
@@ -141,5 +142,5 @@
|
|
|
141
142
|
"**/*.scss",
|
|
142
143
|
"**/*.css"
|
|
143
144
|
],
|
|
144
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "3931acee4fc6da9481e5bef55ea6347a4b10e2fb"
|
|
145
146
|
}
|