@pingux/astro 2.2.0-alpha.3 → 2.2.0-alpha.4
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 +4 -6
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +1 -1
- package/lib/cjs/components/Callout/Callout.js +12 -9
- package/lib/cjs/components/Callout/Callout.stories.js +12 -9
- package/lib/cjs/components/CheckboxField/CheckboxField.js +5 -8
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +5 -13
- package/lib/cjs/components/ColorField/ColorField.js +5 -8
- package/lib/cjs/components/ColorField/ColorField.stories.js +5 -12
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +4 -5
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +4 -5
- 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 +14 -11
- package/lib/cjs/components/FieldHelperText/FieldHelperText.stories.js +12 -10
- package/lib/cjs/components/FileInputField/FileInputField.js +14 -19
- package/lib/cjs/components/FileInputField/FileInputField.stories.js +5 -11
- package/lib/cjs/components/FileInputField/FileItem.js +14 -6
- package/lib/cjs/components/FileInputField/FileSelect.js +1 -1
- package/lib/cjs/components/Icon/NoticeIcon.js +11 -5
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +6 -9
- package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +5 -12
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +7 -5
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +7 -10
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +5 -12
- 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 +13 -7
- package/lib/cjs/components/Messages/Messages.js +14 -7
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +9 -13
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +5 -12
- package/lib/cjs/components/NumberField/NumberField.js +5 -8
- package/lib/cjs/components/NumberField/NumberField.stories.js +5 -12
- package/lib/cjs/components/PasswordField/PasswordField.js +10 -14
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +5 -11
- package/lib/cjs/components/RadioField/RadioField.js +4 -7
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +5 -8
- package/lib/cjs/components/RadioGroupField/RadioGroupField.stories.js +4 -11
- package/lib/cjs/components/RequirementsList/RequirementsList.js +15 -6
- 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 +7 -11
- package/lib/cjs/components/SelectField/SelectField.stories.js +5 -12
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +4 -6
- package/lib/cjs/components/SwitchField/SwitchField.js +8 -12
- package/lib/cjs/components/SwitchField/SwitchField.stories.js +5 -12
- package/lib/cjs/components/TextAreaField/TextAreaField.js +8 -12
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +5 -12
- package/lib/cjs/components/TextField/TextField.js +8 -12
- package/lib/cjs/components/TextField/TextField.stories.js +5 -12
- package/lib/cjs/hooks/useField/useField.js +1 -1
- package/lib/cjs/utils/docUtils/statusProp.js +55 -0
- package/lib/components/ArrayField/ArrayField.js +4 -6
- package/lib/components/ArrayField/ArrayField.stories.js +1 -1
- package/lib/components/Callout/Callout.js +13 -9
- package/lib/components/Callout/Callout.stories.js +13 -9
- package/lib/components/CheckboxField/CheckboxField.js +5 -8
- package/lib/components/CheckboxField/CheckboxField.stories.js +5 -13
- package/lib/components/ColorField/ColorField.js +5 -8
- package/lib/components/ColorField/ColorField.stories.js +5 -12
- package/lib/components/ComboBox/ComboBoxInput.js +4 -5
- package/lib/components/ComboBoxField/ComboBoxField.js +4 -5
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +1 -1
- package/lib/components/DataTable/DataTable.stories.js +1 -1
- package/lib/components/FieldHelperText/FieldHelperText.js +14 -9
- package/lib/components/FieldHelperText/FieldHelperText.stories.js +13 -10
- package/lib/components/FileInputField/FileInputField.js +14 -19
- package/lib/components/FileInputField/FileInputField.stories.js +5 -11
- package/lib/components/FileInputField/FileItem.js +14 -4
- package/lib/components/FileInputField/FileSelect.js +1 -1
- package/lib/components/Icon/NoticeIcon.js +12 -5
- package/lib/components/ImageUploadField/ImageUploadField.js +6 -9
- package/lib/components/ImageUploadField/ImageUploadField.stories.js +5 -12
- package/lib/components/ImageUploadField/ImageUploadFieldBase.js +7 -5
- package/lib/components/LinkSelectField/LinkSelectField.js +7 -10
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +5 -12
- 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 +13 -5
- package/lib/components/Messages/Messages.js +14 -5
- package/lib/components/MultivaluesField/MultivaluesField.js +9 -13
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +5 -12
- package/lib/components/NumberField/NumberField.js +5 -8
- package/lib/components/NumberField/NumberField.stories.js +5 -12
- package/lib/components/PasswordField/PasswordField.js +10 -14
- package/lib/components/PasswordField/PasswordField.stories.js +5 -11
- package/lib/components/RadioField/RadioField.js +4 -7
- package/lib/components/RadioGroupField/RadioGroupField.js +5 -8
- package/lib/components/RadioGroupField/RadioGroupField.stories.js +4 -11
- package/lib/components/RequirementsList/RequirementsList.js +15 -4
- package/lib/components/SearchField/SearchField.js +2 -2
- package/lib/components/SearchField/SearchField.stories.js +2 -2
- package/lib/components/SelectField/SelectField.js +7 -11
- package/lib/components/SelectField/SelectField.stories.js +5 -12
- package/lib/components/SelectFieldBase/SelectFieldBase.js +4 -6
- package/lib/components/SwitchField/SwitchField.js +8 -12
- package/lib/components/SwitchField/SwitchField.stories.js +5 -12
- package/lib/components/TextAreaField/TextAreaField.js +8 -12
- package/lib/components/TextAreaField/TextAreaField.stories.js +5 -12
- package/lib/components/TextField/TextField.js +8 -12
- package/lib/components/TextField/TextField.stories.js +5 -12
- package/lib/hooks/useField/useField.js +1 -1
- package/lib/utils/docUtils/statusProp.js +44 -0
- package/package.json +1 -1
- /package/lib/cjs/utils/{devUtils/props → docUtils}/ariaAttributes.js +0 -0
- /package/lib/cjs/utils/{devUtils/props → docUtils}/ariaAttributes.test.js +0 -0
- /package/lib/cjs/utils/{devUtils/props → docUtils}/fieldAttributes.js +0 -0
- /package/lib/cjs/utils/{devUtils/props → docUtils}/hoverProps.js +0 -0
- /package/lib/utils/{devUtils/props → docUtils}/ariaAttributes.js +0 -0
- /package/lib/utils/{devUtils/props → docUtils}/ariaAttributes.test.js +0 -0
- /package/lib/utils/{devUtils/props → docUtils}/fieldAttributes.js +0 -0
- /package/lib/utils/{devUtils/props → docUtils}/hoverProps.js +0 -0
@@ -8,7 +8,6 @@ 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";
|
12
11
|
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
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; }
|
14
13
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
@@ -17,9 +16,9 @@ import PropTypes from 'prop-types';
|
|
17
16
|
import { v4 as uuid } from 'uuid';
|
18
17
|
import { Item, Menu } from '../..';
|
19
18
|
import { useImageUploadState } from '../../hooks/useImageUploadState';
|
20
|
-
import
|
21
|
-
import {
|
22
|
-
import {
|
19
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
20
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
21
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
23
22
|
import ImagePreviewButton from './ImagePreviewButton';
|
24
23
|
import ImageUploadFieldBase from './ImageUploadFieldBase';
|
25
24
|
|
@@ -94,7 +93,7 @@ var ImageUploadField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
94
93
|
id: statusId
|
95
94
|
}, state.isMenuOpen && 'Menu pop up expanded'));
|
96
95
|
});
|
97
|
-
ImageUploadField.propTypes = _objectSpread(_objectSpread({
|
96
|
+
ImageUploadField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
98
97
|
/** Image preview (controlled), used to represent the current image state. */
|
99
98
|
previewImage: PropTypes.string,
|
100
99
|
/** Text that renders in the upload menu item. */
|
@@ -127,10 +126,8 @@ ImageUploadField.propTypes = _objectSpread(_objectSpread({
|
|
127
126
|
/** Define component height */
|
128
127
|
previewHeight: PropTypes.number,
|
129
128
|
/** Define component height */
|
130
|
-
previewWidth: PropTypes.number
|
131
|
-
|
132
|
-
status: PropTypes.oneOf(_Object$values(statuses))
|
133
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
129
|
+
previewWidth: PropTypes.number
|
130
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
134
131
|
ImageUploadField.defaultProps = {
|
135
132
|
fileTypes: ['image'],
|
136
133
|
loaderSize: 10,
|
@@ -23,9 +23,9 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
23
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
24
24
|
import React, { useRef, useState } from 'react';
|
25
25
|
import { Image, ImageUploadField, OverlayProvider } from '../../index';
|
26
|
-
import
|
27
|
-
import {
|
28
|
-
import {
|
26
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
27
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
28
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
29
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
30
30
|
export default {
|
31
31
|
title: 'Form/ImageUploadField',
|
@@ -37,7 +37,7 @@ export default {
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
},
|
40
|
-
argTypes: _objectSpread(_objectSpread({
|
40
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
41
41
|
previewImage: {
|
42
42
|
control: {
|
43
43
|
type: 'text'
|
@@ -86,15 +86,8 @@ export default {
|
|
86
86
|
type: 'number'
|
87
87
|
},
|
88
88
|
defaultValue: 50
|
89
|
-
},
|
90
|
-
status: {
|
91
|
-
control: {
|
92
|
-
type: 'select',
|
93
|
-
options: statuses
|
94
|
-
},
|
95
|
-
defaultValue: statuses.DEFAULT
|
96
89
|
}
|
97
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
90
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
98
91
|
};
|
99
92
|
export var Default = function Default(args) {
|
100
93
|
return (
|
@@ -8,7 +8,6 @@ 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";
|
12
11
|
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
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; }
|
14
13
|
import React, { forwardRef, useMemo, useRef } from 'react';
|
@@ -18,6 +17,7 @@ import PropTypes from 'prop-types';
|
|
18
17
|
import { Box, FieldHelperText, Input, Label, PopoverMenu } from '../..';
|
19
18
|
import useField from '../../hooks/useField';
|
20
19
|
import statuses from '../../utils/devUtils/constants/statuses';
|
20
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
22
22
|
var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
23
23
|
var children = props.children,
|
@@ -55,6 +55,9 @@ var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
55
55
|
"data-testid": "image-upload-input",
|
56
56
|
onChange: handleInputChange,
|
57
57
|
ref: inputRef,
|
58
|
+
sx: {
|
59
|
+
display: 'none'
|
60
|
+
},
|
58
61
|
type: "file",
|
59
62
|
value: ""
|
60
63
|
}))), !isImageType && ___EmotionJSX(FieldHelperText, {
|
@@ -63,7 +66,7 @@ var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
|
63
66
|
status: status
|
64
67
|
}, helperText));
|
65
68
|
});
|
66
|
-
ImageUploadFieldBase.propTypes = {
|
69
|
+
ImageUploadFieldBase.propTypes = _objectSpread({
|
67
70
|
fileName: PropTypes.string,
|
68
71
|
fileTypes: PropTypes.arrayOf(PropTypes.oneOf(['application', 'audio', 'example', 'application', 'image', 'model', 'text', 'video'])),
|
69
72
|
handleInputChange: PropTypes.func,
|
@@ -71,8 +74,7 @@ ImageUploadFieldBase.propTypes = {
|
|
71
74
|
handleOpenMenuChange: PropTypes.func,
|
72
75
|
helperText: PropTypes.node,
|
73
76
|
isImageType: PropTypes.bool,
|
74
|
-
isMenuOpen: PropTypes.bool
|
75
|
-
|
76
|
-
};
|
77
|
+
isMenuOpen: PropTypes.bool
|
78
|
+
}, statusPropTypes);
|
77
79
|
ImageUploadFieldBase.displayName = 'ImageUploadFieldBase';
|
78
80
|
export default ImageUploadFieldBase;
|
@@ -9,7 +9,6 @@ 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";
|
13
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; }
|
14
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; }
|
15
14
|
import React, { forwardRef } from 'react';
|
@@ -20,8 +19,9 @@ import { v4 as uuid } from 'uuid';
|
|
20
19
|
import { Box, Button, Icon, Loader, Text } from '../..';
|
21
20
|
import { usePropWarning, useSelectField } from '../../hooks';
|
22
21
|
import statuses from '../../utils/devUtils/constants/statuses';
|
23
|
-
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/
|
24
|
-
import { inputFieldAttributesBasePropTypes } from '../../utils/
|
22
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
23
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
24
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
25
25
|
import SelectFieldBase from '../SelectFieldBase';
|
26
26
|
|
27
27
|
/**
|
@@ -86,7 +86,7 @@ var LinkSelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
86
86
|
trigger: trigger
|
87
87
|
}));
|
88
88
|
});
|
89
|
-
LinkSelectField.propTypes = _objectSpread(_objectSpread({
|
89
|
+
LinkSelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
90
90
|
/** Alignment of the popover menu relative to the trigger. */
|
91
91
|
align: PropTypes.oneOf(['start', 'end', 'middle']),
|
92
92
|
/** Where the popover menu opens relative to its trigger. */
|
@@ -130,8 +130,6 @@ LinkSelectField.propTypes = _objectSpread(_objectSpread({
|
|
130
130
|
placeholder: PropTypes.string,
|
131
131
|
/** The currently selected key in the collection (controlled). */
|
132
132
|
selectedKey: PropTypes.string,
|
133
|
-
/** Determines the type of label applied to the component. */
|
134
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
135
133
|
/**
|
136
134
|
* Handler that is called when more items should be loaded, e.g. while scrolling near the bottom.
|
137
135
|
*
|
@@ -150,12 +148,11 @@ LinkSelectField.propTypes = _objectSpread(_objectSpread({
|
|
150
148
|
* (key: Key) => any
|
151
149
|
*/
|
152
150
|
onSelectionChange: PropTypes.func
|
153
|
-
}, inputFieldAttributesBasePropTypes), ariaAttributesBasePropTypes);
|
154
|
-
LinkSelectField.defaultProps = {
|
151
|
+
}, statusPropTypes), inputFieldAttributesBasePropTypes), ariaAttributesBasePropTypes);
|
152
|
+
LinkSelectField.defaultProps = _objectSpread({
|
155
153
|
placeholder: 'Select',
|
156
|
-
status: statuses.DEFAULT,
|
157
154
|
align: 'start',
|
158
155
|
direction: 'bottom'
|
159
|
-
};
|
156
|
+
}, statusDefaultProp);
|
160
157
|
LinkSelectField.displayName = 'LinkSelectField';
|
161
158
|
export default LinkSelectField;
|
@@ -29,9 +29,9 @@ import React, { useState } from 'react';
|
|
29
29
|
import { OverlayProvider } from 'react-aria';
|
30
30
|
import { useAsyncList } from 'react-stately';
|
31
31
|
import { Box, Item, LinkSelectField, Separator } from '../../index';
|
32
|
-
import
|
33
|
-
import {
|
34
|
-
import {
|
32
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
33
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
34
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
35
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
36
36
|
export default {
|
37
37
|
title: 'Form/LinkSelectField',
|
@@ -43,7 +43,7 @@ export default {
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
},
|
46
|
-
argTypes: _objectSpread(_objectSpread({
|
46
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
47
47
|
label: {
|
48
48
|
control: {
|
49
49
|
type: 'text'
|
@@ -62,13 +62,6 @@ export default {
|
|
62
62
|
type: 'text'
|
63
63
|
}
|
64
64
|
},
|
65
|
-
status: {
|
66
|
-
control: {
|
67
|
-
type: 'select',
|
68
|
-
options: statuses
|
69
|
-
},
|
70
|
-
defaultValue: statuses.DEFAULT
|
71
|
-
},
|
72
65
|
defaultSelectedKey: {},
|
73
66
|
disabledKeys: {},
|
74
67
|
name: {},
|
@@ -84,7 +77,7 @@ export default {
|
|
84
77
|
type: 'none'
|
85
78
|
}
|
86
79
|
}
|
87
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
80
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
88
81
|
};
|
89
82
|
export var Default = function Default(args) {
|
90
83
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(LinkSelectField, _extends({}, args, {
|
@@ -16,7 +16,7 @@ import React, { forwardRef } from 'react';
|
|
16
16
|
import { useHover } from '@react-aria/interactions';
|
17
17
|
import PropTypes from 'prop-types';
|
18
18
|
import { useStatusClasses } from '../../hooks';
|
19
|
-
import { onHoverPropTypes } from '../../utils/
|
19
|
+
import { onHoverPropTypes } from '../../utils/docUtils/hoverProps';
|
20
20
|
import Box from '../Box/Box';
|
21
21
|
|
22
22
|
/**
|
@@ -15,7 +15,7 @@ import React, { useState } from 'react';
|
|
15
15
|
import AccountIcon from 'mdi-react/AccountIcon';
|
16
16
|
import MoreVertIcon from 'mdi-react/MoreVertIcon';
|
17
17
|
import { Box, Icon, IconButton, ListItem, Separator, Text } from '../../index';
|
18
|
-
import { onHoverArgTypes } from '../../utils/
|
18
|
+
import { onHoverArgTypes } from '../../utils/docUtils/hoverProps';
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
20
|
export default {
|
21
21
|
title: 'Components/ListItem',
|
@@ -23,7 +23,7 @@ import PropTypes from 'prop-types';
|
|
23
23
|
import { MenuContext } from '../../context/MenuContext';
|
24
24
|
import { usePropWarning } from '../../hooks';
|
25
25
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
26
|
-
import { onHoverPropTypes } from '../../utils/
|
26
|
+
import { onHoverPropTypes } from '../../utils/docUtils/hoverProps';
|
27
27
|
import Box from '../Box';
|
28
28
|
import MenuItem from '../MenuItem';
|
29
29
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
14
14
|
import React from 'react';
|
15
15
|
import { Item } from 'react-stately';
|
16
16
|
import { Menu, Text } from '../../index';
|
17
|
-
import { onHoverArgTypes } from '../../utils/
|
17
|
+
import { onHoverArgTypes } from '../../utils/docUtils/hoverProps';
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
19
19
|
export default {
|
20
20
|
title: 'Components/Menu',
|
@@ -1,15 +1,24 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
1
9
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
3
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
4
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
5
13
|
var _excluded = ["color"];
|
6
|
-
|
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; }
|
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; }
|
7
16
|
import React, { forwardRef, useLayoutEffect, useRef, useState } from 'react';
|
8
17
|
import CloseIcon from 'mdi-react/CloseIcon';
|
9
18
|
import PropTypes from 'prop-types';
|
10
19
|
import { Box, Icon, IconButton, Text } from '../..';
|
11
20
|
import useStatusClasses from '../../hooks/useStatusClasses';
|
12
|
-
import
|
21
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
13
22
|
import { NoticeIcon } from '../Icon/NoticeIcon';
|
14
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
15
24
|
export var ARIA_STATUSES = {
|
@@ -126,8 +135,6 @@ Message.propTypes = {
|
|
126
135
|
key: PropTypes.string,
|
127
136
|
props: PropTypes.shape({
|
128
137
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
129
|
-
/* status changes the background, text, and button color accordingly */
|
130
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
131
138
|
/* Background color */
|
132
139
|
bg: PropTypes.string,
|
133
140
|
/* Text color */
|
@@ -136,7 +143,8 @@ Message.propTypes = {
|
|
136
143
|
icon: PropTypes.elementType,
|
137
144
|
/* Hides the message with an animated transition */
|
138
145
|
isHidden: PropTypes.bool,
|
139
|
-
'data-id': PropTypes.string
|
146
|
+
'data-id': PropTypes.string,
|
147
|
+
status: _objectSpread({}, statusPropTypes).status
|
140
148
|
})
|
141
149
|
}),
|
142
150
|
/* Callback for clicking the message's close button */
|
@@ -1,13 +1,23 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
1
2
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
4
|
var _excluded = ["items", "onClose"];
|
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 _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
5
8
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
6
|
-
import _Object$
|
9
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
10
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
11
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
12
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
13
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
14
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
15
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
16
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
7
17
|
import React, { forwardRef } from 'react';
|
8
18
|
import { useListState } from '@react-stately/list';
|
9
19
|
import PropTypes from 'prop-types';
|
10
|
-
import
|
20
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
11
21
|
import Box from '../Box';
|
12
22
|
import Message from './Message';
|
13
23
|
|
@@ -35,12 +45,11 @@ var Messages = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
35
45
|
});
|
36
46
|
Messages.propTypes = {
|
37
47
|
/* For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections). */
|
38
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
48
|
+
items: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
39
49
|
key: PropTypes.string,
|
40
50
|
text: PropTypes.string,
|
41
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
42
51
|
node: PropTypes.node
|
43
|
-
})),
|
52
|
+
}, statusPropTypes))),
|
44
53
|
/* Callback for clicking the message's close button */
|
45
54
|
onClose: PropTypes.func
|
46
55
|
};
|
@@ -19,7 +19,6 @@ import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instanc
|
|
19
19
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
20
20
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
21
21
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
22
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
23
22
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
24
23
|
import { DismissButton, FocusScope, useOverlayPosition } from 'react-aria';
|
25
24
|
import { useFilter } from '@react-aria/i18n';
|
@@ -29,10 +28,10 @@ import Clear from 'mdi-react/CloseIcon';
|
|
29
28
|
import PropTypes from 'prop-types';
|
30
29
|
import { Badge, Box, Icon, IconButton, PopoverContainer, ScrollBox, Text, TextField } from '../..';
|
31
30
|
import { usePropWarning } from '../../hooks';
|
32
|
-
import statuses from '../../utils/devUtils/constants/statuses';
|
33
|
-
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/devUtils/props/ariaAttributes';
|
34
|
-
import { inputFieldAttributesBasePropTypes } from '../../utils/devUtils/props/fieldAttributes';
|
35
31
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
32
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
33
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
34
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
36
35
|
import ListBox from '../ListBox';
|
37
36
|
|
38
37
|
/**
|
@@ -422,7 +421,7 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
422
421
|
style: style
|
423
422
|
}, listbox));
|
424
423
|
});
|
425
|
-
MultivaluesField.propTypes = _objectSpread(_objectSpread({
|
424
|
+
MultivaluesField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
426
425
|
/** The initial selected keys in the collection (uncontrolled). */
|
427
426
|
defaultSelectedKeys: isIterableProp,
|
428
427
|
/** Where the menu opens relative to its trigger. */
|
@@ -517,17 +516,14 @@ MultivaluesField.propTypes = _objectSpread(_objectSpread({
|
|
517
516
|
/** @ignore */
|
518
517
|
scrollBoxProps: PropTypes.shape({
|
519
518
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.number])
|
520
|
-
})
|
521
|
-
|
522
|
-
|
523
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
524
|
-
MultivaluesField.defaultProps = {
|
519
|
+
})
|
520
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
521
|
+
MultivaluesField.defaultProps = _objectSpread({
|
525
522
|
direction: 'bottom',
|
526
523
|
isReadOnly: false,
|
527
524
|
mode: 'restrictive',
|
528
525
|
scrollBoxProps: {
|
529
526
|
maxHeight: 300
|
530
|
-
}
|
531
|
-
|
532
|
-
};
|
527
|
+
}
|
528
|
+
}, statusDefaultProp);
|
533
529
|
export default MultivaluesField;
|
@@ -13,14 +13,14 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
13
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; }
|
14
14
|
import React, { useState } from 'react';
|
15
15
|
import { Box, Icon, Item, MultivaluesField, OverlayProvider } from '../../index';
|
16
|
-
import
|
17
|
-
import {
|
18
|
-
import {
|
16
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
17
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
18
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
20
20
|
export default {
|
21
21
|
title: 'Form/MultivaluesField',
|
22
22
|
component: MultivaluesField,
|
23
|
-
argTypes: _objectSpread(_objectSpread({
|
23
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
24
24
|
direction: {
|
25
25
|
defaultValue: 'bottom'
|
26
26
|
},
|
@@ -55,19 +55,12 @@ export default {
|
|
55
55
|
type: 'none'
|
56
56
|
}
|
57
57
|
},
|
58
|
-
status: {
|
59
|
-
control: {
|
60
|
-
type: 'select',
|
61
|
-
options: statuses
|
62
|
-
},
|
63
|
-
defaultValue: statuses.DEFAULT
|
64
|
-
},
|
65
58
|
helperText: {
|
66
59
|
control: {
|
67
60
|
type: 'text'
|
68
61
|
}
|
69
62
|
}
|
70
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes),
|
63
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes),
|
71
64
|
parameters: {
|
72
65
|
docs: {
|
73
66
|
source: {
|
@@ -9,7 +9,6 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
11
|
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim";
|
12
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
13
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; }
|
14
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
14
|
import React, { forwardRef, useCallback, useImperativeHandle, useMemo } from 'react';
|
@@ -23,9 +22,9 @@ import PropTypes from 'prop-types';
|
|
23
22
|
import { v4 as uuid } from 'uuid';
|
24
23
|
import { Box, FieldHelperText, Icon, IconButton, Input, Label } from '../..';
|
25
24
|
import { useField, usePropWarning } from '../../hooks';
|
26
|
-
import
|
27
|
-
import {
|
28
|
-
import {
|
25
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
26
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
27
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
29
28
|
|
30
29
|
/**
|
31
30
|
* Number fields allow users to enter a number, and increment or
|
@@ -142,7 +141,7 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
142
141
|
}, helperText)));
|
143
142
|
});
|
144
143
|
export default NumberField;
|
145
|
-
NumberField.propTypes = _objectSpread(_objectSpread({
|
144
|
+
NumberField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
146
145
|
/** A custom aria-label for the decrement button.
|
147
146
|
* If not provided, the localized string "Decrement" is used. */
|
148
147
|
decrementAriaLabel: PropTypes.string,
|
@@ -199,10 +198,8 @@ NumberField.propTypes = _objectSpread(_objectSpread({
|
|
199
198
|
* (value: number) => void
|
200
199
|
*/
|
201
200
|
onChange: PropTypes.func,
|
202
|
-
/** Determines the input status indicator and helper text styling. */
|
203
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
204
201
|
/** The default value (uncontrolled). */
|
205
202
|
defaultValue: PropTypes.number,
|
206
203
|
/** The current value (controlled). */
|
207
204
|
value: PropTypes.number
|
208
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
205
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
@@ -12,9 +12,9 @@ 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 { NumberField } from '../../index';
|
15
|
-
import
|
16
|
-
import {
|
17
|
-
import {
|
15
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
16
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
17
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
19
19
|
export default {
|
20
20
|
title: 'Form/NumberField',
|
@@ -26,7 +26,7 @@ export default {
|
|
26
26
|
}
|
27
27
|
}
|
28
28
|
},
|
29
|
-
argTypes: _objectSpread(_objectSpread({
|
29
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
30
30
|
label: {
|
31
31
|
control: {
|
32
32
|
type: 'text'
|
@@ -43,13 +43,6 @@ export default {
|
|
43
43
|
type: 'text'
|
44
44
|
}
|
45
45
|
},
|
46
|
-
status: {
|
47
|
-
control: {
|
48
|
-
type: 'select',
|
49
|
-
options: statuses
|
50
|
-
},
|
51
|
-
defaultValue: statuses.DEFAULT
|
52
|
-
},
|
53
46
|
value: {
|
54
47
|
control: {
|
55
48
|
type: 'none'
|
@@ -99,7 +92,7 @@ export default {
|
|
99
92
|
type: 'none'
|
100
93
|
}
|
101
94
|
}
|
102
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
95
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
103
96
|
};
|
104
97
|
export var Default = function Default(args) {
|
105
98
|
return ___EmotionJSX(NumberField, args);
|
@@ -15,7 +15,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
15
15
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
16
16
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
17
17
|
import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
|
18
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
19
18
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
20
19
|
import { useOverlayPosition } from 'react-aria';
|
21
20
|
import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
@@ -25,8 +24,9 @@ import PropTypes from 'prop-types';
|
|
25
24
|
import { Box, FieldHelperText, Icon, IconButton, Input, Label, PopoverContainer, RequirementsList } from '../..';
|
26
25
|
import * as hooks from '../../hooks';
|
27
26
|
import statuses from '../../utils/devUtils/constants/statuses';
|
28
|
-
import { ariaAttributesBasePropTypes } from '../../utils/
|
29
|
-
import { inputFieldAttributesBasePropTypes } from '../../utils/
|
27
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
28
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
29
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
30
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
31
31
|
var ARIA_LABELS_FOR_SHOW_PASSWORD_TOGGLE = {
|
32
32
|
HIDE: 'hide password',
|
@@ -163,7 +163,7 @@ var PasswordField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
163
163
|
requirements: requirements
|
164
164
|
}, requirementsListProps))));
|
165
165
|
});
|
166
|
-
PasswordField.propTypes = _objectSpread(_objectSpread({
|
166
|
+
PasswordField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
167
167
|
/** The rendered label for the field. */
|
168
168
|
label: PropTypes.node,
|
169
169
|
/** Whether or not the password is visible. */
|
@@ -218,8 +218,6 @@ PasswordField.propTypes = _objectSpread(_objectSpread({
|
|
218
218
|
/** The given node will be inserted into the field container. */
|
219
219
|
inContainer: PropTypes.node
|
220
220
|
}),
|
221
|
-
/** Determines the input status indicator and helper text styling. */
|
222
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
223
221
|
/** Determines the type of input to use. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). */
|
224
222
|
type: PropTypes.string,
|
225
223
|
/** @ignore Prop that allows testing of the icon button. */
|
@@ -227,21 +225,19 @@ PasswordField.propTypes = _objectSpread(_objectSpread({
|
|
227
225
|
/** @ignore Prop that allows testing of the icon button. */
|
228
226
|
viewIconTestId: PropTypes.string,
|
229
227
|
/** Array of Requirements and their status. */
|
230
|
-
requirements: PropTypes.arrayOf(PropTypes.shape({
|
231
|
-
name: PropTypes.string.isRequired
|
232
|
-
|
233
|
-
})),
|
228
|
+
requirements: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
229
|
+
name: PropTypes.string.isRequired
|
230
|
+
}, statusPropTypes))),
|
234
231
|
/** Props object that is spread to the requirements list. */
|
235
232
|
requirementsListProps: PropTypes.shape({})
|
236
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
237
|
-
PasswordField.defaultProps = {
|
233
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
234
|
+
PasswordField.defaultProps = _objectSpread({
|
238
235
|
hasAutoFocus: false,
|
239
236
|
isDisabled: false,
|
240
237
|
isReadOnly: false,
|
241
238
|
isRequired: false,
|
242
239
|
requirements: [],
|
243
|
-
status: statuses.DEFAULT,
|
244
240
|
type: 'password'
|
245
|
-
};
|
241
|
+
}, statusDefaultProp);
|
246
242
|
PasswordField.displayName = 'PasswordField';
|
247
243
|
export default PasswordField;
|