@thecb/components 8.4.10-beta.2 → 8.4.10-beta.4

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": "8.4.10-beta.2",
3
+ "version": "8.4.10-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
package/src/.DS_Store ADDED
Binary file
Binary file
Binary file
@@ -84,7 +84,7 @@ const FormSelect = ({
84
84
  autocompleteValue={autocompleteValue}
85
85
  smoothScroll={smoothScroll}
86
86
  />
87
- <Stack direction="row" justify="space-between">
87
+ <Stack direction="row" justify="space-between" aria-live="polite">
88
88
  {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
89
89
  <Text
90
90
  color={ERROR_COLOR}
@@ -57,45 +57,30 @@ const RadioButtonWithLabel = ({
57
57
  ariaInvalid,
58
58
  themeValues,
59
59
  index,
60
- handleChange = noop, // optional, for custom event handling in ingesting app
61
- field,
62
- config
63
- }) => {
64
- const getDefaultChecked = (value, idx) => {
65
- const selectionExistsInConfig = config
66
- .map(c => c.value)
67
- .includes(field.rawValue);
68
-
69
- if (selectionExistsInConfig) {
70
- // if exists, selection comes from the redux-freeform state
71
- return field.rawValue === value;
72
- }
73
- // fallback to first option as default selection
74
- return idx === 0;
75
- };
76
- return (
77
- <InputAndLabelContainer
78
- align="center"
79
- childGap="0.5rem"
80
- activeColor={themeValues.activeColor}
81
- >
82
- <HiddenRadioInput
83
- aria-invalid={ariaInvalid}
84
- style={{ marginTop: 0 }}
85
- type="radio"
86
- name={groupName}
87
- id={id}
88
- value={value}
89
- onChange={e => {
90
- setValue(e.target.value);
91
- handleChange(e);
92
- }}
93
- defaultChecked={getDefaultChecked(value, index)}
94
- />
95
- <Text
96
- as="label"
97
- htmlFor={id}
98
- extraStyles={`
60
+ handleChange = noop // optional, for custom event handling in ingesting app
61
+ }) => (
62
+ <InputAndLabelContainer
63
+ align="center"
64
+ childGap="0.5rem"
65
+ activeColor={themeValues.activeColor}
66
+ >
67
+ <HiddenRadioInput
68
+ aria-invalid={ariaInvalid}
69
+ style={{ marginTop: 0 }}
70
+ type="radio"
71
+ name={groupName}
72
+ id={id}
73
+ value={value}
74
+ onChange={e => {
75
+ setValue(e.target.value);
76
+ handleChange(e);
77
+ }}
78
+ defaultChecked={index === 0}
79
+ />
80
+ <Text
81
+ as="label"
82
+ htmlFor={id}
83
+ extraStyles={`
99
84
  font-size: 1rem;
100
85
  display: flex;
101
86
  width: 100%;
@@ -103,16 +88,15 @@ const RadioButtonWithLabel = ({
103
88
  cursor: pointer;
104
89
  }
105
90
  `}
106
- >
107
- <Circle
108
- activeColor={themeValues.activeColor}
109
- inactiveBorderColor={themeValues.inactiveBorderColor}
110
- />
111
- {labelText}
112
- </Text>
113
- </InputAndLabelContainer>
114
- );
115
- };
91
+ >
92
+ <Circle
93
+ activeColor={themeValues.activeColor}
94
+ inactiveBorderColor={themeValues.inactiveBorderColor}
95
+ />
96
+ {labelText}
97
+ </Text>
98
+ </InputAndLabelContainer>
99
+ );
116
100
 
117
101
  export default themeComponent(
118
102
  RadioButtonWithLabel,
@@ -48,8 +48,6 @@ const RadioGroup = ({
48
48
  groupName={groupName}
49
49
  setValue={setValue}
50
50
  handleChange={handleChange}
51
- field={field}
52
- config={config}
53
51
  aria-invalid={field.dirty && field.hasErrors}
54
52
  />
55
53
  ))}
@@ -27,7 +27,7 @@ export const radioGroup = () => (
27
27
  config={config}
28
28
  groupName="radio-button-group"
29
29
  field={{
30
- rawValue: "bar",
30
+ rawValue: "Hello World",
31
31
  dirty: false
32
32
  }}
33
33
  fieldActions={{