@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
@@ -1,29 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
4
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
5
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
6
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
7
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
8
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
9
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
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; }
|
12
|
-
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; }
|
13
|
-
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
14
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
15
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
16
|
-
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
17
|
-
import React, { useMemo, useRef, useState } from 'react';
|
18
|
-
import AccountGroupIcon from 'mdi-react/AccountGroupIcon';
|
19
|
-
import AccountIcon from 'mdi-react/AccountIcon';
|
20
|
-
import CheckIcon from 'mdi-react/CheckIcon';
|
21
|
-
import ChevronRightIcon from 'mdi-react/ChevronRightIcon';
|
22
|
-
import Clear from 'mdi-react/CloseIcon';
|
23
|
-
import SearchIcon from 'mdi-react/SearchIcon';
|
1
|
+
import React from 'react';
|
24
2
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
25
|
-
import {
|
26
|
-
import { Badge, Box, Breadcrumbs, Button, CheckboxField, CollapsiblePanel, CollapsiblePanelItem, Icon, IconButton, Item, ListView, OverlayPanel, OverlayProvider, SearchField, Text } from '../../index';
|
3
|
+
import { CollapsiblePanel } from '../../index';
|
27
4
|
import CollapsiblePanelReadme from './CollapsiblePanel.mdx';
|
28
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
6
|
export default {
|
@@ -60,282 +37,6 @@ export default {
|
|
60
37
|
}
|
61
38
|
}
|
62
39
|
};
|
63
|
-
var data = [{
|
64
|
-
id: '1',
|
65
|
-
icon: 'Group',
|
66
|
-
key: 'Avengers',
|
67
|
-
name: 'Avengers',
|
68
|
-
subtitle: 'Default',
|
69
|
-
badgeValue: '25',
|
70
|
-
isDefaultSelected: true
|
71
|
-
}, {
|
72
|
-
id: '2',
|
73
|
-
icon: 'Group',
|
74
|
-
key: 'Credit Cards',
|
75
|
-
name: 'Credit Cards',
|
76
|
-
subtitle: '',
|
77
|
-
badgeValue: '123'
|
78
|
-
}, {
|
79
|
-
id: '3',
|
80
|
-
icon: 'Group',
|
81
|
-
key: 'Debit Cards',
|
82
|
-
name: 'Debit Cards',
|
83
|
-
subtitle: '',
|
84
|
-
badgeValue: '23'
|
85
|
-
}, {
|
86
|
-
id: '4',
|
87
|
-
icon: 'Group',
|
88
|
-
key: 'Digital Investors',
|
89
|
-
name: 'Digital Investors',
|
90
|
-
subtitle: 'N America',
|
91
|
-
badgeValue: '12',
|
92
|
-
isDefaultSelected: true
|
93
|
-
}, {
|
94
|
-
id: '5',
|
95
|
-
icon: 'Group',
|
96
|
-
key: 'Mortgages',
|
97
|
-
name: 'Mortgages',
|
98
|
-
subtitle: 'N America',
|
99
|
-
badgeValue: '112'
|
100
|
-
}, {
|
101
|
-
id: '6',
|
102
|
-
icon: 'Group',
|
103
|
-
key: 'Person LOC',
|
104
|
-
name: 'Person LOC',
|
105
|
-
subtitle: '',
|
106
|
-
badgeValue: '45'
|
107
|
-
}, {
|
108
|
-
id: '7',
|
109
|
-
icon: 'Group',
|
110
|
-
key: 'Production',
|
111
|
-
name: 'Production',
|
112
|
-
subtitle: '',
|
113
|
-
badgeValue: '55'
|
114
|
-
}, {
|
115
|
-
id: '8',
|
116
|
-
icon: 'Group',
|
117
|
-
key: 'UX Team',
|
118
|
-
name: 'UX Team',
|
119
|
-
subtitle: '',
|
120
|
-
badgeValue: '61'
|
121
|
-
}, {
|
122
|
-
id: '9',
|
123
|
-
icon: 'Group',
|
124
|
-
key: 'UI Team',
|
125
|
-
name: 'UI Team',
|
126
|
-
subtitle: '',
|
127
|
-
badgeValue: '29'
|
128
|
-
}];
|
129
40
|
export var Default = function Default(args) {
|
130
41
|
return ___EmotionJSX(CollapsiblePanel, args);
|
131
|
-
};
|
132
|
-
export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args) {
|
133
|
-
var _useState = useState(data),
|
134
|
-
_useState2 = _slicedToArray(_useState, 2),
|
135
|
-
items = _useState2[0],
|
136
|
-
setItems = _useState2[1];
|
137
|
-
var _useOverlayPanelState = useOverlayPanelState(),
|
138
|
-
state = _useOverlayPanelState.state,
|
139
|
-
onClose = _useOverlayPanelState.onClose;
|
140
|
-
var triggerRef = useRef();
|
141
|
-
var selectedItems = useMemo(function () {
|
142
|
-
var _context;
|
143
|
-
return _sortInstanceProperty(_context = _filterInstanceProperty(items).call(items, function (item) {
|
144
|
-
return item.isDefaultSelected || item.isSelected;
|
145
|
-
})
|
146
|
-
// sort elements to display "default selected" at first place
|
147
|
-
).call(_context, function (a, b) {
|
148
|
-
return Number(!!b.isDefaultSelected) - Number(!!a.isDefaultSelected);
|
149
|
-
});
|
150
|
-
}, [items]);
|
151
|
-
var changeSelection = function changeSelection(key) {
|
152
|
-
setItems(function (prevItems) {
|
153
|
-
return _mapInstanceProperty(prevItems).call(prevItems, function (el) {
|
154
|
-
if (el.key === key) {
|
155
|
-
return _objectSpread(_objectSpread({}, el), {}, {
|
156
|
-
isSelected: !el.isSelected
|
157
|
-
});
|
158
|
-
}
|
159
|
-
return el;
|
160
|
-
});
|
161
|
-
});
|
162
|
-
};
|
163
|
-
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
164
|
-
ref: triggerRef,
|
165
|
-
onPress: state.open
|
166
|
-
}, "Open Panel"), (state.isOpen || state.isTransitioning) && ___EmotionJSX(OverlayPanel, {
|
167
|
-
isOpen: state.isOpen,
|
168
|
-
isTransitioning: state.isTransitioning,
|
169
|
-
size: "large",
|
170
|
-
p: "0"
|
171
|
-
}, ___EmotionJSX(Box, {
|
172
|
-
sx: {
|
173
|
-
minHeight: '60px'
|
174
|
-
},
|
175
|
-
bg: "accent.99"
|
176
|
-
}, ___EmotionJSX(Box, {
|
177
|
-
isRow: true,
|
178
|
-
flexBasis: "0px",
|
179
|
-
flexGrow: "1",
|
180
|
-
alignItems: "center",
|
181
|
-
pl: "md",
|
182
|
-
pr: "md",
|
183
|
-
justifyContent: "space-between",
|
184
|
-
zIndex: 2
|
185
|
-
}, ___EmotionJSX(Box, {
|
186
|
-
isRow: true
|
187
|
-
}, ___EmotionJSX(Icon, {
|
188
|
-
icon: AccountIcon,
|
189
|
-
alignSelf: "center",
|
190
|
-
mr: "md",
|
191
|
-
color: "accent.40",
|
192
|
-
size: 25,
|
193
|
-
flexShrink: 0,
|
194
|
-
display: "flex"
|
195
|
-
}), ___EmotionJSX(Breadcrumbs, {
|
196
|
-
icon: ChevronRightIcon
|
197
|
-
}, ___EmotionJSX(Item, {
|
198
|
-
"aria-label": "Ed Nepomuceno",
|
199
|
-
"data-id": "home",
|
200
|
-
href: "https://www.pingidentity.com",
|
201
|
-
key: "home",
|
202
|
-
variant: "buttons.link"
|
203
|
-
}, "Ed Nepomuceno"), ___EmotionJSX(Item, {
|
204
|
-
"aria-label": "edit groups",
|
205
|
-
"data-id": "editGroups",
|
206
|
-
href: "https://www.pingidentity.com",
|
207
|
-
key: "editGroups",
|
208
|
-
variant: "buttons.link"
|
209
|
-
}, "Edit Groups"))), ___EmotionJSX(Box, {
|
210
|
-
isRow: true
|
211
|
-
}, ___EmotionJSX(IconButton, {
|
212
|
-
"aria-label": "Close Panel",
|
213
|
-
onPress: function onPress() {
|
214
|
-
onClose(state, triggerRef);
|
215
|
-
}
|
216
|
-
}, ___EmotionJSX(Icon, {
|
217
|
-
icon: Clear,
|
218
|
-
size: "sm"
|
219
|
-
}))))), ___EmotionJSX(Box, {
|
220
|
-
pl: "md",
|
221
|
-
pt: "25px"
|
222
|
-
}, ___EmotionJSX(Box, {
|
223
|
-
isRow: true,
|
224
|
-
justifyContent: "space-between",
|
225
|
-
sx: {
|
226
|
-
marginTop: '5px'
|
227
|
-
}
|
228
|
-
}, ___EmotionJSX(Box, {
|
229
|
-
width: "100%"
|
230
|
-
}, ___EmotionJSX(SearchField, {
|
231
|
-
icon: SearchIcon,
|
232
|
-
"aria-label": "Search",
|
233
|
-
placeholder: "Search",
|
234
|
-
width: "100%",
|
235
|
-
mt: "0px",
|
236
|
-
mr: "sm",
|
237
|
-
mb: "xs"
|
238
|
-
}), ___EmotionJSX(ListView, {
|
239
|
-
items: items,
|
240
|
-
style: {
|
241
|
-
width: '100%',
|
242
|
-
outline: 'none'
|
243
|
-
}
|
244
|
-
}, function (item) {
|
245
|
-
return ___EmotionJSX(Item, {
|
246
|
-
key: item.key,
|
247
|
-
textValue: item.name,
|
248
|
-
"data-id": item.key,
|
249
|
-
listItemProps: {
|
250
|
-
isRow: true,
|
251
|
-
sx: {
|
252
|
-
bg: 'white',
|
253
|
-
width: '100%',
|
254
|
-
justifyContent: 'space-between',
|
255
|
-
alignItems: 'center',
|
256
|
-
'&.is-hovered': {
|
257
|
-
bg: 'accent.99'
|
258
|
-
}
|
259
|
-
}
|
260
|
-
}
|
261
|
-
}, ___EmotionJSX(Box, {
|
262
|
-
isRow: true
|
263
|
-
}, ___EmotionJSX(Icon, {
|
264
|
-
icon: AccountGroupIcon,
|
265
|
-
alignSelf: "center",
|
266
|
-
mr: "md",
|
267
|
-
color: "accent.40",
|
268
|
-
size: 25,
|
269
|
-
flexShrink: 1
|
270
|
-
}), ___EmotionJSX(Box, null, ___EmotionJSX(Box, {
|
271
|
-
isRow: true
|
272
|
-
}, ___EmotionJSX(Text, {
|
273
|
-
variant: "listTitle",
|
274
|
-
mb: "xs",
|
275
|
-
mr: "xs"
|
276
|
-
}, item.name), ___EmotionJSX(Badge, {
|
277
|
-
label: item.badgeValue,
|
278
|
-
bg: "accent.99",
|
279
|
-
textColor: "text.secondary",
|
280
|
-
sx: {
|
281
|
-
minWidth: 'max-content'
|
282
|
-
}
|
283
|
-
})), ___EmotionJSX(Text, {
|
284
|
-
variant: "listSubtitle"
|
285
|
-
}, item.subtitle))), item.isDefaultSelected ? ___EmotionJSX(Box, {
|
286
|
-
isRow: true,
|
287
|
-
sx: {
|
288
|
-
border: '1px solid',
|
289
|
-
borderColor: 'neutral.80',
|
290
|
-
borderRadius: 5,
|
291
|
-
minHeight: 22,
|
292
|
-
justifyContent: 'center',
|
293
|
-
alignItems: 'center',
|
294
|
-
p: 'xs',
|
295
|
-
maxWidth: '50%'
|
296
|
-
}
|
297
|
-
}, ___EmotionJSX(Icon, {
|
298
|
-
icon: CheckIcon,
|
299
|
-
color: "neutral.20",
|
300
|
-
size: 13,
|
301
|
-
sx: {
|
302
|
-
flexShrink: 0
|
303
|
-
}
|
304
|
-
}), ___EmotionJSX(Text, {
|
305
|
-
sx: {
|
306
|
-
fontSize: 'sm',
|
307
|
-
pl: 'xs',
|
308
|
-
maxHeight: 32,
|
309
|
-
overflow: 'hidden'
|
310
|
-
}
|
311
|
-
}, "Added by Filter")) : ___EmotionJSX(CheckboxField, {
|
312
|
-
controlProps: {
|
313
|
-
color: 'neutral.10',
|
314
|
-
'aria-label': 'Select'
|
315
|
-
},
|
316
|
-
onChange: function onChange() {
|
317
|
-
return changeSelection(item.key);
|
318
|
-
},
|
319
|
-
isSelected: _someInstanceProperty(selectedItems).call(selectedItems, function (el) {
|
320
|
-
return el.key === item.key;
|
321
|
-
})
|
322
|
-
}));
|
323
|
-
})), ___EmotionJSX(CollapsiblePanel, _extends({
|
324
|
-
items: selectedItems,
|
325
|
-
onSelectionChange: changeSelection,
|
326
|
-
selectedFilterCount: "1000+"
|
327
|
-
}, args), function (item) {
|
328
|
-
return ___EmotionJSX(Item, {
|
329
|
-
key: item.key,
|
330
|
-
textValue: item.name,
|
331
|
-
"data-id": item.key
|
332
|
-
}, ___EmotionJSX(CollapsiblePanelItem, {
|
333
|
-
text: item.name,
|
334
|
-
icon: item.isDefaultSelected ? CheckIcon : Clear,
|
335
|
-
onPress: function onPress() {
|
336
|
-
return changeSelection(item.key);
|
337
|
-
},
|
338
|
-
isDefaultSelected: item.isDefaultSelected
|
339
|
-
}));
|
340
|
-
})))));
|
341
42
|
};
|
@@ -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 _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
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 _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
14
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
@@ -21,9 +20,9 @@ import { useColorFieldState } from '@react-stately/color';
|
|
21
20
|
import PropTypes from 'prop-types';
|
22
21
|
import { Box, Button, FieldHelperText, Input, Label } from '../..';
|
23
22
|
import useField from '../../hooks/useField';
|
24
|
-
import
|
25
|
-
import {
|
26
|
-
import {
|
23
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
24
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
25
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
27
26
|
import PopoverContainer from '../PopoverContainer';
|
28
27
|
|
29
28
|
/**
|
@@ -128,7 +127,7 @@ var ColorField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
128
127
|
onChange: handleColorChange
|
129
128
|
}))));
|
130
129
|
});
|
131
|
-
ColorField.propTypes = _objectSpread(_objectSpread({
|
130
|
+
ColorField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
132
131
|
/** Alignment of the popover menu relative to the trigger. */
|
133
132
|
align: PropTypes.oneOf(['start', 'end', 'middle']),
|
134
133
|
/** Where the popover menu opens relative to its trigger. */
|
@@ -142,13 +141,11 @@ ColorField.propTypes = _objectSpread(_objectSpread({
|
|
142
141
|
* (color, event) => void;
|
143
142
|
*/
|
144
143
|
onChange: PropTypes.func,
|
145
|
-
/** Determines the helper text styling. */
|
146
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
147
144
|
/** Color controls what color is active on the color picker. */
|
148
145
|
value: PropTypes.string,
|
149
146
|
/** Props object that is spread into the Button element. */
|
150
147
|
buttonProps: PropTypes.shape({})
|
151
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
148
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
152
149
|
ColorField.defaultProps = {
|
153
150
|
align: 'middle',
|
154
151
|
direction: 'bottom'
|
@@ -14,9 +14,9 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
14
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
15
|
import React, { useCallback, useState } from 'react';
|
16
16
|
import { ColorField, OverlayProvider } from '../../index';
|
17
|
-
import
|
18
|
-
import {
|
19
|
-
import {
|
17
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
18
|
+
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
19
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
21
21
|
export default {
|
22
22
|
title: 'Form/ColorField',
|
@@ -28,7 +28,7 @@ export default {
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
},
|
31
|
-
argTypes: _objectSpread(_objectSpread({
|
31
|
+
argTypes: _objectSpread(_objectSpread(_objectSpread({
|
32
32
|
value: {
|
33
33
|
control: {
|
34
34
|
type: 'text'
|
@@ -45,13 +45,6 @@ export default {
|
|
45
45
|
type: 'text'
|
46
46
|
}
|
47
47
|
},
|
48
|
-
status: {
|
49
|
-
control: {
|
50
|
-
type: 'select',
|
51
|
-
options: statuses
|
52
|
-
},
|
53
|
-
defaultValue: statuses.DEFAULT
|
54
|
-
},
|
55
48
|
buttonProps: {
|
56
49
|
control: {
|
57
50
|
type: 'none'
|
@@ -68,7 +61,7 @@ export default {
|
|
68
61
|
type: 'none'
|
69
62
|
}
|
70
63
|
}
|
71
|
-
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
64
|
+
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
72
65
|
};
|
73
66
|
export var Default = function Default(args) {
|
74
67
|
var _useState = useState('rgba(127, 0, 127, 1)'),
|
@@ -23,8 +23,8 @@ import PropTypes from 'prop-types';
|
|
23
23
|
import { Box, Button, Icon, Loader, TextField } from '../..';
|
24
24
|
import { usePropWarning } from '../../hooks';
|
25
25
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
26
|
-
import
|
27
|
-
import {
|
26
|
+
import { ariaAttributesBasePropTypes } from '../../utils/docUtils/ariaAttributes';
|
27
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
28
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
29
|
var ComboBoxInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
30
30
|
var controlProps = props.controlProps,
|
@@ -144,7 +144,7 @@ var ComboBoxInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
144
144
|
}
|
145
145
|
}))));
|
146
146
|
});
|
147
|
-
ComboBoxInput.propTypes = _objectSpread({
|
147
|
+
ComboBoxInput.propTypes = _objectSpread(_objectSpread({
|
148
148
|
containerProps: PropTypes.shape({}),
|
149
149
|
controlProps: PropTypes.shape({}),
|
150
150
|
hasAutoFocus: PropTypes.bool,
|
@@ -165,10 +165,9 @@ ComboBoxInput.propTypes = _objectSpread({
|
|
165
165
|
onLoadMore: PropTypes.func,
|
166
166
|
onOpenChange: PropTypes.func,
|
167
167
|
onSelectionChange: PropTypes.func,
|
168
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
169
168
|
style: PropTypes.shape({}),
|
170
169
|
triggerProps: PropTypes.shape({}),
|
171
170
|
triggerRef: PropTypes.shape({}),
|
172
171
|
wrapperProps: PropTypes.shape({})
|
173
|
-
}, ariaAttributesBasePropTypes);
|
172
|
+
}, statusPropTypes), ariaAttributesBasePropTypes);
|
174
173
|
export default ComboBoxInput;
|
@@ -25,8 +25,9 @@ import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
|
25
25
|
import PropTypes from 'prop-types';
|
26
26
|
import { usePropWarning } from '../../hooks';
|
27
27
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
28
|
-
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/devUtils/props/ariaAttributes';
|
29
28
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
29
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
30
|
+
import { statusPropTypes } from '../../utils/docUtils/statusProp';
|
30
31
|
import ComboBoxInput from '../ComboBox';
|
31
32
|
import ListBox from '../ListBox';
|
32
33
|
import PopoverContainer from '../PopoverContainer';
|
@@ -219,7 +220,7 @@ var ComboBoxField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
219
220
|
"aria-invalid": status === 'error' && true
|
220
221
|
})), listBox);
|
221
222
|
});
|
222
|
-
ComboBoxField.propTypes = _objectSpread({
|
223
|
+
ComboBoxField.propTypes = _objectSpread(_objectSpread({
|
223
224
|
/* Whether or not adding new options to the list is enabled. */
|
224
225
|
hasAddOption: PropTypes.bool,
|
225
226
|
/** Whether the ComboBox allows a non-item matching input value to be set. */
|
@@ -242,8 +243,6 @@ ComboBoxField.propTypes = _objectSpread({
|
|
242
243
|
direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
243
244
|
/** Text rendered below the input. */
|
244
245
|
helperText: PropTypes.node,
|
245
|
-
/** Determines the input status indicator and helper text styling. */
|
246
|
-
status: PropTypes.oneOf(['default', 'success', 'warning', 'error']),
|
247
246
|
/** The initial selected key in the collection (uncontrolled). */
|
248
247
|
defaultSelectedKey: PropTypes.string,
|
249
248
|
/** The currently selected key in the collection (controlled). */
|
@@ -339,7 +338,7 @@ ComboBoxField.propTypes = _objectSpread({
|
|
339
338
|
controlProps: PropTypes.shape({
|
340
339
|
onClick: PropTypes.func
|
341
340
|
})
|
342
|
-
}, ariaAttributesBasePropTypes);
|
341
|
+
}, statusPropTypes), ariaAttributesBasePropTypes);
|
343
342
|
ComboBoxField.defaultProps = {
|
344
343
|
menuTrigger: 'focus',
|
345
344
|
direction: 'bottom',
|
@@ -31,7 +31,7 @@ import { useFilter } from '@react-aria/i18n';
|
|
31
31
|
import { action } from '@storybook/addon-actions';
|
32
32
|
import { ComboBoxField, Item, OverlayProvider, Section } from '../../index';
|
33
33
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
34
|
-
import { ariaAttributeBaseArgTypes } from '../../utils/
|
34
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
35
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
36
36
|
var items = [{
|
37
37
|
name: 'Aardvark',
|
@@ -35,7 +35,7 @@ import isChromatic from 'chromatic/isChromatic';
|
|
35
35
|
import ApplicationIcon from 'mdi-react/ApplicationIcon';
|
36
36
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
37
37
|
import { DataTable, DataTableBadge, DataTableBody, DataTableCell, DataTableColumn, DataTableHeader, DataTableMenu, DataTableMultiLine, DataTableRow } from '../../index';
|
38
|
-
import { ariaAttributeBaseArgTypes } from '../../utils/
|
38
|
+
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
39
39
|
import DataTableReadme from './DataTable.mdx';
|
40
40
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
41
41
|
export default {
|
@@ -1,12 +1,21 @@
|
|
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 _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
3
11
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
4
12
|
var _excluded = ["className", "status", "id"];
|
5
|
-
|
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; }
|
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; }
|
6
15
|
import React, { forwardRef } from 'react';
|
7
16
|
import PropTypes from 'prop-types';
|
8
17
|
import { useStatusClasses } from '../../hooks';
|
9
|
-
import
|
18
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
10
19
|
import Text from '../Text';
|
11
20
|
|
12
21
|
/**
|
@@ -33,14 +42,10 @@ var FieldHelperText = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
42
|
className: classNames
|
34
43
|
}));
|
35
44
|
});
|
36
|
-
FieldHelperText.propTypes = {
|
37
|
-
/** Determines the color of the field message. */
|
38
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
45
|
+
FieldHelperText.propTypes = _objectSpread({
|
39
46
|
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
40
47
|
id: PropTypes.string
|
41
|
-
};
|
42
|
-
FieldHelperText.defaultProps = {
|
43
|
-
status: statuses.DEFAULT
|
44
|
-
};
|
48
|
+
}, statusPropTypes);
|
49
|
+
FieldHelperText.defaultProps = _objectSpread({}, statusDefaultProp);
|
45
50
|
FieldHelperText.displayName = 'FieldHelperText';
|
46
51
|
export default FieldHelperText;
|
@@ -1,19 +1,22 @@
|
|
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";
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
+
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; }
|
11
|
+
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; }
|
1
12
|
import React from 'react';
|
2
13
|
import { FieldHelperText } from '../../index';
|
3
|
-
import
|
14
|
+
import { statusArgTypes } from '../../utils/docUtils/statusProp';
|
4
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
5
16
|
export default {
|
6
17
|
title: 'Form/Base Components/FieldHelperText',
|
7
18
|
component: FieldHelperText,
|
8
|
-
argTypes: {
|
9
|
-
status: {
|
10
|
-
control: {
|
11
|
-
type: 'select',
|
12
|
-
options: statuses
|
13
|
-
},
|
14
|
-
defaultValue: statuses.DEFAULT
|
15
|
-
}
|
16
|
-
}
|
19
|
+
argTypes: _objectSpread({}, statusArgTypes)
|
17
20
|
};
|
18
21
|
export var Default = function Default(args) {
|
19
22
|
return ___EmotionJSX(FieldHelperText, args, "Look at me!");
|
@@ -16,7 +16,6 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
|
|
16
16
|
import _URL from "@babel/runtime-corejs3/core-js-stable/url";
|
17
17
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
18
18
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
19
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
20
19
|
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; }
|
21
20
|
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; }
|
22
21
|
import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
@@ -28,8 +27,9 @@ import { Box, FieldHelperText, Input, Label, Loader } from '../..';
|
|
28
27
|
import useField from '../../hooks/useField';
|
29
28
|
import useStatusClasses from '../../hooks/useStatusClasses';
|
30
29
|
import statuses from '../../utils/devUtils/constants/statuses';
|
31
|
-
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/
|
32
|
-
import { inputFieldAttributesBasePropTypes } from '../../utils/
|
30
|
+
import { ariaAttributesBasePropTypes, getAriaAttributeProps } from '../../utils/docUtils/ariaAttributes';
|
31
|
+
import { inputFieldAttributesBasePropTypes } from '../../utils/docUtils/fieldAttributes';
|
32
|
+
import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusProp';
|
33
33
|
import FileItem from './FileItem';
|
34
34
|
import FileSelect from './FileSelect';
|
35
35
|
|
@@ -192,13 +192,11 @@ var FileInputField = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
192
192
|
}, helperText));
|
193
193
|
});
|
194
194
|
FileInputField.displayName = 'FileInputField';
|
195
|
-
FileInputField.propTypes = _objectSpread(_objectSpread({
|
195
|
+
FileInputField.propTypes = _objectSpread(_objectSpread(_objectSpread({
|
196
196
|
/** The rendered label for the field. */
|
197
197
|
label: PropTypes.node,
|
198
198
|
/** Text rendered below the input. */
|
199
199
|
helperText: PropTypes.node,
|
200
|
-
/** Determines the component border status color indicator and helper text styling. */
|
201
|
-
status: PropTypes.oneOf(_Object$values(statuses)),
|
202
200
|
/** Default button text that will be changed on the file name once file is uploaded */
|
203
201
|
defaultButtonText: PropTypes.string,
|
204
202
|
/** Defines whether input can accept multiple files or not */
|
@@ -225,21 +223,19 @@ FileInputField.propTypes = _objectSpread(_objectSpread({
|
|
225
223
|
*
|
226
224
|
* }
|
227
225
|
* */
|
228
|
-
fileList: PropTypes.arrayOf(PropTypes.shape({
|
226
|
+
fileList: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
229
227
|
fileObj: PropTypes.shape({}),
|
230
228
|
id: PropTypes.string.isRequired,
|
231
229
|
name: PropTypes.string.isRequired,
|
232
|
-
downloadLink: PropTypes.string
|
233
|
-
|
234
|
-
})),
|
230
|
+
downloadLink: PropTypes.string
|
231
|
+
}, statusPropTypes))),
|
235
232
|
/** Default array of objects for uploaded files. */
|
236
|
-
defaultFileList: PropTypes.arrayOf(PropTypes.shape({
|
233
|
+
defaultFileList: PropTypes.arrayOf(PropTypes.shape(_objectSpread({
|
237
234
|
fileObj: PropTypes.shape({}),
|
238
235
|
id: PropTypes.string.isRequired,
|
239
236
|
name: PropTypes.string.isRequired,
|
240
|
-
downloadLink: PropTypes.string
|
241
|
-
|
242
|
-
})),
|
237
|
+
downloadLink: PropTypes.string
|
238
|
+
}, statusPropTypes))),
|
243
239
|
/** The handler that is called when the input files is uploaded.
|
244
240
|
*
|
245
241
|
* `(event, files) => void`
|
@@ -252,9 +248,8 @@ FileInputField.propTypes = _objectSpread(_objectSpread({
|
|
252
248
|
onRemove: PropTypes.func,
|
253
249
|
/** These props will be spread to the field text component. */
|
254
250
|
textProps: PropTypes.shape({})
|
255
|
-
}, ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
256
|
-
FileInputField.defaultProps = {
|
257
|
-
defaultButtonText: 'Select a file'
|
258
|
-
|
259
|
-
};
|
251
|
+
}, statusPropTypes), ariaAttributesBasePropTypes), inputFieldAttributesBasePropTypes);
|
252
|
+
FileInputField.defaultProps = _objectSpread({
|
253
|
+
defaultButtonText: 'Select a file'
|
254
|
+
}, statusDefaultProp);
|
260
255
|
export default FileInputField;
|