@carbon/react 1.11.0 → 1.12.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/es/components/ComboBox/ComboBox.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +104 -0
- package/es/components/Layout/LayoutDirection.js +53 -0
- package/es/components/Layout/LayoutDirectionContext.js +14 -0
- package/es/components/Layout/useLayoutDirection.js +19 -0
- package/es/components/ListBox/ListBoxMenuItem.js +2 -1
- package/es/components/Modal/Modal.js +3 -3
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Text/TextDirection.js +51 -0
- package/es/components/TreeView/TreeView.js +5 -5
- package/es/index.js +9 -4
- package/lib/components/ComboBox/ComboBox.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +114 -0
- package/lib/components/Layout/LayoutDirection.js +62 -0
- package/lib/components/Layout/LayoutDirectionContext.js +22 -0
- package/lib/components/Layout/useLayoutDirection.js +23 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -1
- package/lib/components/Modal/Modal.js +3 -3
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/Text/TextDirection.js +60 -0
- package/lib/components/TreeView/TreeView.js +5 -24
- package/lib/index.js +20 -10
- package/package.json +5 -5
|
@@ -346,7 +346,6 @@ var ComboBox = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
346
346
|
return /*#__PURE__*/React__default.createElement(ListBox.MenuItem, _extends({
|
|
347
347
|
key: itemProps.id,
|
|
348
348
|
isActive: selectedItem === item,
|
|
349
|
-
tabIndex: "-1",
|
|
350
349
|
isHighlighted: highlightedIndex === index || (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) === item.id || false,
|
|
351
350
|
title: itemToElement ? item.text : itemToString(item)
|
|
352
351
|
}, itemProps), itemToElement ? /*#__PURE__*/React__default.createElement(ItemToElement, _extends({
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 { objectWithoutProperties as _objectWithoutProperties, 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 '../TextInput/index.js';
|
|
13
|
+
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
|
+
import TextInput from '../TextInput/TextInput.js';
|
|
16
|
+
|
|
17
|
+
var _excluded = ["className"];
|
|
18
|
+
|
|
19
|
+
function FluidTextInput(_ref) {
|
|
20
|
+
var className = _ref.className,
|
|
21
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
|
|
23
|
+
var prefix = usePrefix();
|
|
24
|
+
var classNames = cx("".concat(prefix, "--text-input--fluid"), className);
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
isFluid: true
|
|
28
|
+
}
|
|
29
|
+
}, /*#__PURE__*/React__default.createElement(TextInput, _extends({
|
|
30
|
+
className: classNames
|
|
31
|
+
}, other)));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
FluidTextInput.propTypes = {
|
|
35
|
+
/**
|
|
36
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
37
|
+
*/
|
|
38
|
+
className: PropTypes.string,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Optionally provide the default value of the `<input>`
|
|
42
|
+
*/
|
|
43
|
+
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Specify whether the `<input>` should be disabled
|
|
47
|
+
*/
|
|
48
|
+
disabled: PropTypes.bool,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Specify a custom `id` for the `<input>`
|
|
52
|
+
*/
|
|
53
|
+
id: PropTypes.string.isRequired,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the control is currently invalid
|
|
57
|
+
*/
|
|
58
|
+
invalid: PropTypes.bool,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
62
|
+
*/
|
|
63
|
+
invalidText: PropTypes.node,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
67
|
+
* control
|
|
68
|
+
*/
|
|
69
|
+
labelText: PropTypes.node.isRequired,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
73
|
+
* is updated
|
|
74
|
+
*/
|
|
75
|
+
onChange: PropTypes.func,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
79
|
+
* `<input>` is clicked
|
|
80
|
+
*/
|
|
81
|
+
onClick: PropTypes.func,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Specify the placeholder attribute for the `<input>`
|
|
85
|
+
*/
|
|
86
|
+
placeholder: PropTypes.string,
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Specify the value of the `<input>`
|
|
90
|
+
*/
|
|
91
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specify whether the control is currently in warning state
|
|
95
|
+
*/
|
|
96
|
+
warn: PropTypes.bool,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Provide the text that is displayed when the control is in warning state
|
|
100
|
+
*/
|
|
101
|
+
warnText: PropTypes.node
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { FluidTextInput as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import { LayoutDirectionContext } from './LayoutDirectionContext.js';
|
|
12
|
+
export { LayoutDirectionContext } from './LayoutDirectionContext.js';
|
|
13
|
+
|
|
14
|
+
var _excluded = ["as", "children", "dir"];
|
|
15
|
+
|
|
16
|
+
function LayoutDirection(_ref) {
|
|
17
|
+
var _ref$as = _ref.as,
|
|
18
|
+
BaseComponent = _ref$as === void 0 ? 'div' : _ref$as,
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
dir = _ref.dir,
|
|
21
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
|
|
23
|
+
var value = React__default.useMemo(function () {
|
|
24
|
+
return {
|
|
25
|
+
direction: dir
|
|
26
|
+
};
|
|
27
|
+
}, [dir]);
|
|
28
|
+
return /*#__PURE__*/React__default.createElement(LayoutDirectionContext.Provider, {
|
|
29
|
+
value: value
|
|
30
|
+
}, /*#__PURE__*/React__default.createElement(BaseComponent, _extends({
|
|
31
|
+
dir: dir
|
|
32
|
+
}, rest), children));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
LayoutDirection.propTypes = {
|
|
36
|
+
/**
|
|
37
|
+
* Customize the element type used to render the outermost node
|
|
38
|
+
*/
|
|
39
|
+
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Provide child elements or components to be rendered inside of this
|
|
43
|
+
* component
|
|
44
|
+
*/
|
|
45
|
+
children: PropTypes.node,
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Specify the layout direction of this part of the page
|
|
49
|
+
*/
|
|
50
|
+
dir: PropTypes.oneOf(['ltr', 'rtl']).isRequired
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { LayoutDirection };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 React__default from 'react';
|
|
9
|
+
|
|
10
|
+
var LayoutDirectionContext = /*#__PURE__*/React__default.createContext({
|
|
11
|
+
direction: 'ltr'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { LayoutDirectionContext };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 { useContext } from 'react';
|
|
9
|
+
import { LayoutDirectionContext } from './LayoutDirectionContext.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get access to the current layout direction in context
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function useLayoutDirection() {
|
|
16
|
+
return useContext(LayoutDirectionContext);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useLayoutDirection };
|
|
@@ -49,7 +49,8 @@ var ListBoxMenuItem = /*#__PURE__*/React__default.forwardRef(function ListBoxMen
|
|
|
49
49
|
var className = cx("".concat(prefix, "--list-box__menu-item"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--list-box__menu-item--active"), isActive), _defineProperty(_cx, "".concat(prefix, "--list-box__menu-item--highlighted"), isHighlighted), _cx));
|
|
50
50
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
51
51
|
className: className,
|
|
52
|
-
title: isTruncated ? title : undefined
|
|
52
|
+
title: isTruncated ? title : undefined,
|
|
53
|
+
tabIndex: "-1"
|
|
53
54
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
54
55
|
className: "".concat(prefix, "--list-box__menu-item__option"),
|
|
55
56
|
ref: (forwardedRef === null || forwardedRef === void 0 ? void 0 : forwardedRef.menuItemOptionRef) || ref
|
|
@@ -121,7 +121,7 @@ var Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
121
121
|
tabIndex: "-1",
|
|
122
122
|
className: "".concat(modalCloseButtonClass, "__icon")
|
|
123
123
|
}));
|
|
124
|
-
var ariaLabel = modalLabel || ['aria-label'] || modalAriaLabel || modalHeading;
|
|
124
|
+
var ariaLabel = modalLabel || rest['aria-label'] || modalAriaLabel || modalHeading;
|
|
125
125
|
var getAriaLabelledBy = modalLabel ? modalLabelId : modalHeadingId;
|
|
126
126
|
var hasScrollingContentProps = hasScrollingContent ? {
|
|
127
127
|
tabIndex: 0,
|
|
@@ -151,7 +151,7 @@ var Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
151
151
|
useEffect(function () {
|
|
152
152
|
var initialFocus = function initialFocus(focusContainerElement) {
|
|
153
153
|
var containerElement = focusContainerElement || innerModal.current;
|
|
154
|
-
var primaryFocusElement = containerElement ? containerElement.querySelector(selectorPrimaryFocus) : null;
|
|
154
|
+
var primaryFocusElement = containerElement ? containerElement.querySelector(danger ? ".".concat(prefix, "--btn--secondary") : selectorPrimaryFocus) : null;
|
|
155
155
|
|
|
156
156
|
if (primaryFocusElement) {
|
|
157
157
|
return primaryFocusElement;
|
|
@@ -171,7 +171,7 @@ var Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
171
171
|
if (open) {
|
|
172
172
|
focusButton(innerModal.current);
|
|
173
173
|
}
|
|
174
|
-
}, [open, selectorPrimaryFocus]);
|
|
174
|
+
}, [open, selectorPrimaryFocus, danger, prefix]);
|
|
175
175
|
var modalBody = /*#__PURE__*/React__default.createElement("div", _extends({
|
|
176
176
|
ref: innerModal,
|
|
177
177
|
role: "dialog"
|
|
@@ -625,7 +625,7 @@ _defineProperty(Slider, "propTypes", {
|
|
|
625
625
|
required: PropTypes.bool,
|
|
626
626
|
|
|
627
627
|
/**
|
|
628
|
-
* A value determining how much the value should increase/decrease by moving the thumb by mouse.
|
|
628
|
+
* A value determining how much the value should increase/decrease by moving the thumb by mouse. If a value other than 1 is provided and the input is *not* hidden, the new step requirement should be added to a visible label. Values outside of the `step` increment will be considered invalid.
|
|
629
629
|
*/
|
|
630
630
|
step: PropTypes.number,
|
|
631
631
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 PropTypes from 'prop-types';
|
|
9
|
+
import React__default, { useRef, useMemo, useEffect } from 'react';
|
|
10
|
+
import { TextDirectionContext } from './TextDirectionContext.js';
|
|
11
|
+
|
|
12
|
+
function TextDirection(_ref) {
|
|
13
|
+
var children = _ref.children,
|
|
14
|
+
_ref$dir = _ref.dir,
|
|
15
|
+
dir = _ref$dir === void 0 ? 'auto' : _ref$dir,
|
|
16
|
+
getTextDirection = _ref.getTextDirection;
|
|
17
|
+
var savedCallback = useRef(getTextDirection);
|
|
18
|
+
var value = useMemo(function () {
|
|
19
|
+
return {
|
|
20
|
+
direction: dir,
|
|
21
|
+
getTextDirection: savedCallback
|
|
22
|
+
};
|
|
23
|
+
}, [dir]);
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
savedCallback.current = getTextDirection;
|
|
26
|
+
});
|
|
27
|
+
return /*#__PURE__*/React__default.createElement(TextDirectionContext.Provider, {
|
|
28
|
+
value: value
|
|
29
|
+
}, children);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
TextDirection.propTypes = {
|
|
33
|
+
/**
|
|
34
|
+
* Provide children to be rendered inside of this component
|
|
35
|
+
*/
|
|
36
|
+
children: PropTypes.node,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Specify the text direction for rendered children
|
|
40
|
+
*/
|
|
41
|
+
dir: PropTypes.oneOf(['ltr', 'rtl', 'auto']),
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Optionally provide a custom function to get the text direction for a piece
|
|
45
|
+
* of text. Whatever is returned will become the value of the `dir` attribute
|
|
46
|
+
* on a node of text. Should return one of: 'ltr', 'rtl', or 'auto'
|
|
47
|
+
*/
|
|
48
|
+
getTextDirection: PropTypes.func
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { TextDirection };
|
|
@@ -10,7 +10,6 @@ import React__default, { useRef, useState, useEffect } from 'react';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import uniqueId from '../../tools/uniqueId.js';
|
|
13
|
-
import * as FeatureFlags from '@carbon/feature-flags';
|
|
14
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
14
|
import { matches, match } from '../../internal/keyboard/match.js';
|
|
16
15
|
import { ArrowUp, ArrowDown, Home, End } from '../../internal/keyboard/keys.js';
|
|
@@ -23,12 +22,13 @@ function TreeView(_ref) {
|
|
|
23
22
|
_ref$hideLabel = _ref.hideLabel,
|
|
24
23
|
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
25
24
|
label = _ref.label,
|
|
26
|
-
multiselect = _ref.multiselect,
|
|
25
|
+
_ref$multiselect = _ref.multiselect,
|
|
26
|
+
multiselect = _ref$multiselect === void 0 ? false : _ref$multiselect,
|
|
27
27
|
onSelect = _ref.onSelect,
|
|
28
28
|
_ref$selected = _ref.selected,
|
|
29
29
|
preselected = _ref$selected === void 0 ? [] : _ref$selected,
|
|
30
30
|
_ref$size = _ref.size,
|
|
31
|
-
size = _ref$size === void 0 ?
|
|
31
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
32
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
33
|
|
|
34
34
|
var _useRef = useRef(rest.id || uniqueId()),
|
|
@@ -276,7 +276,7 @@ TreeView.propTypes = {
|
|
|
276
276
|
label: PropTypes.string.isRequired,
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
|
-
* Specify the selection mode of the tree.
|
|
279
|
+
* **[Experimental]** Specify the selection mode of the tree.
|
|
280
280
|
* If `multiselect` is `false` then only one node can be selected at a time
|
|
281
281
|
*/
|
|
282
282
|
multiselect: PropTypes.bool,
|
|
@@ -294,7 +294,7 @@ TreeView.propTypes = {
|
|
|
294
294
|
/**
|
|
295
295
|
* Specify the size of the tree from a list of available sizes.
|
|
296
296
|
*/
|
|
297
|
-
size:
|
|
297
|
+
size: PropTypes.oneOf(['xs', 'sm'])
|
|
298
298
|
};
|
|
299
299
|
|
|
300
300
|
export { TreeView as default };
|
package/es/index.js
CHANGED
|
@@ -78,6 +78,7 @@ export { default as TimePickerSelect } from './components/TimePickerSelect/index
|
|
|
78
78
|
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
79
79
|
export { Toggle } from './components/Toggle/Toggle.js';
|
|
80
80
|
export { Toggletip, ToggletipActions, ToggletipButton, ToggletipContent, ToggletipLabel } from './components/Toggletip/index.js';
|
|
81
|
+
import './components/TreeView/index.js';
|
|
81
82
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
82
83
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
83
84
|
export { default as SkeletonPlaceholder } from './components/SkeletonPlaceholder/SkeletonPlaceholder.js';
|
|
@@ -103,7 +104,6 @@ export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/Overflow
|
|
|
103
104
|
export { Popover, PopoverContent } from './components/Popover/index.js';
|
|
104
105
|
export { HStack, VStack } from './components/Stack/index.js';
|
|
105
106
|
export { DefinitionTooltip } from './components/Tooltip/next/DefinitionTooltip.js';
|
|
106
|
-
import './components/TreeView/index.js';
|
|
107
107
|
export { GlobalTheme, Theme, useTheme } from './components/Theme/index.js';
|
|
108
108
|
export { usePrefix } from './internal/usePrefix.js';
|
|
109
109
|
export { default as AspectRatio } from './components/AspectRatio/AspectRatio.js';
|
|
@@ -114,6 +114,7 @@ export { default as FileUploaderItem } from './components/FileUploader/FileUploa
|
|
|
114
114
|
export { default as Row } from './components/Grid/Row.js';
|
|
115
115
|
export { default as Column } from './components/Grid/Column.js';
|
|
116
116
|
export { default as NumberInputSkeleton } from './components/NumberInput/NumberInput.Skeleton.js';
|
|
117
|
+
export { default as TreeNode } from './components/TreeView/TreeNode.js';
|
|
117
118
|
export { default as HeaderMenuButton } from './components/UIShell/HeaderMenuButton.js';
|
|
118
119
|
export { default as HeaderName } from './components/UIShell/HeaderName.js';
|
|
119
120
|
export { default as SkipToContent } from './components/UIShell/SkipToContent.js';
|
|
@@ -123,6 +124,7 @@ export { default as SideNavIcon } from './components/UIShell/SideNavIcon.js';
|
|
|
123
124
|
export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
124
125
|
export { default as SideNavLinkText } from './components/UIShell/SideNavLinkText.js';
|
|
125
126
|
export { default as unstable_useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
127
|
+
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
126
128
|
export { default as unstable_MenuDivider } from './components/Menu/MenuDivider.js';
|
|
127
129
|
export { default as unstable_MenuGroup } from './components/Menu/MenuGroup.js';
|
|
128
130
|
export { default as unstable_MenuItem } from './components/Menu/MenuItem.js';
|
|
@@ -131,11 +133,10 @@ export { default as unstable_MenuSelectableItem } from './components/Menu/MenuSe
|
|
|
131
133
|
export { default as unstable_PageSelector } from './components/Pagination/experimental/PageSelector.js';
|
|
132
134
|
export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
|
|
133
135
|
export { default as ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
134
|
-
export { default as unstable_TreeNode } from './components/TreeView/TreeNode.js';
|
|
135
136
|
export { default as MultiSelect } from './components/MultiSelect/MultiSelect.js';
|
|
136
137
|
export { default as TextInput } from './components/TextInput/TextInput.js';
|
|
138
|
+
export { default as TreeView } from './components/TreeView/TreeView.js';
|
|
137
139
|
export { default as unstable_Menu } from './components/Menu/Menu.js';
|
|
138
|
-
export { default as unstable_TreeView } from './components/TreeView/TreeView.js';
|
|
139
140
|
export { default as Breadcrumb } from './components/Breadcrumb/Breadcrumb.js';
|
|
140
141
|
export { default as BreadcrumbItem } from './components/Breadcrumb/BreadcrumbItem.js';
|
|
141
142
|
export { default as ComposedModal, ModalBody } from './components/ComposedModal/ComposedModal.js';
|
|
@@ -173,6 +174,7 @@ export { default as ControlledPasswordInput } from './components/TextInput/Contr
|
|
|
173
174
|
export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
|
|
174
175
|
export { ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
175
176
|
export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
|
|
177
|
+
export { IconTab, TabList, TabPanel, TabPanels } from './components/Tabs/next/Tabs.js';
|
|
176
178
|
export { default as Content } from './components/UIShell/Content.js';
|
|
177
179
|
export { default as Header } from './components/UIShell/Header.js';
|
|
178
180
|
export { default as HeaderContainer } from './components/UIShell/HeaderContainer.js';
|
|
@@ -194,6 +196,9 @@ export { default as SideNavLink } from './components/UIShell/SideNavLink.js';
|
|
|
194
196
|
export { SideNavMenu } from './components/UIShell/SideNavMenu.js';
|
|
195
197
|
export { default as SideNavMenuItem } from './components/UIShell/SideNavMenuItem.js';
|
|
196
198
|
export { default as SideNavSwitcher } from './components/UIShell/SideNavSwitcher.js';
|
|
199
|
+
export { LayoutDirection as unstable_LayoutDirection } from './components/Layout/LayoutDirection.js';
|
|
200
|
+
export { useLayoutDirection as unstable_useLayoutDirection } from './components/Layout/useLayoutDirection.js';
|
|
197
201
|
export { Stack } from './components/Stack/Stack.js';
|
|
198
202
|
export { Tooltip } from './components/Tooltip/next/Tooltip.js';
|
|
199
|
-
export {
|
|
203
|
+
export { Text as unstable_Text } from './components/Text/Text.js';
|
|
204
|
+
export { TextDirection as unstable_TextDirection } from './components/Text/TextDirection.js';
|
|
@@ -357,7 +357,6 @@ var ComboBox = /*#__PURE__*/React__default["default"].forwardRef(function (props
|
|
|
357
357
|
return /*#__PURE__*/React__default["default"].createElement(ListBox["default"].MenuItem, _rollupPluginBabelHelpers["extends"]({
|
|
358
358
|
key: itemProps.id,
|
|
359
359
|
isActive: selectedItem === item,
|
|
360
|
-
tabIndex: "-1",
|
|
361
360
|
isHighlighted: highlightedIndex === index || (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.id) === item.id || false,
|
|
362
361
|
title: itemToElement ? item.text : itemToString(item)
|
|
363
362
|
}, itemProps), itemToElement ? /*#__PURE__*/React__default["default"].createElement(ItemToElement, _rollupPluginBabelHelpers["extends"]({
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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
|
+
require('../TextInput/index.js');
|
|
17
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
|
+
var TextInput = require('../TextInput/TextInput.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
+
|
|
27
|
+
var _excluded = ["className"];
|
|
28
|
+
|
|
29
|
+
function FluidTextInput(_ref) {
|
|
30
|
+
var className = _ref.className,
|
|
31
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
|
|
33
|
+
var prefix = usePrefix.usePrefix();
|
|
34
|
+
var classNames = cx__default["default"]("".concat(prefix, "--text-input--fluid"), className);
|
|
35
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
36
|
+
value: {
|
|
37
|
+
isFluid: true
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
40
|
+
className: classNames
|
|
41
|
+
}, other)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
FluidTextInput.propTypes = {
|
|
45
|
+
/**
|
|
46
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
47
|
+
*/
|
|
48
|
+
className: PropTypes__default["default"].string,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optionally provide the default value of the `<input>`
|
|
52
|
+
*/
|
|
53
|
+
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Specify whether the `<input>` should be disabled
|
|
57
|
+
*/
|
|
58
|
+
disabled: PropTypes__default["default"].bool,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Specify a custom `id` for the `<input>`
|
|
62
|
+
*/
|
|
63
|
+
id: PropTypes__default["default"].string.isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Specify whether the control is currently invalid
|
|
67
|
+
*/
|
|
68
|
+
invalid: PropTypes__default["default"].bool,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
72
|
+
*/
|
|
73
|
+
invalidText: PropTypes__default["default"].node,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
77
|
+
* control
|
|
78
|
+
*/
|
|
79
|
+
labelText: PropTypes__default["default"].node.isRequired,
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
83
|
+
* is updated
|
|
84
|
+
*/
|
|
85
|
+
onChange: PropTypes__default["default"].func,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
89
|
+
* `<input>` is clicked
|
|
90
|
+
*/
|
|
91
|
+
onClick: PropTypes__default["default"].func,
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Specify the placeholder attribute for the `<input>`
|
|
95
|
+
*/
|
|
96
|
+
placeholder: PropTypes__default["default"].string,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Specify the value of the `<input>`
|
|
100
|
+
*/
|
|
101
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Specify whether the control is currently in warning state
|
|
105
|
+
*/
|
|
106
|
+
warn: PropTypes__default["default"].bool,
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Provide the text that is displayed when the control is in warning state
|
|
110
|
+
*/
|
|
111
|
+
warnText: PropTypes__default["default"].node
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
exports["default"] = FluidTextInput;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 LayoutDirectionContext = require('./LayoutDirectionContext.js');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
+
|
|
22
|
+
var _excluded = ["as", "children", "dir"];
|
|
23
|
+
|
|
24
|
+
function LayoutDirection(_ref) {
|
|
25
|
+
var _ref$as = _ref.as,
|
|
26
|
+
BaseComponent = _ref$as === void 0 ? 'div' : _ref$as,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
dir = _ref.dir,
|
|
29
|
+
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
var value = React__default["default"].useMemo(function () {
|
|
32
|
+
return {
|
|
33
|
+
direction: dir
|
|
34
|
+
};
|
|
35
|
+
}, [dir]);
|
|
36
|
+
return /*#__PURE__*/React__default["default"].createElement(LayoutDirectionContext.LayoutDirectionContext.Provider, {
|
|
37
|
+
value: value
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement(BaseComponent, _rollupPluginBabelHelpers["extends"]({
|
|
39
|
+
dir: dir
|
|
40
|
+
}, rest), children));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
LayoutDirection.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Customize the element type used to render the outermost node
|
|
46
|
+
*/
|
|
47
|
+
as: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].string, PropTypes__default["default"].elementType]),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Provide child elements or components to be rendered inside of this
|
|
51
|
+
* component
|
|
52
|
+
*/
|
|
53
|
+
children: PropTypes__default["default"].node,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Specify the layout direction of this part of the page
|
|
57
|
+
*/
|
|
58
|
+
dir: PropTypes__default["default"].oneOf(['ltr', 'rtl']).isRequired
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.LayoutDirectionContext = LayoutDirectionContext.LayoutDirectionContext;
|
|
62
|
+
exports.LayoutDirection = LayoutDirection;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 React = require('react');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
|
|
18
|
+
var LayoutDirectionContext = /*#__PURE__*/React__default["default"].createContext({
|
|
19
|
+
direction: 'ltr'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.LayoutDirectionContext = LayoutDirectionContext;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 React = require('react');
|
|
13
|
+
var LayoutDirectionContext = require('./LayoutDirectionContext.js');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get access to the current layout direction in context
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function useLayoutDirection() {
|
|
20
|
+
return React.useContext(LayoutDirectionContext.LayoutDirectionContext);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.useLayoutDirection = useLayoutDirection;
|
|
@@ -59,7 +59,8 @@ var ListBoxMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
59
59
|
var className = cx__default["default"]("".concat(prefix, "--list-box__menu-item"), (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box__menu-item--active"), isActive), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box__menu-item--highlighted"), isHighlighted), _cx));
|
|
60
60
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
61
61
|
className: className,
|
|
62
|
-
title: isTruncated ? title : undefined
|
|
62
|
+
title: isTruncated ? title : undefined,
|
|
63
|
+
tabIndex: "-1"
|
|
63
64
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
64
65
|
className: "".concat(prefix, "--list-box__menu-item__option"),
|
|
65
66
|
ref: (forwardedRef === null || forwardedRef === void 0 ? void 0 : forwardedRef.menuItemOptionRef) || ref
|
|
@@ -131,7 +131,7 @@ var Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_re
|
|
|
131
131
|
tabIndex: "-1",
|
|
132
132
|
className: "".concat(modalCloseButtonClass, "__icon")
|
|
133
133
|
}));
|
|
134
|
-
var ariaLabel = modalLabel || ['aria-label'] || modalAriaLabel || modalHeading;
|
|
134
|
+
var ariaLabel = modalLabel || rest['aria-label'] || modalAriaLabel || modalHeading;
|
|
135
135
|
var getAriaLabelledBy = modalLabel ? modalLabelId : modalHeadingId;
|
|
136
136
|
var hasScrollingContentProps = hasScrollingContent ? {
|
|
137
137
|
tabIndex: 0,
|
|
@@ -161,7 +161,7 @@ var Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_re
|
|
|
161
161
|
React.useEffect(function () {
|
|
162
162
|
var initialFocus = function initialFocus(focusContainerElement) {
|
|
163
163
|
var containerElement = focusContainerElement || innerModal.current;
|
|
164
|
-
var primaryFocusElement = containerElement ? containerElement.querySelector(selectorPrimaryFocus) : null;
|
|
164
|
+
var primaryFocusElement = containerElement ? containerElement.querySelector(danger ? ".".concat(prefix, "--btn--secondary") : selectorPrimaryFocus) : null;
|
|
165
165
|
|
|
166
166
|
if (primaryFocusElement) {
|
|
167
167
|
return primaryFocusElement;
|
|
@@ -181,7 +181,7 @@ var Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_re
|
|
|
181
181
|
if (open) {
|
|
182
182
|
focusButton(innerModal.current);
|
|
183
183
|
}
|
|
184
|
-
}, [open, selectorPrimaryFocus]);
|
|
184
|
+
}, [open, selectorPrimaryFocus, danger, prefix]);
|
|
185
185
|
var modalBody = /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
186
186
|
ref: innerModal,
|
|
187
187
|
role: "dialog"
|
|
@@ -655,7 +655,7 @@ _rollupPluginBabelHelpers.defineProperty(Slider, "propTypes", {
|
|
|
655
655
|
required: PropTypes__default["default"].bool,
|
|
656
656
|
|
|
657
657
|
/**
|
|
658
|
-
* A value determining how much the value should increase/decrease by moving the thumb by mouse.
|
|
658
|
+
* A value determining how much the value should increase/decrease by moving the thumb by mouse. If a value other than 1 is provided and the input is *not* hidden, the new step requirement should be added to a visible label. Values outside of the `step` increment will be considered invalid.
|
|
659
659
|
*/
|
|
660
660
|
step: PropTypes__default["default"].number,
|
|
661
661
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2022
|
|
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 PropTypes = require('prop-types');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var TextDirectionContext = require('./TextDirectionContext.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
+
|
|
21
|
+
function TextDirection(_ref) {
|
|
22
|
+
var children = _ref.children,
|
|
23
|
+
_ref$dir = _ref.dir,
|
|
24
|
+
dir = _ref$dir === void 0 ? 'auto' : _ref$dir,
|
|
25
|
+
getTextDirection = _ref.getTextDirection;
|
|
26
|
+
var savedCallback = React.useRef(getTextDirection);
|
|
27
|
+
var value = React.useMemo(function () {
|
|
28
|
+
return {
|
|
29
|
+
direction: dir,
|
|
30
|
+
getTextDirection: savedCallback
|
|
31
|
+
};
|
|
32
|
+
}, [dir]);
|
|
33
|
+
React.useEffect(function () {
|
|
34
|
+
savedCallback.current = getTextDirection;
|
|
35
|
+
});
|
|
36
|
+
return /*#__PURE__*/React__default["default"].createElement(TextDirectionContext.TextDirectionContext.Provider, {
|
|
37
|
+
value: value
|
|
38
|
+
}, children);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
TextDirection.propTypes = {
|
|
42
|
+
/**
|
|
43
|
+
* Provide children to be rendered inside of this component
|
|
44
|
+
*/
|
|
45
|
+
children: PropTypes__default["default"].node,
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Specify the text direction for rendered children
|
|
49
|
+
*/
|
|
50
|
+
dir: PropTypes__default["default"].oneOf(['ltr', 'rtl', 'auto']),
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Optionally provide a custom function to get the text direction for a piece
|
|
54
|
+
* of text. Whatever is returned will become the value of the `dir` attribute
|
|
55
|
+
* on a node of text. Should return one of: 'ltr', 'rtl', or 'auto'
|
|
56
|
+
*/
|
|
57
|
+
getTextDirection: PropTypes__default["default"].func
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.TextDirection = TextDirection;
|
|
@@ -14,35 +14,15 @@ var React = require('react');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var uniqueId = require('../../tools/uniqueId.js');
|
|
17
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
18
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
18
|
var match = require('../../internal/keyboard/match.js');
|
|
20
19
|
var keys = require('../../internal/keyboard/keys.js');
|
|
21
20
|
|
|
22
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
22
|
|
|
24
|
-
function _interopNamespace(e) {
|
|
25
|
-
if (e && e.__esModule) return e;
|
|
26
|
-
var n = Object.create(null);
|
|
27
|
-
if (e) {
|
|
28
|
-
Object.keys(e).forEach(function (k) {
|
|
29
|
-
if (k !== 'default') {
|
|
30
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
31
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () { return e[k]; }
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
n["default"] = e;
|
|
39
|
-
return Object.freeze(n);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
43
24
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
44
25
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
45
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
46
26
|
|
|
47
27
|
var _excluded = ["active", "children", "className", "hideLabel", "label", "multiselect", "onSelect", "selected", "size"];
|
|
48
28
|
function TreeView(_ref) {
|
|
@@ -52,12 +32,13 @@ function TreeView(_ref) {
|
|
|
52
32
|
_ref$hideLabel = _ref.hideLabel,
|
|
53
33
|
hideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
54
34
|
label = _ref.label,
|
|
55
|
-
multiselect = _ref.multiselect,
|
|
35
|
+
_ref$multiselect = _ref.multiselect,
|
|
36
|
+
multiselect = _ref$multiselect === void 0 ? false : _ref$multiselect,
|
|
56
37
|
onSelect = _ref.onSelect,
|
|
57
38
|
_ref$selected = _ref.selected,
|
|
58
39
|
preselected = _ref$selected === void 0 ? [] : _ref$selected,
|
|
59
40
|
_ref$size = _ref.size,
|
|
60
|
-
size = _ref$size === void 0 ?
|
|
41
|
+
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
61
42
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
62
43
|
|
|
63
44
|
var _useRef = React.useRef(rest.id || uniqueId["default"]()),
|
|
@@ -305,7 +286,7 @@ TreeView.propTypes = {
|
|
|
305
286
|
label: PropTypes__default["default"].string.isRequired,
|
|
306
287
|
|
|
307
288
|
/**
|
|
308
|
-
* Specify the selection mode of the tree.
|
|
289
|
+
* **[Experimental]** Specify the selection mode of the tree.
|
|
309
290
|
* If `multiselect` is `false` then only one node can be selected at a time
|
|
310
291
|
*/
|
|
311
292
|
multiselect: PropTypes__default["default"].bool,
|
|
@@ -323,7 +304,7 @@ TreeView.propTypes = {
|
|
|
323
304
|
/**
|
|
324
305
|
* Specify the size of the tree from a list of available sizes.
|
|
325
306
|
*/
|
|
326
|
-
size:
|
|
307
|
+
size: PropTypes__default["default"].oneOf(['xs', 'sm'])
|
|
327
308
|
};
|
|
328
309
|
|
|
329
310
|
exports["default"] = TreeView;
|
package/lib/index.js
CHANGED
|
@@ -82,6 +82,7 @@ var index$c = require('./components/TimePickerSelect/index.js');
|
|
|
82
82
|
var Toggle_Skeleton = require('./components/Toggle/Toggle.Skeleton.js');
|
|
83
83
|
var Toggle = require('./components/Toggle/Toggle.js');
|
|
84
84
|
var index$i = require('./components/Toggletip/index.js');
|
|
85
|
+
require('./components/TreeView/index.js');
|
|
85
86
|
var UnorderedList = require('./components/UnorderedList/UnorderedList.js');
|
|
86
87
|
var SkeletonText = require('./components/SkeletonText/SkeletonText.js');
|
|
87
88
|
var SkeletonPlaceholder = require('./components/SkeletonPlaceholder/SkeletonPlaceholder.js');
|
|
@@ -107,7 +108,6 @@ var index$n = require('./components/OverflowMenuV2/index.js');
|
|
|
107
108
|
var index$o = require('./components/Popover/index.js');
|
|
108
109
|
var index$p = require('./components/Stack/index.js');
|
|
109
110
|
var DefinitionTooltip = require('./components/Tooltip/next/DefinitionTooltip.js');
|
|
110
|
-
require('./components/TreeView/index.js');
|
|
111
111
|
var index$q = require('./components/Theme/index.js');
|
|
112
112
|
var usePrefix = require('./internal/usePrefix.js');
|
|
113
113
|
var AspectRatio = require('./components/AspectRatio/AspectRatio.js');
|
|
@@ -118,6 +118,7 @@ var FileUploaderItem = require('./components/FileUploader/FileUploaderItem.js');
|
|
|
118
118
|
var Row = require('./components/Grid/Row.js');
|
|
119
119
|
var Column = require('./components/Grid/Column.js');
|
|
120
120
|
var NumberInput_Skeleton = require('./components/NumberInput/NumberInput.Skeleton.js');
|
|
121
|
+
var TreeNode = require('./components/TreeView/TreeNode.js');
|
|
121
122
|
var HeaderMenuButton = require('./components/UIShell/HeaderMenuButton.js');
|
|
122
123
|
var HeaderName = require('./components/UIShell/HeaderName.js');
|
|
123
124
|
var SkipToContent = require('./components/UIShell/SkipToContent.js');
|
|
@@ -127,6 +128,7 @@ var SideNavIcon = require('./components/UIShell/SideNavIcon.js');
|
|
|
127
128
|
var SideNavItem = require('./components/UIShell/SideNavItem.js');
|
|
128
129
|
var SideNavLinkText = require('./components/UIShell/SideNavLinkText.js');
|
|
129
130
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
131
|
+
var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
130
132
|
var MenuDivider = require('./components/Menu/MenuDivider.js');
|
|
131
133
|
var MenuGroup = require('./components/Menu/MenuGroup.js');
|
|
132
134
|
var MenuItem = require('./components/Menu/MenuItem.js');
|
|
@@ -135,11 +137,10 @@ var MenuSelectableItem = require('./components/Menu/MenuSelectableItem.js');
|
|
|
135
137
|
var PageSelector = require('./components/Pagination/experimental/PageSelector.js');
|
|
136
138
|
var Pagination = require('./components/Pagination/experimental/Pagination.js');
|
|
137
139
|
var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
138
|
-
var TreeNode = require('./components/TreeView/TreeNode.js');
|
|
139
140
|
var MultiSelect = require('./components/MultiSelect/MultiSelect.js');
|
|
140
141
|
var TextInput = require('./components/TextInput/TextInput.js');
|
|
141
|
-
var Menu = require('./components/Menu/Menu.js');
|
|
142
142
|
var TreeView = require('./components/TreeView/TreeView.js');
|
|
143
|
+
var Menu = require('./components/Menu/Menu.js');
|
|
143
144
|
var Breadcrumb = require('./components/Breadcrumb/Breadcrumb.js');
|
|
144
145
|
var BreadcrumbItem = require('./components/Breadcrumb/BreadcrumbItem.js');
|
|
145
146
|
var ComposedModal = require('./components/ComposedModal/ComposedModal.js');
|
|
@@ -177,6 +178,7 @@ var ControlledPasswordInput = require('./components/TextInput/ControlledPassword
|
|
|
177
178
|
var PasswordInput = require('./components/TextInput/PasswordInput.js');
|
|
178
179
|
var ProgressIndicator = require('./components/ProgressIndicator/ProgressIndicator.js');
|
|
179
180
|
var StructuredList_Skeleton = require('./components/StructuredList/StructuredList.Skeleton.js');
|
|
181
|
+
var Tabs = require('./components/Tabs/next/Tabs.js');
|
|
180
182
|
var Content = require('./components/UIShell/Content.js');
|
|
181
183
|
var Header = require('./components/UIShell/Header.js');
|
|
182
184
|
var HeaderContainer = require('./components/UIShell/HeaderContainer.js');
|
|
@@ -198,9 +200,12 @@ var SideNavLink = require('./components/UIShell/SideNavLink.js');
|
|
|
198
200
|
var SideNavMenu = require('./components/UIShell/SideNavMenu.js');
|
|
199
201
|
var SideNavMenuItem = require('./components/UIShell/SideNavMenuItem.js');
|
|
200
202
|
var SideNavSwitcher = require('./components/UIShell/SideNavSwitcher.js');
|
|
203
|
+
var LayoutDirection = require('./components/Layout/LayoutDirection.js');
|
|
204
|
+
var useLayoutDirection = require('./components/Layout/useLayoutDirection.js');
|
|
201
205
|
var Stack = require('./components/Stack/Stack.js');
|
|
202
206
|
var Tooltip = require('./components/Tooltip/next/Tooltip.js');
|
|
203
|
-
var
|
|
207
|
+
var Text = require('./components/Text/Text.js');
|
|
208
|
+
var TextDirection = require('./components/Text/TextDirection.js');
|
|
204
209
|
|
|
205
210
|
|
|
206
211
|
|
|
@@ -330,6 +335,7 @@ exports.FileUploaderItem = FileUploaderItem["default"];
|
|
|
330
335
|
exports.Row = Row["default"];
|
|
331
336
|
exports.Column = Column["default"];
|
|
332
337
|
exports.NumberInputSkeleton = NumberInput_Skeleton["default"];
|
|
338
|
+
exports.TreeNode = TreeNode["default"];
|
|
333
339
|
exports.HeaderMenuButton = HeaderMenuButton["default"];
|
|
334
340
|
exports.HeaderName = HeaderName["default"];
|
|
335
341
|
exports.SkipToContent = SkipToContent["default"];
|
|
@@ -339,6 +345,7 @@ exports.SideNavIcon = SideNavIcon["default"];
|
|
|
339
345
|
exports.SideNavItem = SideNavItem["default"];
|
|
340
346
|
exports.SideNavLinkText = SideNavLinkText["default"];
|
|
341
347
|
exports.unstable_useContextMenu = useContextMenu["default"];
|
|
348
|
+
exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
342
349
|
exports.unstable_MenuDivider = MenuDivider["default"];
|
|
343
350
|
exports.unstable_MenuGroup = MenuGroup["default"];
|
|
344
351
|
exports.unstable_MenuItem = MenuItem["default"];
|
|
@@ -347,11 +354,10 @@ exports.unstable_MenuSelectableItem = MenuSelectableItem["default"];
|
|
|
347
354
|
exports.unstable_PageSelector = PageSelector["default"];
|
|
348
355
|
exports.unstable_Pagination = Pagination["default"];
|
|
349
356
|
exports.ProgressBar = ProgressBar["default"];
|
|
350
|
-
exports.unstable_TreeNode = TreeNode["default"];
|
|
351
357
|
exports.MultiSelect = MultiSelect["default"];
|
|
352
358
|
exports.TextInput = TextInput["default"];
|
|
359
|
+
exports.TreeView = TreeView["default"];
|
|
353
360
|
exports.unstable_Menu = Menu["default"];
|
|
354
|
-
exports.unstable_TreeView = TreeView["default"];
|
|
355
361
|
exports.Breadcrumb = Breadcrumb["default"];
|
|
356
362
|
exports.BreadcrumbItem = BreadcrumbItem["default"];
|
|
357
363
|
exports.ComposedModal = ComposedModal["default"];
|
|
@@ -394,6 +400,10 @@ exports.ControlledPasswordInput = ControlledPasswordInput["default"];
|
|
|
394
400
|
exports.PasswordInput = PasswordInput["default"];
|
|
395
401
|
exports.ProgressStep = ProgressIndicator.ProgressStep;
|
|
396
402
|
exports.StructuredListSkeleton = StructuredList_Skeleton["default"];
|
|
403
|
+
exports.IconTab = Tabs.IconTab;
|
|
404
|
+
exports.TabList = Tabs.TabList;
|
|
405
|
+
exports.TabPanel = Tabs.TabPanel;
|
|
406
|
+
exports.TabPanels = Tabs.TabPanels;
|
|
397
407
|
exports.Content = Content["default"];
|
|
398
408
|
exports.Header = Header["default"];
|
|
399
409
|
exports.HeaderContainer = HeaderContainer["default"];
|
|
@@ -415,9 +425,9 @@ exports.SideNavLink = SideNavLink["default"];
|
|
|
415
425
|
exports.SideNavMenu = SideNavMenu.SideNavMenu;
|
|
416
426
|
exports.SideNavMenuItem = SideNavMenuItem["default"];
|
|
417
427
|
exports.SideNavSwitcher = SideNavSwitcher["default"];
|
|
428
|
+
exports.unstable_LayoutDirection = LayoutDirection.LayoutDirection;
|
|
429
|
+
exports.unstable_useLayoutDirection = useLayoutDirection.useLayoutDirection;
|
|
418
430
|
exports.Stack = Stack.Stack;
|
|
419
431
|
exports.Tooltip = Tooltip.Tooltip;
|
|
420
|
-
exports.
|
|
421
|
-
exports.
|
|
422
|
-
exports.TabPanel = Tabs.TabPanel;
|
|
423
|
-
exports.TabPanels = Tabs.TabPanels;
|
|
432
|
+
exports.unstable_Text = Text.Text;
|
|
433
|
+
exports.unstable_TextDirection = TextDirection.TextDirection;
|
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.12.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@carbon/feature-flags": "^0.8.0",
|
|
47
47
|
"@carbon/icons-react": "^11.7.0",
|
|
48
48
|
"@carbon/layout": "^11.5.0",
|
|
49
|
-
"@carbon/styles": "^1.
|
|
49
|
+
"@carbon/styles": "^1.12.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.1",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@babel/preset-env": "^7.18.2",
|
|
74
74
|
"@babel/preset-react": "^7.17.12",
|
|
75
75
|
"@carbon/test-utils": "^10.25.0",
|
|
76
|
-
"@carbon/themes": "^11.
|
|
76
|
+
"@carbon/themes": "^11.8.0",
|
|
77
77
|
"@rollup/plugin-babel": "^5.3.0",
|
|
78
78
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
79
79
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"rimraf": "^3.0.2",
|
|
111
111
|
"rollup": "^2.46.0",
|
|
112
112
|
"rollup-plugin-strip-banner": "^2.0.0",
|
|
113
|
-
"rtlcss": "^
|
|
113
|
+
"rtlcss": "^4.0.0",
|
|
114
114
|
"sass": "^1.51.0",
|
|
115
115
|
"sass-loader": "^13.0.0",
|
|
116
116
|
"storybook-readme": "^5.0.9",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"**/*.scss",
|
|
131
131
|
"**/*.css"
|
|
132
132
|
],
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "e3e4c8ce2fba7e4510764c70205b8cb57ccba8e1"
|
|
134
134
|
}
|