@telus-uds/components-base 1.24.0 → 1.24.1

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,20 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Thu, 15 Dec 2022 23:06:31 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Jan 2023 03:41:27 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.24.1
8
+
9
+ Thu, 05 Jan 2023 03:41:27 GMT
10
+
11
+ ### Patches
12
+
13
+ - fix the list with headings in docs and storybook (mauricio.batresmontejo@telus.com)
14
+
7
15
  ## 1.24.0
8
16
 
9
- Thu, 15 Dec 2022 23:06:31 GMT
17
+ Thu, 15 Dec 2022 23:08:41 GMT
10
18
 
11
19
  ### Minor changes
12
20
 
@@ -3463,17 +3463,6 @@
3463
3463
  "docs": {
3464
3464
  "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.",
3465
3465
  "props": {
3466
- "showFeedbackIcon": {
3467
- "defaultValue": {
3468
- "value": "false",
3469
- "computed": false
3470
- },
3471
- "type": {
3472
- "name": "bool"
3473
- },
3474
- "required": false,
3475
- "description": ""
3476
- },
3477
3466
  "title": {
3478
3467
  "type": {
3479
3468
  "name": "string"
@@ -105,12 +105,10 @@ const Feedback = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
105
105
  validation,
106
106
  tokens,
107
107
  variant,
108
- showFeedbackIcon = false,
109
108
  ...rest
110
109
  } = _ref5;
111
110
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Feedback', tokens, { ...variant,
112
- validation,
113
- icon: showFeedbackIcon
111
+ validation
114
112
  });
115
113
  const {
116
114
  space
@@ -176,8 +174,7 @@ Feedback.propTypes = { ...selectedSystemPropTypes,
176
174
  /** @ignore */
177
175
  id: _propTypes.default.string,
178
176
  tokens: (0, _utils.getTokensPropType)('Feedback'),
179
- variant: _utils.variantProp.propType,
180
- showFeedbackIcon: _propTypes.default.bool
177
+ variant: _utils.variantProp.propType
181
178
  };
182
179
  var _default = Feedback;
183
180
  exports.default = _default;
@@ -78,7 +78,9 @@ const Fieldset = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
78
78
  id: feedbackId,
79
79
  title: feedback,
80
80
  validation: validation,
81
- showFeedbackIcon: showIcon
81
+ variant: {
82
+ icon: showIcon
83
+ }
82
84
  }); // Some accessibility patterns depend on elements being direct children, e.g. fieldset -> legend,
83
85
  // and on MacOS voiceover, radiogroup -> radio. To allow elements to be direct children of the
84
86
  // fieldset as much as possible, but also allow different spacing within content and between
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _ListItemBase = _interopRequireDefault(require("./ListItemBase"));
11
11
 
12
+ var _Typography = _interopRequireDefault(require("../Typography"));
13
+
12
14
  var _ThemeProvider = require("../ThemeProvider");
13
15
 
14
16
  var _utils = require("../utils");
@@ -29,14 +31,20 @@ const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
29
31
  tokens,
30
32
  variant,
31
33
  children,
34
+ title,
32
35
  ...listItemProps
33
36
  } = _ref;
34
37
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('List', tokens, variant);
35
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemBase.default, {
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListItemBase.default, {
36
39
  tokens: themeTokens,
37
40
  ref: ref,
38
41
  ...listItemProps,
39
- children: children
42
+ children: [Boolean(title) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
43
+ variant: {
44
+ size: 'h4'
45
+ },
46
+ children: title
47
+ }), children]
40
48
  });
41
49
  });
42
50
  ListItem.displayName = 'ListItem';
@@ -168,8 +168,8 @@ const RadioGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
168
168
  feedback: feedback,
169
169
  inactive: inactive,
170
170
  validation: validation,
171
- showIcon: true,
172
171
  showErrorBorder: true,
172
+ showIcon: true,
173
173
  accessibilityRole: "radiogroup",
174
174
  ...selectProps(rest),
175
175
  children: (0, _StackView.getStackedContent)(radios, {
@@ -84,12 +84,10 @@ const Feedback = /*#__PURE__*/forwardRef((_ref5, ref) => {
84
84
  validation,
85
85
  tokens,
86
86
  variant,
87
- showFeedbackIcon = false,
88
87
  ...rest
89
88
  } = _ref5;
90
89
  const themeTokens = useThemeTokens('Feedback', tokens, { ...variant,
91
- validation,
92
- icon: showFeedbackIcon
90
+ validation
93
91
  });
94
92
  const {
95
93
  space
@@ -155,8 +153,7 @@ Feedback.propTypes = { ...selectedSystemPropTypes,
155
153
  /** @ignore */
156
154
  id: PropTypes.string,
157
155
  tokens: getTokensPropType('Feedback'),
158
- variant: variantProp.propType,
159
- showFeedbackIcon: PropTypes.bool
156
+ variant: variantProp.propType
160
157
  };
161
158
  export default Feedback;
162
159
  const staticStyles = StyleSheet.create({
@@ -59,7 +59,9 @@ const Fieldset = /*#__PURE__*/forwardRef((_ref, ref) => {
59
59
  id: feedbackId,
60
60
  title: feedback,
61
61
  validation: validation,
62
- showFeedbackIcon: showIcon
62
+ variant: {
63
+ icon: showIcon
64
+ }
63
65
  }); // Some accessibility patterns depend on elements being direct children, e.g. fieldset -> legend,
64
66
  // and on MacOS voiceover, radiogroup -> radio. To allow elements to be direct children of the
65
67
  // fieldset as much as possible, but also allow different spacing within content and between
@@ -1,5 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import ListItemBase from './ListItemBase';
3
+ import Typography from '../Typography';
3
4
  import { useThemeTokens } from '../ThemeProvider';
4
5
  import { variantProp } from '../utils';
5
6
  /**
@@ -7,19 +8,26 @@ import { variantProp } from '../utils';
7
8
  */
8
9
 
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
12
  const ListItem = /*#__PURE__*/forwardRef((_ref, ref) => {
11
13
  let {
12
14
  tokens,
13
15
  variant,
14
16
  children,
17
+ title,
15
18
  ...listItemProps
16
19
  } = _ref;
17
20
  const themeTokens = useThemeTokens('List', tokens, variant);
18
- return /*#__PURE__*/_jsx(ListItemBase, {
21
+ return /*#__PURE__*/_jsxs(ListItemBase, {
19
22
  tokens: themeTokens,
20
23
  ref: ref,
21
24
  ...listItemProps,
22
- children: children
25
+ children: [Boolean(title) && /*#__PURE__*/_jsx(Typography, {
26
+ variant: {
27
+ size: 'h4'
28
+ },
29
+ children: title
30
+ }), children]
23
31
  });
24
32
  });
25
33
  ListItem.displayName = 'ListItem';
@@ -145,8 +145,8 @@ const RadioGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
145
145
  feedback: feedback,
146
146
  inactive: inactive,
147
147
  validation: validation,
148
- showIcon: true,
149
148
  showErrorBorder: true,
149
+ showIcon: true,
150
150
  accessibilityRole: "radiogroup",
151
151
  ...selectProps(rest),
152
152
  children: getStackedContent(radios, {
package/package.json CHANGED
@@ -70,5 +70,5 @@
70
70
  "standard-engine": {
71
71
  "skip": true
72
72
  },
73
- "version": "1.24.0"
73
+ "version": "1.24.1"
74
74
  }
@@ -56,14 +56,10 @@ 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
- (
60
- { title, children, id, validation, tokens, variant, showFeedbackIcon = false, ...rest },
61
- ref
62
- ) => {
59
+ ({ title, children, id, validation, tokens, variant, ...rest }, ref) => {
63
60
  const themeTokens = useThemeTokens('Feedback', tokens, {
64
61
  ...variant,
65
- validation,
66
- icon: showFeedbackIcon
62
+ validation
67
63
  })
68
64
  const { space } = themeTokens
69
65
 
@@ -121,8 +117,7 @@ Feedback.propTypes = {
121
117
  /** @ignore */
122
118
  id: PropTypes.string,
123
119
  tokens: getTokensPropType('Feedback'),
124
- variant: variantProp.propType,
125
- showFeedbackIcon: PropTypes.bool
120
+ variant: variantProp.propType
126
121
  }
127
122
 
128
123
  export default Feedback
@@ -59,7 +59,7 @@ const Fieldset = forwardRef(
59
59
  id={feedbackId}
60
60
  title={feedback}
61
61
  validation={validation}
62
- showFeedbackIcon={showIcon}
62
+ variant={{ icon: showIcon }}
63
63
  />
64
64
  )
65
65
 
@@ -1,16 +1,18 @@
1
1
  import React, { forwardRef } from 'react'
2
2
 
3
3
  import ListItemBase from './ListItemBase'
4
+ import Typography from '../Typography'
4
5
  import { useThemeTokens } from '../ThemeProvider'
5
6
  import { variantProp } from '../utils'
6
7
 
7
8
  /**
8
9
  * ListItem is responsible for rendering icon or a bullet as side item
9
10
  */
10
- const ListItem = forwardRef(({ tokens, variant, children, ...listItemProps }, ref) => {
11
+ const ListItem = forwardRef(({ tokens, variant, children, title, ...listItemProps }, ref) => {
11
12
  const themeTokens = useThemeTokens('List', tokens, variant)
12
13
  return (
13
14
  <ListItemBase tokens={themeTokens} ref={ref} {...listItemProps}>
15
+ {Boolean(title) && <Typography variant={{ size: 'h4' }}>{title}</Typography>}
14
16
  {children}
15
17
  </ListItemBase>
16
18
  )
@@ -155,8 +155,8 @@ const RadioGroup = forwardRef(
155
155
  feedback={feedback}
156
156
  inactive={inactive}
157
157
  validation={validation}
158
- showIcon
159
158
  showErrorBorder
159
+ showIcon
160
160
  accessibilityRole="radiogroup"
161
161
  {...selectProps(rest)}
162
162
  >