@carbon/react 1.5.0-rc.0 → 1.6.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/ComposedModal/ComposedModal.js +2 -1
- package/es/components/ComposedModal/next/ComposedModal.js +2 -1
- package/es/components/DataTable/TableActionList.js +3 -1
- package/es/components/DataTable/TableToolbarContent.js +3 -1
- package/es/components/DataTable/TableToolbarSearch.js +10 -2
- package/es/components/DatePicker/DatePicker.js +14 -5
- package/es/components/FileUploader/FileUploader.js +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/Filename.js +1 -1
- package/es/components/Layer/index.js +13 -1
- package/es/components/Link/Link.js +6 -3
- package/es/components/ListBox/ListBoxPropTypes.js +1 -2
- package/es/components/ListBox/ListBoxSelection.js +3 -4
- package/es/components/OverflowMenu/OverflowMenu.js +0 -1
- package/es/components/RadioButton/next/RadioButton.js +2 -1
- package/es/components/Search/next/Search.js +1 -0
- package/es/components/Tabs/next/Tabs.js +42 -4
- package/es/components/Toggle/Toggle.js +147 -109
- package/es/components/UIShell/HeaderGlobalBar.js +3 -1
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/HeaderMenuButton.js +3 -4
- package/es/components/UIShell/HeaderName.js +3 -4
- package/es/components/UIShell/HeaderNavigation.js +27 -75
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/SideNavFooter.js +3 -10
- package/es/components/UIShell/SideNavIcon.js +3 -4
- package/es/components/UIShell/SideNavItem.js +4 -5
- package/es/components/UIShell/SideNavLink.js +0 -6
- package/es/components/UIShell/SideNavLinkText.js +3 -4
- package/es/components/UIShell/SideNavMenu.js +93 -131
- package/es/components/UIShell/SideNavSwitcher.js +4 -2
- package/es/components/UIShell/SkipToContent.js +3 -4
- package/es/index.js +13 -11
- package/es/tools/wrapComponent.js +6 -4
- package/lib/components/ComposedModal/ComposedModal.js +2 -1
- package/lib/components/ComposedModal/next/ComposedModal.js +2 -1
- package/lib/components/DataTable/TableActionList.js +3 -1
- package/lib/components/DataTable/TableToolbarContent.js +3 -1
- package/lib/components/DataTable/TableToolbarSearch.js +10 -2
- package/lib/components/DatePicker/DatePicker.js +14 -5
- package/lib/components/FileUploader/FileUploader.js +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/Filename.js +1 -1
- package/lib/components/Layer/index.js +13 -0
- package/lib/components/Link/Link.js +6 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +1 -21
- package/lib/components/ListBox/ListBoxSelection.js +3 -4
- package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
- package/lib/components/RadioButton/next/RadioButton.js +2 -1
- package/lib/components/Search/next/Search.js +1 -0
- package/lib/components/Tabs/next/Tabs.js +42 -4
- package/lib/components/Toggle/Toggle.js +146 -107
- package/lib/components/UIShell/HeaderGlobalBar.js +3 -1
- package/lib/components/UIShell/HeaderMenu.js +1 -1
- package/lib/components/UIShell/HeaderMenuButton.js +3 -4
- package/lib/components/UIShell/HeaderName.js +3 -4
- package/lib/components/UIShell/HeaderNavigation.js +25 -73
- package/lib/components/UIShell/SideNav.js +3 -3
- package/lib/components/UIShell/SideNavFooter.js +3 -10
- package/lib/components/UIShell/SideNavIcon.js +3 -4
- package/lib/components/UIShell/SideNavItem.js +4 -5
- package/lib/components/UIShell/SideNavLink.js +0 -6
- package/lib/components/UIShell/SideNavLinkText.js +3 -4
- package/lib/components/UIShell/SideNavMenu.js +89 -128
- package/lib/components/UIShell/SideNavSwitcher.js +4 -2
- package/lib/components/UIShell/SkipToContent.js +3 -4
- package/lib/index.js +86 -82
- package/lib/tools/wrapComponent.js +6 -4
- package/package.json +18 -18
- package/es/components/Toggle/index.js +0 -19
- package/es/components/Toggle/next/Toggle.js +0 -158
- package/es/components/UIShell/index.js +0 -17
- package/es/components/UIShell/next/HeaderNavigation.js +0 -52
- package/es/components/UIShell/next/SideNavMenu.js +0 -160
- package/lib/components/Toggle/index.js +0 -23
- package/lib/components/Toggle/next/Toggle.js +0 -169
- package/lib/components/UIShell/index.js +0 -42
- package/lib/components/UIShell/next/HeaderNavigation.js +0 -62
- package/lib/components/UIShell/next/SideNavMenu.js +0 -170
package/es/index.js
CHANGED
|
@@ -79,7 +79,8 @@ export { default as RadioTile } from './components/RadioTile/RadioTile.js';
|
|
|
79
79
|
export { default as TileGroup } from './components/TileGroup/index.js';
|
|
80
80
|
export { default as TimePicker } from './components/TimePicker/index.js';
|
|
81
81
|
export { default as TimePickerSelect } from './components/TimePickerSelect/index.js';
|
|
82
|
-
export { default as
|
|
82
|
+
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
83
|
+
export { Toggle } from './components/Toggle/Toggle.js';
|
|
83
84
|
export { Toggletip, ToggletipActions, ToggletipButton, ToggletipContent, ToggletipLabel } from './components/Toggletip/index.js';
|
|
84
85
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
85
86
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
@@ -95,14 +96,12 @@ export { default as SearchSkeleton } from './components/Search/Search.Skeleton.j
|
|
|
95
96
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
96
97
|
export { default as TabsSkeleton } from './components/Tabs/Tabs.Skeleton.js';
|
|
97
98
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
98
|
-
export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
|
|
99
99
|
export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
|
|
100
100
|
export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
|
|
101
|
-
export { HeaderNavigation, SideNavMenu } from './components/UIShell/index.js';
|
|
102
101
|
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags } from './components/FeatureFlags/index.js';
|
|
103
102
|
export { Heading, Section } from './components/Heading/index.js';
|
|
104
103
|
export { IconButton } from './components/IconButton/index.js';
|
|
105
|
-
export { Layer } from './components/Layer/index.js';
|
|
104
|
+
export { Layer, useLayer } from './components/Layer/index.js';
|
|
106
105
|
import './components/Menu/index.js';
|
|
107
106
|
export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2/index.js';
|
|
108
107
|
export { Popover, PopoverContent } from './components/Popover/index.js';
|
|
@@ -110,6 +109,7 @@ export { HStack, VStack } from './components/Stack/index.js';
|
|
|
110
109
|
export { DefinitionTooltip } from './components/Tooltip/next/DefinitionTooltip.js';
|
|
111
110
|
import './components/TreeView/index.js';
|
|
112
111
|
export { GlobalTheme, Theme, useTheme } from './components/Theme/index.js';
|
|
112
|
+
export { usePrefix } from './internal/usePrefix.js';
|
|
113
113
|
export { default as AspectRatio } from './components/AspectRatio/AspectRatio.js';
|
|
114
114
|
export { default as Filename } from './components/FileUploader/Filename.js';
|
|
115
115
|
export { default as FileUploaderButton } from './components/FileUploader/FileUploaderButton.js';
|
|
@@ -117,7 +117,14 @@ export { default as FileUploaderDropContainer } from './components/FileUploader/
|
|
|
117
117
|
export { default as FileUploaderItem } from './components/FileUploader/FileUploaderItem.js';
|
|
118
118
|
export { default as Row } from './components/Grid/Row.js';
|
|
119
119
|
export { default as Column } from './components/Grid/Column.js';
|
|
120
|
+
export { default as HeaderMenuButton } from './components/UIShell/HeaderMenuButton.js';
|
|
121
|
+
export { default as HeaderName } from './components/UIShell/HeaderName.js';
|
|
122
|
+
export { default as SkipToContent } from './components/UIShell/SkipToContent.js';
|
|
120
123
|
export { default as SideNavDivider } from './components/UIShell/SideNavDivider.js';
|
|
124
|
+
export { default as SideNavFooter } from './components/UIShell/SideNavFooter.js';
|
|
125
|
+
export { default as SideNavIcon } from './components/UIShell/SideNavIcon.js';
|
|
126
|
+
export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
127
|
+
export { default as SideNavLinkText } from './components/UIShell/SideNavLinkText.js';
|
|
121
128
|
export { default as unstable_useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
122
129
|
export { default as unstable_MenuDivider } from './components/Menu/MenuDivider.js';
|
|
123
130
|
export { default as unstable_MenuGroup } from './components/Menu/MenuGroup.js';
|
|
@@ -170,24 +177,19 @@ export { default as HeaderContainer } from './components/UIShell/HeaderContainer
|
|
|
170
177
|
export { default as HeaderGlobalAction } from './components/UIShell/HeaderGlobalAction.js';
|
|
171
178
|
export { default as HeaderGlobalBar } from './components/UIShell/HeaderGlobalBar.js';
|
|
172
179
|
export { default as HeaderMenu } from './components/UIShell/HeaderMenu.js';
|
|
173
|
-
export { default as HeaderMenuButton } from './components/UIShell/HeaderMenuButton.js';
|
|
174
180
|
export { default as HeaderMenuItem } from './components/UIShell/HeaderMenuItem.js';
|
|
175
|
-
export {
|
|
181
|
+
export { HeaderNavigation } from './components/UIShell/HeaderNavigation.js';
|
|
176
182
|
export { default as HeaderPanel } from './components/UIShell/HeaderPanel.js';
|
|
177
183
|
export { default as HeaderSideNavItems } from './components/UIShell/HeaderSideNavItems.js';
|
|
178
184
|
export { default as Switcher } from './components/UIShell/Switcher.js';
|
|
179
185
|
export { default as SwitcherItem } from './components/UIShell/SwitcherItem.js';
|
|
180
186
|
export { default as SwitcherDivider } from './components/UIShell/SwitcherDivider.js';
|
|
181
|
-
export { default as SkipToContent } from './components/UIShell/SkipToContent.js';
|
|
182
187
|
export { default as SideNav } from './components/UIShell/SideNav.js';
|
|
183
188
|
export { default as SideNavDetails } from './components/UIShell/SideNavDetails.js';
|
|
184
|
-
export { default as SideNavFooter } from './components/UIShell/SideNavFooter.js';
|
|
185
189
|
export { default as SideNavHeader } from './components/UIShell/SideNavHeader.js';
|
|
186
|
-
export { default as SideNavIcon } from './components/UIShell/SideNavIcon.js';
|
|
187
|
-
export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
188
190
|
export { default as SideNavItems } from './components/UIShell/SideNavItems.js';
|
|
189
191
|
export { default as SideNavLink } from './components/UIShell/SideNavLink.js';
|
|
190
|
-
export {
|
|
192
|
+
export { SideNavMenu } from './components/UIShell/SideNavMenu.js';
|
|
191
193
|
export { default as SideNavMenuItem } from './components/UIShell/SideNavMenuItem.js';
|
|
192
194
|
export { default as SideNavSwitcher } from './components/UIShell/SideNavSwitcher.js';
|
|
193
195
|
export { Stack } from './components/Stack/Stack.js';
|
|
@@ -9,26 +9,28 @@ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _
|
|
|
9
9
|
import React__default from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../internal/usePrefix.js';
|
|
12
13
|
|
|
13
14
|
var _excluded = ["className"];
|
|
14
15
|
|
|
15
16
|
var wrapComponent = function wrapComponent(_ref) {
|
|
16
17
|
var name = _ref.name,
|
|
17
|
-
|
|
18
|
+
getClassName = _ref.className,
|
|
18
19
|
type = _ref.type;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
function Component(_ref2) {
|
|
21
22
|
var baseClassName = _ref2.className,
|
|
22
23
|
other = _objectWithoutProperties(_ref2, _excluded);
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var prefix = usePrefix();
|
|
26
|
+
var componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
25
27
|
return /*#__PURE__*/React__default.createElement(type, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
26
28
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
27
29
|
// and so we have empty `class` attributes in the resulting markup
|
|
28
30
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
29
31
|
className: !!componentClass ? componentClass : undefined
|
|
30
32
|
}));
|
|
31
|
-
}
|
|
33
|
+
}
|
|
32
34
|
|
|
33
35
|
Component.displayName = name;
|
|
34
36
|
Component.propTypes = {
|
|
@@ -233,7 +233,8 @@ var ComposedModal = /*#__PURE__*/function (_Component) {
|
|
|
233
233
|
onClick: this.handleClick,
|
|
234
234
|
onKeyDown: this.handleKeyDown,
|
|
235
235
|
onTransitionEnd: open ? this.handleTransitionEnd : undefined,
|
|
236
|
-
className: modalClass
|
|
236
|
+
className: modalClass,
|
|
237
|
+
tabIndex: "-1"
|
|
237
238
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
238
239
|
ref: this.startSentinel,
|
|
239
240
|
tabIndex: "0",
|
|
@@ -204,7 +204,8 @@ var ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function C
|
|
|
204
204
|
onBlur: handleBlur,
|
|
205
205
|
onClick: handleClick,
|
|
206
206
|
onKeyDown: handleKeyDown,
|
|
207
|
-
className: modalClass
|
|
207
|
+
className: modalClass,
|
|
208
|
+
tabIndex: "-1"
|
|
208
209
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
209
210
|
className: containerClass,
|
|
210
211
|
role: "dialog",
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableActionList = wrapComponent["default"]({
|
|
15
15
|
name: 'TableActionList',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--action-list");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableActionList$1 = TableActionList;
|
|
20
22
|
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableToolbarContent = wrapComponent["default"]({
|
|
15
15
|
name: 'TableToolbarContent',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--toolbar-content");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableToolbarContent$1 = TableToolbarContent;
|
|
20
22
|
|
|
@@ -23,7 +23,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
23
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
25
|
|
|
26
|
-
var _excluded = ["className", "searchContainerClass", "onChange", "onClear", "translateWithId", "placeholder", "labelText", "expanded", "defaultExpanded", "defaultValue", "disabled", "onExpand", "persistent", "id", "onBlur", "onFocus"];
|
|
26
|
+
var _excluded = ["className", "searchContainerClass", "onChange", "onClear", "translateWithId", "placeholder", "labelText", "expanded", "defaultExpanded", "defaultValue", "disabled", "onExpand", "persistent", "id", "onBlur", "onFocus", "size"];
|
|
27
27
|
var getInstanceId = instanceId["default"]();
|
|
28
28
|
var translationKeys = {
|
|
29
29
|
'carbon.table.toolbar.search.label': 'Filter table',
|
|
@@ -53,6 +53,8 @@ var TableToolbarSearch = function TableToolbarSearch(_ref) {
|
|
|
53
53
|
id = _ref.id,
|
|
54
54
|
onBlur = _ref.onBlur,
|
|
55
55
|
onFocus = _ref.onFocus,
|
|
56
|
+
_ref$size = _ref.size,
|
|
57
|
+
size = _ref$size === void 0 ? 'lg' : _ref$size,
|
|
56
58
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
|
|
58
60
|
var _useRef = React.useRef(expandedProp !== undefined),
|
|
@@ -136,7 +138,8 @@ var TableToolbarSearch = function TableToolbarSearch(_ref) {
|
|
|
136
138
|
} : handleOnFocus,
|
|
137
139
|
onBlur: onBlur ? function (event) {
|
|
138
140
|
return onBlur(event, handleExpand);
|
|
139
|
-
} : handleOnBlur
|
|
141
|
+
} : handleOnBlur,
|
|
142
|
+
size: size
|
|
140
143
|
}, rest));
|
|
141
144
|
};
|
|
142
145
|
|
|
@@ -222,6 +225,11 @@ TableToolbarSearch.propTypes = {
|
|
|
222
225
|
*/
|
|
223
226
|
searchContainerClass: PropTypes__default["default"].string,
|
|
224
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Specify the size of the Search
|
|
230
|
+
*/
|
|
231
|
+
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
232
|
+
|
|
225
233
|
/**
|
|
226
234
|
* Optional prop to specify the tabIndex of the <Search> (in expanded state) or the container (in collapsed state)
|
|
227
235
|
*/
|
|
@@ -31,7 +31,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
31
31
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
32
32
|
var flatpickr__default = /*#__PURE__*/_interopDefaultLegacy(flatpickr);
|
|
33
33
|
|
|
34
|
-
var _excluded = ["allowInput", "appendTo", "children", "className", "dateFormat", "datePickerType", "disable", "enable", "inline", "light", "locale", "maxDate", "minDate", "onChange", "onClose", "onOpen", "short", "value"];
|
|
34
|
+
var _excluded = ["allowInput", "appendTo", "children", "className", "closeOnSelect", "dateFormat", "datePickerType", "disable", "enable", "inline", "light", "locale", "maxDate", "minDate", "onChange", "onClose", "onOpen", "short", "value"];
|
|
35
35
|
|
|
36
36
|
index["default"].en.weekdays.shorthand.forEach(function (_day, index$1) {
|
|
37
37
|
var currentDay = index["default"].en.weekdays.shorthand;
|
|
@@ -163,6 +163,8 @@ function DatePicker(_ref) {
|
|
|
163
163
|
appendTo = _ref.appendTo,
|
|
164
164
|
children = _ref.children,
|
|
165
165
|
className = _ref.className,
|
|
166
|
+
_ref$closeOnSelect = _ref.closeOnSelect,
|
|
167
|
+
closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
|
|
166
168
|
_ref$dateFormat = _ref.dateFormat,
|
|
167
169
|
dateFormat = _ref$dateFormat === void 0 ? 'm/d/Y' : _ref$dateFormat,
|
|
168
170
|
datePickerType = _ref.datePickerType,
|
|
@@ -262,6 +264,7 @@ function DatePicker(_ref) {
|
|
|
262
264
|
inline: inline !== null && inline !== void 0 ? inline : false,
|
|
263
265
|
disableMobile: true,
|
|
264
266
|
defaultDate: value,
|
|
267
|
+
closeOnSelect: closeOnSelect,
|
|
265
268
|
mode: datePickerType,
|
|
266
269
|
allowInput: allowInput !== null && allowInput !== void 0 ? allowInput : true,
|
|
267
270
|
dateFormat: dateFormat,
|
|
@@ -322,7 +325,7 @@ function DatePicker(_ref) {
|
|
|
322
325
|
// error with IBM Equal Access Accessibility Checker so we add an aria
|
|
323
326
|
// role to the container div.
|
|
324
327
|
|
|
325
|
-
calendar.calendarContainer.setAttribute('role', '
|
|
328
|
+
calendar.calendarContainer.setAttribute('role', 'application'); // IBM EAAC requires an aria-label on a role='region'
|
|
326
329
|
|
|
327
330
|
calendar.calendarContainer.setAttribute('aria-label', 'calendar-container');
|
|
328
331
|
}
|
|
@@ -386,9 +389,10 @@ function DatePicker(_ref) {
|
|
|
386
389
|
}, [inline]);
|
|
387
390
|
React.useEffect(function () {
|
|
388
391
|
if (calendarRef.current) {
|
|
389
|
-
|
|
390
|
-
value
|
|
391
|
-
}
|
|
392
|
+
if (value !== undefined) {
|
|
393
|
+
calendarRef.current.setDate(value);
|
|
394
|
+
}
|
|
395
|
+
|
|
392
396
|
updateClassNames(calendarRef.current, prefix); //for simple date picker w/o calendar; initial mount may not have value
|
|
393
397
|
} else if (!calendarRef.current && value) {
|
|
394
398
|
startInputField.current.value = value;
|
|
@@ -423,6 +427,11 @@ DatePicker.propTypes = {
|
|
|
423
427
|
*/
|
|
424
428
|
className: PropTypes__default["default"].string,
|
|
425
429
|
|
|
430
|
+
/**
|
|
431
|
+
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
|
|
432
|
+
*/
|
|
433
|
+
closeOnSelect: PropTypes__default["default"].bool,
|
|
434
|
+
|
|
426
435
|
/**
|
|
427
436
|
* The date format.
|
|
428
437
|
*/
|
|
@@ -253,7 +253,7 @@ _rollupPluginBabelHelpers.defineProperty(FileUploader, "propTypes", {
|
|
|
253
253
|
iconDescription: FeatureFlags__namespace.enabled('enable-v11-release') ? PropTypes__default["default"].string.isRequired : PropTypes__default["default"].string,
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* Specify the description text of this
|
|
256
|
+
* Specify the description text of this `<FileUploader>`
|
|
257
257
|
*/
|
|
258
258
|
labelDescription: PropTypes__default["default"].string,
|
|
259
259
|
|
|
@@ -175,7 +175,7 @@ FileUploaderButton.propTypes = {
|
|
|
175
175
|
disabled: PropTypes__default["default"].bool,
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
|
-
* Provide a unique id for the underlying
|
|
178
|
+
* Provide a unique id for the underlying `<input>` node
|
|
179
179
|
*/
|
|
180
180
|
id: PropTypes__default["default"].string,
|
|
181
181
|
|
|
@@ -78,7 +78,7 @@ Filename.propTypes = {
|
|
|
78
78
|
status: PropTypes__default["default"].oneOf(['edit', 'complete', 'uploading']),
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Provide a custom tabIndex value for the
|
|
81
|
+
* Provide a custom tabIndex value for the `<Filename>`
|
|
82
82
|
*/
|
|
83
83
|
tabIndex: PropTypes__default["default"].string
|
|
84
84
|
};
|
|
@@ -25,6 +25,18 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
25
25
|
var _excluded = ["as", "className", "children", "level"];
|
|
26
26
|
var levels = ['one', 'two', 'three'];
|
|
27
27
|
var MAX_LEVEL = levels.length - 1;
|
|
28
|
+
/**
|
|
29
|
+
* A custom hook that will return information about the current layer. A common
|
|
30
|
+
* field to pull from this is the `level` for the layer that the component that
|
|
31
|
+
* calls this hook is currently in
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
function useLayer() {
|
|
35
|
+
var level = React__default["default"].useContext(LayerContext.LayerContext);
|
|
36
|
+
return {
|
|
37
|
+
level: level
|
|
38
|
+
};
|
|
39
|
+
}
|
|
28
40
|
function Layer(_ref) {
|
|
29
41
|
var _ref$as = _ref.as,
|
|
30
42
|
BaseComponent = _ref$as === void 0 ? 'div' : _ref$as,
|
|
@@ -70,3 +82,4 @@ Layer.propTypes = {
|
|
|
70
82
|
};
|
|
71
83
|
|
|
72
84
|
exports.Layer = Layer;
|
|
85
|
+
exports.useLayer = useLayer;
|
|
@@ -28,9 +28,12 @@ var Link = /*#__PURE__*/React__default["default"].forwardRef(function Link(_ref,
|
|
|
28
28
|
var children = _ref.children,
|
|
29
29
|
customClassName = _ref.className,
|
|
30
30
|
href = _ref.href,
|
|
31
|
-
disabled = _ref.disabled,
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
_ref$disabled = _ref.disabled,
|
|
32
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
33
|
+
_ref$inline = _ref.inline,
|
|
34
|
+
inline = _ref$inline === void 0 ? false : _ref$inline,
|
|
35
|
+
_ref$visited = _ref.visited,
|
|
36
|
+
visited = _ref$visited === void 0 ? false : _ref$visited,
|
|
34
37
|
Icon = _ref.renderIcon,
|
|
35
38
|
size = _ref.size,
|
|
36
39
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
@@ -10,33 +10,13 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
var PropTypes = require('prop-types');
|
|
13
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
14
13
|
|
|
15
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
15
|
|
|
17
|
-
function _interopNamespace(e) {
|
|
18
|
-
if (e && e.__esModule) return e;
|
|
19
|
-
var n = Object.create(null);
|
|
20
|
-
if (e) {
|
|
21
|
-
Object.keys(e).forEach(function (k) {
|
|
22
|
-
if (k !== 'default') {
|
|
23
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return e[k]; }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
n["default"] = e;
|
|
32
|
-
return Object.freeze(n);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
16
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
36
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
37
17
|
|
|
38
18
|
var ListBoxType = PropTypes__default["default"].oneOf(['default', 'inline']);
|
|
39
|
-
var ListBoxSize =
|
|
19
|
+
var ListBoxSize = PropTypes__default["default"].oneOf(['sm', 'md', 'lg']);
|
|
40
20
|
|
|
41
21
|
exports.ListBoxSize = ListBoxSize;
|
|
42
22
|
exports.ListBoxType = ListBoxType;
|
|
@@ -31,7 +31,7 @@ var _Close, _Close2, _defaultTranslations;
|
|
|
31
31
|
* selection.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
function ListBoxSelection(_ref) {
|
|
35
35
|
var _cx;
|
|
36
36
|
|
|
37
37
|
var clearSelection = _ref.clearSelection,
|
|
@@ -98,7 +98,7 @@ var ListBoxSelection = function ListBoxSelection(_ref) {
|
|
|
98
98
|
"aria-label": description,
|
|
99
99
|
title: description
|
|
100
100
|
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null)));
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
|
|
103
103
|
var translationIds = {
|
|
104
104
|
'clear.all': 'clear.all',
|
|
@@ -153,7 +153,6 @@ ListBoxSelection.defaultProps = {
|
|
|
153
153
|
return defaultTranslations[id];
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
var ListBoxSelection$1 = ListBoxSelection;
|
|
157
156
|
|
|
158
|
-
exports["default"] = ListBoxSelection
|
|
157
|
+
exports["default"] = ListBoxSelection;
|
|
159
158
|
exports.translationIds = translationIds;
|
|
@@ -539,7 +539,6 @@ _rollupPluginBabelHelpers.defineProperty(OverflowMenu, "defaultProps", {
|
|
|
539
539
|
onOpen: function onOpen() {},
|
|
540
540
|
menuOffset: getMenuOffset,
|
|
541
541
|
menuOffsetFlip: getMenuOffset,
|
|
542
|
-
light: false,
|
|
543
542
|
selectorPrimaryFocus: '[data-overflow-menu-primary-focus]'
|
|
544
543
|
});
|
|
545
544
|
|
|
@@ -60,7 +60,8 @@ var RadioButton = /*#__PURE__*/React__default["default"].forwardRef(function Rad
|
|
|
60
60
|
id: uniqueId,
|
|
61
61
|
ref: ref,
|
|
62
62
|
disabled: disabled,
|
|
63
|
-
value: value
|
|
63
|
+
value: value,
|
|
64
|
+
name: name
|
|
64
65
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
65
66
|
htmlFor: uniqueId,
|
|
66
67
|
className: "".concat(prefix, "--radio-button__label")
|
|
@@ -153,6 +153,7 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
153
153
|
className: clearClasses,
|
|
154
154
|
disabled: disabled,
|
|
155
155
|
onClick: clearInput,
|
|
156
|
+
title: closeButtonLabelText,
|
|
156
157
|
type: "button"
|
|
157
158
|
}, _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))));
|
|
158
159
|
});
|
|
@@ -608,6 +608,11 @@ var TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabPan
|
|
|
608
608
|
tabIndex = _useState8[0],
|
|
609
609
|
setTabIndex = _useState8[1];
|
|
610
610
|
|
|
611
|
+
var _useState9 = React.useState(false),
|
|
612
|
+
_useState10 = _rollupPluginBabelHelpers.slicedToArray(_useState9, 2),
|
|
613
|
+
interactiveContent = _useState10[0],
|
|
614
|
+
setInteractiveContent = _useState10[1];
|
|
615
|
+
|
|
611
616
|
var _React$useContext3 = React__default["default"].useContext(TabsContext),
|
|
612
617
|
selectedIndex = _React$useContext3.selectedIndex,
|
|
613
618
|
baseId = _React$useContext3.baseId;
|
|
@@ -615,14 +620,47 @@ var TabPanel = /*#__PURE__*/React__default["default"].forwardRef(function TabPan
|
|
|
615
620
|
var index = React__default["default"].useContext(TabPanelContext);
|
|
616
621
|
var id = "".concat(baseId, "-tabpanel-").concat(index);
|
|
617
622
|
var tabId = "".concat(baseId, "-tab-").concat(index);
|
|
618
|
-
var className = cx__default["default"]("".concat(prefix, "--tab-content"), customClassName
|
|
623
|
+
var className = cx__default["default"]("".concat(prefix, "--tab-content"), customClassName, _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--tab-content--interactive"), interactiveContent));
|
|
624
|
+
useEffectOnce.useEffectOnce(function () {
|
|
625
|
+
if (!panel.current) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
619
628
|
|
|
620
|
-
|
|
621
|
-
var interactiveContent = useNoInteractiveChildren.getInteractiveContent(panel.current);
|
|
629
|
+
var content = useNoInteractiveChildren.getInteractiveContent(panel.current);
|
|
622
630
|
|
|
623
|
-
if (
|
|
631
|
+
if (content) {
|
|
632
|
+
setInteractiveContent(true);
|
|
624
633
|
setTabIndex('-1');
|
|
625
634
|
}
|
|
635
|
+
}); // tabindex should only be 0 if no interactive content in children
|
|
636
|
+
|
|
637
|
+
React.useEffect(function () {
|
|
638
|
+
if (!panel.current) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
var node = panel.current;
|
|
643
|
+
|
|
644
|
+
function callback() {
|
|
645
|
+
var content = useNoInteractiveChildren.getInteractiveContent(node);
|
|
646
|
+
|
|
647
|
+
if (content) {
|
|
648
|
+
setInteractiveContent(true);
|
|
649
|
+
setTabIndex('-1');
|
|
650
|
+
} else {
|
|
651
|
+
setInteractiveContent(false);
|
|
652
|
+
setTabIndex('0');
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
var observer = new MutationObserver(callback);
|
|
657
|
+
observer.observe(node, {
|
|
658
|
+
childList: true,
|
|
659
|
+
subtree: true
|
|
660
|
+
});
|
|
661
|
+
return function () {
|
|
662
|
+
observer.disconnect(node);
|
|
663
|
+
};
|
|
626
664
|
}, []);
|
|
627
665
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
628
666
|
"aria-labelledby": tabId,
|