@pingux/astro 2.2.0-alpha.6 → 2.2.0-alpha.7
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/CollapsiblePanel/CollapsiblePanel.stories.js +3 -307
- 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 +4 -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/OverlayPanel/OverlayPanel.stories.js +15 -117
- 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/CollapsiblePanel/CollapsiblePanel.stories.js +2 -301
- 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 +4 -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/ListView/{ListView.stories.js → ListView.stories.hidden.js} +1 -0
- 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/OverlayPanel/OverlayPanel.stories.js +15 -116
- 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/recipes/{ApplicationSearchDropdown.stories.js → ApplicationSearchDropdown.stories.hidden.js} +1 -0
- package/lib/utils/docUtils/statusProp.js +44 -0
- package/package.json +1 -1
- package/lib/cjs/recipes/PanelHeader.stories.js +0 -80
- package/lib/recipes/PanelHeader.stories.js +0 -70
- /package/lib/cjs/components/ListView/{ListView.stories.js → ListView.stories.hidden.js} +0 -0
- /package/lib/cjs/recipes/{ApplicationSearchDropdown.stories.js → ApplicationSearchDropdown.stories.hidden.js} +0 -0
- /package/lib/cjs/recipes/{CollapsiblePanel.stories.js → CollapsiblePanel.stories.hidden.js} +0 -0
- /package/lib/cjs/recipes/{ScrollableListView.stories.js → ScrollableListView.stories.hidden.js} +0 -0
- /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/recipes/{CollapsiblePanel.stories.js → CollapsiblePanel.stories.hidden.js} +0 -0
- /package/lib/recipes/{ScrollableListView.stories.js → ScrollableListView.stories.hidden.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
@@ -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);
|
@@ -10,7 +10,7 @@ import ChevronRightIcon from 'mdi-react/ChevronRightIcon';
|
|
10
10
|
import CloseIcon from 'mdi-react/CloseIcon';
|
11
11
|
import CogIcon from 'mdi-react/CogIcon';
|
12
12
|
import { useOverlayPanelState } from '../../hooks';
|
13
|
-
import { Avatar, Box, Breadcrumbs, Button, ColorField, IconButton,
|
13
|
+
import { Avatar, Box, Breadcrumbs, Button, ColorField, IconButton, MultivaluesField, OverlayPanel, OverlayProvider, SwitchField, Tab, Tabs, Text, TextField } from '../../index';
|
14
14
|
import { pingImg } from '../../utils/devUtils/constants/images';
|
15
15
|
import { panelSizes } from '../../utils/devUtils/constants/panelSizes';
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -70,111 +70,10 @@ export var Default = function Default(_ref) {
|
|
70
70
|
}, "Children render here."))))
|
71
71
|
);
|
72
72
|
};
|
73
|
-
export var
|
74
|
-
var args = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
73
|
+
export var CustomWidth = function CustomWidth() {
|
75
74
|
var _useOverlayPanelState2 = useOverlayPanelState(),
|
76
75
|
state = _useOverlayPanelState2.state,
|
77
76
|
onClose = _useOverlayPanelState2.onClose;
|
78
|
-
var _useOverlayPanelState3 = useOverlayPanelState(),
|
79
|
-
innerState = _useOverlayPanelState3.state,
|
80
|
-
onCloseInner = _useOverlayPanelState3.onClose;
|
81
|
-
var outerTriggerRef = useRef();
|
82
|
-
var innerTriggerRef = useRef();
|
83
|
-
var _useState = useState(false),
|
84
|
-
_useState2 = _slicedToArray(_useState, 2),
|
85
|
-
messagesOpen = _useState2[0],
|
86
|
-
setMessagesOpen = _useState2[1];
|
87
|
-
var toggleMessagesOpen = function toggleMessagesOpen() {
|
88
|
-
setMessagesOpen(!messagesOpen);
|
89
|
-
};
|
90
|
-
var closeOuterPanel = function closeOuterPanel() {
|
91
|
-
if (innerState.isOpen) {
|
92
|
-
innerState.close();
|
93
|
-
}
|
94
|
-
onClose(state, outerTriggerRef);
|
95
|
-
};
|
96
|
-
var closeInnerPanel = function closeInnerPanel() {
|
97
|
-
onCloseInner(innerState, innerTriggerRef);
|
98
|
-
};
|
99
|
-
var inner = innerState.isOpen && ___EmotionJSX(OverlayPanel, _extends({
|
100
|
-
variant: "overlayPanel.innerPanel" // applies higher z-index
|
101
|
-
,
|
102
|
-
isOpen: innerState.isOpen
|
103
|
-
}, args, {
|
104
|
-
state: innerState,
|
105
|
-
triggerRef: innerTriggerRef
|
106
|
-
}), ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
107
|
-
onPress: closeInnerPanel
|
108
|
-
}, "Close Inner Panel"), ___EmotionJSX(Text, {
|
109
|
-
pt: "md"
|
110
|
-
}, "Children render here.")));
|
111
|
-
var items = [{
|
112
|
-
id: 1,
|
113
|
-
name: 'Form 1'
|
114
|
-
}, {
|
115
|
-
id: 2,
|
116
|
-
name: 'Form 2'
|
117
|
-
}];
|
118
|
-
var outer =
|
119
|
-
// should have higher z-index applied
|
120
|
-
(state.isOpen || state.isTransitioning) && ___EmotionJSX(OverlayPanel, _extends({
|
121
|
-
isOpen: state.isOpen,
|
122
|
-
isTransitioning: state.isTransitioning,
|
123
|
-
sx: {
|
124
|
-
p: '0px'
|
125
|
-
}
|
126
|
-
}, args, {
|
127
|
-
state: state,
|
128
|
-
triggerRef: outerTriggerRef
|
129
|
-
}), ___EmotionJSX(Box, {
|
130
|
-
sx: {
|
131
|
-
p: '12px'
|
132
|
-
}
|
133
|
-
}, ___EmotionJSX(Button, {
|
134
|
-
onPress: closeOuterPanel,
|
135
|
-
"aria-expanded": state.isOpen
|
136
|
-
}, "Close Panel"), ___EmotionJSX(Text, {
|
137
|
-
pt: "md",
|
138
|
-
mb: "24px"
|
139
|
-
}, "Children render here."), ___EmotionJSX(ListView, {
|
140
|
-
items: items
|
141
|
-
}, function (item) {
|
142
|
-
return ___EmotionJSX(Item, {
|
143
|
-
key: item.id
|
144
|
-
}, ___EmotionJSX(Text, {
|
145
|
-
variant: "itemTitle",
|
146
|
-
alignSelf: "center",
|
147
|
-
mr: "auto"
|
148
|
-
}, item.name));
|
149
|
-
}), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
|
150
|
-
onPress: toggleMessagesOpen
|
151
|
-
}, "Toggle Messages"), ___EmotionJSX("br", null), ___EmotionJSX(Button, {
|
152
|
-
ref: innerTriggerRef,
|
153
|
-
onPress: innerState.open,
|
154
|
-
"aria-expanded": innerState.isOpen
|
155
|
-
}, "Open Inner Panel"), inner));
|
156
|
-
return (
|
157
|
-
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
158
|
-
// readers when an overlay opens.
|
159
|
-
___EmotionJSX(React.Fragment, null, ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
160
|
-
ref: outerTriggerRef,
|
161
|
-
onPress: state.open,
|
162
|
-
"aria-expanded": state.isOpen
|
163
|
-
}, "Open Panel"), outer), messagesOpen && ___EmotionJSX(Messages, {
|
164
|
-
sx: {
|
165
|
-
zIndex: 11
|
166
|
-
},
|
167
|
-
onClose: toggleMessagesOpen
|
168
|
-
}, ___EmotionJSX(Item, {
|
169
|
-
key: "message2",
|
170
|
-
status: "success"
|
171
|
-
}, "Z Index higher than inner pannel")))
|
172
|
-
);
|
173
|
-
};
|
174
|
-
export var CustomWidth = function CustomWidth() {
|
175
|
-
var _useOverlayPanelState4 = useOverlayPanelState(),
|
176
|
-
state = _useOverlayPanelState4.state,
|
177
|
-
onClose = _useOverlayPanelState4.onClose;
|
178
77
|
var triggerRef = useRef();
|
179
78
|
return (
|
180
79
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
@@ -202,14 +101,14 @@ export var CustomWidth = function CustomWidth() {
|
|
202
101
|
);
|
203
102
|
};
|
204
103
|
export var Expandable = function Expandable() {
|
205
|
-
var
|
206
|
-
state =
|
207
|
-
onClose =
|
104
|
+
var _useOverlayPanelState3 = useOverlayPanelState(),
|
105
|
+
state = _useOverlayPanelState3.state,
|
106
|
+
onClose = _useOverlayPanelState3.onClose;
|
208
107
|
var triggerRef = useRef();
|
209
|
-
var
|
210
|
-
|
211
|
-
isExpanded =
|
212
|
-
setIsExpanded =
|
108
|
+
var _useState = useState(false),
|
109
|
+
_useState2 = _slicedToArray(_useState, 2),
|
110
|
+
isExpanded = _useState2[0],
|
111
|
+
setIsExpanded = _useState2[1];
|
213
112
|
var sx = {
|
214
113
|
overlayPanel: {
|
215
114
|
padding: 0,
|
@@ -285,13 +184,13 @@ export var Expandable = function Expandable() {
|
|
285
184
|
var onCloseHandler = function onCloseHandler() {
|
286
185
|
return onClose(state, triggerRef);
|
287
186
|
};
|
288
|
-
var
|
289
|
-
|
290
|
-
color =
|
291
|
-
setColor =
|
292
|
-
var handleColorChange = useCallback(function (
|
187
|
+
var _useState3 = useState('#EACE91'),
|
188
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
189
|
+
color = _useState4[0],
|
190
|
+
setColor = _useState4[1];
|
191
|
+
var handleColorChange = useCallback(function (_ref2) {
|
293
192
|
var _context, _context2, _context3;
|
294
|
-
var rgb =
|
193
|
+
var rgb = _ref2.rgb;
|
295
194
|
var r = rgb.r,
|
296
195
|
b = rgb.b,
|
297
196
|
g = rgb.g,
|
@@ -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;
|
@@ -15,8 +15,9 @@ 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/
|
18
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
19
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
20
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
20
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
21
22
|
export default {
|
22
23
|
title: 'Form/PasswordField',
|
@@ -28,20 +29,13 @@ export default {
|
|
28
29
|
}
|
29
30
|
}
|
30
31
|
},
|
31
|
-
argTypes: _objectSpread(_objectSpread({
|
32
|
-
status: {
|
33
|
-
control: {
|
34
|
-
type: 'select',
|
35
|
-
options: statuses
|
36
|
-
},
|
37
|
-
defaultValue: statuses.DEFAULT
|
38
|
-
},
|
32
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
39
33
|
helperText: {
|
40
34
|
control: {
|
41
35
|
type: 'text'
|
42
36
|
}
|
43
37
|
}
|
44
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
38
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
45
39
|
};
|
46
40
|
export var Default = function Default(args) {
|
47
41
|
return ___EmotionJSX(PasswordField, _extends({
|
@@ -8,15 +8,14 @@ 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, { createContext, forwardRef, useContext, useImperativeHandle, useRef } from 'react';
|
15
14
|
import { useRadio } from 'react-aria';
|
16
15
|
import PropTypes from 'prop-types';
|
17
16
|
import { useField, usePropWarning } from '../../hooks';
|
18
|
-
import
|
19
|
-
import {
|
17
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
18
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
20
19
|
import Box from '../Box';
|
21
20
|
import FieldHelperText from '../FieldHelperText';
|
22
21
|
import Label from '../Label';
|
@@ -83,7 +82,7 @@ var RadioField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
83
82
|
variant: "forms.radio.checkedContent"
|
84
83
|
}, checkedContent));
|
85
84
|
});
|
86
|
-
RadioField.propTypes = _objectSpread({
|
85
|
+
RadioField.propTypes = _objectSpread(_objectSpread({
|
87
86
|
/** Content to display when the radio is checked. */
|
88
87
|
checkedContent: PropTypes.node,
|
89
88
|
/** The rendered label for the field. */
|
@@ -105,8 +104,6 @@ RadioField.propTypes = _objectSpread({
|
|
105
104
|
isReadOnly: PropTypes.bool,
|
106
105
|
/** Whether the Radio is required. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required). */
|
107
106
|
isRequired: PropTypes.bool,
|
108
|
-
/** Determines the textarea status indicator and helper text styling. */
|
109
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
110
107
|
/** 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). */
|
111
108
|
value: PropTypes.string,
|
112
109
|
/** Handler that is called when the element receives focus. */
|
@@ -130,6 +127,6 @@ RadioField.propTypes = _objectSpread({
|
|
130
127
|
* object.
|
131
128
|
*/
|
132
129
|
'aria-details': PropTypes.string
|
133
|
-
}, ariaAttributesBasePropTypes);
|
130
|
+
}, statusPropTypes), ariaAttributesBasePropTypes);
|
134
131
|
RadioField.displayName = 'RadioField';
|
135
132
|
export default RadioField;
|
@@ -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, useMemo } from 'react';
|
@@ -19,9 +18,9 @@ import { v4 as uuid } from 'uuid';
|
|
19
18
|
import { Box, FieldHelperText, Label } from '../..';
|
20
19
|
import { usePropWarning, useStatusClasses } from '../../hooks';
|
21
20
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
22
|
-
import
|
23
|
-
import {
|
24
|
-
import {
|
21
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
22
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
23
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
25
24
|
import { RadioContext } from '../RadioField';
|
26
25
|
|
27
26
|
/**
|
@@ -83,7 +82,7 @@ var RadioGroupField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
83
82
|
id: helperTextId
|
84
83
|
}, helperText));
|
85
84
|
});
|
86
|
-
RadioGroupField.propTypes = _objectSpread(_objectSpread({
|
85
|
+
RadioGroupField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
87
86
|
/** 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). */
|
88
87
|
name: PropTypes.string,
|
89
88
|
/** The current value (controlled). */
|
@@ -96,8 +95,6 @@ RadioGroupField.propTypes = _objectSpread(_objectSpread({
|
|
96
95
|
hintText: PropTypes.string,
|
97
96
|
/** Determines the arrangement of the radios. */
|
98
97
|
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
|
99
|
-
/** Determines the helper text styling. */
|
100
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
101
98
|
/**
|
102
99
|
* Handler that is called when the value changes.
|
103
100
|
*
|
@@ -115,6 +112,6 @@ RadioGroupField.propTypes = _objectSpread(_objectSpread({
|
|
115
112
|
label: PropTypes.node,
|
116
113
|
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
117
114
|
id: PropTypes.string
|
118
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
115
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
119
116
|
RadioGroupField.displayName = 'RadioGroupField';
|
120
117
|
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 { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
16
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
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(_objectSpread({
|
22
22
|
label: {
|
23
23
|
control: {
|
24
24
|
type: 'text'
|
@@ -35,13 +35,6 @@ 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
|
-
},
|
45
38
|
defaultValue: {
|
46
39
|
defaultValue: 'A'
|
47
40
|
},
|
@@ -55,7 +48,7 @@ export default {
|
|
55
48
|
type: 'none'
|
56
49
|
}
|
57
50
|
}
|
58
|
-
}, ariaAttributeBaseArgTypes)
|
51
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes)
|
59
52
|
};
|
60
53
|
export var Default = function Default(args) {
|
61
54
|
return ___EmotionJSX(RadioGroupField, args, ___EmotionJSX(RadioField, {
|
@@ -1,13 +1,25 @@
|
|
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 = ["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; }
|
4
7
|
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";
|
5
16
|
import React, { forwardRef } from 'react';
|
6
17
|
import ErrorCircle from 'mdi-react/AlertCircleIcon';
|
7
18
|
import WarningCircle from 'mdi-react/AlertCircleOutlineIcon';
|
8
19
|
import DefaultCircle from 'mdi-react/CheckboxBlankCircleOutlineIcon';
|
9
20
|
import SuccessCircle from 'mdi-react/CheckCircleIcon';
|
10
21
|
import PropTypes from 'prop-types';
|
22
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
11
23
|
import Box from '../Box';
|
12
24
|
import Icon from '../Icon';
|
13
25
|
import Text from '../Text';
|
@@ -82,10 +94,9 @@ RequirementsList.propTypes = {
|
|
82
94
|
/**
|
83
95
|
* Requirements and their status.
|
84
96
|
*/
|
85
|
-
requirements: PropTypes.arrayOf(PropTypes.shape({
|
86
|
-
name: PropTypes.string.isRequired
|
87
|
-
|
88
|
-
}))
|
97
|
+
requirements: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
98
|
+
name: PropTypes.string.isRequired
|
99
|
+
}, statusPropTypes)))
|
89
100
|
};
|
90
101
|
RequirementsList.defaultProps = {
|
91
102
|
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/docUtils/ariaAttributes';
|
22
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/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/docUtils/ariaAttributes';
|
20
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
22
22
|
export default {
|
23
23
|
title: 'Form/SearchField',
|
@@ -9,15 +9,14 @@ 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';
|
16
15
|
import PropTypes from 'prop-types';
|
17
16
|
import { usePropWarning, useSelectField } from '../../hooks';
|
18
|
-
import
|
19
|
-
import {
|
20
|
-
import {
|
17
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
18
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
19
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
21
20
|
import SelectFieldBase from '../SelectFieldBase';
|
22
21
|
|
23
22
|
/**
|
@@ -37,7 +36,7 @@ var SelectField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
37
36
|
"aria-invalid": status === 'error' && true
|
38
37
|
}));
|
39
38
|
});
|
40
|
-
SelectField.propTypes = _objectSpread(_objectSpread({
|
39
|
+
SelectField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
41
40
|
/** Alignment of the popover menu relative to the trigger. */
|
42
41
|
align: PropTypes.oneOf(['start', 'end', 'middle']),
|
43
42
|
/** Where the popover menu opens relative to its trigger. */
|
@@ -85,8 +84,6 @@ SelectField.propTypes = _objectSpread(_objectSpread({
|
|
85
84
|
selectedKey: PropTypes.string,
|
86
85
|
/** Determines the textarea status indicator and helper text styling. Eg. float. */
|
87
86
|
labelMode: PropTypes.string,
|
88
|
-
/** Determines the type of label applied to the component. */
|
89
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
90
87
|
/**
|
91
88
|
* Handler that is called when more items should be loaded, e.g. while scrolling near the bottom.
|
92
89
|
*
|
@@ -117,15 +114,14 @@ SelectField.propTypes = _objectSpread(_objectSpread({
|
|
117
114
|
scrollBoxProps: PropTypes.shape({
|
118
115
|
maxHeight: PropTypes.string
|
119
116
|
})
|
120
|
-
}, ariaAttributesBasePropTypes);
|
121
|
-
SelectField.defaultProps = {
|
117
|
+
}, statusPropTypes), ariaAttributesBasePropTypes);
|
118
|
+
SelectField.defaultProps = _objectSpread({
|
122
119
|
placeholder: 'Select',
|
123
|
-
status: statuses.DEFAULT,
|
124
120
|
align: 'start',
|
125
121
|
direction: 'bottom',
|
126
122
|
scrollBoxProps: {
|
127
123
|
maxHeight: '300px'
|
128
124
|
}
|
129
|
-
};
|
125
|
+
}, statusDefaultProp);
|
130
126
|
SelectField.displayName = 'SelectField';
|
131
127
|
export default SelectField;
|