@carbon/react 1.20.0 → 1.21.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/Accordion/Accordion.Skeleton.js +1 -1
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +1 -1
- package/es/components/Button/Button.Skeleton.js +1 -1
- package/es/components/Button/Button.js +1 -0
- package/es/components/{Checkbox → Button}/index.js +3 -3
- package/es/components/{Pagination → ButtonSet}/index.js +2 -3
- package/es/components/Checkbox/Checkbox.Skeleton.js +1 -1
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +1 -1
- package/es/components/{RadioButtonGroup → ComboBox}/index.js +2 -2
- package/es/components/ComposedModal/ModalFooter.js +1 -1
- package/es/components/ContainedList/ContainedListItem/index.js +9 -0
- package/es/components/ContainedList/index.js +1 -1
- package/es/components/ContentSwitcher/index.js +3 -3
- package/es/components/{ModalWrapper → Copy}/index.js +2 -2
- package/es/components/CopyButton/index.js +9 -0
- package/es/components/DangerButton/DangerButton.js +1 -1
- package/es/components/DataTable/TableBatchAction.js +1 -1
- package/es/components/DataTable/TableBatchActions.js +1 -1
- package/es/components/DataTable/index.js +1 -1
- package/es/components/DatePicker/DatePicker.Skeleton.js +1 -1
- package/es/components/DatePicker/DatePicker.js +17 -6
- package/es/components/DatePicker/index.js +10 -0
- package/es/components/DatePickerInput/index.js +9 -0
- package/es/components/Dropdown/Dropdown.Skeleton.js +1 -1
- package/es/components/Dropdown/index.js +10 -0
- package/es/components/FileUploader/FileUploader.Skeleton.js +1 -1
- package/es/components/FluidDatePicker/FluidDatePicker.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.js +1 -1
- package/es/components/FluidSelect/FluidSelect.js +1 -1
- package/es/components/FluidSelect/index.js +10 -0
- package/es/components/FluidTextArea/FluidTextArea.js +1 -1
- package/es/components/FluidTextInput/index.js +10 -0
- package/es/components/{ExpandableSearch → Form}/index.js +2 -2
- package/es/components/Icon/Icon.Skeleton.js +1 -1
- package/es/components/IconButton/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +9 -0
- package/es/components/Link/index.js +9 -0
- package/es/components/Loading/index.js +9 -0
- package/es/components/Menu/index.js +1 -1
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/Modal/index.js +1 -1
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/index.js +1 -1
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/OverflowMenu/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +1 -1
- package/es/components/Pagination/Pagination.Skeleton.js +1 -1
- package/es/components/Pagination/Pagination.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.js +1 -1
- package/es/components/Pagination/experimental/Pagination.js +2 -2
- package/es/components/PaginationNav/PaginationNav.js +1 -1
- package/es/components/Popover/index.js +5 -1
- package/es/components/PrimaryButton/PrimaryButton.js +1 -1
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +1 -1
- package/es/components/RadioButton/RadioButton.Skeleton.js +1 -1
- package/es/components/RadioButton/index.js +1 -1
- package/es/components/RadioTile/index.js +9 -0
- package/es/components/Search/Search.Skeleton.js +1 -1
- package/es/components/Search/index.js +1 -1
- package/es/components/SecondaryButton/SecondaryButton.js +1 -1
- package/es/components/Select/Select.Skeleton.js +1 -1
- package/es/components/Select/index.js +10 -0
- package/es/components/SelectItem/index.js +9 -0
- package/es/components/SkeletonText/index.js +9 -0
- package/es/components/Slider/Slider.Skeleton.js +1 -1
- package/es/components/Slider/index.js +3 -3
- package/es/components/Stack/Stack.js +9 -5
- package/es/components/Tab/index.js +1 -1
- package/es/components/Tabs/Tabs.Skeleton.js +1 -1
- package/es/components/Tag/Tag.Skeleton.js +1 -1
- package/es/components/Tag/Tag.js +2 -1
- package/es/components/TextArea/TextArea.Skeleton.js +1 -1
- package/es/components/TextArea/index.js +10 -0
- package/es/components/TextInput/TextInput.Skeleton.js +1 -1
- package/es/components/TextInput/index.js +1 -1
- package/es/components/TileGroup/index.js +3 -3
- package/es/components/TimePickerSelect/index.js +1 -1
- package/es/components/Toggle/Toggle.Skeleton.js +1 -1
- package/es/components/Toggle/Toggle.js +27 -8
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +1 -1
- package/es/components/TreeView/index.js +1 -1
- package/es/components/UIShell/HeaderGlobalAction.js +1 -1
- package/es/components/UIShell/HeaderNavigation.js +1 -1
- package/es/components/UIShell/SideNavLink.js +5 -0
- package/es/components/UIShell/SideNavMenu.js +1 -1
- package/es/es/components/Checkbox/Checkbox.Skeleton.d.ts +1 -0
- package/es/es/components/Checkbox/Checkbox.d.ts +1 -1
- package/es/es/components/Checkbox/index.d.ts +3 -2
- package/es/es/components/Text/Text.d.ts +1 -1
- package/es/es/components/Text/TextDirection.d.ts +2 -2
- package/es/es/index.d.ts +119 -0
- package/es/index.js +24 -28
- package/lib/components/Accordion/Accordion.Skeleton.js +1 -0
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +1 -0
- package/lib/components/Button/Button.Skeleton.js +1 -0
- package/lib/components/Button/Button.js +1 -0
- package/lib/components/{Checkbox → Button}/index.js +5 -4
- package/lib/components/ButtonSet/index.js +17 -0
- package/lib/components/Checkbox/Checkbox.Skeleton.js +1 -0
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +1 -0
- package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
- package/lib/components/{Pagination → ComboBox}/index.js +3 -3
- package/lib/components/ComposedModal/ModalFooter.js +1 -1
- package/lib/components/ContainedList/ContainedListItem/index.js +17 -0
- package/lib/components/ContainedList/index.js +1 -0
- package/lib/components/ContentSwitcher/index.js +4 -3
- package/lib/components/{ModalWrapper → Copy}/index.js +3 -2
- package/lib/components/CopyButton/index.js +17 -0
- package/lib/components/DangerButton/DangerButton.js +1 -1
- package/lib/components/DataTable/TableBatchAction.js +1 -1
- package/lib/components/DataTable/TableBatchActions.js +1 -1
- package/lib/components/DataTable/index.js +1 -0
- package/lib/components/DatePicker/DatePicker.Skeleton.js +1 -0
- package/lib/components/DatePicker/DatePicker.js +15 -4
- package/lib/components/DatePicker/index.js +19 -0
- package/lib/components/DatePickerInput/index.js +17 -0
- package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -0
- package/lib/components/Dropdown/index.js +19 -0
- package/lib/components/FileUploader/FileUploader.Skeleton.js +1 -0
- package/lib/components/FluidDatePicker/FluidDatePicker.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
- package/lib/components/FluidSelect/FluidSelect.js +1 -1
- package/lib/components/FluidSelect/index.js +19 -0
- package/lib/components/FluidTextArea/FluidTextArea.js +1 -1
- package/lib/components/FluidTextInput/index.js +19 -0
- package/lib/components/{RadioButtonGroup → Form}/index.js +3 -2
- package/lib/components/Icon/Icon.Skeleton.js +1 -0
- package/lib/components/IconButton/index.js +1 -1
- package/lib/components/InlineCheckbox/index.js +17 -0
- package/lib/components/{ExpandableSearch → Link}/index.js +3 -2
- package/lib/components/Loading/index.js +17 -0
- package/lib/components/Menu/index.js +1 -0
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/Modal/index.js +1 -0
- package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
- package/lib/components/MultiSelect/index.js +1 -0
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/OverflowMenu/index.js +1 -0
- package/lib/components/OverflowMenuItem/index.js +1 -0
- package/lib/components/Pagination/Pagination.Skeleton.js +1 -0
- package/lib/components/Pagination/Pagination.js +1 -1
- package/lib/components/Pagination/experimental/PageSelector.js +1 -1
- package/lib/components/Pagination/experimental/Pagination.js +2 -2
- package/lib/components/PaginationNav/PaginationNav.js +1 -1
- package/lib/components/Popover/index.js +5 -1
- package/lib/components/PrimaryButton/PrimaryButton.js +1 -1
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +1 -0
- package/lib/components/RadioButton/RadioButton.Skeleton.js +1 -0
- package/lib/components/RadioButton/index.js +1 -0
- package/lib/components/RadioTile/index.js +17 -0
- package/lib/components/Search/Search.Skeleton.js +1 -0
- package/lib/components/Search/index.js +1 -0
- package/lib/components/SecondaryButton/SecondaryButton.js +1 -1
- package/lib/components/Select/Select.Skeleton.js +1 -0
- package/lib/components/Select/index.js +19 -0
- package/lib/components/SelectItem/index.js +17 -0
- package/lib/components/SkeletonText/index.js +17 -0
- package/lib/components/Slider/Slider.Skeleton.js +1 -0
- package/lib/components/Slider/index.js +4 -3
- package/lib/components/Stack/Stack.js +9 -5
- package/lib/components/Tab/index.js +1 -0
- package/lib/components/Tabs/Tabs.Skeleton.js +1 -0
- package/lib/components/Tag/Tag.Skeleton.js +1 -0
- package/lib/components/Tag/Tag.js +2 -0
- package/lib/components/TextArea/TextArea.Skeleton.js +1 -0
- package/lib/components/TextArea/index.js +19 -0
- package/lib/components/TextInput/TextInput.Skeleton.js +1 -0
- package/lib/components/TextInput/index.js +1 -0
- package/lib/components/TileGroup/index.js +4 -3
- package/lib/components/TimePickerSelect/index.js +1 -0
- package/lib/components/Toggle/Toggle.Skeleton.js +1 -0
- package/lib/components/Toggle/Toggle.js +27 -8
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +1 -0
- package/lib/components/TreeView/index.js +1 -0
- package/lib/components/UIShell/HeaderGlobalAction.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.js +1 -0
- package/lib/components/UIShell/SideNavLink.js +5 -0
- package/lib/components/UIShell/SideNavMenu.js +1 -0
- package/lib/index.js +85 -89
- package/lib/lib/components/Checkbox/Checkbox.Skeleton.d.ts +1 -0
- package/lib/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/lib/lib/components/Checkbox/index.d.ts +3 -2
- package/lib/lib/components/Text/Text.d.ts +1 -1
- package/lib/lib/components/Text/TextDirection.d.ts +2 -2
- package/lib/lib/index.d.ts +119 -0
- package/package.json +8 -8
- package/es/components/Accordion/index.js +0 -11
- package/es/components/AccordionItem/index.js +0 -13
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +0 -42
- package/es/components/FluidNumberInput/FluidNumberInput.js +0 -138
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +0 -42
- package/es/components/FluidSearch/FluidSearch.js +0 -114
- package/es/components/Tabs/index.js +0 -10
- package/lib/components/Accordion/index.js +0 -20
- package/lib/components/AccordionItem/index.js +0 -18
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +0 -52
- package/lib/components/FluidNumberInput/FluidNumberInput.js +0 -148
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +0 -52
- package/lib/components/FluidSearch/FluidSearch.js +0 -124
- package/lib/components/Tabs/index.js +0 -23
|
@@ -0,0 +1,9 @@
|
|
|
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 RadioTile from './RadioTile.js';
|
|
9
|
+
export { default as RadioTile, default } from './RadioTile.js';
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import React__default from 'react';
|
|
10
|
-
import '../Button/Button.Skeleton.js';
|
|
11
10
|
import Button from '../Button/Button.js';
|
|
11
|
+
import '../Button/Button.Skeleton.js';
|
|
12
12
|
|
|
13
13
|
var SecondaryButton = function SecondaryButton(props) {
|
|
14
14
|
return /*#__PURE__*/React__default.createElement(Button, _extends({
|
|
@@ -0,0 +1,10 @@
|
|
|
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 Select from './Select.js';
|
|
9
|
+
export { default as Select, default } from './Select.js';
|
|
10
|
+
export { default as SelectSkeleton } from './Select.Skeleton.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
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 SelectItem from './SelectItem.js';
|
|
9
|
+
export { default as SelectItem, default } from './SelectItem.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
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 SkeletonText from './SkeletonText.js';
|
|
9
|
+
export { default as SkeletonText, default } from './SkeletonText.js';
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import Slider from './Slider.js';
|
|
8
|
+
import Slider$1 from './Slider.js';
|
|
9
9
|
import { createClassWrapper } from '../../internal/createClassWrapper.js';
|
|
10
10
|
export { default as SliderSkeleton } from './Slider.Skeleton.js';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var Slider = createClassWrapper(Slider$1);
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { Slider, Slider as default };
|
|
@@ -61,11 +61,15 @@ var Stack = /*#__PURE__*/React__default.forwardRef(function Stack(props, ref) {
|
|
|
61
61
|
style["--".concat(prefix, "-stack-gap")] = gap;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
return (
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
// eslint-disable-next-line react/forbid-component-props
|
|
67
|
+
React__default.createElement(BaseComponent, _extends({}, rest, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
className: className,
|
|
70
|
+
style: style
|
|
71
|
+
}), children)
|
|
72
|
+
);
|
|
69
73
|
});
|
|
70
74
|
Stack.propTypes = {
|
|
71
75
|
/**
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
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 TextArea from './TextArea.js';
|
|
9
|
+
export { default as TextArea, default } from './TextArea.js';
|
|
10
|
+
export { default as TextAreaSkeleton } from './TextArea.Skeleton.js';
|
|
@@ -9,7 +9,7 @@ import { deprecateFieldOnObject } from '../../internal/deprecateFieldOnObject.js
|
|
|
9
9
|
import ControlledPasswordInput from './ControlledPasswordInput.js';
|
|
10
10
|
import PasswordInput from './PasswordInput.js';
|
|
11
11
|
import TextInput from './TextInput.js';
|
|
12
|
-
export { default } from './TextInput.js';
|
|
12
|
+
export { default as TextInput, default } from './TextInput.js';
|
|
13
13
|
export { default as TextInputSkeleton } from './TextInput.Skeleton.js';
|
|
14
14
|
|
|
15
15
|
TextInput.ControlledPasswordInput = ControlledPasswordInput;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { createClassWrapper } from '../../internal/createClassWrapper.js';
|
|
9
|
-
import TileGroup from './TileGroup.js';
|
|
9
|
+
import TileGroup$1 from './TileGroup.js';
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var TileGroup = createClassWrapper(TileGroup$1);
|
|
12
12
|
|
|
13
|
-
export {
|
|
13
|
+
export { TileGroup, TileGroup as default };
|
|
@@ -10,4 +10,4 @@ import TimePickerSelect$1 from './TimePickerSelect.js';
|
|
|
10
10
|
|
|
11
11
|
var TimePickerSelect = FeatureFlags.enabled('enable-v11-release') ? TimePickerSelect$1 : TimePickerSelect$1;
|
|
12
12
|
|
|
13
|
-
export { TimePickerSelect as default };
|
|
13
|
+
export { TimePickerSelect, TimePickerSelect as default };
|
|
@@ -71,4 +71,4 @@ _defineProperty(ToggleSkeleton, "propTypes", (_defineProperty2 = {}, _defineProp
|
|
|
71
71
|
|
|
72
72
|
_defineProperty(ToggleSkeleton, "defaultProps", (_defineProperty3 = {}, _defineProperty(_defineProperty3, 'aria-label', 'Toggle is loading'), _defineProperty(_defineProperty3, "size", 'md'), _defineProperty3));
|
|
73
73
|
|
|
74
|
-
export { ToggleSkeleton as default };
|
|
74
|
+
export { ToggleSkeleton, ToggleSkeleton as default };
|
|
@@ -14,11 +14,12 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
14
14
|
|
|
15
15
|
var _path;
|
|
16
16
|
|
|
17
|
-
var _excluded = ["className", "defaultToggled", "disabled", "hideLabel", "id", "labelA", "labelB", "labelText", "onClick", "onToggle", "readOnly", "size", "toggled"];
|
|
17
|
+
var _excluded = ["aria-labelledby", "className", "defaultToggled", "disabled", "hideLabel", "id", "labelA", "labelB", "labelText", "onClick", "onToggle", "readOnly", "size", "toggled"];
|
|
18
18
|
function Toggle(_ref) {
|
|
19
19
|
var _classNames;
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var ariaLabelledby = _ref['aria-labelledby'],
|
|
22
|
+
className = _ref.className,
|
|
22
23
|
_ref$defaultToggled = _ref.defaultToggled,
|
|
23
24
|
defaultToggled = _ref$defaultToggled === void 0 ? false : _ref$defaultToggled,
|
|
24
25
|
_ref$disabled = _ref.disabled,
|
|
@@ -62,6 +63,8 @@ function Toggle(_ref) {
|
|
|
62
63
|
|
|
63
64
|
var isSm = size === 'sm';
|
|
64
65
|
var sideLabel = hideLabel ? labelText : checked ? labelB : labelA;
|
|
66
|
+
var renderSideLabel = !(hideLabel && ariaLabelledby);
|
|
67
|
+
var LabelComponent = ariaLabelledby ? 'div' : 'label';
|
|
65
68
|
var wrapperClasses = cx("".concat(prefix, "--toggle"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--toggle--disabled"), disabled), _defineProperty(_classNames, "".concat(prefix, "--toggle--readonly"), readOnly), _classNames), className);
|
|
66
69
|
var labelTextClasses = cx("".concat(prefix, "--toggle__label-text"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
67
70
|
var appearanceClasses = cx("".concat(prefix, "--toggle__appearance"), _defineProperty({}, "".concat(prefix, "--toggle__appearance--sm"), isSm));
|
|
@@ -74,12 +77,13 @@ function Toggle(_ref) {
|
|
|
74
77
|
role: "switch",
|
|
75
78
|
type: "button",
|
|
76
79
|
"aria-checked": checked,
|
|
80
|
+
"aria-labelledby": ariaLabelledby,
|
|
77
81
|
disabled: disabled,
|
|
78
82
|
onClick: handleClick
|
|
79
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
80
|
-
htmlFor: id,
|
|
83
|
+
})), /*#__PURE__*/React__default.createElement(LabelComponent, {
|
|
84
|
+
htmlFor: ariaLabelledby ? null : id,
|
|
81
85
|
className: "".concat(prefix, "--toggle__label")
|
|
82
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
86
|
+
}, labelText && /*#__PURE__*/React__default.createElement("span", {
|
|
83
87
|
className: labelTextClasses
|
|
84
88
|
}, labelText), /*#__PURE__*/React__default.createElement("div", {
|
|
85
89
|
className: appearanceClasses
|
|
@@ -92,12 +96,17 @@ function Toggle(_ref) {
|
|
|
92
96
|
viewBox: "0 0 6 5"
|
|
93
97
|
}, _path || (_path = /*#__PURE__*/React__default.createElement("path", {
|
|
94
98
|
d: "M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z"
|
|
95
|
-
})))), /*#__PURE__*/React__default.createElement("span", {
|
|
99
|
+
})))), renderSideLabel && /*#__PURE__*/React__default.createElement("span", {
|
|
96
100
|
className: "".concat(prefix, "--toggle__text"),
|
|
97
101
|
"aria-hidden": "true"
|
|
98
102
|
}, sideLabel))));
|
|
99
103
|
}
|
|
100
104
|
Toggle.propTypes = {
|
|
105
|
+
/**
|
|
106
|
+
* Specify another element's id to be used as the label for this toggle
|
|
107
|
+
*/
|
|
108
|
+
'aria-labelledby': PropTypes.string,
|
|
109
|
+
|
|
101
110
|
/**
|
|
102
111
|
* Specify a custom className to apply to the form-item node
|
|
103
112
|
*/
|
|
@@ -135,9 +144,19 @@ Toggle.propTypes = {
|
|
|
135
144
|
|
|
136
145
|
/**
|
|
137
146
|
* Provide the text that will be read by a screen reader when visiting this
|
|
138
|
-
* control
|
|
147
|
+
* control. This is required unless 'aria-labelledby' is provided instead
|
|
139
148
|
*/
|
|
140
|
-
labelText:
|
|
149
|
+
labelText: function labelText(props) {
|
|
150
|
+
if (!props['aria-labelledby'] && !props.labelText) {
|
|
151
|
+
return new Error('labelText property is required if no aria-labelledby is provided.');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
155
|
+
rest[_key - 1] = arguments[_key];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return PropTypes.node.apply(PropTypes, [props].concat(rest));
|
|
159
|
+
},
|
|
141
160
|
|
|
142
161
|
/**
|
|
143
162
|
* Provide an event listener that is called when the control is clicked
|
|
@@ -68,4 +68,4 @@ _defineProperty(ToggleSmallSkeleton, "propTypes", (_defineProperty2 = {}, _defin
|
|
|
68
68
|
|
|
69
69
|
_defineProperty(ToggleSmallSkeleton, "defaultProps", _defineProperty({}, 'aria-label', 'Toggle is loading'));
|
|
70
70
|
|
|
71
|
-
export { ToggleSmallSkeleton as default };
|
|
71
|
+
export { ToggleSmallSkeleton, ToggleSmallSkeleton as default };
|
|
@@ -10,8 +10,8 @@ import cx from 'classnames';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
|
|
13
|
-
import '../Button/Button.Skeleton.js';
|
|
14
13
|
import Button from '../Button/Button.js';
|
|
14
|
+
import '../Button/Button.Skeleton.js';
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
|
|
17
17
|
var _excluded = ["aria-label", "aria-labelledby", "children", "className", "onClick", "isActive", "tooltipAlignment"];
|
|
@@ -50,6 +50,11 @@ SideNavLink.propTypes = _objectSpread2(_objectSpread2({}, LinkPropTypes), {}, {
|
|
|
50
50
|
*/
|
|
51
51
|
className: PropTypes.string,
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Specify whether the link is the current page
|
|
55
|
+
*/
|
|
56
|
+
isActive: PropTypes.bool,
|
|
57
|
+
|
|
53
58
|
/**
|
|
54
59
|
* Specify if this is a large variation of the SideNavLink
|
|
55
60
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ReactNodeLike } from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
9
|
+
type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type';
|
|
10
10
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
|
|
11
11
|
/**
|
|
12
12
|
* Provide an `id` to uniquely identify the Checkbox input
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
export { default as CheckboxSkeleton } from './Checkbox.Skeleton';
|
|
8
7
|
import Checkbox, { CheckboxProps } from './Checkbox';
|
|
9
|
-
export
|
|
8
|
+
export { default as CheckboxSkeleton } from './Checkbox.Skeleton';
|
|
10
9
|
export default Checkbox;
|
|
10
|
+
export { Checkbox };
|
|
11
|
+
export type { CheckboxProps };
|
|
@@ -11,7 +11,7 @@ import { TextDir } from './TextDirection';
|
|
|
11
11
|
export interface TextBaseProps {
|
|
12
12
|
dir?: TextDir | undefined;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type TextProps<T extends React.ElementType> = PolymorphicProps<T, TextBaseProps>;
|
|
15
15
|
declare function Text<T extends React.ElementType>({ as, children, dir, ...rest }: TextProps<T>): JSX.Element;
|
|
16
16
|
declare namespace Text {
|
|
17
17
|
var propTypes: {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { ReactNode } from 'react';
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type TextDir = 'ltr' | 'rtl' | 'auto';
|
|
10
|
+
export type GetTextDirection = (text: string | string[] | undefined) => TextDir;
|
|
11
11
|
export interface TextDirectionProps {
|
|
12
12
|
children: ReactNode | undefined;
|
|
13
13
|
dir?: TextDir;
|
package/es/es/index.d.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2018
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import './feature-flags';
|
|
8
|
+
export * from './components/Accordion';
|
|
9
|
+
export * from './components/AccordionItem';
|
|
10
|
+
export * from './components/AspectRatio';
|
|
11
|
+
export * from './components/Breadcrumb';
|
|
12
|
+
export * from './components/Button';
|
|
13
|
+
export * from './components/ButtonSet';
|
|
14
|
+
export * from './components/Checkbox';
|
|
15
|
+
export * from './components/ClassPrefix';
|
|
16
|
+
export * from './components/CodeSnippet';
|
|
17
|
+
export * from './components/ComboBox';
|
|
18
|
+
export * from './components/ComposedModal';
|
|
19
|
+
export * from './components/ContainedList';
|
|
20
|
+
export * from './components/ContentSwitcher';
|
|
21
|
+
export * from './components/Copy';
|
|
22
|
+
export * from './components/CopyButton';
|
|
23
|
+
export * from './components/DangerButton';
|
|
24
|
+
export * from './components/DataTable';
|
|
25
|
+
export * from './components/DatePicker';
|
|
26
|
+
export * from './components/DatePickerInput';
|
|
27
|
+
export * from './components/Dropdown';
|
|
28
|
+
export * from './components/ErrorBoundary';
|
|
29
|
+
export * from './components/FileUploader';
|
|
30
|
+
export * from './components/FilterableMultiSelect';
|
|
31
|
+
export * from './components/Form';
|
|
32
|
+
export * from './components/FluidForm';
|
|
33
|
+
export * from './components/FormGroup';
|
|
34
|
+
export * from './components/FormItem';
|
|
35
|
+
export * from './components/FormLabel';
|
|
36
|
+
export * from './components/Grid';
|
|
37
|
+
export * from './components/IdPrefix';
|
|
38
|
+
export * from './components/InlineLoading';
|
|
39
|
+
export * from './components/Link';
|
|
40
|
+
export * from './components/ListItem';
|
|
41
|
+
export * from './components/Loading';
|
|
42
|
+
export * from './components/Modal';
|
|
43
|
+
export * from './components/ModalWrapper';
|
|
44
|
+
export * from './components/MultiSelect';
|
|
45
|
+
export * from './components/Notification';
|
|
46
|
+
export * from './components/NumberInput';
|
|
47
|
+
export * from './components/OrderedList';
|
|
48
|
+
export * from './components/OverflowMenu';
|
|
49
|
+
export * from './components/OverflowMenuItem';
|
|
50
|
+
export * from './components/Pagination';
|
|
51
|
+
export * from './components/PaginationNav';
|
|
52
|
+
export * from './components/PasswordInput';
|
|
53
|
+
export * from './components/PrimaryButton';
|
|
54
|
+
export * from './components/ProgressIndicator';
|
|
55
|
+
export * from './components/RadioButton';
|
|
56
|
+
export * from './components/RadioButtonGroup';
|
|
57
|
+
export * from './components/Search';
|
|
58
|
+
export * from './components/ExpandableSearch';
|
|
59
|
+
export * from './components/SecondaryButton';
|
|
60
|
+
export * from './components/Select';
|
|
61
|
+
export * from './components/SelectItem';
|
|
62
|
+
export * from './components/SelectItemGroup';
|
|
63
|
+
export * from './components/Switch';
|
|
64
|
+
export * from './components/Slider';
|
|
65
|
+
export * from './components/StructuredList';
|
|
66
|
+
export * from './components/Tab';
|
|
67
|
+
export * from './components/TabContent';
|
|
68
|
+
export * from './components/Tabs';
|
|
69
|
+
export * from './components/Tag';
|
|
70
|
+
export * from './components/TextArea';
|
|
71
|
+
export * from './components/TextInput';
|
|
72
|
+
export * from './components/Tile';
|
|
73
|
+
export * from './components/RadioTile';
|
|
74
|
+
export * from './components/TileGroup';
|
|
75
|
+
export * from './components/TimePicker';
|
|
76
|
+
export * from './components/TimePickerSelect';
|
|
77
|
+
export * from './components/Toggle';
|
|
78
|
+
export * from './components/Toggletip';
|
|
79
|
+
export * from './components/TreeView';
|
|
80
|
+
export * from './components/UnorderedList';
|
|
81
|
+
export * from './components/SkeletonText';
|
|
82
|
+
export * from './components/SkeletonPlaceholder';
|
|
83
|
+
export * from './components/SkeletonIcon';
|
|
84
|
+
export * from './components/DataTableSkeleton';
|
|
85
|
+
export * from './components/Pagination/Pagination.Skeleton';
|
|
86
|
+
export * from './components/RadioButton/RadioButton.Skeleton';
|
|
87
|
+
export * from './components/Tag/Tag.Skeleton';
|
|
88
|
+
export * from './components/Toggle/Toggle.Skeleton';
|
|
89
|
+
export * from './components/ToggleSmall/ToggleSmall.Skeleton';
|
|
90
|
+
export * from './components/Icon/Icon.Skeleton';
|
|
91
|
+
export * from './components/UIShell';
|
|
92
|
+
export { useContextMenu as unstable_useContextMenu } from './components/ContextMenu';
|
|
93
|
+
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags, } from './components/FeatureFlags';
|
|
94
|
+
export { FluidComboBox as unstable__FluidComboBox, FluidComboBoxSkeleton as unstable__FluidComboBoxSkeleton, } from './components/FluidComboBox';
|
|
95
|
+
export { FluidDatePicker as unstable__FluidDatePicker, FluidDatePickerSkeleton as unstable__FluidDatePickerSkeleton, } from './components/FluidDatePicker';
|
|
96
|
+
export { FluidDatePickerInput as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput';
|
|
97
|
+
export { FluidDropdown as unstable__FluidDropdown, FluidDropdownSkeleton as unstable__FluidDropdownSkeleton, } from './components/FluidDropdown';
|
|
98
|
+
export { FluidMultiSelect as unstable__FluidMultiSelect, FluidMultiSelectSkeleton as unstable__FluidMultiSelectSkeleton, } from './components/FluidMultiSelect';
|
|
99
|
+
export { FluidSelect as unstable__FluidSelect, FluidSelectSkeleton as unstable__FluidSelectSkeleton, } from './components/FluidSelect';
|
|
100
|
+
export { FluidTextArea as unstable__FluidTextArea, FluidTextAreaSkeleton as unstable__FluidTextAreaSkeleton, } from './components/FluidTextArea';
|
|
101
|
+
export { FluidTextInput as unstable__FluidTextInput, FluidTextInputSkeleton as unstable__FluidTextInputSkeleton, } from './components/FluidTextInput';
|
|
102
|
+
export { FluidTimePicker as unstable__FluidTimePicker, FluidTimePickerSkeleton as unstable__FluidTimePickerSkeleton, } from './components/FluidTimePicker';
|
|
103
|
+
export { FluidTimePickerSelect as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect';
|
|
104
|
+
export * from './components/Heading';
|
|
105
|
+
export * from './components/IconButton';
|
|
106
|
+
export * from './components/Layer';
|
|
107
|
+
export { LayoutDirection as unstable_LayoutDirection, useLayoutDirection as unstable_useLayoutDirection, } from './components/Layout';
|
|
108
|
+
export { Menu as unstable_Menu, MenuDivider as unstable_MenuDivider, MenuGroup as unstable_MenuGroup, MenuItem as unstable_MenuItem, MenuRadioGroup as unstable_MenuRadioGroup, MenuSelectableItem as unstable_MenuSelectableItem, } from './components/Menu';
|
|
109
|
+
export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2';
|
|
110
|
+
export { PageSelector as unstable_PageSelector, Pagination as unstable_Pagination, } from './components/Pagination/experimental';
|
|
111
|
+
export * from './components/Popover';
|
|
112
|
+
export * from './components/ProgressBar';
|
|
113
|
+
export * from './components/Stack';
|
|
114
|
+
export * from './components/Tooltip';
|
|
115
|
+
export { Text as unstable_Text, TextDirection as unstable_TextDirection, } from './components/Text';
|
|
116
|
+
export * from './components/Tooltip/DefinitionTooltip';
|
|
117
|
+
export * from './components/Theme';
|
|
118
|
+
export * from './internal/usePrefix';
|
|
119
|
+
export { useIdPrefix } from './internal/useIdPrefix';
|