@spothero/ui 14.5.1 → 14.5.2-beta.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,8 @@
1
+ # 14.5.2-beta.0 - 05/09/2022
2
+
3
+ ## Miscellaneous Updates
4
+ * [[4e10f87](https://github.com/spothero/fe-ui/commit/4e10f87)] - `fix:` Link new Input and Label using htmlFor (Mick Johnson)
5
+
1
6
  # 14.5.1 - 05/05/2022
2
7
  ## Miscellaneous Updates
3
8
  * [[87e838a](https://github.com/spothero/fe-ui/commit/87e838a)] - `feature:` FED 321 secondary button updates, add tertiary and destructive buttons ([#284](https://github.com/spothero/fe-ui/pull/284)) (Mick Johnson)
package/CHANGELOG.tmp CHANGED
@@ -1,4 +1,5 @@
1
- # 14.5.1 - 05/05/2022
1
+ # 14.5.2-beta.0 - 05/09/2022
2
+
2
3
  ## Miscellaneous Updates
3
- * [[87e838a](https://github.com/spothero/fe-ui/commit/87e838a)] - `feature:` FED 321 secondary button updates, add tertiary and destructive buttons ([#284](https://github.com/spothero/fe-ui/pull/284)) (Mick Johnson)
4
+ * [[4e10f87](https://github.com/spothero/fe-ui/commit/4e10f87)] - `fix:` Link new Input and Label using htmlFor (Mick Johnson)
4
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.5.1",
3
+ "version": "14.5.2-beta.0",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index-bundled.cjs.js",
6
6
  "module": "v2/index.js",
@@ -8,21 +8,26 @@ import {
8
8
  } from '@chakra-ui/react';
9
9
 
10
10
  const FormControl = forwardRef(
11
- ({children, label, helperText, errorMessage, ...props}, ref) => (
11
+ ({children, label, inputId, helperText, errorMessage, ...props}, ref) => (
12
12
  <ChakraFormControl {...props} ref={ref}>
13
13
  {label && (
14
14
  <FormLabel
15
- color="gray.600"
15
+ color={props.isInvalid ? 'error' : 'gray.600'}
16
16
  fontWeight="semibold"
17
17
  mb={2}
18
18
  fontSize="sm"
19
+ htmlFor={inputId}
19
20
  >
20
21
  {label}
21
22
  </FormLabel>
22
23
  )}
23
24
  {children}
24
25
  {helperText && (
25
- <FormHelperText color="gray.600" mt={1} fontSize="xs">
26
+ <FormHelperText
27
+ color={props.isInvalid ? 'error' : 'gray.600'}
28
+ mt={1}
29
+ fontSize="xs"
30
+ >
26
31
  {helperText}
27
32
  </FormHelperText>
28
33
  )}
@@ -35,6 +40,8 @@ const FormControl = forwardRef(
35
40
 
36
41
  FormControl.propTypes = {
37
42
  label: PropTypes.string,
43
+ isInvalid: PropTypes.bool,
44
+ inputId: PropTypes.string,
38
45
  helperText: PropTypes.string,
39
46
  errorMessage: PropTypes.string,
40
47
  children: PropTypes.node,
@@ -23,6 +23,7 @@ const Input = forwardRef(
23
23
  errorMessage={errorMessage}
24
24
  helperText={helperText}
25
25
  label={label}
26
+ inputId={props.id}
26
27
  >
27
28
  <ChakraInput ref={ref} {...props} />
28
29
  </FormControl>
@@ -30,6 +31,7 @@ const Input = forwardRef(
30
31
  );
31
32
 
32
33
  Input.propTypes = {
34
+ id: PropTypes.string.isRequired,
33
35
  label: PropTypes.string,
34
36
  helperText: PropTypes.string,
35
37
  errorMessage: PropTypes.string,