@spothero/ui 14.5.2 → 14.6.0
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 +10 -0
- package/CHANGELOG.tmp +8 -3
- package/package.json +1 -1
- package/styles/v2/components/FormControl/FormControl.jsx +1 -1
- package/styles/v2/components/Input/Input.stories.js +1 -0
- package/styles/v2/components/Select/Select.jsx +48 -1
- package/styles/v2/components/Select/Select.stories.js +45 -19
- package/v2/index-bundled.cjs.js +3 -3
- package/v2/index-bundled.cjs.js.map +1 -1
- package/v2/index-bundled.esm.js +3 -3
- package/v2/index-bundled.esm.js.map +1 -1
- package/v2/index-unbundled.cjs.js +283 -227
- package/v2/index-unbundled.cjs.js.map +1 -1
- package/v2/index-unbundled.esm.js +271 -215
- package/v2/index-unbundled.esm.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# 14.6.0 - 05/10/2022
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
* [[119cc85](https://github.com/spothero/fe-ui/commit/119cc85)] - Wrap Select component in FormControl component ([#285](https://github.com/spothero/fe-ui/pull/285)) (annaliarosed)
|
|
5
|
+
* `feat:` Wrap Select in FormControl and update stories for Select
|
|
6
|
+
* `feat:` Update styles to match design
|
|
7
|
+
* `chore:` Remove FormControl stories for now
|
|
8
|
+
* `fix:` Connect label and input
|
|
9
|
+
* `fix:` Connect label and inputCo-authored-by: Annalia Destefano <annalia.destefano@spothero.com>
|
|
10
|
+
|
|
1
11
|
# 14.5.2 - 05/10/2022
|
|
2
12
|
|
|
3
13
|
## Miscellaneous Updates
|
package/CHANGELOG.tmp
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
# 14.
|
|
1
|
+
# 14.6.0 - 05/10/2022
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
* [[
|
|
3
|
+
## New Features
|
|
4
|
+
* [[119cc85](https://github.com/spothero/fe-ui/commit/119cc85)] - Wrap Select component in FormControl component ([#285](https://github.com/spothero/fe-ui/pull/285)) (annaliarosed)
|
|
5
|
+
* `feat:` Wrap Select in FormControl and update stories for Select
|
|
6
|
+
* `feat:` Update styles to match design
|
|
7
|
+
* `chore:` Remove FormControl stories for now
|
|
8
|
+
* `fix:` Connect label and input
|
|
9
|
+
* `fix:` Connect label and inputCo-authored-by: Annalia Destefano <annalia.destefano@spothero.com>
|
|
5
10
|
|
package/package.json
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
import React, {forwardRef} from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import {Select as ChakraSelect} from '@chakra-ui/react';
|
|
4
|
+
import FormControl from '../FormControl/FormControl';
|
|
5
|
+
|
|
6
|
+
const Select = forwardRef(
|
|
7
|
+
(
|
|
8
|
+
{
|
|
9
|
+
label,
|
|
10
|
+
helperText,
|
|
11
|
+
errorMessage,
|
|
12
|
+
isInvalid,
|
|
13
|
+
isDisabled,
|
|
14
|
+
isRequired,
|
|
15
|
+
...props
|
|
16
|
+
},
|
|
17
|
+
ref
|
|
18
|
+
) => (
|
|
19
|
+
<FormControl
|
|
20
|
+
isInvalid={isInvalid}
|
|
21
|
+
isDisabled={isDisabled}
|
|
22
|
+
isRequired={isRequired}
|
|
23
|
+
errorMessage={errorMessage}
|
|
24
|
+
helperText={helperText}
|
|
25
|
+
label={label}
|
|
26
|
+
inputId={props.id}
|
|
27
|
+
>
|
|
28
|
+
<ChakraSelect
|
|
29
|
+
fontWeight="regular"
|
|
30
|
+
fontSize="sm"
|
|
31
|
+
ref={ref}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
</FormControl>
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
Select.propTypes = {
|
|
39
|
+
id: PropTypes.string.isRequired,
|
|
40
|
+
label: PropTypes.string,
|
|
41
|
+
helperText: PropTypes.string,
|
|
42
|
+
errorMessage: PropTypes.string,
|
|
43
|
+
isInvalid: PropTypes.bool,
|
|
44
|
+
isDisabled: PropTypes.bool,
|
|
45
|
+
isRequired: PropTypes.bool,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default Select;
|
|
@@ -1,33 +1,59 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
|
|
3
4
|
import Component from './Select';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: 'v2/Select',
|
|
8
|
+
component: Component,
|
|
7
9
|
parameters: {
|
|
8
10
|
removeBaseHtmlClass: true,
|
|
9
11
|
},
|
|
10
12
|
};
|
|
11
13
|
|
|
12
|
-
const SelectTemplate =
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}}
|
|
21
|
-
maxWidth="300px"
|
|
22
|
-
>
|
|
23
|
-
<option value="one">One</option>
|
|
24
|
-
<option value="two">Two</option>
|
|
25
|
-
<option value="three">Three</option>
|
|
26
|
-
<option value="four">Four</option>
|
|
27
|
-
</Component>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
14
|
+
const SelectTemplate = props => (
|
|
15
|
+
<Component variant="outline" maxWidth="200px" {...props}>
|
|
16
|
+
<option value="one">One</option>
|
|
17
|
+
<option value="two">Two</option>
|
|
18
|
+
<option value="three">Three</option>
|
|
19
|
+
<option value="four">Four</option>
|
|
20
|
+
</Component>
|
|
21
|
+
);
|
|
30
22
|
|
|
31
|
-
SelectTemplate.propTypes = {
|
|
23
|
+
SelectTemplate.propTypes = {
|
|
24
|
+
placeholder: PropTypes.string,
|
|
25
|
+
label: PropTypes.string,
|
|
26
|
+
helperText: PropTypes.string,
|
|
27
|
+
errorMessage: PropTypes.string,
|
|
28
|
+
isInvalid: PropTypes.bool,
|
|
29
|
+
isDisabled: PropTypes.bool,
|
|
30
|
+
isReadOnly: PropTypes.bool,
|
|
31
|
+
};
|
|
32
32
|
|
|
33
33
|
export const Select = SelectTemplate.bind({});
|
|
34
|
+
|
|
35
|
+
Select.argTypes = {
|
|
36
|
+
placeholder: {
|
|
37
|
+
control: {type: 'text'},
|
|
38
|
+
},
|
|
39
|
+
label: {
|
|
40
|
+
control: {type: 'text'},
|
|
41
|
+
},
|
|
42
|
+
helperText: {
|
|
43
|
+
control: {type: 'text'},
|
|
44
|
+
},
|
|
45
|
+
errorMessage: {
|
|
46
|
+
control: {type: 'text'},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Select.args = {
|
|
51
|
+
placeholder: 'Placeholder text',
|
|
52
|
+
label: 'Label',
|
|
53
|
+
helperText: 'Helper text',
|
|
54
|
+
errorMessage: 'Error message',
|
|
55
|
+
isInvalid: false,
|
|
56
|
+
isDisabled: false,
|
|
57
|
+
isReadOnly: false,
|
|
58
|
+
isRequired: false,
|
|
59
|
+
};
|