@telus-uds/components-base 1.22.0 → 1.23.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,12 +1,24 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Wed, 07 Dec 2022 15:09:47 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 14 Dec 2022 01:42:49 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.23.0
8
+
9
+ Wed, 14 Dec 2022 01:42:49 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - undefined (mauricio.batresmontejo@telus.com)
14
+
15
+ ### Patches
16
+
17
+ - chore: new design to error feedback for radio group (mauricio.batresmontejo@telus.com)
18
+
7
19
  ## 1.22.0
8
20
 
9
- Wed, 07 Dec 2022 15:09:47 GMT
21
+ Wed, 07 Dec 2022 15:14:20 GMT
10
22
 
11
23
  ### Minor changes
12
24
 
@@ -3452,6 +3452,17 @@
3452
3452
  "docs": {
3453
3453
  "description": "A feedback box commonly used with form fields.\n\n### Standalone usage\nWhile its primary use is to facilitate feedback states for other form components such as `TextInput`,\nyou may use it standalone.\n\n### Complex content\nYou may pass any React tree as the children of this component, bear in mind that a render function\nis better suited for styling children based on Feedback's variant.\n\n### Using a render function\nWhen a function is passed for rendering content, it will receive the feedback text styles and\nvariant as arguments.\n\n### Accessibility\nAll accessibility props set on this component will be applied to the outer container.",
3454
3454
  "props": {
3455
+ "showFeedbackIcon": {
3456
+ "defaultValue": {
3457
+ "value": "false",
3458
+ "computed": false
3459
+ },
3460
+ "type": {
3461
+ "name": "bool"
3462
+ },
3463
+ "required": false,
3464
+ "description": ""
3465
+ },
3455
3466
  "title": {
3456
3467
  "type": {
3457
3468
  "name": "string"
@@ -12299,6 +12310,10 @@
12299
12310
  "name": "func",
12300
12311
  "required": false
12301
12312
  },
12313
+ "description": {
12314
+ "name": "string",
12315
+ "required": false
12316
+ },
12302
12317
  "ref": {
12303
12318
  "name": "custom",
12304
12319
  "raw": "ABBPropTypes.ref()",
@@ -162,6 +162,8 @@ const CheckboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
162
162
  feedback: feedback,
163
163
  inactive: inactive,
164
164
  validation: validation,
165
+ showIcon: true,
166
+ showErrorBorder: true,
165
167
  ...selectProps(rest),
166
168
  children: (0, _StackView.getStackedContent)(checkboxes, {
167
169
  space,
@@ -105,12 +105,12 @@ const Feedback = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
105
105
  validation,
106
106
  tokens,
107
107
  variant,
108
- icon,
108
+ showFeedbackIcon = false,
109
109
  ...rest
110
110
  } = _ref5;
111
111
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Feedback', tokens, { ...variant,
112
112
  validation,
113
- icon
113
+ icon: showFeedbackIcon
114
114
  });
115
115
  const {
116
116
  space
@@ -176,7 +176,8 @@ Feedback.propTypes = { ...selectedSystemPropTypes,
176
176
  /** @ignore */
177
177
  id: _propTypes.default.string,
178
178
  tokens: (0, _utils.getTokensPropType)('Feedback'),
179
- variant: _utils.variantProp.propType
179
+ variant: _utils.variantProp.propType,
180
+ showFeedbackIcon: _propTypes.default.bool
180
181
  };
181
182
  var _default = Feedback;
182
183
  exports.default = _default;
@@ -78,7 +78,7 @@ const Fieldset = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
78
78
  id: feedbackId,
79
79
  title: feedback,
80
80
  validation: validation,
81
- icon: showIcon
81
+ showFeedbackIcon: showIcon
82
82
  }); // Some accessibility patterns depend on elements being direct children, e.g. fieldset -> legend,
83
83
  // and on MacOS voiceover, radiogroup -> radio. To allow elements to be direct children of the
84
84
  // fieldset as much as possible, but also allow different spacing within content and between
@@ -132,6 +132,7 @@ const staticStyles = _StyleSheet.default.create({
132
132
  PressableListItemBase.propTypes = { ..._utils.withLinkRouter.propTypes,
133
133
  href: _propTypes.default.string,
134
134
  onPress: _propTypes.default.func,
135
+ // eslint-disable-next-line react/forbid-prop-types
135
136
  tokens: _propTypes.default.any,
136
137
  icon: _propTypes.default.elementType,
137
138
  children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
@@ -131,6 +131,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
131
131
  id,
132
132
  onChange: itemOnChange,
133
133
  ref: itemRef,
134
+ description,
134
135
  ...itemRest
135
136
  } = _ref2;
136
137
  const radioId = id || "Radio[".concat(index, "]");
@@ -142,7 +143,6 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
142
143
  };
143
144
 
144
145
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Radio.default, {
145
- error: validation === 'error',
146
146
  ref: itemRef,
147
147
  id: radioId,
148
148
  checked: isChecked,
@@ -152,6 +152,7 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
152
152
  name: inputGroupName,
153
153
  tokens: radioTokens,
154
154
  variant: variant,
155
+ description: description,
155
156
  ...selectItemProps(itemRest)
156
157
  }, radioId);
157
158
  });
@@ -167,6 +168,8 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
167
168
  feedback: feedback,
168
169
  inactive: inactive,
169
170
  validation: validation,
171
+ showIcon: true,
172
+ showErrorBorder: true,
170
173
  accessibilityRole: "radiogroup",
171
174
  ...selectProps(rest),
172
175
  children: (0, _StackView.getStackedContent)(radios, {
@@ -205,6 +208,7 @@ RadioGroup.propTypes = { ...selectedSystemPropTypes,
205
208
  label: _propTypes.default.string,
206
209
  id: _propTypes.default.string,
207
210
  onChange: _propTypes.default.func,
211
+ description: _propTypes.default.string,
208
212
  ref: _airbnbPropTypes.default.ref()
209
213
  })),
210
214
 
@@ -139,6 +139,8 @@ const CheckboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
139
139
  feedback: feedback,
140
140
  inactive: inactive,
141
141
  validation: validation,
142
+ showIcon: true,
143
+ showErrorBorder: true,
142
144
  ...selectProps(rest),
143
145
  children: getStackedContent(checkboxes, {
144
146
  space,
@@ -84,12 +84,12 @@ const Feedback = /*#__PURE__*/forwardRef((_ref5, ref) => {
84
84
  validation,
85
85
  tokens,
86
86
  variant,
87
- icon,
87
+ showFeedbackIcon = false,
88
88
  ...rest
89
89
  } = _ref5;
90
90
  const themeTokens = useThemeTokens('Feedback', tokens, { ...variant,
91
91
  validation,
92
- icon
92
+ icon: showFeedbackIcon
93
93
  });
94
94
  const {
95
95
  space
@@ -155,7 +155,8 @@ Feedback.propTypes = { ...selectedSystemPropTypes,
155
155
  /** @ignore */
156
156
  id: PropTypes.string,
157
157
  tokens: getTokensPropType('Feedback'),
158
- variant: variantProp.propType
158
+ variant: variantProp.propType,
159
+ showFeedbackIcon: PropTypes.bool
159
160
  };
160
161
  export default Feedback;
161
162
  const staticStyles = StyleSheet.create({
@@ -59,7 +59,7 @@ const Fieldset = /*#__PURE__*/forwardRef((_ref, ref) => {
59
59
  id: feedbackId,
60
60
  title: feedback,
61
61
  validation: validation,
62
- icon: showIcon
62
+ showFeedbackIcon: showIcon
63
63
  }); // Some accessibility patterns depend on elements being direct children, e.g. fieldset -> legend,
64
64
  // and on MacOS voiceover, radiogroup -> radio. To allow elements to be direct children of the
65
65
  // fieldset as much as possible, but also allow different spacing within content and between
@@ -105,6 +105,7 @@ const staticStyles = StyleSheet.create({
105
105
  PressableListItemBase.propTypes = { ...withLinkRouter.propTypes,
106
106
  href: PropTypes.string,
107
107
  onPress: PropTypes.func,
108
+ // eslint-disable-next-line react/forbid-prop-types
108
109
  tokens: PropTypes.any,
109
110
  icon: PropTypes.elementType,
110
111
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
@@ -108,6 +108,7 @@ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
108
108
  id,
109
109
  onChange: itemOnChange,
110
110
  ref: itemRef,
111
+ description,
111
112
  ...itemRest
112
113
  } = _ref2;
113
114
  const radioId = id || "Radio[".concat(index, "]");
@@ -119,7 +120,6 @@ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
119
120
  };
120
121
 
121
122
  return /*#__PURE__*/_jsx(Radio, {
122
- error: validation === 'error',
123
123
  ref: itemRef,
124
124
  id: radioId,
125
125
  checked: isChecked,
@@ -129,6 +129,7 @@ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
129
129
  name: inputGroupName,
130
130
  tokens: radioTokens,
131
131
  variant: variant,
132
+ description: description,
132
133
  ...selectItemProps(itemRest)
133
134
  }, radioId);
134
135
  });
@@ -144,6 +145,8 @@ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
144
145
  feedback: feedback,
145
146
  inactive: inactive,
146
147
  validation: validation,
148
+ showIcon: true,
149
+ showErrorBorder: true,
147
150
  accessibilityRole: "radiogroup",
148
151
  ...selectProps(rest),
149
152
  children: getStackedContent(radios, {
@@ -182,6 +185,7 @@ RadioGroup.propTypes = { ...selectedSystemPropTypes,
182
185
  label: PropTypes.string,
183
186
  id: PropTypes.string,
184
187
  onChange: PropTypes.func,
188
+ description: PropTypes.string,
185
189
  ref: ABBPropTypes.ref()
186
190
  })),
187
191
 
package/package.json CHANGED
@@ -70,5 +70,5 @@
70
70
  "standard-engine": {
71
71
  "skip": true
72
72
  },
73
- "version": "1.22.0"
73
+ "version": "1.23.0"
74
74
  }
@@ -152,6 +152,8 @@ const CheckboxGroup = forwardRef(
152
152
  feedback={feedback}
153
153
  inactive={inactive}
154
154
  validation={validation}
155
+ showIcon
156
+ showErrorBorder
155
157
  {...selectProps(rest)}
156
158
  >
157
159
  {getStackedContent(checkboxes, { space, direction: 'column' })}
@@ -56,8 +56,15 @@ const selectIconContainerStyles = ({ iconGap }) => ({
56
56
  * All accessibility props set on this component will be applied to the outer container.
57
57
  */
58
58
  const Feedback = forwardRef(
59
- ({ title, children, id, validation, tokens, variant, icon, ...rest }, ref) => {
60
- const themeTokens = useThemeTokens('Feedback', tokens, { ...variant, validation, icon })
59
+ (
60
+ { title, children, id, validation, tokens, variant, showFeedbackIcon = false, ...rest },
61
+ ref
62
+ ) => {
63
+ const themeTokens = useThemeTokens('Feedback', tokens, {
64
+ ...variant,
65
+ validation,
66
+ icon: showFeedbackIcon
67
+ })
61
68
  const { space } = themeTokens
62
69
 
63
70
  const { icon: IconComponent } = themeTokens
@@ -114,7 +121,8 @@ Feedback.propTypes = {
114
121
  /** @ignore */
115
122
  id: PropTypes.string,
116
123
  tokens: getTokensPropType('Feedback'),
117
- variant: variantProp.propType
124
+ variant: variantProp.propType,
125
+ showFeedbackIcon: PropTypes.bool
118
126
  }
119
127
 
120
128
  export default Feedback
@@ -55,7 +55,12 @@ const Fieldset = forwardRef(
55
55
  />
56
56
  )
57
57
  const feedbackContent = feedback && (
58
- <Feedback id={feedbackId} title={feedback} validation={validation} icon={showIcon} />
58
+ <Feedback
59
+ id={feedbackId}
60
+ title={feedback}
61
+ validation={validation}
62
+ showFeedbackIcon={showIcon}
63
+ />
59
64
  )
60
65
 
61
66
  // Some accessibility patterns depend on elements being direct children, e.g. fieldset -> legend,
@@ -91,6 +91,7 @@ PressableListItemBase.propTypes = {
91
91
  ...withLinkRouter.propTypes,
92
92
  href: PropTypes.string,
93
93
  onPress: PropTypes.func,
94
+ // eslint-disable-next-line react/forbid-prop-types
94
95
  tokens: PropTypes.any,
95
96
  icon: PropTypes.elementType,
96
97
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
@@ -116,17 +116,15 @@ const RadioGroup = forwardRef(
116
116
  }
117
117
 
118
118
  const radios = items.map(
119
- ({ label, id, onChange: itemOnChange, ref: itemRef, ...itemRest }, index) => {
119
+ ({ label, id, onChange: itemOnChange, ref: itemRef, description, ...itemRest }, index) => {
120
120
  const radioId = id || `Radio[${index}]`
121
121
  const isChecked = currentValue === radioId
122
122
  const handleChange = (newCheckedState, event) => {
123
123
  if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event)
124
124
  if (newCheckedState) setValue(radioId, event)
125
125
  }
126
-
127
126
  return (
128
127
  <Radio
129
- error={validation === 'error'}
130
128
  ref={itemRef}
131
129
  key={radioId}
132
130
  id={radioId}
@@ -137,6 +135,7 @@ const RadioGroup = forwardRef(
137
135
  name={inputGroupName}
138
136
  tokens={radioTokens}
139
137
  variant={variant}
138
+ description={description}
140
139
  {...selectItemProps(itemRest)}
141
140
  />
142
141
  )
@@ -156,6 +155,8 @@ const RadioGroup = forwardRef(
156
155
  feedback={feedback}
157
156
  inactive={inactive}
158
157
  validation={validation}
158
+ showIcon
159
+ showErrorBorder
159
160
  accessibilityRole="radiogroup"
160
161
  {...selectProps(rest)}
161
162
  >
@@ -193,6 +194,7 @@ RadioGroup.propTypes = {
193
194
  label: PropTypes.string,
194
195
  id: PropTypes.string,
195
196
  onChange: PropTypes.func,
197
+ description: PropTypes.string,
196
198
  ref: ABBPropTypes.ref()
197
199
  })
198
200
  ),