@spothero/ui 14.5.2 → 14.7.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 +16 -0
- package/CHANGELOG.tmp +4 -3
- package/package.json +1 -1
- package/styles/v2/components/FormControl/FormControl.jsx +1 -1
- package/styles/v2/components/Input/Input.jsx +18 -13
- package/styles/v2/components/Input/Input.stories.js +1 -0
- package/styles/v2/components/Select/Select.jsx +54 -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 +294 -228
- package/v2/index-unbundled.cjs.js.map +1 -1
- package/v2/index-unbundled.esm.js +281 -216
- package/v2/index-unbundled.esm.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# 14.7.0 - 05/12/2022
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
* [[bf20c4f](https://github.com/spothero/fe-ui/commit/bf20c4f)] - Add classname to input and select so it doesn't break in prod ([#287](https://github.com/spothero/fe-ui/pull/287)) (annaliarosed)
|
|
5
|
+
* `Co-authored-by:` Annalia Destefano <annalia.destefano@spothero.com>
|
|
6
|
+
|
|
7
|
+
# 14.6.0 - 05/10/2022
|
|
8
|
+
|
|
9
|
+
## New Features
|
|
10
|
+
* [[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)
|
|
11
|
+
* `feat:` Wrap Select in FormControl and update stories for Select
|
|
12
|
+
* `feat:` Update styles to match design
|
|
13
|
+
* `chore:` Remove FormControl stories for now
|
|
14
|
+
* `fix:` Connect label and input
|
|
15
|
+
* `fix:` Connect label and inputCo-authored-by: Annalia Destefano <annalia.destefano@spothero.com>
|
|
16
|
+
|
|
1
17
|
# 14.5.2 - 05/10/2022
|
|
2
18
|
|
|
3
19
|
## Miscellaneous Updates
|
package/CHANGELOG.tmp
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
# 14.
|
|
1
|
+
# 14.7.0 - 05/12/2022
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
* [[
|
|
3
|
+
## New Features
|
|
4
|
+
* [[bf20c4f](https://github.com/spothero/fe-ui/commit/bf20c4f)] - Add classname to input and select so it doesn't break in prod ([#287](https://github.com/spothero/fe-ui/pull/287)) (annaliarosed)
|
|
5
|
+
* `Co-authored-by:` Annalia Destefano <annalia.destefano@spothero.com>
|
|
5
6
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, {forwardRef} from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import {Input as ChakraInput} from '@chakra-ui/react';
|
|
4
5
|
import FormControl from '../FormControl/FormControl';
|
|
@@ -15,19 +16,23 @@ const Input = forwardRef(
|
|
|
15
16
|
...props
|
|
16
17
|
},
|
|
17
18
|
ref
|
|
18
|
-
) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
) => {
|
|
20
|
+
const classes = cn({'FormElement-contains-error': isInvalid});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<FormControl
|
|
24
|
+
isInvalid={isInvalid}
|
|
25
|
+
isDisabled={isDisabled}
|
|
26
|
+
isRequired={isRequired}
|
|
27
|
+
errorMessage={errorMessage}
|
|
28
|
+
helperText={helperText}
|
|
29
|
+
label={label}
|
|
30
|
+
inputId={props.id}
|
|
31
|
+
>
|
|
32
|
+
<ChakraInput ref={ref} className={classes} {...props} />
|
|
33
|
+
</FormControl>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
31
36
|
);
|
|
32
37
|
|
|
33
38
|
Input.propTypes = {
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
import React, {forwardRef} from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import {Select as ChakraSelect} from '@chakra-ui/react';
|
|
5
|
+
import FormControl from '../FormControl/FormControl';
|
|
6
|
+
|
|
7
|
+
const Select = forwardRef(
|
|
8
|
+
(
|
|
9
|
+
{
|
|
10
|
+
label,
|
|
11
|
+
helperText,
|
|
12
|
+
errorMessage,
|
|
13
|
+
isInvalid,
|
|
14
|
+
isDisabled,
|
|
15
|
+
isRequired,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
ref
|
|
19
|
+
) => {
|
|
20
|
+
const classes = cn({'FormElement-contains-error': isInvalid});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<FormControl
|
|
24
|
+
isInvalid={isInvalid}
|
|
25
|
+
isDisabled={isDisabled}
|
|
26
|
+
isRequired={isRequired}
|
|
27
|
+
errorMessage={errorMessage}
|
|
28
|
+
helperText={helperText}
|
|
29
|
+
label={label}
|
|
30
|
+
inputId={props.id}
|
|
31
|
+
>
|
|
32
|
+
<ChakraSelect
|
|
33
|
+
fontWeight="regular"
|
|
34
|
+
fontSize="sm"
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={classes}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
</FormControl>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
Select.propTypes = {
|
|
45
|
+
id: PropTypes.string.isRequired,
|
|
46
|
+
label: PropTypes.string,
|
|
47
|
+
helperText: PropTypes.string,
|
|
48
|
+
errorMessage: PropTypes.string,
|
|
49
|
+
isInvalid: PropTypes.bool,
|
|
50
|
+
isDisabled: PropTypes.bool,
|
|
51
|
+
isRequired: PropTypes.bool,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
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
|
+
};
|