@carbon/react 1.13.0-rc.0 → 1.14.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Accordion/Accordion.Skeleton.js +12 -4
- package/es/components/Accordion/Accordion.js +9 -2
- package/es/components/FileUploader/Filename.js +3 -1
- package/es/components/FluidTextArea/FluidTextArea.js +130 -0
- package/es/components/FluidTextInput/FluidTextInput.js +13 -4
- package/es/components/Notification/Notification.js +6 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +128 -154
- package/es/components/RadioTile/RadioTile.js +2 -11
- package/es/components/TextArea/TextArea.js +14 -5
- package/es/components/TextInput/PasswordInput.js +7 -6
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/index.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.js +12 -4
- package/lib/components/Accordion/Accordion.js +9 -2
- package/lib/components/FileUploader/Filename.js +3 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +140 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +12 -3
- package/lib/components/Notification/Notification.js +6 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +126 -152
- package/lib/components/RadioTile/RadioTile.js +2 -11
- package/lib/components/TextArea/TextArea.js +13 -4
- package/lib/components/TextInput/PasswordInput.js +7 -6
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/index.js +47 -46
- package/package.json +9 -8
- package/es/components/ProgressIndicator/index.js +0 -15
- package/es/components/ProgressIndicator/next/ProgressIndicator.js +0 -117
- package/lib/components/ProgressIndicator/index.js +0 -39
- package/lib/components/ProgressIndicator/next/ProgressIndicator.js +0 -127
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { useState } from 'react';
|
|
10
|
+
import React__default, { useContext, useState } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { WarningFilled } from '@carbon/icons-react';
|
|
13
13
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
16
|
|
|
16
17
|
var _excluded = ["className", "id", "labelText", "hideLabel", "onChange", "onClick", "invalid", "invalidText", "helperText", "light", "placeholder", "enableCounter", "maxCount"];
|
|
17
18
|
var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, ref) {
|
|
@@ -33,6 +34,10 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
33
34
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
|
|
35
36
|
var prefix = usePrefix();
|
|
37
|
+
|
|
38
|
+
var _useContext = useContext(FormContext),
|
|
39
|
+
isFluid = _useContext.isFluid;
|
|
40
|
+
|
|
36
41
|
var enabled = useFeatureFlag('enable-v11-release');
|
|
37
42
|
var defaultValue = other.defaultValue,
|
|
38
43
|
value = other.value,
|
|
@@ -66,7 +71,7 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
66
71
|
textareaProps.maxLength = maxCount;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
var labelClasses = cx("".concat(prefix, "--label"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames, "".concat(prefix, "--label--disabled"), disabled), _classNames));
|
|
74
|
+
var labelClasses = cx("".concat(prefix, "--label"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--visually-hidden"), hideLabel && !isFluid), _defineProperty(_classNames, "".concat(prefix, "--label--disabled"), disabled), _classNames));
|
|
70
75
|
var label = labelText ? /*#__PURE__*/React__default.createElement("label", {
|
|
71
76
|
htmlFor: id,
|
|
72
77
|
className: labelClasses
|
|
@@ -84,7 +89,9 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
84
89
|
role: "alert",
|
|
85
90
|
className: "".concat(prefix, "--form-requirement"),
|
|
86
91
|
id: errorId
|
|
87
|
-
}, invalidText
|
|
92
|
+
}, invalidText, isFluid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
93
|
+
className: "".concat(prefix, "--text-area__invalid-icon")
|
|
94
|
+
})) : null;
|
|
88
95
|
var textareaClasses = cx("".concat(prefix, "--text-area"), [enabled ? null : className], (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--text-area--light"), light), _defineProperty(_classNames4, "".concat(prefix, "--text-area--invalid"), invalid), _classNames4));
|
|
89
96
|
var input = /*#__PURE__*/React__default.createElement("textarea", _extends({}, other, textareaProps, {
|
|
90
97
|
placeholder: placeholder || null,
|
|
@@ -100,9 +107,11 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
100
107
|
}, label, counter), /*#__PURE__*/React__default.createElement("div", {
|
|
101
108
|
className: "".concat(prefix, "--text-area__wrapper"),
|
|
102
109
|
"data-invalid": invalid || null
|
|
103
|
-
}, invalid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
110
|
+
}, invalid && !isFluid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
104
111
|
className: "".concat(prefix, "--text-area__invalid-icon")
|
|
105
|
-
}), input
|
|
112
|
+
}), input, isFluid && /*#__PURE__*/React__default.createElement("hr", {
|
|
113
|
+
className: "".concat(prefix, "--text-area__divider")
|
|
114
|
+
}), isFluid && invalid ? error : null), invalid && !isFluid ? error : helper);
|
|
106
115
|
});
|
|
107
116
|
TextArea.displayName = 'TextArea';
|
|
108
117
|
TextArea.propTypes = {
|
|
@@ -69,6 +69,9 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
69
69
|
warnText: warnText
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
var _useContext = useContext(FormContext),
|
|
73
|
+
isFluid = _useContext.isFluid;
|
|
74
|
+
|
|
72
75
|
var handleTogglePasswordVisibility = function handleTogglePasswordVisibility(event) {
|
|
73
76
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
74
77
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
@@ -94,7 +97,7 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
94
97
|
ref: ref
|
|
95
98
|
}, rest);
|
|
96
99
|
|
|
97
|
-
var inputWrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--text-input-wrapper"), "".concat(prefix, "--password-input-wrapper"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _classNames2));
|
|
100
|
+
var inputWrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--text-input-wrapper"), "".concat(prefix, "--password-input-wrapper"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _defineProperty(_classNames2, "".concat(prefix, "--text-input--fluid"), isFluid), _classNames2));
|
|
98
101
|
var labelClasses = cx("".concat(prefix, "--label"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames3, "".concat(prefix, "--label--disabled"), disabled), _defineProperty(_classNames3, "".concat(prefix, "--label--inline"), inline), _defineProperty(_classNames3, "".concat(prefix, "--label--inline--").concat(size), inline && !!size), _classNames3));
|
|
99
102
|
var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--disabled"), disabled), _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--inline"), inline), _classNames4));
|
|
100
103
|
var fieldOuterWrapperClasses = cx("".concat(prefix, "--text-input__field-outer-wrapper"), _defineProperty({}, "".concat(prefix, "--text-input__field-outer-wrapper--inline"), inline));
|
|
@@ -123,7 +126,9 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
123
126
|
}), {
|
|
124
127
|
disabled: disabled,
|
|
125
128
|
"data-toggle-password-visibility": inputType === 'password'
|
|
126
|
-
})), /*#__PURE__*/React__default.createElement("
|
|
129
|
+
})), isFluid && /*#__PURE__*/React__default.createElement("hr", {
|
|
130
|
+
className: "".concat(prefix, "--text-input__divider")
|
|
131
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
|
127
132
|
type: "button",
|
|
128
133
|
className: passwordVisibilityToggleClasses,
|
|
129
134
|
disabled: disabled,
|
|
@@ -131,10 +136,6 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
131
136
|
}, !disabled && /*#__PURE__*/React__default.createElement("span", {
|
|
132
137
|
className: "".concat(prefix, "--assistive-text")
|
|
133
138
|
}, passwordIsVisible ? hidePasswordLabel : showPasswordLabel), passwordVisibilityIcon));
|
|
134
|
-
|
|
135
|
-
var _useContext = useContext(FormContext),
|
|
136
|
-
isFluid = _useContext.isFluid;
|
|
137
|
-
|
|
138
139
|
useEffect(function () {
|
|
139
140
|
setInputType(type);
|
|
140
141
|
}, [type]);
|
|
@@ -56,7 +56,7 @@ function Toggle(_ref) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
var isSm = size === 'sm';
|
|
59
|
-
var sideLabel =
|
|
59
|
+
var sideLabel = checked ? labelB : labelA;
|
|
60
60
|
var wrapperClasses = cx("".concat(prefix, "--toggle"), _defineProperty({}, "".concat(prefix, "--toggle--disabled"), disabled), className);
|
|
61
61
|
var labelTextClasses = cx("".concat(prefix, "--toggle__label-text"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
62
62
|
var appearanceClasses = cx("".concat(prefix, "--toggle__appearance"), _defineProperty({}, "".concat(prefix, "--toggle__appearance--sm"), isSm));
|
package/es/index.js
CHANGED
|
@@ -47,7 +47,6 @@ export { default as OverflowMenuItem } from './components/OverflowMenuItem/index
|
|
|
47
47
|
export { default as Pagination } from './components/Pagination/index.js';
|
|
48
48
|
export { default as PaginationNav } from './components/PaginationNav/PaginationNav.js';
|
|
49
49
|
export { default as PrimaryButton } from './components/PrimaryButton/PrimaryButton.js';
|
|
50
|
-
export { ProgressIndicator } from './components/ProgressIndicator/index.js';
|
|
51
50
|
export { default as RadioButton } from './components/RadioButton/RadioButton.js';
|
|
52
51
|
export { default as RadioButtonGroup } from './components/RadioButtonGroup/RadioButtonGroup.js';
|
|
53
52
|
export { default as Search } from './components/Search/index.js';
|
|
@@ -125,6 +124,7 @@ export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
|
125
124
|
export { default as SideNavLinkText } from './components/UIShell/SideNavLinkText.js';
|
|
126
125
|
export { default as unstable_useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
127
126
|
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
127
|
+
export { default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
128
128
|
export { default as unstable_MenuDivider } from './components/Menu/MenuDivider.js';
|
|
129
129
|
export { default as unstable_MenuGroup } from './components/Menu/MenuGroup.js';
|
|
130
130
|
export { default as unstable_MenuItem } from './components/Menu/MenuItem.js';
|
|
@@ -172,7 +172,7 @@ export { ActionableNotification, InlineNotification, NotificationActionButton, N
|
|
|
172
172
|
export { NumberInput } from './components/NumberInput/NumberInput.js';
|
|
173
173
|
export { default as ControlledPasswordInput } from './components/TextInput/ControlledPasswordInput.js';
|
|
174
174
|
export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
|
|
175
|
-
export { ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
175
|
+
export { ProgressIndicator, ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
176
176
|
export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
|
|
177
177
|
export { IconTab, TabList, TabPanel, TabPanels } from './components/Tabs/next/Tabs.js';
|
|
178
178
|
export { default as Content } from './components/UIShell/Content.js';
|
|
@@ -25,17 +25,20 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
25
25
|
|
|
26
26
|
var _SkeletonText, _SkeletonText2, _SkeletonText3;
|
|
27
27
|
|
|
28
|
-
var _excluded = ["align", "
|
|
28
|
+
var _excluded = ["align", "className", "count", "isFlush", "open"];
|
|
29
29
|
|
|
30
30
|
function AccordionSkeleton(_ref) {
|
|
31
|
+
var _cx;
|
|
32
|
+
|
|
31
33
|
var align = _ref.align,
|
|
32
|
-
open = _ref.open,
|
|
33
|
-
count = _ref.count,
|
|
34
34
|
className = _ref.className,
|
|
35
|
+
count = _ref.count,
|
|
36
|
+
isFlush = _ref.isFlush,
|
|
37
|
+
open = _ref.open,
|
|
35
38
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
36
39
|
|
|
37
40
|
var prefix = usePrefix.usePrefix();
|
|
38
|
-
var classes = cx__default["default"]("".concat(prefix, "--accordion"), "".concat(prefix, "--skeleton"), className, _rollupPluginBabelHelpers.defineProperty(
|
|
41
|
+
var classes = cx__default["default"]("".concat(prefix, "--accordion"), "".concat(prefix, "--skeleton"), className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--flush"), isFlush && align !== 'start'), _cx));
|
|
39
42
|
var numSkeletonItems = open ? count - 1 : count;
|
|
40
43
|
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
41
44
|
className: classes
|
|
@@ -80,6 +83,11 @@ AccordionSkeleton.propTypes = {
|
|
|
80
83
|
*/
|
|
81
84
|
count: PropTypes__default["default"].number,
|
|
82
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Specify whether an individual AccordionItem should be flush, default is false
|
|
88
|
+
*/
|
|
89
|
+
isFlush: PropTypes__default["default"].bool,
|
|
90
|
+
|
|
83
91
|
/**
|
|
84
92
|
* `false` to not display the first item opened
|
|
85
93
|
*/
|
|
@@ -41,7 +41,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
41
41
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
42
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
43
43
|
|
|
44
|
-
var _excluded = ["align", "children", "className", "disabled", "size"];
|
|
44
|
+
var _excluded = ["align", "children", "className", "disabled", "isFlush", "size"];
|
|
45
45
|
|
|
46
46
|
function Accordion(_ref) {
|
|
47
47
|
var _cx;
|
|
@@ -52,12 +52,14 @@ function Accordion(_ref) {
|
|
|
52
52
|
customClassName = _ref.className,
|
|
53
53
|
_ref$disabled = _ref.disabled,
|
|
54
54
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
55
|
+
_ref$isFlush = _ref.isFlush,
|
|
56
|
+
isFlush = _ref$isFlush === void 0 ? false : _ref$isFlush,
|
|
55
57
|
_ref$size = _ref.size,
|
|
56
58
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
57
59
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
58
60
|
|
|
59
61
|
var prefix = usePrefix.usePrefix();
|
|
60
|
-
var className = cx__default["default"]("".concat(prefix, "--accordion"), customClassName, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(size), size), _cx));
|
|
62
|
+
var className = cx__default["default"]("".concat(prefix, "--accordion"), customClassName, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(size), size), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--flush"), isFlush && align !== 'start'), _cx));
|
|
61
63
|
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
62
64
|
className: className
|
|
63
65
|
}, rest), disabled ? React__default["default"].Children.toArray(children).map(function (child) {
|
|
@@ -88,6 +90,11 @@ Accordion.propTypes = {
|
|
|
88
90
|
*/
|
|
89
91
|
disabled: PropTypes__default["default"].bool,
|
|
90
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Specify whether Accordion text should be flush, default is false, does not work with align="start"
|
|
95
|
+
*/
|
|
96
|
+
isFlush: PropTypes__default["default"].bool,
|
|
97
|
+
|
|
91
98
|
/**
|
|
92
99
|
* Specify the size of the Accordion. Currently supports the following:
|
|
93
100
|
*/
|
|
@@ -54,7 +54,9 @@ function Filename(_ref) {
|
|
|
54
54
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers["extends"]({
|
|
55
55
|
"aria-label": iconDescription,
|
|
56
56
|
className: "".concat(prefix, "--file-complete")
|
|
57
|
-
}, rest
|
|
57
|
+
}, rest, {
|
|
58
|
+
tabIndex: null
|
|
59
|
+
}), iconDescription && /*#__PURE__*/React__default["default"].createElement("title", null, iconDescription));
|
|
58
60
|
|
|
59
61
|
default:
|
|
60
62
|
return null;
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
var TextArea = require('../TextArea/TextArea.js');
|
|
17
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
|
+
|
|
26
|
+
var _excluded = ["className"];
|
|
27
|
+
|
|
28
|
+
function FluidTextArea(_ref) {
|
|
29
|
+
var className = _ref.className,
|
|
30
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var prefix = usePrefix.usePrefix();
|
|
33
|
+
var classNames = cx__default["default"]("".concat(prefix, "--text-area--fluid"), className);
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
isFluid: true
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextArea["default"], _rollupPluginBabelHelpers["extends"]({
|
|
39
|
+
className: classNames
|
|
40
|
+
}, other)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
FluidTextArea.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Provide a custom className that is applied directly to the underlying
|
|
46
|
+
* `<textarea>` node
|
|
47
|
+
*/
|
|
48
|
+
className: PropTypes__default["default"].string,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Specify the `cols` attribute for the underlying `<textarea>` node
|
|
52
|
+
*/
|
|
53
|
+
cols: PropTypes__default["default"].number,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optionally provide the default value of the `<textarea>`
|
|
57
|
+
*/
|
|
58
|
+
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Specify whether the control is disabled
|
|
62
|
+
*/
|
|
63
|
+
disabled: PropTypes__default["default"].bool,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Specify whether to display the character counter
|
|
67
|
+
*/
|
|
68
|
+
enableCounter: PropTypes__default["default"].bool,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Provide text that is used alongside the control label for additional help
|
|
72
|
+
*/
|
|
73
|
+
helperText: PropTypes__default["default"].node,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Specify whether you want the underlying label to be visually hidden
|
|
77
|
+
*/
|
|
78
|
+
hideLabel: PropTypes__default["default"].bool,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Provide a unique identifier for the control
|
|
82
|
+
*/
|
|
83
|
+
id: PropTypes__default["default"].string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Specify whether the control is currently invalid
|
|
87
|
+
*/
|
|
88
|
+
invalid: PropTypes__default["default"].bool,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
92
|
+
*/
|
|
93
|
+
invalidText: PropTypes__default["default"].node,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
97
|
+
* control
|
|
98
|
+
*/
|
|
99
|
+
labelText: PropTypes__default["default"].node.isRequired,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
103
|
+
* Don't use this to make tile background color same as container background color.
|
|
104
|
+
*/
|
|
105
|
+
light: PropTypes__default["default"].bool,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
|
|
109
|
+
*/
|
|
110
|
+
maxCount: PropTypes__default["default"].number,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Optionally provide an `onChange` handler that is called whenever `<textarea>`
|
|
114
|
+
* is updated
|
|
115
|
+
*/
|
|
116
|
+
onChange: PropTypes__default["default"].func,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
120
|
+
* `<textarea>` is clicked
|
|
121
|
+
*/
|
|
122
|
+
onClick: PropTypes__default["default"].func,
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Specify the placeholder attribute for the `<textarea>`
|
|
126
|
+
*/
|
|
127
|
+
placeholder: PropTypes__default["default"].string,
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Specify the rows attribute for the `<textarea>`
|
|
131
|
+
*/
|
|
132
|
+
rows: PropTypes__default["default"].number,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Provide the current value of the `<textarea>`
|
|
136
|
+
*/
|
|
137
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
exports["default"] = FluidTextArea;
|
|
@@ -14,6 +14,7 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
require('../TextInput/index.js');
|
|
17
|
+
var PasswordInput = require('../TextInput/PasswordInput.js');
|
|
17
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
19
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
20
|
var TextInput = require('../TextInput/TextInput.js');
|
|
@@ -24,19 +25,22 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
24
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
27
|
|
|
27
|
-
var _excluded = ["className"];
|
|
28
|
+
var _excluded = ["className", "isPassword"];
|
|
28
29
|
|
|
29
30
|
function FluidTextInput(_ref) {
|
|
30
31
|
var className = _ref.className,
|
|
32
|
+
isPassword = _ref.isPassword,
|
|
31
33
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
32
34
|
|
|
33
35
|
var prefix = usePrefix.usePrefix();
|
|
34
|
-
var classNames = cx__default["default"]("".concat(prefix, "--text-input--fluid"),
|
|
36
|
+
var classNames = cx__default["default"](className, _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--text-input--fluid"), !isPassword));
|
|
35
37
|
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
36
38
|
value: {
|
|
37
39
|
isFluid: true
|
|
38
40
|
}
|
|
39
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
41
|
+
}, isPassword ? /*#__PURE__*/React__default["default"].createElement(PasswordInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
42
|
+
className: classNames
|
|
43
|
+
}, other)) : /*#__PURE__*/React__default["default"].createElement(TextInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
40
44
|
className: classNames
|
|
41
45
|
}, other)));
|
|
42
46
|
}
|
|
@@ -72,6 +76,11 @@ FluidTextInput.propTypes = {
|
|
|
72
76
|
*/
|
|
73
77
|
invalidText: PropTypes__default["default"].node,
|
|
74
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Specify whether the control is a password input
|
|
81
|
+
*/
|
|
82
|
+
isPassword: PropTypes__default["default"].bool,
|
|
83
|
+
|
|
75
84
|
/**
|
|
76
85
|
* Provide the text that will be read by a screen reader when visiting this
|
|
77
86
|
* control
|
|
@@ -18,6 +18,7 @@ var Button = require('../Button/Button.js');
|
|
|
18
18
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
19
19
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
20
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
|
+
var useId = require('../../internal/useId.js');
|
|
21
22
|
var match = require('../../internal/keyboard/match.js');
|
|
22
23
|
var keys = require('../../internal/keyboard/keys.js');
|
|
23
24
|
|
|
@@ -516,6 +517,7 @@ function ActionableNotification(_ref6) {
|
|
|
516
517
|
setIsOpen = _useState6[1];
|
|
517
518
|
|
|
518
519
|
var prefix = usePrefix.usePrefix();
|
|
520
|
+
var id = useId.useId('actionable-notification');
|
|
519
521
|
var containerClassName = cx__default["default"](className, (_cx6 = {}, _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification"), true), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--toast"), !inline), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--low-contrast"), lowContrast), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--").concat(kind), kind), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--hide-close-button"), hideCloseButton), _cx6));
|
|
520
522
|
var ref = React.useRef(null);
|
|
521
523
|
useIsomorphicEffect["default"](function () {
|
|
@@ -544,7 +546,8 @@ function ActionableNotification(_ref6) {
|
|
|
544
546
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
545
547
|
ref: ref,
|
|
546
548
|
role: role,
|
|
547
|
-
className: containerClassName
|
|
549
|
+
className: containerClassName,
|
|
550
|
+
"aria-labelledby": title ? id : undefined
|
|
548
551
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
549
552
|
className: "".concat(prefix, "--actionable-notification__details")
|
|
550
553
|
}, /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
@@ -556,7 +559,8 @@ function ActionableNotification(_ref6) {
|
|
|
556
559
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
557
560
|
className: "".concat(prefix, "--actionable-notification__content")
|
|
558
561
|
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
559
|
-
className: "".concat(prefix, "--actionable-notification__title")
|
|
562
|
+
className: "".concat(prefix, "--actionable-notification__title"),
|
|
563
|
+
id: id
|
|
560
564
|
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
561
565
|
className: "".concat(prefix, "--actionable-notification__subtitle")
|
|
562
566
|
}, subtitle), children))), /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|