@telus-uds/components-base 1.88.0 → 1.90.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/lib/Button/ButtonBase.js +1 -1
  3. package/lib/Carousel/Carousel.js +2 -6
  4. package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +1 -0
  5. package/lib/Carousel/dictionary.js +6 -2
  6. package/lib/InputSupports/InputSupports.js +7 -1
  7. package/lib/Status/Status.js +168 -0
  8. package/lib/Status/index.js +10 -0
  9. package/lib/index.js +8 -0
  10. package/lib/utils/index.js +9 -1
  11. package/lib/utils/props/inputSupportsProps.js +12 -0
  12. package/lib/utils/transformGradient.js +23 -0
  13. package/lib-module/Button/ButtonBase.js +1 -1
  14. package/lib-module/Carousel/Carousel.js +2 -6
  15. package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +1 -0
  16. package/lib-module/Carousel/dictionary.js +6 -2
  17. package/lib-module/InputSupports/InputSupports.js +7 -1
  18. package/lib-module/Status/Status.js +162 -0
  19. package/lib-module/Status/index.js +2 -0
  20. package/lib-module/index.js +1 -0
  21. package/lib-module/utils/index.js +2 -1
  22. package/lib-module/utils/props/inputSupportsProps.js +12 -0
  23. package/lib-module/utils/transformGradient.js +15 -0
  24. package/package.json +2 -2
  25. package/src/Button/ButtonBase.jsx +1 -1
  26. package/src/Carousel/Carousel.jsx +4 -6
  27. package/src/Carousel/CarouselTabs/CarouselTabsPanel.jsx +7 -1
  28. package/src/Carousel/dictionary.js +6 -2
  29. package/src/InputSupports/InputSupports.jsx +6 -0
  30. package/src/Status/Status.jsx +142 -0
  31. package/src/Status/index.js +3 -0
  32. package/src/index.js +1 -0
  33. package/src/utils/index.js +1 -0
  34. package/src/utils/props/inputSupportsProps.js +21 -1
  35. package/src/utils/transformGradient.js +17 -0
  36. package/types/Checkbox.d.ts +47 -0
  37. package/types/CheckboxCardGroup.d.ts +72 -0
  38. package/types/index.d.ts +10 -0
package/CHANGELOG.md CHANGED
@@ -1,12 +1,41 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Thu, 04 Jul 2024 19:28:59 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 26 Jul 2024 21:17:56 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.90.0
8
+
9
+ Fri, 26 Jul 2024 21:17:56 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Status`: add component (guillermo.peitzner@telus.com)
14
+ - Bump @telus-uds/system-theme-tokens to v2.60.0
15
+
16
+ ### Patches
17
+
18
+ - Conditionally add iconSpace on mobile if we have an icon to render (jaime.tuyuc@telus.com)
19
+ - `Carousel`: fix accessibility issue, remove unused accessibilityValue (<tony.eng@telus.com>)
20
+
21
+ ## 1.89.0
22
+
23
+ Fri, 19 Jul 2024 18:20:50 GMT
24
+
25
+ ### Minor changes
26
+
27
+ - `PriceLockup`: Add `micro` option to `size` variant (tim.hysniu@telus.com)
28
+ - Add type definitions for `Checkbox` and `CheckboxCardGroup` (evander.owusu@telus.com)
29
+
30
+ ### Patches
31
+
32
+ - `Carousel`: add accessibilityLabel to autoplay button to resolve accessibility issue (<tony.eng@telus.com>)
33
+ - `TextInput`: make feedback tokens and props work (guillermo.peitzner@telus.com)
34
+ - `CarouselTabsPanel`: add accessibilityRole to resolve accessibility issue (<tony.eng@telus.com>)
35
+
7
36
  ## 1.88.0
8
37
 
9
- Thu, 04 Jul 2024 19:28:59 GMT
38
+ Thu, 04 Jul 2024 19:35:15 GMT
10
39
 
11
40
  ### Minor changes
12
41
 
@@ -306,7 +306,7 @@ const ButtonBase = /*#__PURE__*/_react.default.forwardRef((_ref11, ref) => {
306
306
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.IconText, {
307
307
  icon: IconComponent,
308
308
  iconPosition: iconPosition,
309
- space: iconSpace,
309
+ space: icon ? iconSpace : 0,
310
310
  iconProps: {
311
311
  ...iconProps,
312
312
  tokens: iconTokens
@@ -552,12 +552,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
552
552
  const systemProps = selectProps({
553
553
  ...rest,
554
554
  accessibilityRole,
555
- accessibilityLabel,
556
- accessibilityValue: {
557
- min: 1,
558
- max: childrenArray.length,
559
- now: activeIndex + 1
560
- }
555
+ accessibilityLabel
561
556
  });
562
557
 
563
558
  // If container isn't used for focus, give it a label of title if none is passed in,
@@ -610,6 +605,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
610
605
  })],
611
606
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
612
607
  icon: isCarouselPlaying ? pauseIcon : playIcon,
608
+ accessibilityLabel: isCarouselPlaying ? getCopy('pauseButtonLabel') : getCopy('playButtonLabel'),
613
609
  variant: previousNextIconButtonVariants,
614
610
  onPress: onAnimationControlButtonPress
615
611
  })
@@ -50,6 +50,7 @@ const CarouselTabsPanel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
50
50
  variant: dividerVariant
51
51
  },
52
52
  ref: ref,
53
+ accessibilityRole: "tablist",
53
54
  children: items.map((_ref2, index) => {
54
55
  let {
55
56
  title,
@@ -11,7 +11,9 @@ var _default = {
11
11
  iconButtonLabel: 'Show %{itemLabel} %{targetStep} of %{stepCount}',
12
12
  stepLabel: '%{itemLabel} %{stepNumber}',
13
13
  stepTrackerLabel: '%{itemLabel} %{stepNumber} of %{stepCount}',
14
- skipLink: 'Skip %{title}'
14
+ skipLink: 'Skip %{title}',
15
+ playButtonLabel: 'Play',
16
+ pauseButtonLabel: 'Pause'
15
17
  },
16
18
  fr: {
17
19
  // French translations
@@ -19,7 +21,9 @@ var _default = {
19
21
  iconButtonLabel: 'Montrer %{itemLabel} %{targetStep} de %{stepCount}',
20
22
  stepLabel: '%{itemLabel} %{stepNumber}',
21
23
  stepTrackerLabel: '%{itemLabel} %{stepNumber} de %{stepCount}',
22
- skipLink: 'Passer %{title}'
24
+ skipLink: 'Passer %{title}',
25
+ playButtonLabel: 'Lancer',
26
+ pauseButtonLabel: 'Pauser'
23
27
  }
24
28
  };
25
29
  exports.default = _default;
@@ -23,6 +23,7 @@ const InputSupports = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
23
23
  hintPosition = 'inline',
24
24
  feedback,
25
25
  feedbackTokens = {},
26
+ feedbackProps = {},
26
27
  tooltip,
27
28
  validation,
28
29
  nativeID
@@ -60,7 +61,8 @@ const InputSupports = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
60
61
  id: feedbackId,
61
62
  title: feedback,
62
63
  validation: validation,
63
- tokens: feedbackTokens
64
+ tokens: feedbackTokens,
65
+ ...feedbackProps
64
66
  }) : null]
65
67
  });
66
68
  });
@@ -92,6 +94,10 @@ InputSupports.propTypes = {
92
94
  * Additional tokens to override the default feedback tokens.
93
95
  */
94
96
  feedbackTokens: (0, _utils.getTokensPropType)('Feedback'),
97
+ /**
98
+ * Additional props to pass to the `Feedback` component.
99
+ */
100
+ feedbackProps: _propTypes.default.object,
95
101
  /**
96
102
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
97
103
  */
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
9
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
10
+ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _ThemeProvider = require("../ThemeProvider");
13
+ var _utils = require("../utils");
14
+ var _Icon = _interopRequireDefault(require("../Icon"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
18
+ const selectContainerStyles = _ref => {
19
+ let {
20
+ backgroundColor,
21
+ backgroundGradient,
22
+ borderColor,
23
+ borderRadius,
24
+ borderWidth,
25
+ paddingBottom,
26
+ paddingLeft,
27
+ paddingRight,
28
+ paddingTop
29
+ } = _ref;
30
+ const styles = {
31
+ borderColor,
32
+ borderRadius,
33
+ borderWidth,
34
+ paddingBottom,
35
+ paddingLeft,
36
+ paddingRight,
37
+ paddingTop
38
+ };
39
+ if (backgroundGradient) {
40
+ if (_Platform.default.OS === 'web') {
41
+ styles.background = (0, _utils.transformGradient)(backgroundGradient);
42
+ } else {
43
+ const {
44
+ stops: [stopOne, stopTwo]
45
+ } = backgroundGradient;
46
+ styles.gradient = {};
47
+ styles.gradient.start = {
48
+ x: 0,
49
+ y: 0
50
+ };
51
+ styles.gradient.end = {
52
+ x: 1,
53
+ y: 1
54
+ };
55
+ styles.gradient.colors = [stopOne.color, stopTwo.color];
56
+ }
57
+ } else {
58
+ styles.backgroundColor = backgroundColor;
59
+ }
60
+ return styles;
61
+ };
62
+ const selectIconProps = _ref2 => {
63
+ let {
64
+ icon,
65
+ iconColor
66
+ } = _ref2;
67
+ return {
68
+ icon,
69
+ tokens: {
70
+ color: iconColor
71
+ },
72
+ variant: {
73
+ size: 'small'
74
+ }
75
+ };
76
+ };
77
+ const selectTextStyles = _ref3 => {
78
+ let {
79
+ textColor,
80
+ textLineHeight,
81
+ fontName,
82
+ fontSize,
83
+ fontWeight
84
+ } = _ref3;
85
+ return (0, _ThemeProvider.applyTextStyles)({
86
+ fontColor: textColor,
87
+ fontName,
88
+ fontSize,
89
+ fontWeight,
90
+ lineHeight: _Platform.default.OS === 'web' ? textLineHeight : textLineHeight * 1.2,
91
+ marginLeft: 8
92
+ });
93
+ };
94
+
95
+ /**
96
+ * Status component displays a status indicator with optional custom gradient.
97
+ *
98
+ * @component
99
+ * @param {object} tokens - The tokens for customizing the status component.
100
+ * @param {string} variant - The variant of the status component.
101
+ * @param {ReactNode} children - The content to be displayed inside the status component.
102
+ * @param {function} customGradient - The custom gradient function for the status component.
103
+ * @param {object} rest - The rest of the props to be applied to the status component.
104
+ * @param {React.Ref} ref - The ref to be applied to the status component.
105
+ * @returns {ReactNode} The rendered status component.
106
+ */
107
+ const Status = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
108
+ let {
109
+ tokens,
110
+ variant,
111
+ children,
112
+ customGradient,
113
+ ...rest
114
+ } = _ref4;
115
+ const themeTokens = (0, _ThemeProvider.useThemeTokens)('Status', tokens, variant);
116
+ const containerStyles = {
117
+ ...selectContainerStyles(themeTokens),
118
+ ...staticStyles.container
119
+ };
120
+ let content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
121
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
122
+ ...selectIconProps(themeTokens)
123
+ }), (0, _utils.wrapStringsInText)(children, {
124
+ style: selectTextStyles(themeTokens)
125
+ })]
126
+ });
127
+ if (typeof customGradient === 'function') {
128
+ content = customGradient(containerStyles.gradient, containerStyles, content);
129
+ }
130
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
131
+ ref: ref,
132
+ style: containerStyles,
133
+ ...selectProps(rest),
134
+ children: content
135
+ });
136
+ });
137
+ Status.displayName = 'Status';
138
+ Status.propTypes = {
139
+ ...selectedSystemPropTypes,
140
+ tokens: (0, _utils.getTokensPropType)('Status'),
141
+ variant: _utils.variantProp.propType,
142
+ /**
143
+ * The content to be displayed inside the status component.
144
+ */
145
+ children: _propTypes.default.node.isRequired,
146
+ /**
147
+ * The custom gradient function for the status component.
148
+ */
149
+ customGradient: _propTypes.default.func
150
+ };
151
+ const staticStyles = _StyleSheet.default.create({
152
+ container: {
153
+ flexDirection: 'row',
154
+ alignItems: 'center',
155
+ ..._Platform.default.select({
156
+ web: {
157
+ display: 'inline-flex',
158
+ width: 'fit-content'
159
+ },
160
+ default: {
161
+ display: 'flex',
162
+ width: 'auto'
163
+ }
164
+ })
165
+ }
166
+ });
167
+ var _default = Status;
168
+ exports.default = _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _Status = _interopRequireDefault(require("./Status"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var _default = _Status.default;
10
+ exports.default = _default;
package/lib/index.js CHANGED
@@ -54,6 +54,7 @@ var _exportNames = {
54
54
  SkipLink: true,
55
55
  Spacer: true,
56
56
  StackView: true,
57
+ Status: true,
57
58
  StepTracker: true,
58
59
  Tabs: true,
59
60
  Tags: true,
@@ -398,6 +399,12 @@ Object.defineProperty(exports, "StackView", {
398
399
  return _StackView.default;
399
400
  }
400
401
  });
402
+ Object.defineProperty(exports, "Status", {
403
+ enumerable: true,
404
+ get: function () {
405
+ return _Status.default;
406
+ }
407
+ });
401
408
  Object.defineProperty(exports, "StepTracker", {
402
409
  enumerable: true,
403
410
  get: function () {
@@ -678,6 +685,7 @@ Object.keys(_StackView).forEach(function (key) {
678
685
  }
679
686
  });
680
687
  });
688
+ var _Status = _interopRequireDefault(require("./Status"));
681
689
  var _StepTracker = _interopRequireDefault(require("./StepTracker"));
682
690
  var _Tabs = _interopRequireDefault(require("./Tabs"));
683
691
  var _Tags = _interopRequireDefault(require("./Tags"));
@@ -16,7 +16,8 @@ var _exportNames = {
16
16
  withLinkRouter: true,
17
17
  containUniqueFields: true,
18
18
  BaseView: true,
19
- htmlAttrs: true
19
+ htmlAttrs: true,
20
+ transformGradient: true
20
21
  };
21
22
  Object.defineProperty(exports, "BaseView", {
22
23
  enumerable: true,
@@ -42,6 +43,12 @@ Object.defineProperty(exports, "info", {
42
43
  return _info.default;
43
44
  }
44
45
  });
46
+ Object.defineProperty(exports, "transformGradient", {
47
+ enumerable: true,
48
+ get: function () {
49
+ return _transformGradient.transformGradient;
50
+ }
51
+ });
45
52
  Object.defineProperty(exports, "useCopy", {
46
53
  enumerable: true,
47
54
  get: function () {
@@ -216,6 +223,7 @@ Object.keys(_ssr).forEach(function (key) {
216
223
  var _containUniqueFields = _interopRequireDefault(require("./containUniqueFields"));
217
224
  var _BaseView = _interopRequireDefault(require("./BaseView"));
218
225
  var _htmlAttrs = _interopRequireDefault(require("./htmlAttrs"));
226
+ var _transformGradient = require("./transformGradient");
219
227
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
220
228
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
221
229
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -29,6 +29,14 @@ var _default = {
29
29
  * Visual variant is determined based on the `validation` prop.
30
30
  */
31
31
  feedback: _propTypes.default.string,
32
+ /**
33
+ * Tokens to be passed to the feedback component.
34
+ */
35
+ feedbackTokens: _propTypes.default.object,
36
+ /**
37
+ * Props to be passed to the feedback component.
38
+ */
39
+ feedbackProps: _propTypes.default.object,
32
40
  /**
33
41
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
34
42
  */
@@ -45,6 +53,8 @@ var _default = {
45
53
  hint,
46
54
  hintPosition,
47
55
  feedback,
56
+ feedbackTokens,
57
+ feedbackProps,
48
58
  tooltip,
49
59
  validation
50
60
  } = _ref;
@@ -55,6 +65,8 @@ var _default = {
55
65
  hint,
56
66
  hintPosition,
57
67
  feedback,
68
+ feedbackTokens,
69
+ feedbackProps,
58
70
  tooltip,
59
71
  validation
60
72
  }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.transformGradient = exports.default = void 0;
7
+ /**
8
+ * Transforms a gradient object into a CSS gradient string.
9
+ *
10
+ * @param {Object} gradient - The gradient object to transform.
11
+ * @param {string} gradient.type - The type of gradient (linear or radial).
12
+ * @param {number} gradient.angle - The angle of the linear gradient in degrees.
13
+ * @param {Array} gradient.stops - An array of gradient stops.
14
+ * @param {string} gradient.stops[].color - The color of the gradient stop.
15
+ * @param {number} gradient.stops[].stop - The position of the gradient stop as a percentage.
16
+ * @returns {string} The CSS gradient string.
17
+ */
18
+ const transformGradient = gradient => `${gradient.type}-gradient(${gradient.angle}deg, ${gradient.stops[0].color} ${gradient.stops[0].stop * 100}%, ${gradient.stops[1].color} ${gradient.stops[1].stop * 100}%)`;
19
+ exports.transformGradient = transformGradient;
20
+ var _default = {
21
+ transformGradient
22
+ };
23
+ exports.default = _default;
@@ -299,7 +299,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef((_ref11, ref) => {
299
299
  children: /*#__PURE__*/_jsx(IconText, {
300
300
  icon: IconComponent,
301
301
  iconPosition: iconPosition,
302
- space: iconSpace,
302
+ space: icon ? iconSpace : 0,
303
303
  iconProps: {
304
304
  ...iconProps,
305
305
  tokens: iconTokens
@@ -546,12 +546,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
546
546
  const systemProps = selectProps({
547
547
  ...rest,
548
548
  accessibilityRole,
549
- accessibilityLabel,
550
- accessibilityValue: {
551
- min: 1,
552
- max: childrenArray.length,
553
- now: activeIndex + 1
554
- }
549
+ accessibilityLabel
555
550
  });
556
551
 
557
552
  // If container isn't used for focus, give it a label of title if none is passed in,
@@ -604,6 +599,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
604
599
  })],
605
600
  children: /*#__PURE__*/_jsx(IconButton, {
606
601
  icon: isCarouselPlaying ? pauseIcon : playIcon,
602
+ accessibilityLabel: isCarouselPlaying ? getCopy('pauseButtonLabel') : getCopy('playButtonLabel'),
607
603
  variant: previousNextIconButtonVariants,
608
604
  onPress: onAnimationControlButtonPress
609
605
  })
@@ -44,6 +44,7 @@ const CarouselTabsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
44
44
  variant: dividerVariant
45
45
  },
46
46
  ref: ref,
47
+ accessibilityRole: "tablist",
47
48
  children: items.map((_ref2, index) => {
48
49
  let {
49
50
  title,
@@ -5,7 +5,9 @@ export default {
5
5
  iconButtonLabel: 'Show %{itemLabel} %{targetStep} of %{stepCount}',
6
6
  stepLabel: '%{itemLabel} %{stepNumber}',
7
7
  stepTrackerLabel: '%{itemLabel} %{stepNumber} of %{stepCount}',
8
- skipLink: 'Skip %{title}'
8
+ skipLink: 'Skip %{title}',
9
+ playButtonLabel: 'Play',
10
+ pauseButtonLabel: 'Pause'
9
11
  },
10
12
  fr: {
11
13
  // French translations
@@ -13,6 +15,8 @@ export default {
13
15
  iconButtonLabel: 'Montrer %{itemLabel} %{targetStep} de %{stepCount}',
14
16
  stepLabel: '%{itemLabel} %{stepNumber}',
15
17
  stepTrackerLabel: '%{itemLabel} %{stepNumber} de %{stepCount}',
16
- skipLink: 'Passer %{title}'
18
+ skipLink: 'Passer %{title}',
19
+ playButtonLabel: 'Lancer',
20
+ pauseButtonLabel: 'Pauser'
17
21
  }
18
22
  };
@@ -17,6 +17,7 @@ const InputSupports = /*#__PURE__*/React.forwardRef((_ref, ref) => {
17
17
  hintPosition = 'inline',
18
18
  feedback,
19
19
  feedbackTokens = {},
20
+ feedbackProps = {},
20
21
  tooltip,
21
22
  validation,
22
23
  nativeID
@@ -54,7 +55,8 @@ const InputSupports = /*#__PURE__*/React.forwardRef((_ref, ref) => {
54
55
  id: feedbackId,
55
56
  title: feedback,
56
57
  validation: validation,
57
- tokens: feedbackTokens
58
+ tokens: feedbackTokens,
59
+ ...feedbackProps
58
60
  }) : null]
59
61
  });
60
62
  });
@@ -86,6 +88,10 @@ InputSupports.propTypes = {
86
88
  * Additional tokens to override the default feedback tokens.
87
89
  */
88
90
  feedbackTokens: getTokensPropType('Feedback'),
91
+ /**
92
+ * Additional props to pass to the `Feedback` component.
93
+ */
94
+ feedbackProps: PropTypes.object,
89
95
  /**
90
96
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
91
97
  */
@@ -0,0 +1,162 @@
1
+ import React from 'react';
2
+ import Platform from "react-native-web/dist/exports/Platform";
3
+ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
4
+ import View from "react-native-web/dist/exports/View";
5
+ import PropTypes from 'prop-types';
6
+ import { useThemeTokens, applyTextStyles } from '../ThemeProvider';
7
+ import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps, wrapStringsInText, transformGradient } from '../utils';
8
+ import Icon from '../Icon';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
13
+ const selectContainerStyles = _ref => {
14
+ let {
15
+ backgroundColor,
16
+ backgroundGradient,
17
+ borderColor,
18
+ borderRadius,
19
+ borderWidth,
20
+ paddingBottom,
21
+ paddingLeft,
22
+ paddingRight,
23
+ paddingTop
24
+ } = _ref;
25
+ const styles = {
26
+ borderColor,
27
+ borderRadius,
28
+ borderWidth,
29
+ paddingBottom,
30
+ paddingLeft,
31
+ paddingRight,
32
+ paddingTop
33
+ };
34
+ if (backgroundGradient) {
35
+ if (Platform.OS === 'web') {
36
+ styles.background = transformGradient(backgroundGradient);
37
+ } else {
38
+ const {
39
+ stops: [stopOne, stopTwo]
40
+ } = backgroundGradient;
41
+ styles.gradient = {};
42
+ styles.gradient.start = {
43
+ x: 0,
44
+ y: 0
45
+ };
46
+ styles.gradient.end = {
47
+ x: 1,
48
+ y: 1
49
+ };
50
+ styles.gradient.colors = [stopOne.color, stopTwo.color];
51
+ }
52
+ } else {
53
+ styles.backgroundColor = backgroundColor;
54
+ }
55
+ return styles;
56
+ };
57
+ const selectIconProps = _ref2 => {
58
+ let {
59
+ icon,
60
+ iconColor
61
+ } = _ref2;
62
+ return {
63
+ icon,
64
+ tokens: {
65
+ color: iconColor
66
+ },
67
+ variant: {
68
+ size: 'small'
69
+ }
70
+ };
71
+ };
72
+ const selectTextStyles = _ref3 => {
73
+ let {
74
+ textColor,
75
+ textLineHeight,
76
+ fontName,
77
+ fontSize,
78
+ fontWeight
79
+ } = _ref3;
80
+ return applyTextStyles({
81
+ fontColor: textColor,
82
+ fontName,
83
+ fontSize,
84
+ fontWeight,
85
+ lineHeight: Platform.OS === 'web' ? textLineHeight : textLineHeight * 1.2,
86
+ marginLeft: 8
87
+ });
88
+ };
89
+
90
+ /**
91
+ * Status component displays a status indicator with optional custom gradient.
92
+ *
93
+ * @component
94
+ * @param {object} tokens - The tokens for customizing the status component.
95
+ * @param {string} variant - The variant of the status component.
96
+ * @param {ReactNode} children - The content to be displayed inside the status component.
97
+ * @param {function} customGradient - The custom gradient function for the status component.
98
+ * @param {object} rest - The rest of the props to be applied to the status component.
99
+ * @param {React.Ref} ref - The ref to be applied to the status component.
100
+ * @returns {ReactNode} The rendered status component.
101
+ */
102
+ const Status = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
103
+ let {
104
+ tokens,
105
+ variant,
106
+ children,
107
+ customGradient,
108
+ ...rest
109
+ } = _ref4;
110
+ const themeTokens = useThemeTokens('Status', tokens, variant);
111
+ const containerStyles = {
112
+ ...selectContainerStyles(themeTokens),
113
+ ...staticStyles.container
114
+ };
115
+ let content = /*#__PURE__*/_jsxs(_Fragment, {
116
+ children: [/*#__PURE__*/_jsx(Icon, {
117
+ ...selectIconProps(themeTokens)
118
+ }), wrapStringsInText(children, {
119
+ style: selectTextStyles(themeTokens)
120
+ })]
121
+ });
122
+ if (typeof customGradient === 'function') {
123
+ content = customGradient(containerStyles.gradient, containerStyles, content);
124
+ }
125
+ return /*#__PURE__*/_jsx(View, {
126
+ ref: ref,
127
+ style: containerStyles,
128
+ ...selectProps(rest),
129
+ children: content
130
+ });
131
+ });
132
+ Status.displayName = 'Status';
133
+ Status.propTypes = {
134
+ ...selectedSystemPropTypes,
135
+ tokens: getTokensPropType('Status'),
136
+ variant: variantProp.propType,
137
+ /**
138
+ * The content to be displayed inside the status component.
139
+ */
140
+ children: PropTypes.node.isRequired,
141
+ /**
142
+ * The custom gradient function for the status component.
143
+ */
144
+ customGradient: PropTypes.func
145
+ };
146
+ const staticStyles = StyleSheet.create({
147
+ container: {
148
+ flexDirection: 'row',
149
+ alignItems: 'center',
150
+ ...Platform.select({
151
+ web: {
152
+ display: 'inline-flex',
153
+ width: 'fit-content'
154
+ },
155
+ default: {
156
+ display: 'flex',
157
+ width: 'auto'
158
+ }
159
+ })
160
+ }
161
+ });
162
+ export default Status;
@@ -0,0 +1,2 @@
1
+ import Status from './Status';
2
+ export default Status;
@@ -53,6 +53,7 @@ export { default as SkipLink } from './SkipLink';
53
53
  export { default as Spacer } from './Spacer';
54
54
  export { default as StackView } from './StackView';
55
55
  export * from './StackView';
56
+ export { default as Status } from './Status';
56
57
  export { default as StepTracker } from './StepTracker';
57
58
  export { default as Tabs } from './Tabs';
58
59
  export { default as Tags } from './Tags';
@@ -19,4 +19,5 @@ export { default as withLinkRouter } from './withLinkRouter';
19
19
  export * from './ssr';
20
20
  export { default as containUniqueFields } from './containUniqueFields';
21
21
  export { default as BaseView } from './BaseView';
22
- export { default as htmlAttrs } from './htmlAttrs';
22
+ export { default as htmlAttrs } from './htmlAttrs';
23
+ export { transformGradient } from './transformGradient';
@@ -22,6 +22,14 @@ export default {
22
22
  * Visual variant is determined based on the `validation` prop.
23
23
  */
24
24
  feedback: PropTypes.string,
25
+ /**
26
+ * Tokens to be passed to the feedback component.
27
+ */
28
+ feedbackTokens: PropTypes.object,
29
+ /**
30
+ * Props to be passed to the feedback component.
31
+ */
32
+ feedbackProps: PropTypes.object,
25
33
  /**
26
34
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
27
35
  */
@@ -38,6 +46,8 @@ export default {
38
46
  hint,
39
47
  hintPosition,
40
48
  feedback,
49
+ feedbackTokens,
50
+ feedbackProps,
41
51
  tooltip,
42
52
  validation
43
53
  } = _ref;
@@ -48,6 +58,8 @@ export default {
48
58
  hint,
49
59
  hintPosition,
50
60
  feedback,
61
+ feedbackTokens,
62
+ feedbackProps,
51
63
  tooltip,
52
64
  validation
53
65
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Transforms a gradient object into a CSS gradient string.
3
+ *
4
+ * @param {Object} gradient - The gradient object to transform.
5
+ * @param {string} gradient.type - The type of gradient (linear or radial).
6
+ * @param {number} gradient.angle - The angle of the linear gradient in degrees.
7
+ * @param {Array} gradient.stops - An array of gradient stops.
8
+ * @param {string} gradient.stops[].color - The color of the gradient stop.
9
+ * @param {number} gradient.stops[].stop - The position of the gradient stop as a percentage.
10
+ * @returns {string} The CSS gradient string.
11
+ */
12
+ export const transformGradient = gradient => `${gradient.type}-gradient(${gradient.angle}deg, ${gradient.stops[0].color} ${gradient.stops[0].stop * 100}%, ${gradient.stops[1].color} ${gradient.stops[1].stop * 100}%)`;
13
+ export default {
14
+ transformGradient
15
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@floating-ui/react-native": "^0.8.1",
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@telus-uds/system-constants": "^1.3.0",
14
- "@telus-uds/system-theme-tokens": "^2.59.0",
14
+ "@telus-uds/system-theme-tokens": "^2.60.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "css-mediaquery": "^0.1.2",
17
17
  "expo-linear-gradient": "^12.5.0",
@@ -85,6 +85,6 @@
85
85
  "standard-engine": {
86
86
  "skip": true
87
87
  },
88
- "version": "1.88.0",
88
+ "version": "1.90.0",
89
89
  "types": "types/index.d.ts"
90
90
  }
@@ -276,7 +276,7 @@ const ButtonBase = React.forwardRef(
276
276
  <IconText
277
277
  icon={IconComponent}
278
278
  iconPosition={iconPosition}
279
- space={iconSpace}
279
+ space={icon ? iconSpace : 0}
280
280
  iconProps={{ ...iconProps, tokens: iconTokens }}
281
281
  >
282
282
  {wrapStringsInText(
@@ -616,12 +616,7 @@ const Carousel = React.forwardRef(
616
616
  const systemProps = selectProps({
617
617
  ...rest,
618
618
  accessibilityRole,
619
- accessibilityLabel,
620
- accessibilityValue: {
621
- min: 1,
622
- max: childrenArray.length,
623
- now: activeIndex + 1
624
- }
619
+ accessibilityLabel
625
620
  })
626
621
 
627
622
  // If container isn't used for focus, give it a label of title if none is passed in,
@@ -687,6 +682,9 @@ const Carousel = React.forwardRef(
687
682
  >
688
683
  <IconButton
689
684
  icon={isCarouselPlaying ? pauseIcon : playIcon}
685
+ accessibilityLabel={
686
+ isCarouselPlaying ? getCopy('pauseButtonLabel') : getCopy('playButtonLabel')
687
+ }
690
688
  variant={previousNextIconButtonVariants}
691
689
  onPress={onAnimationControlButtonPress}
692
690
  />
@@ -32,7 +32,13 @@ const CarouselTabsPanel = React.forwardRef(({ items }, ref) => {
32
32
 
33
33
  return (
34
34
  <View style={selectTabPanelStyle()}>
35
- <StackView direction="row" space={3} divider={{ variant: dividerVariant }} ref={ref}>
35
+ <StackView
36
+ direction="row"
37
+ space={3}
38
+ divider={{ variant: dividerVariant }}
39
+ ref={ref}
40
+ accessibilityRole="tablist"
41
+ >
36
42
  {items.map(({ title, onPress, inverse, ...panelItemProps }, index) => {
37
43
  const selected = index === activeIndex
38
44
  const isNext = index === activeIndex + 1
@@ -5,7 +5,9 @@ export default {
5
5
  iconButtonLabel: 'Show %{itemLabel} %{targetStep} of %{stepCount}',
6
6
  stepLabel: '%{itemLabel} %{stepNumber}',
7
7
  stepTrackerLabel: '%{itemLabel} %{stepNumber} of %{stepCount}',
8
- skipLink: 'Skip %{title}'
8
+ skipLink: 'Skip %{title}',
9
+ playButtonLabel: 'Play',
10
+ pauseButtonLabel: 'Pause'
9
11
  },
10
12
  fr: {
11
13
  // French translations
@@ -13,6 +15,8 @@ export default {
13
15
  iconButtonLabel: 'Montrer %{itemLabel} %{targetStep} de %{stepCount}',
14
16
  stepLabel: '%{itemLabel} %{stepNumber}',
15
17
  stepTrackerLabel: '%{itemLabel} %{stepNumber} de %{stepCount}',
16
- skipLink: 'Passer %{title}'
18
+ skipLink: 'Passer %{title}',
19
+ playButtonLabel: 'Lancer',
20
+ pauseButtonLabel: 'Pauser'
17
21
  }
18
22
  }
@@ -18,6 +18,7 @@ const InputSupports = React.forwardRef(
18
18
  hintPosition = 'inline',
19
19
  feedback,
20
20
  feedbackTokens = {},
21
+ feedbackProps = {},
21
22
  tooltip,
22
23
  validation,
23
24
  nativeID
@@ -54,6 +55,7 @@ const InputSupports = React.forwardRef(
54
55
  title={feedback}
55
56
  validation={validation}
56
57
  tokens={feedbackTokens}
58
+ {...feedbackProps}
57
59
  />
58
60
  ) : null}
59
61
  </StackView>
@@ -89,6 +91,10 @@ InputSupports.propTypes = {
89
91
  * Additional tokens to override the default feedback tokens.
90
92
  */
91
93
  feedbackTokens: getTokensPropType('Feedback'),
94
+ /**
95
+ * Additional props to pass to the `Feedback` component.
96
+ */
97
+ feedbackProps: PropTypes.object,
92
98
  /**
93
99
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
94
100
  */
@@ -0,0 +1,142 @@
1
+ import React from 'react'
2
+ import { Platform, StyleSheet, View } from 'react-native'
3
+ import PropTypes from 'prop-types'
4
+
5
+ import { useThemeTokens, applyTextStyles } from '../ThemeProvider'
6
+ import {
7
+ a11yProps,
8
+ getTokensPropType,
9
+ selectSystemProps,
10
+ variantProp,
11
+ viewProps,
12
+ wrapStringsInText,
13
+ transformGradient
14
+ } from '../utils'
15
+
16
+ import Icon from '../Icon'
17
+
18
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
19
+
20
+ const selectContainerStyles = ({
21
+ backgroundColor,
22
+ backgroundGradient,
23
+ borderColor,
24
+ borderRadius,
25
+ borderWidth,
26
+ paddingBottom,
27
+ paddingLeft,
28
+ paddingRight,
29
+ paddingTop
30
+ }) => {
31
+ const styles = {
32
+ borderColor,
33
+ borderRadius,
34
+ borderWidth,
35
+ paddingBottom,
36
+ paddingLeft,
37
+ paddingRight,
38
+ paddingTop
39
+ }
40
+
41
+ if (backgroundGradient) {
42
+ if (Platform.OS === 'web') {
43
+ styles.background = transformGradient(backgroundGradient)
44
+ } else {
45
+ const {
46
+ stops: [stopOne, stopTwo]
47
+ } = backgroundGradient
48
+ styles.gradient = {}
49
+ styles.gradient.start = { x: 0, y: 0 }
50
+ styles.gradient.end = { x: 1, y: 1 }
51
+ styles.gradient.colors = [stopOne.color, stopTwo.color]
52
+ }
53
+ } else {
54
+ styles.backgroundColor = backgroundColor
55
+ }
56
+
57
+ return styles
58
+ }
59
+
60
+ const selectIconProps = ({ icon, iconColor }) => ({
61
+ icon,
62
+ tokens: { color: iconColor },
63
+ variant: { size: 'small' }
64
+ })
65
+
66
+ const selectTextStyles = ({ textColor, textLineHeight, fontName, fontSize, fontWeight }) =>
67
+ applyTextStyles({
68
+ fontColor: textColor,
69
+ fontName,
70
+ fontSize,
71
+ fontWeight,
72
+ lineHeight: Platform.OS === 'web' ? textLineHeight : textLineHeight * 1.2,
73
+ marginLeft: 8
74
+ })
75
+
76
+ /**
77
+ * Status component displays a status indicator with optional custom gradient.
78
+ *
79
+ * @component
80
+ * @param {object} tokens - The tokens for customizing the status component.
81
+ * @param {string} variant - The variant of the status component.
82
+ * @param {ReactNode} children - The content to be displayed inside the status component.
83
+ * @param {function} customGradient - The custom gradient function for the status component.
84
+ * @param {object} rest - The rest of the props to be applied to the status component.
85
+ * @param {React.Ref} ref - The ref to be applied to the status component.
86
+ * @returns {ReactNode} The rendered status component.
87
+ */
88
+ const Status = React.forwardRef(({ tokens, variant, children, customGradient, ...rest }, ref) => {
89
+ const themeTokens = useThemeTokens('Status', tokens, variant)
90
+ const containerStyles = { ...selectContainerStyles(themeTokens), ...staticStyles.container }
91
+
92
+ let content = (
93
+ <>
94
+ <Icon {...selectIconProps(themeTokens)} />
95
+ {wrapStringsInText(children, { style: selectTextStyles(themeTokens) })}
96
+ </>
97
+ )
98
+ if (typeof customGradient === 'function') {
99
+ content = customGradient(containerStyles.gradient, containerStyles, content)
100
+ }
101
+
102
+ return (
103
+ <View ref={ref} style={containerStyles} {...selectProps(rest)}>
104
+ {content}
105
+ </View>
106
+ )
107
+ })
108
+
109
+ Status.displayName = 'Status'
110
+
111
+ Status.propTypes = {
112
+ ...selectedSystemPropTypes,
113
+ tokens: getTokensPropType('Status'),
114
+ variant: variantProp.propType,
115
+ /**
116
+ * The content to be displayed inside the status component.
117
+ */
118
+ children: PropTypes.node.isRequired,
119
+ /**
120
+ * The custom gradient function for the status component.
121
+ */
122
+ customGradient: PropTypes.func
123
+ }
124
+
125
+ const staticStyles = StyleSheet.create({
126
+ container: {
127
+ flexDirection: 'row',
128
+ alignItems: 'center',
129
+ ...Platform.select({
130
+ web: {
131
+ display: 'inline-flex',
132
+ width: 'fit-content'
133
+ },
134
+ default: {
135
+ display: 'flex',
136
+ width: 'auto'
137
+ }
138
+ })
139
+ }
140
+ })
141
+
142
+ export default Status
@@ -0,0 +1,3 @@
1
+ import Status from './Status'
2
+
3
+ export default Status
package/src/index.js CHANGED
@@ -53,6 +53,7 @@ export { default as SkipLink } from './SkipLink'
53
53
  export { default as Spacer } from './Spacer'
54
54
  export { default as StackView } from './StackView'
55
55
  export * from './StackView'
56
+ export { default as Status } from './Status'
56
57
  export { default as StepTracker } from './StepTracker'
57
58
  export { default as Tabs } from './Tabs'
58
59
  export { default as Tags } from './Tags'
@@ -20,3 +20,4 @@ export * from './ssr'
20
20
  export { default as containUniqueFields } from './containUniqueFields'
21
21
  export { default as BaseView } from './BaseView'
22
22
  export { default as htmlAttrs } from './htmlAttrs'
23
+ export { transformGradient } from './transformGradient'
@@ -23,6 +23,14 @@ export default {
23
23
  * Visual variant is determined based on the `validation` prop.
24
24
  */
25
25
  feedback: PropTypes.string,
26
+ /**
27
+ * Tokens to be passed to the feedback component.
28
+ */
29
+ feedbackTokens: PropTypes.object,
30
+ /**
31
+ * Props to be passed to the feedback component.
32
+ */
33
+ feedbackProps: PropTypes.object,
26
34
  /**
27
35
  * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
28
36
  */
@@ -32,13 +40,25 @@ export default {
32
40
  */
33
41
  validation: PropTypes.oneOf(['error', 'success'])
34
42
  },
35
- select: ({ copy, label, hint, hintPosition, feedback, tooltip, validation }) => ({
43
+ select: ({
44
+ copy,
45
+ label,
46
+ hint,
47
+ hintPosition,
48
+ feedback,
49
+ feedbackTokens,
50
+ feedbackProps,
51
+ tooltip,
52
+ validation
53
+ }) => ({
36
54
  supportsProps: {
37
55
  copy,
38
56
  label,
39
57
  hint,
40
58
  hintPosition,
41
59
  feedback,
60
+ feedbackTokens,
61
+ feedbackProps,
42
62
  tooltip,
43
63
  validation
44
64
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Transforms a gradient object into a CSS gradient string.
3
+ *
4
+ * @param {Object} gradient - The gradient object to transform.
5
+ * @param {string} gradient.type - The type of gradient (linear or radial).
6
+ * @param {number} gradient.angle - The angle of the linear gradient in degrees.
7
+ * @param {Array} gradient.stops - An array of gradient stops.
8
+ * @param {string} gradient.stops[].color - The color of the gradient stop.
9
+ * @param {number} gradient.stops[].stop - The position of the gradient stop as a percentage.
10
+ * @returns {string} The CSS gradient string.
11
+ */
12
+ export const transformGradient = (gradient) =>
13
+ `${gradient.type}-gradient(${gradient.angle}deg, ${gradient.stops[0].color} ${
14
+ gradient.stops[0].stop * 100
15
+ }%, ${gradient.stops[1].color} ${gradient.stops[1].stop * 100}%)`
16
+
17
+ export default { transformGradient }
@@ -0,0 +1,47 @@
1
+ import { StyleProp, ViewStyle, TextStyle } from 'react-native'
2
+ import { Tokens, Variant } from '../ThemeProvider'
3
+
4
+ type CheckboxProps = {
5
+ checked?: boolean
6
+ defaultChecked?: boolean
7
+ error?: boolean
8
+ feedback?: string
9
+ id?: string
10
+ inactive?: boolean
11
+ label?: string
12
+ name?: string
13
+ onChange?: (value: boolean, event: any) => void
14
+ tokens?: Tokens
15
+ value?: string | number | boolean
16
+ variant?: Variant
17
+ style?: StyleProp<ViewStyle>
18
+ labelStyle?: StyleProp<TextStyle>
19
+ containerStyle?: StyleProp<ViewStyle>
20
+ }
21
+
22
+ type CheckboxTokens = {
23
+ containerBackgroundColor?: string
24
+ feedbackMarginBottom?: number
25
+ feedbackMarginTop?: number
26
+ feedbackPosition?: string
27
+ icon?: string
28
+ iconBackgroundColor?: string
29
+ iconColor?: string
30
+ iconSize?: number
31
+ inputBackgroundColor?: string
32
+ inputBorderColor?: string
33
+ inputBorderRadius?: number | string
34
+ inputBorderWidth?: number | string
35
+ inputHeight?: number
36
+ inputOutlineColor?: string
37
+ inputOutlineOffset?: number
38
+ inputOutlineWidth?: number | string
39
+ inputShadow?: string
40
+ inputWidth?: number
41
+ labelColor?: string
42
+ labelFontName?: string
43
+ labelFontSize?: number
44
+ labelFontWeight?: number
45
+ labelLineHeight?: number
46
+ labelMarginLeft?: number
47
+ }
@@ -0,0 +1,72 @@
1
+ import * as React from 'react'
2
+ import { Direction, ResponsiveDirection } from './Common'
3
+
4
+ type CheckboxCardGroupProps = {
5
+ copy?: 'en' | 'fr'
6
+ variant?: 'fullWidth'
7
+ legend?: string
8
+ tooltip?: string
9
+ hint?: string
10
+ hintPosition?: 'inline' | 'below'
11
+ validation?: 'error' | 'success'
12
+ feedback?: string
13
+ initialCheckedIds?: string[]
14
+ checkedIds?: string[]
15
+ onChange?: (checkedIds: string[]) => void
16
+ readOnly?: boolean
17
+ inactive?: boolean
18
+ }
19
+
20
+ type CheckboxCardGroupTokens = {
21
+ borderBottomLeftRadius?: number
22
+ borderBottomRightRadius?: number
23
+ borderTopLeftRadius?: number
24
+ borderTopRightRadius?: number
25
+ direction?: Direction | ResponsiveDirection
26
+ fieldSpace?: number
27
+ outlineOffset?: number
28
+ outlineWidth?: number
29
+ showIcon?: boolean
30
+ space?: number
31
+ }
32
+
33
+ type checkboxCardTokens = {
34
+ outerBorderColer?: string
35
+ outerBorderWidth?: number
36
+ outerBorderGap?: number
37
+ flex?: number
38
+ backgroundColor?: string
39
+ borderColor?: string
40
+ borderRadius?: number
41
+ borderWidth?: number
42
+ paddingBottom?: number
43
+ paddingLeft?: number
44
+ paddingRight?: number
45
+ paddingTop?: number
46
+ minWidth?: number
47
+ shadow?: string
48
+ contentAlignItems?: string
49
+ contentJustifyContent?: string
50
+ contentFlexGrow?: number
51
+ contentFlexShrink?: number
52
+ checkboxCheckedBackgroundColor?: string
53
+ checkboxCheckedSize?: number
54
+ checkboxInputBackgroundColor?: string
55
+ checkboxInputBorderColor?: string
56
+ checkboxInputBorderWidth?: number
57
+ checkboxInputOutlineColor?: string
58
+ checkboxInputOutlineWidth?: number
59
+ checkboxInputSize?: number
60
+ checkboxOuterBorderColor?: string
61
+ checkboxOuterBorderWidth?: number
62
+ checkboxOuterBorderGap?: number
63
+ fontSize?: number
64
+ fontName?: string
65
+ lineHeight?: number
66
+ color?: string
67
+ letterSpacing?: string
68
+ textTransform?: string
69
+ fontWeight?: number
70
+ checkboxSpace?: number
71
+ contentSpace?: number
72
+ }
package/types/index.d.ts CHANGED
@@ -7,6 +7,16 @@ export type { BoxVariants, BoxTokens, BoxProps } from './Box'
7
7
  export { default as ChevronLink } from './ChevronLink'
8
8
  export { ChevronLinkTokens, ChevronLinkProps, HrefProps } from './ChevronLink'
9
9
 
10
+ export { default as Checkbox } from './Checkbox'
11
+ export { CheckboxProps, CheckboxTokens } from './Checkbox'
12
+
13
+ export { default as CheckboxCardGroup } from './CheckboxCardGroup'
14
+ export {
15
+ CheckboxCardGroupProps,
16
+ CheckboxCardGroupTokens,
17
+ checkboxCardTokens
18
+ } from './CheckboxCardGroup'
19
+
10
20
  export { default as Divider } from './Divider'
11
21
  export { DividerVariants, DividerProps, DividerTokens } from './Divider'
12
22