@telus-uds/components-base 4.0.0-beta.0 → 4.0.0-beta.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.
@@ -13,9 +13,12 @@ var _tokens = require("../utils/props/tokens");
13
13
  var _selectSystemProps = require("../utils/props/selectSystemProps");
14
14
  var _variantProp = require("../utils/props/variantProp");
15
15
  var _viewProps = require("../utils/props/viewProps");
16
+ var _useCopy = require("../utils/useCopy");
16
17
  var _StackWrap = require("../StackView/StackWrap");
17
18
  var _Typography = require("../Typography/Typography");
18
19
  var _ColourBubble = require("./ColourBubble");
20
+ var _constants = require("./constants");
21
+ var _dictionary = require("./dictionary");
19
22
  var _jsxRuntime = require("react/jsx-runtime");
20
23
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
24
  const [selectProps, selectedSystemPropTypes] = (0, _selectSystemProps.selectSystemProps)([_a11yProps.a11yProps, _viewProps.viewProps]);
@@ -27,37 +30,49 @@ const ColourToggle = exports.ColourToggle = /*#__PURE__*/_react.default.forwardR
27
30
  items,
28
31
  onChange,
29
32
  showTooltips,
33
+ copy = 'en',
34
+ dictionary = _dictionary.DEFAULT_COLOUR_TOGGLE_DICTIONARY,
30
35
  ...rest
31
36
  } = _ref;
32
37
  const [currentColourId, setCurrentColourId] = _react.default.useState(defaultColourId);
33
38
  const getTokens = (0, _useThemeTokens.useThemeTokensCallback)('ColourToggle', tokens, variant);
39
+ const getCopy = (0, _useCopy.useCopy)({
40
+ dictionary,
41
+ copy
42
+ });
34
43
  const {
35
44
  space
36
45
  } = getTokens();
37
- const {
38
- colourName: currentColourName = ''
39
- } = items.find(item => item.id === currentColourId) || '';
46
+ const currentItem = items.find(_ref2 => {
47
+ let {
48
+ id
49
+ } = _ref2;
50
+ return id === currentColourId;
51
+ });
40
52
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
41
53
  ref: ref,
42
54
  ...selectProps(rest),
43
55
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.Typography, {
44
- children: currentColourName
56
+ children: currentItem?.unavailable ? `${currentItem.colourName} ${getCopy('unavailable')}` : currentItem?.colourName ?? ''
45
57
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_StackWrap.StackWrap, {
46
58
  space: space,
47
59
  accessibilityRole: "radiogroup",
48
- children: items.map((_ref2, index) => {
60
+ children: items.map((_ref3, index) => {
49
61
  let {
50
62
  id,
51
63
  colourHexCode,
52
- colourName
53
- } = _ref2;
64
+ colourName,
65
+ unavailable,
66
+ disabled
67
+ } = _ref3;
54
68
  const colourBubbleId = id || `ColourBubble[${index}]`;
55
69
  const handleChangeColour = event => {
56
70
  setCurrentColourId(id);
57
71
  onChange?.(event, {
58
72
  id,
59
73
  colourHexCode,
60
- colourName
74
+ colourName,
75
+ unavailable
61
76
  });
62
77
  };
63
78
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColourBubble.ColourBubble, {
@@ -67,7 +82,9 @@ const ColourToggle = exports.ColourToggle = /*#__PURE__*/_react.default.forwardR
67
82
  colourHexCode: colourHexCode,
68
83
  colourName: colourName,
69
84
  onPress: handleChangeColour,
70
- showTooltip: showTooltips
85
+ showTooltip: showTooltips,
86
+ unavailable: unavailable,
87
+ isDisabled: !!disabled
71
88
  }, colourBubbleId);
72
89
  })
73
90
  })]
@@ -94,7 +111,9 @@ ColourToggle.propTypes = {
94
111
  items: _propTypes.default.arrayOf(_propTypes.default.exact({
95
112
  colourHexCode: _propTypes.default.string,
96
113
  colourName: _propTypes.default.string,
97
- id: _propTypes.default.string
114
+ id: _propTypes.default.string,
115
+ unavailable: _propTypes.default.oneOf(Object.values(_constants.UNAVAILABLE_VARIANT)),
116
+ disabled: _propTypes.default.bool
98
117
  })),
99
118
  /**
100
119
  * If provided, this function is called when the current selection of the color is changed of all currently `items`. Receives two parameters: item object selected and the event
@@ -103,5 +122,16 @@ ColourToggle.propTypes = {
103
122
  /**
104
123
  * When true, displays each colour's name as a tooltip on hover (web only).
105
124
  */
106
- showTooltips: _propTypes.default.bool
125
+ showTooltips: _propTypes.default.bool,
126
+ /**
127
+ * Select English or French copy.
128
+ */
129
+ copy: _propTypes.default.oneOf(['en', 'fr']),
130
+ /**
131
+ * Override default labels.
132
+ */
133
+ dictionary: _propTypes.default.shape({
134
+ en: _constants.DICTIONARY_CONTENT_SHAPE,
135
+ fr: _constants.DICTIONARY_CONTENT_SHAPE
136
+ })
107
137
  };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UNAVAILABLE_VARIANT = exports.DICTIONARY_CONTENT_SHAPE = void 0;
7
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const UNAVAILABLE_VARIANT = exports.UNAVAILABLE_VARIANT = {
10
+ DARK: 'dark',
11
+ LIGHT: 'light'
12
+ };
13
+ const DICTIONARY_CONTENT_SHAPE = exports.DICTIONARY_CONTENT_SHAPE = _propTypes.default.shape({
14
+ unavailable: _propTypes.default.string
15
+ });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DEFAULT_COLOUR_TOGGLE_DICTIONARY = void 0;
7
+ const DEFAULT_COLOUR_TOGGLE_DICTIONARY = exports.DEFAULT_COLOUR_TOGGLE_DICTIONARY = {
8
+ en: {
9
+ unavailable: '(Out of stock)'
10
+ },
11
+ fr: {
12
+ unavailable: '(En rupture de stock)'
13
+ }
14
+ };
@@ -207,7 +207,11 @@ const Validator = exports.Validator = /*#__PURE__*/_react.default.forwardRef((_r
207
207
 
208
208
  // Sync external value prop to internal state
209
209
  _react.default.useEffect(() => {
210
- if (value && Number(value).toString() !== 'NaN') {
210
+ if (value === '') {
211
+ setCodes(Array(validatorsLength).fill(''));
212
+ return;
213
+ }
214
+ if (Number(value).toString() !== 'NaN') {
211
215
  const digits = value.split('').slice(0, validatorsLength);
212
216
  const newCodes = Array(validatorsLength).fill('');
213
217
  digits.forEach((digit, i) => {
@@ -21,6 +21,8 @@ import { getPressHandlersWithArgs } from '../utils/pressability';
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
23
23
  const [selectItemProps, selectedItemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, pressProps, viewProps]);
24
+ const EQUAL_WIDTH = 'equal';
25
+ const RESPONSIVE_WIDTH = 'responsive';
24
26
  export const ButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
25
27
  let {
26
28
  variant,
@@ -65,31 +67,90 @@ export const ButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
65
67
  const isMobileNonContained = Platform.OS !== 'web' && (!variant || variant?.style !== 'contained');
66
68
  const themeButtonTokensCallback = useThemeTokensCallback('ButtonGroupItem', tokens, variant);
67
69
  const gapValue = useSpacingScale(gap || space);
70
+ const isWeb = Platform.OS === 'web';
71
+ const buttonWidthVariant = variant?.width;
68
72
  const getButtonTokens = useCallback(state => {
69
73
  const themeButtonTokens = themeButtonTokensCallback(state);
70
74
  const shouldUseTransparentBackground = isMobileNonContained && !state.selected && !state.pressed && !state.hover && !state.focus;
75
+ let widthStyle;
76
+ switch (buttonWidthVariant) {
77
+ case EQUAL_WIDTH:
78
+ widthStyle = staticStyles.equalWidth;
79
+ break;
80
+ case RESPONSIVE_WIDTH:
81
+ widthStyle = staticStyles.responsiveWidth;
82
+ break;
83
+ // no default
84
+ }
71
85
  return {
72
86
  ...themeButtonTokens,
73
- ...(variant?.width === 'equal' && staticStyles.equalWidth),
87
+ ...widthStyle,
74
88
  ...(shouldUseTransparentBackground && {
75
89
  backgroundColor: 'transparent'
76
90
  }),
77
91
  alignSelf: themeButtonTokens.width ? 'flex-start' : 'center'
78
92
  };
79
- }, [themeButtonTokensCallback, isMobileNonContained, variant?.width]);
80
- const fieldsetStyles = useMemo(() => ({
81
- ...staticStyles.fieldsetBase,
82
- borderRadius,
83
- backgroundColor: isMobileNonContained ? 'transparent' : backgroundColor || 'transparent',
84
- padding,
85
- width: variant?.width === 'equal' ? '100%' : 'auto'
86
- }), [borderRadius, backgroundColor, padding, variant?.width, isMobileNonContained]);
87
- const viewStyles = useMemo(() => ({
88
- ...staticStyles.viewBase,
89
- flexDirection: direction === 'column' ? 'column' : 'row',
90
- gap: gapValue || 0,
91
- justifyContent: variant?.width === 'equal' ? 'space-evenly' : 'flex-start'
92
- }), [direction, gapValue, variant?.width]);
93
+ }, [themeButtonTokensCallback, isMobileNonContained, buttonWidthVariant]);
94
+ const fieldsetStyles = useMemo(() => {
95
+ let fieldSetBase;
96
+ switch (buttonWidthVariant) {
97
+ case EQUAL_WIDTH:
98
+ case RESPONSIVE_WIDTH:
99
+ fieldSetBase = staticStyles.fieldSetResponsive;
100
+ break;
101
+ default:
102
+ fieldSetBase = staticStyles.fieldsetBase;
103
+ break;
104
+ }
105
+ return {
106
+ ...fieldSetBase,
107
+ borderRadius,
108
+ backgroundColor: isMobileNonContained ? 'transparent' : backgroundColor || 'transparent',
109
+ padding
110
+ };
111
+ }, [borderRadius, backgroundColor, padding, isMobileNonContained, buttonWidthVariant]);
112
+ const buttonsContainerStyles = useMemo(() => {
113
+ let flexWrap;
114
+ if (isWeb) {
115
+ flexWrap = 'wrap';
116
+ } else {
117
+ switch (buttonWidthVariant) {
118
+ case EQUAL_WIDTH:
119
+ case RESPONSIVE_WIDTH:
120
+ flexWrap = 'nowrap';
121
+ break;
122
+ default:
123
+ flexWrap = 'wrap';
124
+ break;
125
+ }
126
+ }
127
+ let justifyContent;
128
+ switch (buttonWidthVariant) {
129
+ case EQUAL_WIDTH:
130
+ justifyContent = 'space-evenly';
131
+ break;
132
+ default:
133
+ justifyContent = 'flex-start';
134
+ break;
135
+ }
136
+ let viewBaseStyle;
137
+ switch (buttonWidthVariant) {
138
+ case EQUAL_WIDTH:
139
+ case RESPONSIVE_WIDTH:
140
+ viewBaseStyle = {};
141
+ break;
142
+ default:
143
+ viewBaseStyle = staticStyles.viewBase;
144
+ break;
145
+ }
146
+ return {
147
+ ...viewBaseStyle,
148
+ flexWrap,
149
+ flexDirection: direction === 'column' ? 'column' : 'row',
150
+ gap: gapValue || 0,
151
+ justifyContent
152
+ };
153
+ }, [direction, gapValue, buttonWidthVariant, isWeb]);
93
154
  const {
94
155
  currentValues,
95
156
  toggleOneValue
@@ -111,7 +172,7 @@ export const ButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
111
172
  }
112
173
 
113
174
  // Some web screenreaders e.g. MacOS Voiceover don't handle radiogroups properly unless radio is direct child of radiogroup
114
- const innerRole = Platform.OS === 'web' && accessibilityRole === 'radiogroup' ? accessibilityRole : undefined;
175
+ const buttonsWrapperRole = Platform.OS === 'web' && accessibilityRole === 'radiogroup' ? accessibilityRole : undefined;
115
176
  return /*#__PURE__*/_jsx(Fieldset, {
116
177
  ...systemProps,
117
178
  ref: ref,
@@ -129,8 +190,8 @@ export const ButtonGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
129
190
  style: fieldsetStyles,
130
191
  ...selectProps(rest),
131
192
  children: /*#__PURE__*/_jsx(View, {
132
- accessibilityRole: innerRole,
133
- style: viewStyles,
193
+ accessibilityRole: buttonsWrapperRole,
194
+ style: buttonsContainerStyles,
134
195
  children: items.map((_ref2, index) => {
135
196
  let {
136
197
  label,
@@ -300,17 +361,24 @@ ButtonGroup.propTypes = {
300
361
  copy: PropTypes.oneOf(['en', 'fr'])
301
362
  };
302
363
  const staticStyles = StyleSheet.create({
364
+ equalWidth: {
365
+ width: '100%',
366
+ flex: 1
367
+ },
368
+ responsiveWidth: {
369
+ width: 'auto'
370
+ },
303
371
  fieldsetBase: {
304
372
  alignSelf: 'flex-start',
305
- display: 'inline'
373
+ display: 'inline',
374
+ width: 'auto'
375
+ },
376
+ fieldSetResponsive: {
377
+ width: '100%'
306
378
  },
307
379
  viewBase: {
308
380
  flexWrap: 'wrap',
309
381
  alignContent: 'stretch',
310
382
  alignItems: 'center'
311
- },
312
- equalWidth: {
313
- width: '100%',
314
- flex: 1
315
383
  }
316
384
  });
@@ -20,9 +20,7 @@ import { FlexGridCol } from '../FlexGrid/FlexGridCol/FlexGridCol';
20
20
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
21
21
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
22
22
  const GRID_COLUMNS = 12;
23
- const isOverlayColor = color => {
24
- return color && typeof color === 'string' && color.startsWith('rgba(');
25
- };
23
+ const isOverlayColor = color => color && typeof color === 'string' && color.startsWith('rgba(');
26
24
  const setBackgroundImage = _ref => {
27
25
  let {
28
26
  src,
@@ -31,7 +29,8 @@ const setBackgroundImage = _ref => {
31
29
  backgroundImagePosition,
32
30
  backgroundImageAlign,
33
31
  content,
34
- cardStyle
32
+ cardStyle,
33
+ testID
35
34
  } = _ref;
36
35
  const borderRadius = cardStyle?.borderRadius || 0;
37
36
  const borderWidth = cardStyle?.borderWidth || 0;
@@ -91,6 +90,7 @@ const setBackgroundImage = _ref => {
91
90
  style: [staticStyles.imageBackground, backgroundImageStyle],
92
91
  role: "img",
93
92
  "aria-label": alt,
93
+ testID: testID,
94
94
  children: content
95
95
  });
96
96
  }
@@ -105,7 +105,8 @@ const setBackgroundImage = _ref => {
105
105
  style: [staticStyles.containImage, positionStyles],
106
106
  accessible: true,
107
107
  accessibilityLabel: alt,
108
- accessibilityIgnoresInvertColors: true
108
+ accessibilityIgnoresInvertColors: true,
109
+ testID: testID
109
110
  }), /*#__PURE__*/_jsx(View, {
110
111
  style: staticStyles.contentOverlay,
111
112
  children: content
@@ -121,6 +122,7 @@ const setBackgroundImage = _ref => {
121
122
  style: staticStyles.imageBackground,
122
123
  accessible: true,
123
124
  accessibilityLabel: alt,
125
+ testID: testID,
124
126
  children: content
125
127
  });
126
128
  };
@@ -129,22 +131,13 @@ const selectPaddedContentStyles = _ref2 => {
129
131
  paddingTop,
130
132
  paddingBottom,
131
133
  paddingLeft,
132
- paddingRight,
133
- borderWidth,
134
- borderColor,
135
- borderRadius,
136
- hasInteractiveBorder
134
+ paddingRight
137
135
  } = _ref2;
138
136
  return {
139
137
  paddingTop,
140
138
  paddingBottom,
141
139
  paddingLeft,
142
- paddingRight,
143
- ...(hasInteractiveBorder ? {
144
- borderWidth,
145
- borderColor,
146
- borderRadius
147
- } : {})
140
+ paddingRight
148
141
  };
149
142
  };
150
143
  const selectInteractiveOverlayStyles = _ref3 => {
@@ -163,12 +156,31 @@ const selectInteractiveOverlayStyles = _ref3 => {
163
156
  backgroundColor,
164
157
  borderRadius: adjustedBorderRadius,
165
158
  pointerEvents: 'none',
166
- zIndex: 1
159
+ zIndex: 3
160
+ };
161
+ };
162
+ const selectOuterContainerStyles = _ref4 => {
163
+ let {
164
+ containerStyle,
165
+ backgroundColor,
166
+ borderRadius,
167
+ borderColor,
168
+ borderWidth,
169
+ hasGradientToken
170
+ } = _ref4;
171
+ return {
172
+ ...containerStyle,
173
+ backgroundColor,
174
+ borderRadius,
175
+ ...(hasGradientToken ? {} : {
176
+ borderColor,
177
+ borderWidth
178
+ })
167
179
  };
168
180
  };
169
181
 
170
182
  // Ensure explicit selection of tokens
171
- export const selectStyles = _ref4 => {
183
+ export const selectStyles = function (_ref5) {
172
184
  let {
173
185
  flex,
174
186
  backgroundColor,
@@ -189,7 +201,10 @@ export const selectStyles = _ref4 => {
189
201
  gradient,
190
202
  maxHeight,
191
203
  overflowY
192
- } = _ref4;
204
+ } = _ref5;
205
+ let {
206
+ hasBgImage = false
207
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
193
208
  const hasGradient = (gradient || backgroundGradient) && Platform.OS === 'web';
194
209
  let backgroundImageValue = null;
195
210
  if (hasGradient) {
@@ -218,7 +233,11 @@ export const selectStyles = _ref4 => {
218
233
  ...(gradient && Platform.OS === 'web' ? {
219
234
  backgroundImage: backgroundImageValue,
220
235
  backgroundOrigin: `border-box`,
221
- boxShadow: `inset 0 1000px ${boxShadowColor}`,
236
+ // bgImage child fills the content-box and replaces what the inset shadow
237
+ // used to cover, so we omit it to avoid hiding the image.
238
+ ...(hasBgImage ? {} : {
239
+ boxShadow: `inset 0 1000px ${boxShadowColor}`
240
+ }),
222
241
  border: `${borderWidth}px solid transparent`
223
242
  } : {}),
224
243
  ...(backgroundGradient && Platform.OS === 'web' ? {
@@ -235,7 +254,7 @@ export const selectStyles = _ref4 => {
235
254
  * A themeless base component for Card which components can apply theme tokens to. Not
236
255
  * intended to be used in apps or sites directly: build themed components on top of this.
237
256
  */
238
- export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
257
+ export const CardBase = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
239
258
  let {
240
259
  children,
241
260
  tokens,
@@ -243,15 +262,14 @@ export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
243
262
  backgroundImage,
244
263
  fullBleedContent,
245
264
  cardState,
265
+ testID,
246
266
  ...rest
247
- } = _ref5;
267
+ } = _ref6;
248
268
  const resolvedTokens = typeof tokens === 'function' ? tokens(cardState) : tokens;
249
- const tokensToUse = backgroundImage && backgroundImage.src ? {
250
- ...resolvedTokens,
251
- gradient: undefined,
252
- backgroundGradient: undefined
253
- } : resolvedTokens;
254
- const cardStyle = selectStyles(tokensToUse);
269
+ const hasBgImage = Boolean(backgroundImage && backgroundImage.src);
270
+ const cardStyle = selectStyles(resolvedTokens, {
271
+ hasBgImage
272
+ });
255
273
  const props = selectProps(rest);
256
274
  let content = children;
257
275
  const {
@@ -284,31 +302,29 @@ export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
284
302
  ...containerStyle
285
303
  } = cardStyle;
286
304
  const hasPadding = paddingTop || paddingBottom || paddingLeft || paddingRight;
287
- const hasInteractiveBorder = borderWidth && borderWidth > 0;
288
305
  const hasInteractiveOverlay = isOverlayColor(backgroundColor);
289
- const paddedContent = hasPadding || hasInteractiveBorder ? /*#__PURE__*/_jsx(View, {
306
+ const outerBackgroundColor = hasInteractiveOverlay ? undefined : backgroundColor;
307
+ const hasGradientToken = Boolean(resolvedTokens.gradient) && Platform.OS === 'web';
308
+ const paddedContent = hasPadding ? /*#__PURE__*/_jsx(View, {
290
309
  style: selectPaddedContentStyles({
291
310
  paddingTop,
292
311
  paddingBottom,
293
312
  paddingLeft,
294
- paddingRight,
295
- borderWidth,
296
- borderColor,
297
- borderRadius,
298
- hasInteractiveBorder
313
+ paddingRight
299
314
  }),
300
315
  children: children
301
316
  }) : children;
302
317
  const contentWithOverlay = /*#__PURE__*/_jsxs(_Fragment, {
303
- children: [hasInteractiveOverlay && Platform.OS === 'web' && /*#__PURE__*/_jsx(View, {
318
+ children: [/*#__PURE__*/_jsx(View, {
319
+ style: staticStyles.contentOverlay,
320
+ children: paddedContent
321
+ }), hasInteractiveOverlay && Platform.OS === 'web' && /*#__PURE__*/_jsx(View, {
304
322
  style: selectInteractiveOverlayStyles({
305
323
  backgroundColor,
306
324
  borderRadius,
307
325
  borderWidth
308
- })
309
- }), /*#__PURE__*/_jsx(View, {
310
- style: staticStyles.contentOverlay,
311
- children: paddedContent
326
+ }),
327
+ testID: testID && `${testID}-card-base-bg-overlay`
312
328
  })]
313
329
  });
314
330
  content = setBackgroundImage({
@@ -319,17 +335,23 @@ export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
319
335
  backgroundImageAlign,
320
336
  content: contentWithOverlay,
321
337
  cardStyle: {
322
- ...containerStyle,
323
- borderRadius
324
- }
338
+ borderRadius,
339
+ borderWidth
340
+ },
341
+ testID: testID && `${testID}-card-base-bg-image`
325
342
  });
326
343
  return /*#__PURE__*/_jsx(View, {
327
- style: {
328
- ...containerStyle,
329
- borderRadius
330
- },
344
+ style: selectOuterContainerStyles({
345
+ containerStyle,
346
+ backgroundColor: outerBackgroundColor,
347
+ borderRadius,
348
+ borderColor,
349
+ borderWidth,
350
+ hasGradientToken
351
+ }),
331
352
  dataSet: dataSet,
332
353
  ref: ref,
354
+ testID: testID,
333
355
  ...props,
334
356
  children: content
335
357
  });
@@ -369,6 +391,7 @@ export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
369
391
  style: containerStyle,
370
392
  dataSet: dataSet,
371
393
  ref: ref,
394
+ testID: testID,
372
395
  ...props,
373
396
  children: /*#__PURE__*/_jsx(FlexGrid, {
374
397
  children: /*#__PURE__*/_jsx(FlexGridRow, {
@@ -385,6 +408,7 @@ export const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
385
408
  style: cardStyle,
386
409
  dataSet: dataSet,
387
410
  ref: ref,
411
+ testID: testID,
388
412
  ...props,
389
413
  children: content
390
414
  });
@@ -427,6 +451,10 @@ CardBase.propTypes = {
427
451
  ...selectedSystemPropTypes,
428
452
  children: PropTypes.node,
429
453
  tokens: getTokensPropType('Card'),
454
+ /**
455
+ * Identifier for testing purposes.
456
+ */
457
+ testID: PropTypes.string,
430
458
  /**
431
459
  * Apply background image to the card.
432
460
  */