@pingux/astro 2.2.0-alpha.5 → 2.2.0-alpha.6
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/lib/cjs/components/ArrayField/ArrayField.js +6 -4
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +1 -1
- package/lib/cjs/components/Callout/Callout.js +9 -12
- package/lib/cjs/components/Callout/Callout.stories.js +9 -12
- package/lib/cjs/components/CheckboxField/CheckboxField.js +8 -5
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +13 -5
- package/lib/cjs/components/ColorField/ColorField.js +8 -5
- package/lib/cjs/components/ColorField/ColorField.stories.js +12 -5
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +5 -4
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +5 -4
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +1 -1
- package/lib/cjs/components/DataTable/DataTable.stories.js +1 -1
- package/lib/cjs/components/FieldHelperText/FieldHelperText.js +11 -14
- package/lib/cjs/components/FieldHelperText/FieldHelperText.stories.js +10 -12
- package/lib/cjs/components/FileInputField/FileInputField.js +19 -14
- package/lib/cjs/components/FileInputField/FileInputField.stories.js +11 -5
- package/lib/cjs/components/FileInputField/FileItem.js +6 -14
- package/lib/cjs/components/FileInputField/FileSelect.js +1 -1
- package/lib/cjs/components/Icon/NoticeIcon.js +5 -11
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +9 -6
- package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +12 -5
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +5 -4
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +10 -7
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +12 -5
- package/lib/cjs/components/ListItem/ListItem.js +1 -1
- package/lib/cjs/components/ListItem/ListItem.stories.js +1 -1
- package/lib/cjs/components/Menu/Menu.js +1 -1
- package/lib/cjs/components/Menu/Menu.stories.js +1 -1
- package/lib/cjs/components/Messages/Message.js +7 -13
- package/lib/cjs/components/Messages/Messages.js +7 -14
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +13 -9
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +12 -5
- package/lib/cjs/components/NumberField/NumberField.js +8 -5
- package/lib/cjs/components/NumberField/NumberField.stories.js +12 -5
- package/lib/cjs/components/PasswordField/PasswordField.js +14 -10
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +11 -5
- package/lib/cjs/components/RadioField/RadioField.js +7 -4
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +8 -5
- package/lib/cjs/components/RadioGroupField/RadioGroupField.stories.js +11 -4
- package/lib/cjs/components/RequirementsList/RequirementsList.js +6 -15
- package/lib/cjs/components/SearchField/SearchField.js +2 -2
- package/lib/cjs/components/SearchField/SearchField.stories.js +2 -2
- package/lib/cjs/components/SelectField/SelectField.js +11 -7
- package/lib/cjs/components/SelectField/SelectField.stories.js +12 -5
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +6 -4
- package/lib/cjs/components/SwitchField/SwitchField.js +12 -8
- package/lib/cjs/components/SwitchField/SwitchField.stories.js +12 -5
- package/lib/cjs/components/TextAreaField/TextAreaField.js +12 -8
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +12 -5
- package/lib/cjs/components/TextField/TextField.js +12 -8
- package/lib/cjs/components/TextField/TextField.stories.js +12 -5
- package/lib/cjs/hooks/useField/useField.js +1 -1
- package/lib/cjs/recipes/PanelHeader.stories.js +80 -0
- package/lib/components/ArrayField/ArrayField.js +6 -4
- package/lib/components/ArrayField/ArrayField.stories.js +1 -1
- package/lib/components/Callout/Callout.js +9 -13
- package/lib/components/Callout/Callout.stories.js +9 -13
- package/lib/components/CheckboxField/CheckboxField.js +8 -5
- package/lib/components/CheckboxField/CheckboxField.stories.js +13 -5
- package/lib/components/ColorField/ColorField.js +8 -5
- package/lib/components/ColorField/ColorField.stories.js +12 -5
- package/lib/components/ComboBox/ComboBoxInput.js +5 -4
- package/lib/components/ComboBoxField/ComboBoxField.js +5 -4
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +1 -1
- package/lib/components/DataTable/DataTable.stories.js +1 -1
- package/lib/components/FieldHelperText/FieldHelperText.js +9 -14
- package/lib/components/FieldHelperText/FieldHelperText.stories.js +10 -13
- package/lib/components/FileInputField/FileInputField.js +19 -14
- package/lib/components/FileInputField/FileInputField.stories.js +11 -5
- package/lib/components/FileInputField/FileItem.js +4 -14
- package/lib/components/FileInputField/FileSelect.js +1 -1
- package/lib/components/Icon/NoticeIcon.js +5 -12
- package/lib/components/ImageUploadField/ImageUploadField.js +9 -6
- package/lib/components/ImageUploadField/ImageUploadField.stories.js +12 -5
- package/lib/components/ImageUploadField/ImageUploadFieldBase.js +5 -4
- package/lib/components/LinkSelectField/LinkSelectField.js +10 -7
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +12 -5
- package/lib/components/ListItem/ListItem.js +1 -1
- package/lib/components/ListItem/ListItem.stories.js +1 -1
- package/lib/components/Menu/Menu.js +1 -1
- package/lib/components/Menu/Menu.stories.js +1 -1
- package/lib/components/Messages/Message.js +5 -13
- package/lib/components/Messages/Messages.js +5 -14
- package/lib/components/MultivaluesField/MultivaluesField.js +13 -9
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +12 -5
- package/lib/components/NumberField/NumberField.js +8 -5
- package/lib/components/NumberField/NumberField.stories.js +12 -5
- package/lib/components/PasswordField/PasswordField.js +14 -10
- package/lib/components/PasswordField/PasswordField.stories.js +11 -5
- package/lib/components/RadioField/RadioField.js +7 -4
- package/lib/components/RadioGroupField/RadioGroupField.js +8 -5
- package/lib/components/RadioGroupField/RadioGroupField.stories.js +11 -4
- package/lib/components/RequirementsList/RequirementsList.js +4 -15
- package/lib/components/SearchField/SearchField.js +2 -2
- package/lib/components/SearchField/SearchField.stories.js +2 -2
- package/lib/components/SelectField/SelectField.js +11 -7
- package/lib/components/SelectField/SelectField.stories.js +12 -5
- package/lib/components/SelectFieldBase/SelectFieldBase.js +6 -4
- package/lib/components/SwitchField/SwitchField.js +12 -8
- package/lib/components/SwitchField/SwitchField.stories.js +12 -5
- package/lib/components/TextAreaField/TextAreaField.js +12 -8
- package/lib/components/TextAreaField/TextAreaField.stories.js +12 -5
- package/lib/components/TextField/TextField.js +12 -8
- package/lib/components/TextField/TextField.stories.js +12 -5
- package/lib/hooks/useField/useField.js +1 -1
- package/lib/recipes/PanelHeader.stories.js +70 -0
- package/package.json +1 -1
- package/lib/cjs/utils/docUtils/statusProp.js +0 -55
- package/lib/utils/docUtils/statusProp.js +0 -44
- /package/lib/cjs/utils/{docUtils → devUtils/props}/ariaAttributes.js +0 -0
- /package/lib/cjs/utils/{docUtils → devUtils/props}/ariaAttributes.test.js +0 -0
- /package/lib/cjs/utils/{docUtils → devUtils/props}/fieldAttributes.js +0 -0
- /package/lib/cjs/utils/{docUtils → devUtils/props}/hoverProps.js +0 -0
- /package/lib/utils/{docUtils → devUtils/props}/ariaAttributes.js +0 -0
- /package/lib/utils/{docUtils → devUtils/props}/ariaAttributes.test.js +0 -0
- /package/lib/utils/{docUtils → devUtils/props}/fieldAttributes.js +0 -0
- /package/lib/utils/{docUtils → devUtils/props}/hoverProps.js +0 -0
@@ -15,9 +15,8 @@ import React, { useState } from 'react';
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
16
16
|
import { PasswordField } from '../../index';
|
17
17
|
import statuses from '../../utils/devUtils/constants/statuses';
|
18
|
-
import { ariaAttributeBaseArgTypes } from '../../utils/
|
19
|
-
import { inputFieldAttributeBaseArgTypes } from '../../utils/
|
20
|
-
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
18
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
19
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
21
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
22
21
|
export default {
|
23
22
|
title: 'Form/PasswordField',
|
@@ -29,13 +28,20 @@ export default {
|
|
29
28
|
}
|
30
29
|
}
|
31
30
|
},
|
32
|
-
argTypes: _objectSpread(_objectSpread(
|
31
|
+
argTypes: _objectSpread(_objectSpread({
|
32
|
+
status: {
|
33
|
+
control: {
|
34
|
+
type: 'select',
|
35
|
+
options: statuses
|
36
|
+
},
|
37
|
+
defaultValue: statuses.DEFAULT
|
38
|
+
},
|
33
39
|
helperText: {
|
34
40
|
control: {
|
35
41
|
type: 'text'
|
36
42
|
}
|
37
43
|
}
|
38
|
-
},
|
44
|
+
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
39
45
|
};
|
40
46
|
export var Default = function Default(args) {
|
41
47
|
return ___EmotionJSX(PasswordField, _extends({
|
@@ -8,14 +8,15 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
11
12
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
14
|
import React, { createContext, forwardRef, useContext, useImperativeHandle, useRef } from 'react';
|
14
15
|
import { useRadio } from 'react-aria';
|
15
16
|
import PropTypes from 'prop-types';
|
16
17
|
import { useField, usePropWarning } from '../../hooks';
|
17
|
-
import
|
18
|
-
import {
|
18
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
19
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
19
20
|
import Box from '../Box';
|
20
21
|
import FieldHelperText from '../FieldHelperText';
|
21
22
|
import Label from '../Label';
|
@@ -82,7 +83,7 @@ var RadioField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
83
|
variant: "forms.radio.checkedContent"
|
83
84
|
}, checkedContent));
|
84
85
|
});
|
85
|
-
RadioField.propTypes = _objectSpread(
|
86
|
+
RadioField.propTypes = _objectSpread({
|
86
87
|
/** Content to display when the radio is checked. */
|
87
88
|
checkedContent: PropTypes.node,
|
88
89
|
/** The rendered label for the field. */
|
@@ -104,6 +105,8 @@ RadioField.propTypes = _objectSpread(_objectSpread({
|
|
104
105
|
isReadOnly: PropTypes.bool,
|
105
106
|
/** Whether the Radio is required. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required). */
|
106
107
|
isRequired: PropTypes.bool,
|
108
|
+
/** Determines the textarea status indicator and helper text styling. */
|
109
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
107
110
|
/** The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue). */
|
108
111
|
value: PropTypes.string,
|
109
112
|
/** Handler that is called when the element receives focus. */
|
@@ -127,6 +130,6 @@ RadioField.propTypes = _objectSpread(_objectSpread({
|
|
127
130
|
* object.
|
128
131
|
*/
|
129
132
|
'aria-details': PropTypes.string
|
130
|
-
},
|
133
|
+
}, ariaAttributesBasePropTypes);
|
131
134
|
RadioField.displayName = 'RadioField';
|
132
135
|
export default RadioField;
|
@@ -8,6 +8,7 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
11
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
11
12
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
14
|
import React, { forwardRef, useMemo } from 'react';
|
@@ -18,9 +19,9 @@ import { v4 as uuid } from 'uuid';
|
|
18
19
|
import { Box, FieldHelperText, Label } from '../..';
|
19
20
|
import { usePropWarning, useStatusClasses } from '../../hooks';
|
20
21
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
21
|
-
import
|
22
|
-
import {
|
23
|
-
import {
|
22
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
23
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
24
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
24
25
|
import { RadioContext } from '../RadioField';
|
25
26
|
|
26
27
|
/**
|
@@ -82,7 +83,7 @@ var RadioGroupField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
83
|
id: helperTextId
|
83
84
|
}, helperText));
|
84
85
|
});
|
85
|
-
RadioGroupField.propTypes = _objectSpread(_objectSpread(
|
86
|
+
RadioGroupField.propTypes = _objectSpread(_objectSpread({
|
86
87
|
/** The name of the RadioGroupField, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name_and_radio_buttons). */
|
87
88
|
name: PropTypes.string,
|
88
89
|
/** The current value (controlled). */
|
@@ -95,6 +96,8 @@ RadioGroupField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
95
96
|
hintText: PropTypes.string,
|
96
97
|
/** Determines the arrangement of the radios. */
|
97
98
|
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
99
|
+
/** Determines the helper text styling. */
|
100
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
98
101
|
/**
|
99
102
|
* Handler that is called when the value changes.
|
100
103
|
*
|
@@ -112,6 +115,6 @@ RadioGroupField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
112
115
|
label: PropTypes.node,
|
113
116
|
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
114
117
|
id: PropTypes.string
|
115
|
-
},
|
118
|
+
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
116
119
|
RadioGroupField.displayName = 'RadioGroupField';
|
117
120
|
export default RadioGroupField;
|
@@ -12,13 +12,13 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
13
|
import React, { useState } from 'react';
|
14
14
|
import { RadioField, RadioGroupField } from '../../index';
|
15
|
-
import
|
16
|
-
import {
|
15
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
16
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
18
18
|
export default {
|
19
19
|
title: 'Form/RadioGroupField',
|
20
20
|
component: RadioGroupField,
|
21
|
-
argTypes: _objectSpread(
|
21
|
+
argTypes: _objectSpread({
|
22
22
|
label: {
|
23
23
|
control: {
|
24
24
|
type: 'text'
|
@@ -35,6 +35,13 @@ export default {
|
|
35
35
|
type: 'text'
|
36
36
|
}
|
37
37
|
},
|
38
|
+
status: {
|
39
|
+
control: {
|
40
|
+
type: 'select',
|
41
|
+
options: statuses
|
42
|
+
},
|
43
|
+
defaultValue: statuses.DEFAULT
|
44
|
+
},
|
38
45
|
defaultValue: {
|
39
46
|
defaultValue: 'A'
|
40
47
|
},
|
@@ -48,7 +55,7 @@ export default {
|
|
48
55
|
type: 'none'
|
49
56
|
}
|
50
57
|
}
|
51
|
-
},
|
58
|
+
}, ariaAttributeBaseArgTypes)
|
52
59
|
};
|
53
60
|
export var Default = function Default(args) {
|
54
61
|
return ___EmotionJSX(RadioGroupField, args, ___EmotionJSX(RadioField, {
|
@@ -1,25 +1,13 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
2
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
3
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
4
3
|
var _excluded = ["requirements"];
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
7
4
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
8
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
9
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
10
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
11
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
12
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
13
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
14
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
15
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
16
5
|
import React, { forwardRef } from 'react';
|
17
6
|
import ErrorCircle from 'mdi-react/AlertCircleIcon';
|
18
7
|
import WarningCircle from 'mdi-react/AlertCircleOutlineIcon';
|
19
8
|
import DefaultCircle from 'mdi-react/CheckboxBlankCircleOutlineIcon';
|
20
9
|
import SuccessCircle from 'mdi-react/CheckCircleIcon';
|
21
10
|
import PropTypes from 'prop-types';
|
22
|
-
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
23
11
|
import Box from '../Box';
|
24
12
|
import Icon from '../Icon';
|
25
13
|
import Text from '../Text';
|
@@ -94,9 +82,10 @@ RequirementsList.propTypes = {
|
|
94
82
|
/**
|
95
83
|
* Requirements and their status.
|
96
84
|
*/
|
97
|
-
requirements: PropTypes.arrayOf(PropTypes.shape(
|
98
|
-
name: PropTypes.string.isRequired
|
99
|
-
|
85
|
+
requirements: PropTypes.arrayOf(PropTypes.shape({
|
86
|
+
name: PropTypes.string.isRequired,
|
87
|
+
status: PropTypes.oneOf(['default', 'success', 'warning', 'error'])
|
88
|
+
}))
|
100
89
|
};
|
101
90
|
RequirementsList.defaultProps = {
|
102
91
|
requirements: []
|
@@ -18,8 +18,8 @@ import SearchIcon from 'mdi-react/SearchIcon';
|
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { Box, Icon, IconButton, Input, Label } from '../..';
|
20
20
|
import { useField, usePropWarning } from '../../hooks';
|
21
|
-
import { ariaAttributesBasePropTypes } from '../../utils/
|
22
|
-
import { inputFieldAttributesBasePropTypes } from '../../utils/
|
21
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
22
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
23
23
|
|
24
24
|
/**
|
25
25
|
* Renders a search field with associated controls including visual elements and keyboard
|
@@ -16,8 +16,8 @@ import Users from 'mdi-react/AccountGroupIcon';
|
|
16
16
|
import SearchIcon from 'mdi-react/SearchIcon';
|
17
17
|
import { useDebounce } from '../../hooks';
|
18
18
|
import { Box, SearchField, Text } from '../../index';
|
19
|
-
import { ariaAttributeBaseArgTypes, ariaAttributeBaseDocSettings } from '../../utils/
|
20
|
-
import { inputFieldAttributeBaseArgTypes } from '../../utils/
|
19
|
+
import { ariaAttributeBaseArgTypes, ariaAttributeBaseDocSettings } from '../../utils/devUtils/props/ariaAttributes';
|
20
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
22
22
|
export default {
|
23
23
|
title: 'Form/SearchField',
|
@@ -9,14 +9,15 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
11
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
12
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
12
13
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
13
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
14
15
|
import React, { forwardRef } from 'react';
|
15
16
|
import PropTypes from 'prop-types';
|
16
17
|
import { usePropWarning, useSelectField } from '../../hooks';
|
17
|
-
import
|
18
|
-
import {
|
19
|
-
import {
|
18
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
19
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
20
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
20
21
|
import SelectFieldBase from '../SelectFieldBase';
|
21
22
|
|
22
23
|
/**
|
@@ -36,7 +37,7 @@ var SelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
36
37
|
"aria-invalid": status === 'error' && true
|
37
38
|
}));
|
38
39
|
});
|
39
|
-
SelectField.propTypes = _objectSpread(_objectSpread(
|
40
|
+
SelectField.propTypes = _objectSpread(_objectSpread({
|
40
41
|
/** Alignment of the popover menu relative to the trigger. */
|
41
42
|
align: PropTypes.oneOf(['start', 'end', 'middle']),
|
42
43
|
/** Where the popover menu opens relative to its trigger. */
|
@@ -84,6 +85,8 @@ SelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
84
85
|
selectedKey: PropTypes.string,
|
85
86
|
/** Determines the textarea status indicator and helper text styling. Eg. float. */
|
86
87
|
labelMode: PropTypes.string,
|
88
|
+
/** Determines the type of label applied to the component. */
|
89
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
87
90
|
/**
|
88
91
|
* Handler that is called when more items should be loaded, e.g. while scrolling near the bottom.
|
89
92
|
*
|
@@ -114,14 +117,15 @@ SelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
114
117
|
scrollBoxProps: PropTypes.shape({
|
115
118
|
maxHeight: PropTypes.string
|
116
119
|
})
|
117
|
-
},
|
118
|
-
SelectField.defaultProps =
|
120
|
+
}, ariaAttributesBasePropTypes);
|
121
|
+
SelectField.defaultProps = {
|
119
122
|
placeholder: 'Select',
|
123
|
+
status: statuses.DEFAULT,
|
120
124
|
align: 'start',
|
121
125
|
direction: 'bottom',
|
122
126
|
scrollBoxProps: {
|
123
127
|
maxHeight: '300px'
|
124
128
|
}
|
125
|
-
}
|
129
|
+
};
|
126
130
|
SelectField.displayName = 'SelectField';
|
127
131
|
export default SelectField;
|
@@ -30,9 +30,9 @@ import React, { useState } from 'react';
|
|
30
30
|
import { OverlayProvider } from 'react-aria';
|
31
31
|
import { useAsyncList } from 'react-stately';
|
32
32
|
import { Item, Section, SelectField, Separator } from '../../index';
|
33
|
-
import
|
34
|
-
import {
|
35
|
-
import {
|
33
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
34
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
35
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
36
36
|
import { modes as labelModes } from '../Label/constants';
|
37
37
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
38
38
|
var animals = [{
|
@@ -122,7 +122,7 @@ export default {
|
|
122
122
|
}
|
123
123
|
}
|
124
124
|
},
|
125
|
-
argTypes: _objectSpread(_objectSpread(
|
125
|
+
argTypes: _objectSpread(_objectSpread({
|
126
126
|
label: {
|
127
127
|
control: {
|
128
128
|
type: 'text'
|
@@ -148,6 +148,13 @@ export default {
|
|
148
148
|
},
|
149
149
|
defaultValue: _Object$values(labelModes)[0]
|
150
150
|
},
|
151
|
+
status: {
|
152
|
+
control: {
|
153
|
+
type: 'select',
|
154
|
+
options: statuses
|
155
|
+
},
|
156
|
+
defaultValue: statuses.DEFAULT
|
157
|
+
},
|
151
158
|
defaultSelectedKey: {},
|
152
159
|
disabledKeys: {},
|
153
160
|
name: {},
|
@@ -163,7 +170,7 @@ export default {
|
|
163
170
|
type: 'none'
|
164
171
|
}
|
165
172
|
}
|
166
|
-
},
|
173
|
+
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
167
174
|
};
|
168
175
|
export var Default = function Default(args) {
|
169
176
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, _extends({}, args, {
|
@@ -18,8 +18,8 @@ import { HiddenSelect } from 'react-aria';
|
|
18
18
|
import MenuDown from 'mdi-react/MenuDownIcon';
|
19
19
|
import PropTypes from 'prop-types';
|
20
20
|
import { v4 as uuid } from 'uuid';
|
21
|
-
import
|
22
|
-
import {
|
21
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
22
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/devUtils/props/ariaAttributes';
|
23
23
|
import Box from '../Box';
|
24
24
|
import Button from '../Button';
|
25
25
|
import FieldHelperText from '../FieldHelperText';
|
@@ -105,7 +105,7 @@ var SelectFieldBase = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
105
105
|
id: helperTextId
|
106
106
|
}, helperText));
|
107
107
|
});
|
108
|
-
SelectFieldBase.propTypes = _objectSpread(
|
108
|
+
SelectFieldBase.propTypes = _objectSpread({
|
109
109
|
/** Default text rendered if no option is selected. Deprecated. */
|
110
110
|
defaultText: PropTypes.string,
|
111
111
|
/** Text rendered below the input. */
|
@@ -118,6 +118,8 @@ SelectFieldBase.propTypes = _objectSpread(_objectSpread({
|
|
118
118
|
name: PropTypes.string,
|
119
119
|
/** Temporary text that occupies the text input when it is empty. */
|
120
120
|
placeholder: PropTypes.string,
|
121
|
+
/** Determines the type of label applied to the component. */
|
122
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
121
123
|
/** Determines whether to use column styles. */
|
122
124
|
columnStyleProps: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({})]),
|
123
125
|
/** Determines props that applied to root container. */
|
@@ -154,5 +156,5 @@ SelectFieldBase.propTypes = _objectSpread(_objectSpread({
|
|
154
156
|
triggerRef: PropTypes.shape({}),
|
155
157
|
/** Props for the element representing the selected value. */
|
156
158
|
valueProps: PropTypes.shape({})
|
157
|
-
},
|
159
|
+
}, ariaAttributesBasePropTypes);
|
158
160
|
export default SelectFieldBase;
|
@@ -10,6 +10,7 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
10
10
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
11
11
|
var _excluded = ["label", "helperText", "isDefaultSelected", "isSelected", "onChange", "value", "name", "id", "isDisabled", "isReadOnly", "isRequired", "hasAutoFocus", "onFocus", "onBlur", "onFocusChange", "onKeyDown", "onKeyUp", "status", "controlProps"];
|
12
12
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
13
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
13
14
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
16
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
@@ -20,9 +21,9 @@ import omit from 'lodash/omit';
|
|
20
21
|
import PropTypes from 'prop-types';
|
21
22
|
import { Box, FieldHelperText, Label, Switch } from '../..';
|
22
23
|
import { useField, usePropWarning } from '../../hooks';
|
23
|
-
import
|
24
|
-
import {
|
25
|
-
import {
|
24
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
25
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
26
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
26
27
|
|
27
28
|
/**
|
28
29
|
* Combines a switch, label, and helper text for a complete, form-ready solution.
|
@@ -97,7 +98,7 @@ var SwitchField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
97
98
|
status: status
|
98
99
|
}, helperText));
|
99
100
|
});
|
100
|
-
SwitchField.propTypes = _objectSpread(_objectSpread(
|
101
|
+
SwitchField.propTypes = _objectSpread(_objectSpread({
|
101
102
|
/** A list of class names to apply to the input element. */
|
102
103
|
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
103
104
|
/** Whether the element should receive focus on render. */
|
@@ -134,14 +135,17 @@ SwitchField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
134
135
|
onKeyDown: PropTypes.func,
|
135
136
|
/** Handler that is called when a key is released. */
|
136
137
|
onKeyUp: PropTypes.func,
|
138
|
+
/** Determines the textarea status indicator and helper text styling. */
|
139
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
137
140
|
/** The value of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefvalue). */
|
138
141
|
value: PropTypes.string
|
139
|
-
},
|
140
|
-
SwitchField.defaultProps =
|
142
|
+
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
143
|
+
SwitchField.defaultProps = {
|
141
144
|
isDisabled: false,
|
142
145
|
isReadOnly: false,
|
143
146
|
isRequired: false,
|
144
|
-
hasAutoFocus: false
|
145
|
-
|
147
|
+
hasAutoFocus: false,
|
148
|
+
status: statuses.DEFAULT
|
149
|
+
};
|
146
150
|
SwitchField.displayName = 'SwitchField';
|
147
151
|
export default SwitchField;
|
@@ -13,9 +13,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
import React, { useRef, useState } from 'react';
|
14
14
|
import { Pressable } from '@react-aria/interactions';
|
15
15
|
import { SwitchField, Tooltip, TooltipTrigger } from '../../index';
|
16
|
-
import
|
17
|
-
import {
|
18
|
-
import {
|
16
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
17
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
18
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
20
|
export default {
|
21
21
|
title: 'Form/SwitchField',
|
@@ -27,7 +27,7 @@ export default {
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
},
|
30
|
-
argTypes: _objectSpread(_objectSpread(
|
30
|
+
argTypes: _objectSpread(_objectSpread({
|
31
31
|
label: {
|
32
32
|
control: {
|
33
33
|
type: 'text'
|
@@ -49,6 +49,13 @@ export default {
|
|
49
49
|
},
|
50
50
|
name: {},
|
51
51
|
className: {},
|
52
|
+
status: {
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
options: statuses
|
56
|
+
},
|
57
|
+
defaultValue: statuses.DEFAULT
|
58
|
+
},
|
52
59
|
isDisabled: {},
|
53
60
|
isRequired: {},
|
54
61
|
isReadOnly: {},
|
@@ -60,7 +67,7 @@ export default {
|
|
60
67
|
type: 'none'
|
61
68
|
}
|
62
69
|
}
|
63
|
-
},
|
70
|
+
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
64
71
|
};
|
65
72
|
export var Default = function Default(args) {
|
66
73
|
return ___EmotionJSX(SwitchField, args);
|
@@ -8,6 +8,7 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
11
12
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
14
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
|
@@ -16,9 +17,9 @@ import PropTypes from 'prop-types';
|
|
16
17
|
import { v4 as uuid } from 'uuid';
|
17
18
|
import { Box, FieldHelperText, Label, TextArea } from '../..';
|
18
19
|
import { useColumnStyles, useField, useLabelHeight, usePropWarning } from '../../hooks';
|
19
|
-
import
|
20
|
-
import {
|
21
|
-
import {
|
20
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
21
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
22
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
22
23
|
|
23
24
|
/**
|
24
25
|
* Combines a textarea, label, and helper text for a complete, form-ready solution.
|
@@ -136,7 +137,7 @@ var TextAreaField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
136
137
|
id: helperTextId
|
137
138
|
}, helperText));
|
138
139
|
});
|
139
|
-
TextAreaField.propTypes = _objectSpread(_objectSpread(
|
140
|
+
TextAreaField.propTypes = _objectSpread(_objectSpread({
|
140
141
|
/** The rendered label for the field. */
|
141
142
|
label: PropTypes.node,
|
142
143
|
/** Text rendered below the textarea. */
|
@@ -196,19 +197,22 @@ TextAreaField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
196
197
|
placeholder: PropTypes.string,
|
197
198
|
/** The number of rows to display for the textarea. Controls the default height. */
|
198
199
|
rows: PropTypes.number,
|
200
|
+
/** Determines the textarea status indicator and helper text styling. */
|
201
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
199
202
|
/** Provides a way to insert markup in specified places. */
|
200
203
|
slots: PropTypes.shape({
|
201
204
|
/** The given node will be inserted into the field container. */
|
202
205
|
inContainer: PropTypes.node
|
203
206
|
})
|
204
|
-
},
|
205
|
-
TextAreaField.defaultProps =
|
207
|
+
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
208
|
+
TextAreaField.defaultProps = {
|
206
209
|
hasAutoFocus: false,
|
207
210
|
isDisabled: false,
|
208
211
|
isReadOnly: false,
|
209
212
|
isRequired: false,
|
210
213
|
isUnresizable: false,
|
211
|
-
rows: 4
|
212
|
-
|
214
|
+
rows: 4,
|
215
|
+
status: statuses.DEFAULT
|
216
|
+
};
|
213
217
|
TextAreaField.displayName = 'TextAreaField';
|
214
218
|
export default TextAreaField;
|
@@ -15,9 +15,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
15
15
|
import React, { useState } from 'react';
|
16
16
|
import SearchIcon from 'mdi-react/SearchIcon';
|
17
17
|
import { Box, Icon, TextAreaField } from '../../index';
|
18
|
-
import
|
19
|
-
import {
|
20
|
-
import {
|
18
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
19
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
20
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
21
21
|
import { modes as labelModes } from '../Label/constants';
|
22
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
23
23
|
export default {
|
@@ -30,7 +30,7 @@ export default {
|
|
30
30
|
}
|
31
31
|
}
|
32
32
|
},
|
33
|
-
argTypes: _objectSpread(_objectSpread(
|
33
|
+
argTypes: _objectSpread(_objectSpread({
|
34
34
|
label: {
|
35
35
|
control: {
|
36
36
|
type: 'text'
|
@@ -58,6 +58,13 @@ export default {
|
|
58
58
|
}
|
59
59
|
},
|
60
60
|
rows: {},
|
61
|
+
status: {
|
62
|
+
control: {
|
63
|
+
type: 'select',
|
64
|
+
options: statuses
|
65
|
+
},
|
66
|
+
defaultValue: statuses.DEFAULT
|
67
|
+
},
|
61
68
|
isDisabled: {},
|
62
69
|
isRequired: {},
|
63
70
|
isReadOnly: {},
|
@@ -71,7 +78,7 @@ export default {
|
|
71
78
|
type: 'none'
|
72
79
|
}
|
73
80
|
}
|
74
|
-
},
|
81
|
+
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
75
82
|
};
|
76
83
|
var IconSlot = ___EmotionJSX(Box, {
|
77
84
|
isRow: true
|
@@ -8,6 +8,7 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
11
12
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
14
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
@@ -16,9 +17,9 @@ import { v4 as uuid } from 'uuid';
|
|
16
17
|
import { Box, FieldHelperText, Input, Label } from '../..';
|
17
18
|
import { useField, useLabelHeight, usePropWarning } from '../../hooks';
|
18
19
|
import useColumnStyles from '../../hooks/useColumnStyles';
|
19
|
-
import
|
20
|
-
import {
|
21
|
-
import {
|
20
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
21
|
+
import { ariaAttributesBasePropTypes } from '../../utils/devUtils/props/ariaAttributes';
|
22
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
22
23
|
|
23
24
|
/**
|
24
25
|
* Combines a text input, label, and helper text for a complete, form-ready solution.
|
@@ -70,7 +71,7 @@ var TextField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
70
71
|
id: helperTextId
|
71
72
|
}, helperText));
|
72
73
|
});
|
73
|
-
TextField.propTypes = _objectSpread(_objectSpread(
|
74
|
+
TextField.propTypes = _objectSpread(_objectSpread({
|
74
75
|
/** The rendered label for the field. */
|
75
76
|
label: PropTypes.node,
|
76
77
|
/** A string designating whether or not the label is a float label. */
|
@@ -129,16 +130,19 @@ TextField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
129
130
|
/** The given node will be inserted into the field container. */
|
130
131
|
inContainer: PropTypes.node
|
131
132
|
}),
|
133
|
+
/** Determines the input status indicator and helper text styling. */
|
134
|
+
status: PropTypes.oneOf(_Object$values(statuses)),
|
132
135
|
/** Determines the type of input to use. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). */
|
133
136
|
type: PropTypes.string,
|
134
137
|
/** Props object that is spread directly into the input wrapper element. */
|
135
138
|
wrapperProps: PropTypes.shape({})
|
136
|
-
},
|
137
|
-
TextField.defaultProps =
|
139
|
+
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
140
|
+
TextField.defaultProps = {
|
138
141
|
hasAutoFocus: false,
|
139
142
|
isDisabled: false,
|
140
143
|
isReadOnly: false,
|
141
|
-
isRequired: false
|
142
|
-
|
144
|
+
isRequired: false,
|
145
|
+
status: statuses.DEFAULT
|
146
|
+
};
|
143
147
|
TextField.displayName = 'TextField';
|
144
148
|
export default TextField;
|