@pingux/astro 1.3.0 → 1.3.2-alpha.1
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/CHANGELOG.md +17 -0
- package/lib/cjs/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/cjs/components/FieldHelperText/FieldHelperText.js +0 -1
- package/lib/cjs/components/Input/Input.js +3 -11
- package/lib/cjs/components/Input/Input.test.js +14 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +20 -10
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +74 -0
- package/lib/cjs/components/NumberField/NumberField.js +30 -10
- package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
- package/lib/cjs/components/PageHeader/PageHeader.js +3 -0
- package/lib/cjs/components/PageHeader/PageHeader.stories.js +6 -1
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/cjs/components/SelectField/SelectField.stories.js +3 -55
- package/lib/cjs/components/Tabs/Tabs.stories.js +1 -15
- package/lib/cjs/hooks/useField/useField.js +2 -2
- package/lib/cjs/styles/forms/checkbox.js +0 -1
- package/lib/cjs/styles/forms/input.js +1 -1
- package/lib/cjs/styles/forms/label.js +3 -0
- package/lib/cjs/styles/forms/radio.js +1 -1
- package/lib/cjs/styles/forms/switch.js +3 -1
- package/lib/cjs/styles/variants/boxes.js +4 -1
- package/lib/cjs/styles/variants/text.js +0 -1
- package/lib/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/components/FieldHelperText/FieldHelperText.js +0 -1
- package/lib/components/Input/Input.js +2 -10
- package/lib/components/Input/Input.test.js +11 -2
- package/lib/components/MultivaluesField/MultivaluesField.js +19 -9
- package/lib/components/MultivaluesField/MultivaluesField.test.js +52 -0
- package/lib/components/NumberField/NumberField.js +32 -12
- package/lib/components/NumberField/NumberField.test.js +5 -0
- package/lib/components/PageHeader/PageHeader.js +2 -0
- package/lib/components/PageHeader/PageHeader.stories.js +5 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/components/SelectField/SelectField.stories.js +2 -50
- package/lib/components/Tabs/Tabs.stories.js +0 -11
- package/lib/hooks/useField/useField.js +2 -2
- package/lib/styles/forms/checkbox.js +0 -1
- package/lib/styles/forms/input.js +1 -1
- package/lib/styles/forms/label.js +3 -0
- package/lib/styles/forms/radio.js +1 -1
- package/lib/styles/forms/switch.js +3 -1
- package/lib/styles/variants/boxes.js +4 -1
- package/lib/styles/variants/text.js +0 -1
- package/package.json +1 -1
- package/lib/cjs/layouts/ListLayout.stories.js +0 -895
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +0 -139
- package/lib/layouts/ListLayout.stories.js +0 -866
- package/lib/layouts/SchemaFormLayout.stories.js +0 -107
@@ -1,9 +1,9 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _Number$isInteger from "@babel/runtime-corejs3/core-js-stable/number/is-integer";
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
4
|
import React, { forwardRef } from 'react';
|
4
5
|
import { Input as ThemeUIInput } from 'theme-ui';
|
5
6
|
import PropTypes from 'prop-types';
|
6
|
-
import { useAriaLabelWarning } from '../../hooks';
|
7
7
|
import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
|
8
8
|
/**
|
9
9
|
* Base input component.
|
@@ -21,19 +21,11 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
21
|
maxLength = props.maxLength,
|
22
22
|
others = _objectWithoutProperties(props, ["name", "placeholder", "maxLength"]);
|
23
23
|
|
24
|
-
var ariaLabel = props['aria-label'] || name;
|
25
|
-
useAriaLabelWarning('Input', ariaLabel || placeholder);
|
26
|
-
|
27
|
-
if (!ariaLabel && !placeholder) {
|
28
|
-
ariaLabel = 'Input';
|
29
|
-
}
|
30
|
-
|
31
24
|
return ___EmotionJSX(ThemeUIInput, _extends({
|
32
|
-
"aria-label": ariaLabel,
|
33
25
|
ref: ref,
|
34
26
|
name: name,
|
35
27
|
placeholder: placeholder,
|
36
|
-
maxLength: maxLength
|
28
|
+
maxLength: _Number$isInteger(maxLength) && maxLength > 0 ? maxLength : undefined
|
37
29
|
}, others));
|
38
30
|
});
|
39
31
|
Input.displayName = 'Input';
|
@@ -7,7 +7,8 @@ import axeTest from '../../utils/testUtils/testAxe';
|
|
7
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
8
|
var testId = 'test-input';
|
9
9
|
var defaultProps = {
|
10
|
-
'data-testid': testId
|
10
|
+
'data-testid': testId,
|
11
|
+
'aria-label': 'My Input'
|
11
12
|
};
|
12
13
|
|
13
14
|
var getComponent = function getComponent() {
|
@@ -38,11 +39,19 @@ test('maxlength field with a set maxlength', function () {
|
|
38
39
|
userEvent.type(input, 'banana');
|
39
40
|
expect(input.value.length).toBe(3);
|
40
41
|
});
|
41
|
-
test('maxlength field set as
|
42
|
+
test('maxlength field is not set as null', function () {
|
42
43
|
getComponent({
|
43
44
|
maxLength: null
|
44
45
|
});
|
45
46
|
var input = screen.getByTestId(testId);
|
46
47
|
userEvent.type(input, 'banana');
|
47
48
|
expect(input.value.length).toBe(6);
|
49
|
+
});
|
50
|
+
test('maxlength field is not set as zero', function () {
|
51
|
+
getComponent({
|
52
|
+
maxLength: 0
|
53
|
+
});
|
54
|
+
var input = screen.getByTestId(testId);
|
55
|
+
userEvent.type(input, 'banana');
|
56
|
+
expect(input.value.length).toBe(6);
|
48
57
|
});
|
@@ -27,7 +27,6 @@ import { FocusScope } from '@react-aria/focus';
|
|
27
27
|
import { useListState } from '@react-stately/list';
|
28
28
|
import { DismissButton, useOverlayPosition } from '@react-aria/overlays';
|
29
29
|
import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
30
|
-
import { v4 as uuid } from 'uuid';
|
31
30
|
import { Chip, Icon, IconButton, PopoverContainer, ScrollBox, TextField } from '../..';
|
32
31
|
import ListBox from '../ListBox';
|
33
32
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
@@ -52,6 +51,7 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
52
51
|
disabledKeys = _props$disabledKeys === void 0 ? [] : _props$disabledKeys,
|
53
52
|
hasAutoFocus = props.hasAutoFocus,
|
54
53
|
hasNoStatusIndicator = props.hasNoStatusIndicator,
|
54
|
+
customInputProps = props.inputProps,
|
55
55
|
isDisabled = props.isDisabled,
|
56
56
|
isNotFlippable = props.isNotFlippable,
|
57
57
|
isReadOnly = props.isReadOnly,
|
@@ -219,13 +219,17 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
219
219
|
} else if (hasCustomValue) {
|
220
220
|
var _context3;
|
221
221
|
|
222
|
-
var
|
223
|
-
|
224
|
-
selectionManager.
|
222
|
+
var _key2 = e.target.value;
|
223
|
+
|
224
|
+
if (state.selectionManager.isSelected(_key2)) {
|
225
|
+
return;
|
226
|
+
}
|
227
|
+
|
228
|
+
selectionManager.toggleSelection(_key2);
|
225
229
|
setCustomItems(_concatInstanceProperty(_context3 = []).call(_context3, customItems, [{
|
226
|
-
id:
|
227
|
-
key:
|
228
|
-
name:
|
230
|
+
id: _key2,
|
231
|
+
key: _key2,
|
232
|
+
name: _key2
|
229
233
|
}]));
|
230
234
|
setFilterString('');
|
231
235
|
}
|
@@ -319,7 +323,7 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
319
323
|
onDismiss: close
|
320
324
|
}));
|
321
325
|
|
322
|
-
var inputProps = {
|
326
|
+
var inputProps = _objectSpread(_objectSpread({}, customInputProps), {}, {
|
323
327
|
controlProps: {
|
324
328
|
'aria-expanded': isOpen,
|
325
329
|
role: 'combobox'
|
@@ -335,7 +339,8 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
335
339
|
ref: inputRef,
|
336
340
|
variant: 'forms.input.multivaluesWrapper'
|
337
341
|
}
|
338
|
-
};
|
342
|
+
});
|
343
|
+
|
339
344
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, _extends({
|
340
345
|
onBlur: function onBlur(e) {
|
341
346
|
setIsOpen(false);
|
@@ -385,6 +390,11 @@ MultivaluesField.propTypes = {
|
|
385
390
|
/** Whether the field has a status indicator. */
|
386
391
|
hasNoStatusIndicator: PropTypes.bool,
|
387
392
|
|
393
|
+
/**
|
394
|
+
* Props that get passed as-is to the underlying TextField element
|
395
|
+
*/
|
396
|
+
inputProps: PropTypes.shape({}),
|
397
|
+
|
388
398
|
/** Whether the input is disabled. */
|
389
399
|
isDisabled: PropTypes.bool,
|
390
400
|
|
@@ -212,6 +212,58 @@ test('changing the input value and hitting enter creates new value in non-restri
|
|
212
212
|
var chipContainer = chip.parentElement;
|
213
213
|
expect(chipContainer).toHaveAttribute('role', 'presentation');
|
214
214
|
});
|
215
|
+
test('in non-restrictive mode "onSelectionChange" returns entered keys', function () {
|
216
|
+
var onSelectionChange = jest.fn();
|
217
|
+
getComponent({
|
218
|
+
mode: 'non-restrictive',
|
219
|
+
onSelectionChange: onSelectionChange
|
220
|
+
});
|
221
|
+
var input = screen.getByRole('combobox');
|
222
|
+
var value = 'custom';
|
223
|
+
userEvent.type(input, value);
|
224
|
+
userEvent.type(input, '{enter}');
|
225
|
+
var chip = screen.queryByText(value);
|
226
|
+
expect(chip).toBeInTheDocument();
|
227
|
+
expect(onSelectionChange).toBeCalledTimes(1);
|
228
|
+
expect(onSelectionChange.mock.calls[0][0].has(value)).toBeTruthy();
|
229
|
+
});
|
230
|
+
test('in non-restrictive mode the same value cannot be applied twice', function () {
|
231
|
+
var onSelectionChange = jest.fn();
|
232
|
+
getComponent({
|
233
|
+
mode: 'non-restrictive',
|
234
|
+
onSelectionChange: onSelectionChange
|
235
|
+
});
|
236
|
+
var input = screen.getByRole('combobox');
|
237
|
+
var value = 'custom';
|
238
|
+
userEvent.type(input, value);
|
239
|
+
userEvent.type(input, '{enter}');
|
240
|
+
var chip = screen.queryByText(value);
|
241
|
+
expect(chip).toBeInTheDocument();
|
242
|
+
expect(input).toHaveValue('');
|
243
|
+
userEvent.type(input, value);
|
244
|
+
userEvent.type(input, '{enter}');
|
245
|
+
expect(input).toHaveValue(value);
|
246
|
+
expect(onSelectionChange).toBeCalledTimes(1);
|
247
|
+
});
|
248
|
+
test('in non-restrictive mode the value that was already selected using the list cannot be applied', function () {
|
249
|
+
var onSelectionChange = jest.fn();
|
250
|
+
getComponent({
|
251
|
+
mode: 'non-restrictive',
|
252
|
+
onSelectionChange: onSelectionChange
|
253
|
+
});
|
254
|
+
var input = screen.getByRole('combobox');
|
255
|
+
input.focus();
|
256
|
+
var listbox = screen.getByRole('listbox');
|
257
|
+
var options = within(listbox).getAllByRole('option');
|
258
|
+
var firstOption = options[0];
|
259
|
+
firstOption.click();
|
260
|
+
expect(onSelectionChange.mock.calls[0][0].has(items[0].name)).toBeTruthy();
|
261
|
+
onSelectionChange.mockClear();
|
262
|
+
userEvent.type(input, items[0].name);
|
263
|
+
userEvent.type(input, '{enter}');
|
264
|
+
expect(input).toHaveValue(items[0].name);
|
265
|
+
expect(onSelectionChange).not.toBeCalled();
|
266
|
+
});
|
215
267
|
test('options can be focused via keyboard', function () {
|
216
268
|
getComponent();
|
217
269
|
var input = screen.getByRole('combobox');
|
@@ -14,10 +14,10 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
14
14
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
16
16
|
|
17
|
-
import React, { forwardRef, useImperativeHandle } from 'react';
|
17
|
+
import React, { forwardRef, useCallback, useImperativeHandle, useMemo } from 'react';
|
18
18
|
import PropTypes from 'prop-types';
|
19
|
-
import
|
20
|
-
import
|
19
|
+
import MenuUp from 'mdi-react/MenuUpIcon';
|
20
|
+
import MenuDown from 'mdi-react/MenuDownIcon';
|
21
21
|
import { useNumberField } from '@react-aria/numberfield';
|
22
22
|
import { useNumberFieldState } from '@react-stately/numberfield';
|
23
23
|
import { useLocale } from '@react-aria/i18n';
|
@@ -73,18 +73,38 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
73
73
|
variant: "numberField.arrows"
|
74
74
|
}, ___EmotionJSX(IconButton, _extends({}, incrementButtonProps, {
|
75
75
|
ref: decRef,
|
76
|
-
tabIndex: "-1"
|
76
|
+
tabIndex: "-1",
|
77
|
+
p: 0
|
77
78
|
}), ___EmotionJSX(Icon, {
|
78
|
-
icon:
|
79
|
-
size:
|
79
|
+
icon: MenuUp,
|
80
|
+
size: 18
|
80
81
|
})), ___EmotionJSX(IconButton, _extends({}, decrementButtonProps, {
|
81
82
|
ref: incrRef,
|
82
|
-
tabIndex: "-1"
|
83
|
+
tabIndex: "-1",
|
84
|
+
p: 0
|
83
85
|
}), ___EmotionJSX(Icon, {
|
84
|
-
icon:
|
85
|
-
size:
|
86
|
-
})));
|
87
|
-
|
86
|
+
icon: MenuDown,
|
87
|
+
size: 18
|
88
|
+
}))); // this needed to remove console warning in React 16
|
89
|
+
// I believe once we update to 17 - we can remove this
|
90
|
+
|
91
|
+
|
92
|
+
var onInputFocus = useCallback(function (e) {
|
93
|
+
e.persist();
|
94
|
+
fieldControlProps.onFocus(e);
|
95
|
+
inputProps.onFocus(e);
|
96
|
+
}, [fieldControlProps, inputProps]);
|
97
|
+
var onInputBlur = useCallback(function (e) {
|
98
|
+
e.persist();
|
99
|
+
fieldControlProps.onBlur(e);
|
100
|
+
inputProps.onBlur(e);
|
101
|
+
}, [fieldControlProps, inputProps]);
|
102
|
+
var updatedFieldControlProps = useMemo(function () {
|
103
|
+
return _objectSpread(_objectSpread({}, fieldControlProps), {}, {
|
104
|
+
onFocus: onInputFocus,
|
105
|
+
onBlur: onInputBlur
|
106
|
+
});
|
107
|
+
}, [fieldControlProps, onInputBlur, onInputFocus]);
|
88
108
|
return ___EmotionJSX(Box, fieldContainerProps, ___EmotionJSX(Label, mergeProps(fieldLabelProps, labelProps)), ___EmotionJSX(Box, _extends({
|
89
109
|
variant: "numberField.noDefaultArrows"
|
90
110
|
}, groupProps), ___EmotionJSX(Box, {
|
@@ -95,7 +115,7 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
95
115
|
ref: inputRef // we don't want to merge this props, we want to
|
96
116
|
// overwrite them like defaultValue, value, ect.
|
97
117
|
|
98
|
-
},
|
118
|
+
}, updatedFieldControlProps, omit(inputProps, ['name', 'onFocus', 'onBlur']))), ControlArrows), helperText && ___EmotionJSX(FieldHelperText, {
|
99
119
|
status: status
|
100
120
|
}, helperText)));
|
101
121
|
});
|
@@ -135,4 +135,9 @@ test('number field input receiving name attribute', function () {
|
|
135
135
|
name: testName
|
136
136
|
});
|
137
137
|
expect(screen.getByLabelText(testLabel)).toHaveAttribute('name', testName);
|
138
|
+
});
|
139
|
+
test('number field can be focused', function () {
|
140
|
+
getComponent();
|
141
|
+
userEvent.tab();
|
142
|
+
expect(screen.getByLabelText(testLabel)).toHaveClass('is-focused');
|
138
143
|
});
|
@@ -4,12 +4,14 @@ import React, { forwardRef } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import Text from '../Text/Text';
|
6
6
|
import Box from '../Box/Box';
|
7
|
+
import { useDeprecationWarning } from '../../hooks';
|
7
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
9
|
var PageHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
9
10
|
var title = props.title,
|
10
11
|
children = props.children,
|
11
12
|
others = _objectWithoutProperties(props, ["title", "children"]);
|
12
13
|
|
14
|
+
useDeprecationWarning('The Page Header component will be deprecated in Astro-UI 2.0.0.');
|
13
15
|
return ___EmotionJSX(Box, _extends({
|
14
16
|
isRow: true,
|
15
17
|
justifyContent: "space-between",
|
@@ -2,10 +2,14 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import PageHeader from '../PageHeader/PageHeader';
|
4
4
|
import Button from '../Button/Button';
|
5
|
+
import withDeprecationWarning from '../../utils/devUtils/decorators/withDeprecationWarning';
|
5
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
7
|
export default {
|
7
|
-
title: 'PageHeader',
|
8
|
+
title: 'Deprecated/PageHeader',
|
8
9
|
component: PageHeader,
|
10
|
+
decorators: [function (Story, context) {
|
11
|
+
return withDeprecationWarning(Story, context, 'The `PageHeader` component will be deprecated in Astro-UI 2.0.0.');
|
12
|
+
}],
|
9
13
|
argTypes: {
|
10
14
|
title: {
|
11
15
|
control: {
|
@@ -63,17 +63,21 @@ var RadioGroupField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
63
63
|
}, radioGroupProps), ___EmotionJSX(Label, _extends({
|
64
64
|
isDisabled: isDisabled,
|
65
65
|
hintText: hintText,
|
66
|
-
isRequired: isRequired
|
67
|
-
|
68
|
-
|
69
|
-
}, helperText), ___EmotionJSX(Box, {
|
66
|
+
isRequired: isRequired,
|
67
|
+
variant: "forms.label.radioGroup"
|
68
|
+
}, labelProps), label), ___EmotionJSX(Box, {
|
70
69
|
variant: "forms.radioGroupWrapper",
|
71
70
|
isRow: orientation === ORIENTATION.HORIZONTAL
|
72
71
|
}, ___EmotionJSX(RadioContext.Provider, {
|
73
72
|
value: _objectSpread({
|
74
73
|
isDisabled: isDisabled
|
75
74
|
}, state)
|
76
|
-
}, children))
|
75
|
+
}, children)), helperText && ___EmotionJSX(FieldHelperText, {
|
76
|
+
status: status,
|
77
|
+
sx: {
|
78
|
+
pt: 'xs'
|
79
|
+
}
|
80
|
+
}, helperText));
|
77
81
|
});
|
78
82
|
RadioGroupField.propTypes = {
|
79
83
|
/** 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). */
|
@@ -16,7 +16,6 @@ import { useAsyncList } from '@react-stately/data';
|
|
16
16
|
import { SelectField, Item, Separator, Section } from '../../index';
|
17
17
|
import statuses from '../../utils/devUtils/constants/statuses';
|
18
18
|
import { modes as labelModes } from '../Label/constants';
|
19
|
-
import Box from '../Box';
|
20
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
21
20
|
var animals = [{
|
22
21
|
name: 'Aardvark',
|
@@ -195,52 +194,6 @@ export var FloatLabel = function FloatLabel() {
|
|
195
194
|
key: "yellow"
|
196
195
|
}, "Yellow"));
|
197
196
|
};
|
198
|
-
export var LeftLabel = function LeftLabel() {
|
199
|
-
return ___EmotionJSX(Box, {
|
200
|
-
gap: "xl",
|
201
|
-
width: "100%"
|
202
|
-
}, ___EmotionJSX(SelectField, {
|
203
|
-
helperText: "Here is some helpful text...",
|
204
|
-
label: "Example Label",
|
205
|
-
labelMode: "left"
|
206
|
-
}, ___EmotionJSX(Item, {
|
207
|
-
key: "red"
|
208
|
-
}, "Red"), ___EmotionJSX(Item, {
|
209
|
-
key: "blue"
|
210
|
-
}, "Blue"), ___EmotionJSX(Item, {
|
211
|
-
key: "yellow"
|
212
|
-
}, "Yellow")), ___EmotionJSX(SelectField, {
|
213
|
-
label: "Example Label that is much longer than the previous one",
|
214
|
-
labelMode: "left"
|
215
|
-
}, ___EmotionJSX(Item, {
|
216
|
-
key: "red"
|
217
|
-
}, "Red"), ___EmotionJSX(Item, {
|
218
|
-
key: "blue"
|
219
|
-
}, "Blue"), ___EmotionJSX(Item, {
|
220
|
-
key: "yellow"
|
221
|
-
}, "Yellow")), ___EmotionJSX(SelectField, {
|
222
|
-
label: "Example label with set width",
|
223
|
-
labelMode: "left",
|
224
|
-
containerProps: {
|
225
|
-
sx: {
|
226
|
-
gridTemplateColumns: '120px auto'
|
227
|
-
}
|
228
|
-
}
|
229
|
-
}, ___EmotionJSX(Item, {
|
230
|
-
key: "red"
|
231
|
-
}, "Red"), ___EmotionJSX(Item, {
|
232
|
-
key: "blue"
|
233
|
-
}, "Blue"), ___EmotionJSX(Item, {
|
234
|
-
key: "yellow"
|
235
|
-
}, "Yellow")));
|
236
|
-
};
|
237
|
-
LeftLabel.parameters = {
|
238
|
-
docs: {
|
239
|
-
description: {
|
240
|
-
story: 'Users are able to override the default 40% column width when using left label by providing a new gridTemplatesColumn value, as shown in the example below.'
|
241
|
-
}
|
242
|
-
}
|
243
|
-
};
|
244
197
|
export var Controlled = function Controlled() {
|
245
198
|
var _useState = useState('yellow'),
|
246
199
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -299,15 +252,14 @@ export var DisabledOptions = function DisabledOptions() {
|
|
299
252
|
key: "red"
|
300
253
|
}, "Red"), ___EmotionJSX(Item, {
|
301
254
|
key: "blue"
|
302
|
-
}, "Blue
|
255
|
+
}, "Blue"), ___EmotionJSX(Item, {
|
303
256
|
key: "yellow"
|
304
257
|
}, "Yellow"));
|
305
258
|
};
|
306
259
|
export var NoOptionsAvailable = function NoOptionsAvailable() {
|
307
260
|
return ___EmotionJSX(SelectField, {
|
308
261
|
label: "Select an option...",
|
309
|
-
|
310
|
-
defaultText: "No options available"
|
262
|
+
placeholder: "No options available"
|
311
263
|
});
|
312
264
|
};
|
313
265
|
export var HelperText = function HelperText() {
|
@@ -161,17 +161,6 @@ export var CustomTabLine = function CustomTabLine() {
|
|
161
161
|
}, item.children);
|
162
162
|
});
|
163
163
|
};
|
164
|
-
export var Orientation = function Orientation() {
|
165
|
-
return ___EmotionJSX(Tabs, {
|
166
|
-
orientation: "vertical",
|
167
|
-
items: tabs
|
168
|
-
}, function (item) {
|
169
|
-
return ___EmotionJSX(Tab, {
|
170
|
-
key: item.name,
|
171
|
-
title: item.name
|
172
|
-
}, item.children);
|
173
|
-
});
|
174
|
-
};
|
175
164
|
export var TabPanelProps = function TabPanelProps() {
|
176
165
|
return ___EmotionJSX(Tabs, {
|
177
166
|
tabPanelProps: {
|
@@ -156,8 +156,8 @@ var useField = function useField() {
|
|
156
156
|
}),
|
157
157
|
focusWithinProps = _useFocusWithin.focusWithinProps;
|
158
158
|
|
159
|
-
var isFloatLabel = labelMode === labelModes.FLOAT;
|
160
|
-
var isLeftLabel = labelMode === labelModes.LEFT;
|
159
|
+
var isFloatLabel = labelMode === labelModes.FLOAT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === labelModes.FLOAT;
|
160
|
+
var isLeftLabel = labelMode === labelModes.LEFT || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.labelMode) === labelModes.LEFT;
|
161
161
|
var isFloatLabelActive = isFloatLabel && (hasValue || hasFocusWithin || (containerProps === null || containerProps === void 0 ? void 0 : containerProps.isFloatLabelActive));
|
162
162
|
|
163
163
|
var _useStatusClasses2 = useStatusClasses(containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, {
|
@@ -34,7 +34,10 @@ var radioContainer = {
|
|
34
34
|
}; // Used to add spacing for content shown when a radio is checked
|
35
35
|
|
36
36
|
var radioCheckedContent = {
|
37
|
-
|
37
|
+
pb: 'sm',
|
38
|
+
pl: 'lg',
|
39
|
+
color: 'text.secondary',
|
40
|
+
fontSize: 'md'
|
38
41
|
};
|
39
42
|
|
40
43
|
var listItem = _objectSpread(_objectSpread({}, base), {}, {
|
@@ -43,7 +43,6 @@ var tabLabel = _objectSpread(_objectSpread(_objectSpread({}, base), wordWrap), {
|
|
43
43
|
|
44
44
|
var fieldHelperText = _objectSpread(_objectSpread(_objectSpread({}, base), wordWrap), {}, {
|
45
45
|
fontSize: 'sm',
|
46
|
-
pb: 'sm',
|
47
46
|
'&.is-default': {
|
48
47
|
color: 'text.secondary'
|
49
48
|
},
|