@spothero/ui 14.6.0 → 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 CHANGED
@@ -1,3 +1,9 @@
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
+
1
7
  # 14.6.0 - 05/10/2022
2
8
 
3
9
  ## New Features
package/CHANGELOG.tmp CHANGED
@@ -1,10 +1,6 @@
1
- # 14.6.0 - 05/10/2022
1
+ # 14.7.0 - 05/12/2022
2
2
 
3
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>
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>
10
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.6.0",
3
+ "version": "14.7.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index-bundled.cjs.js",
6
6
  "module": "v2/index.js",
@@ -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
- <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
- <ChakraInput ref={ref} {...props} />
29
- </FormControl>
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,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 {Select as ChakraSelect} from '@chakra-ui/react';
4
5
  import FormControl from '../FormControl/FormControl';
@@ -15,24 +16,29 @@ const Select = forwardRef(
15
16
  ...props
16
17
  },
17
18
  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
- )
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
+ }
36
42
  );
37
43
 
38
44
  Select.propTypes = {