@thecb/components 9.2.4-beta.1 → 9.2.4-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.2.4-beta.1",
3
+ "version": "9.2.4-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -62,7 +62,8 @@ const RadioButtonWithLabel = ({
62
62
  index,
63
63
  handleChange = noop, // optional, for custom event handling in ingesting app
64
64
  field,
65
- config
65
+ config,
66
+ isRequired = false
66
67
  }) => {
67
68
  const getDefaultChecked = (value, idx) => {
68
69
  const selectionExistsInConfig = config
@@ -94,6 +95,7 @@ const RadioButtonWithLabel = ({
94
95
  handleChange(e);
95
96
  }}
96
97
  defaultChecked={getDefaultChecked(value, index)}
98
+ required={isRequired}
97
99
  />
98
100
  <Text
99
101
  as="label"
@@ -29,7 +29,8 @@ const RadioGroup = ({
29
29
  handleChange = noop, // optional, for custom event handling in ingesting app
30
30
  // redux-freeform props - this is similar to how FormInput works, duplicated because the radio input is hidden for styling overrides
31
31
  field,
32
- fieldActions
32
+ fieldActions,
33
+ isRequired = false
33
34
  }) => {
34
35
  const setValue = value => fieldActions.set(value);
35
36
  return (
@@ -37,6 +38,7 @@ const RadioGroup = ({
37
38
  role="radiogroup"
38
39
  aria-labelledby={`radio-group-${groupName}-heading`}
39
40
  $extraStyles={extraStyles}
41
+ required={isRequired}
40
42
  >
41
43
  {Heading !== null && Heading}
42
44
  <Stack childGap="4px">
@@ -51,6 +53,7 @@ const RadioGroup = ({
51
53
  field={field}
52
54
  config={config}
53
55
  aria-invalid={field.dirty && field.hasErrors}
56
+ isRequired={isRequired}
54
57
  />
55
58
  ))}
56
59
  </Stack>
@@ -33,6 +33,7 @@ export const radioGroup = () => (
33
33
  fieldActions={{
34
34
  set: () => noop()
35
35
  }}
36
+ isRequired={true}
36
37
  />
37
38
  );
38
39