@zohodesk/components 1.5.2 → 1.5.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.
Files changed (43) hide show
  1. package/README.md +15 -0
  2. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +2 -0
  3. package/assets/Appearance/light/mode/Component_LightMode.module.css +2 -0
  4. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +2 -0
  5. package/es/CheckBox/CheckBox.js +21 -10
  6. package/es/CheckBox/CheckBox.module.css +21 -6
  7. package/es/CheckBox/__tests__/CheckBox.spec.js +9 -0
  8. package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +162 -93
  9. package/es/CheckBox/props/propTypes.js +4 -1
  10. package/es/Label/Label.js +19 -1
  11. package/es/Label/__tests__/Label.spec.js +58 -0
  12. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +66 -0
  13. package/es/Label/props/defaultProps.js +1 -0
  14. package/es/Label/props/propTypes.js +7 -1
  15. package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +7 -7
  16. package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +7 -7
  17. package/es/Radio/Radio.js +20 -9
  18. package/es/Radio/Radio.module.css +38 -5
  19. package/es/Radio/__tests__/Radio.spec.js +10 -0
  20. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +154 -81
  21. package/es/Radio/props/propTypes.js +4 -1
  22. package/es/Tag/Tag.js +5 -2
  23. package/es/Tag/props/propTypes.js +2 -0
  24. package/lib/CheckBox/CheckBox.js +23 -9
  25. package/lib/CheckBox/CheckBox.module.css +21 -6
  26. package/lib/CheckBox/__tests__/CheckBox.spec.js +21 -12
  27. package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +162 -93
  28. package/lib/CheckBox/props/propTypes.js +5 -1
  29. package/lib/Label/Label.js +21 -1
  30. package/lib/Label/__tests__/Label.spec.js +58 -0
  31. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +66 -0
  32. package/lib/Label/props/defaultProps.js +1 -0
  33. package/lib/Label/props/propTypes.js +8 -1
  34. package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +7 -7
  35. package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +7 -7
  36. package/lib/Radio/Radio.js +22 -8
  37. package/lib/Radio/Radio.module.css +38 -5
  38. package/lib/Radio/__tests__/Radio.spec.js +10 -0
  39. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +154 -81
  40. package/lib/Radio/props/propTypes.js +5 -1
  41. package/lib/Tag/Tag.js +6 -2
  42. package/lib/Tag/props/propTypes.js +2 -0
  43. package/package.json +9 -9
@@ -1,10 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
+ import { propTypes as TypographyPropTypes } from "../../Typography/props/propTypes";
2
3
  export const propTypes = {
3
4
  active: PropTypes.bool,
4
5
  activeStyle: PropTypes.oneOf(['tick', 'minus']),
5
6
  checked: PropTypes.bool,
6
7
  dataId: PropTypes.string,
7
8
  dataSelectorId: PropTypes.string,
9
+ secondaryText: PropTypes.string,
8
10
  disabled: PropTypes.bool,
9
11
  disabledTitle: PropTypes.string,
10
12
  getRef: PropTypes.func,
@@ -36,7 +38,8 @@ export const propTypes = {
36
38
  }),
37
39
  customProps: PropTypes.shape({
38
40
  CheckBoxProps: PropTypes.object,
39
- LabelProps: PropTypes.object
41
+ LabelProps: PropTypes.object,
42
+ secondaryTextProps: PropTypes.exact(TypographyPropTypes)
40
43
  }),
41
44
  renderRightPlaceholderNode: PropTypes.node
42
45
  };
package/es/Label/Label.js CHANGED
@@ -4,6 +4,8 @@
4
4
  import React from 'react';
5
5
  import { defaultProps } from "./props/defaultProps";
6
6
  import { propTypes } from "./props/propTypes";
7
+ import Flex from '@zohodesk/layout/es/Flex/Flex';
8
+ import { renderNode, isRenderable } from '@zohodesk/utils';
7
9
  import style from "./Label.module.css";
8
10
  import colors from "./LabelColors.module.css";
9
11
  export default class Label extends React.Component {
@@ -20,14 +22,20 @@ export default class Label extends React.Component {
20
22
  dataId,
21
23
  dataSelectorId,
22
24
  variant,
25
+ customProps,
23
26
  customClass,
24
27
  id,
28
+ renderRightPlaceholderNode,
25
29
  a11y = {}
26
30
  } = this.props;
31
+ const {
32
+ containerProps,
33
+ rightPlaceholderNodeProps
34
+ } = customProps;
27
35
  const {
28
36
  tabIndex
29
37
  } = a11y;
30
- return /*#__PURE__*/React.createElement("label", {
38
+ const labelElement = /*#__PURE__*/React.createElement("label", {
31
39
  className: `${style.label} ${style[type]} ${style[size]} ${colors[palette]} ${style[`font_${variant}`]}
32
40
  ${clipped ? style.dotted : ''} ${onClick ? style.pointer : style.cursor} ${customClass} `,
33
41
  htmlFor: htmlFor,
@@ -39,6 +47,16 @@ export default class Label extends React.Component {
39
47
  id: id,
40
48
  tabIndex: tabIndex
41
49
  }, text);
50
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderable(renderRightPlaceholderNode) ? /*#__PURE__*/React.createElement(Flex, {
51
+ $ui_displayMode: "flex",
52
+ $ui_direction: "row",
53
+ $ui_alignItems: "center",
54
+ ...containerProps
55
+ }, labelElement, /*#__PURE__*/React.createElement(Flex, {
56
+ $ui_displayMode: "flex",
57
+ $ui_alignItems: "center",
58
+ ...rightPlaceholderNodeProps
59
+ }, renderNode(renderRightPlaceholderNode))) : /*#__PURE__*/React.createElement(React.Fragment, null, labelElement));
42
60
  }
43
61
 
44
62
  }
@@ -96,4 +96,62 @@ describe('Label', () => {
96
96
  }));
97
97
  expect(asFragment()).toMatchSnapshot();
98
98
  });
99
+ test('rendering with renderRightPlaceholderNode', () => {
100
+ const {
101
+ asFragment
102
+ } = render( /*#__PURE__*/React.createElement(Label, {
103
+ text: "New Feature",
104
+ id: "label_new",
105
+ renderRightPlaceholderNode: /*#__PURE__*/React.createElement("span", {
106
+ style: {
107
+ background: '#27ae60',
108
+ color: 'white',
109
+ padding: '2px 6px',
110
+ borderRadius: '3px',
111
+ fontSize: '10px',
112
+ fontWeight: 'bold'
113
+ }
114
+ }, "NEW")
115
+ }));
116
+ expect(asFragment()).toMatchSnapshot();
117
+ });
118
+ test('rendering with customProps - containerProps & rightPlaceholderNodeProps', () => {
119
+ const {
120
+ asFragment
121
+ } = render( /*#__PURE__*/React.createElement(Label, {
122
+ text: "Premium Feature",
123
+ id: "label_premium",
124
+ size: "large",
125
+ palette: "danger",
126
+ renderRightPlaceholderNode: /*#__PURE__*/React.createElement("span", {
127
+ style: {
128
+ fontSize: '10px',
129
+ background: '#f39c12',
130
+ color: 'white',
131
+ padding: '1px 4px',
132
+ borderRadius: '2px'
133
+ }
134
+ }, "PRO"),
135
+ customProps: {
136
+ containerProps: {
137
+ $ui_alignItems: 'center',
138
+ $tagAttributes_container: {
139
+ style: {
140
+ gap: '6px'
141
+ }
142
+ }
143
+ },
144
+ rightPlaceholderNodeProps: {
145
+ $ui_displayMode: 'flex',
146
+ $ui_alignItems: 'center',
147
+ $tagAttributes_container: {
148
+ style: {
149
+ gap: '6px'
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }));
155
+ expect(asFragment()).toMatchSnapshot();
156
+ });
99
157
  });
@@ -310,3 +310,69 @@ exports[`Label rendering the variant of- primary 1`] = `
310
310
  </label>
311
311
  </DocumentFragment>
312
312
  `;
313
+
314
+ exports[`Label rendering with customProps - containerProps & rightPlaceholderNodeProps 1`] = `
315
+ <DocumentFragment>
316
+ <div
317
+ class="flex row alignItems_center"
318
+ data-id="flex"
319
+ data-test-id="flex"
320
+ style="gap: 6px;"
321
+ >
322
+ <label
323
+ class="label title large danger font_default
324
+ cursor "
325
+ data-id="label"
326
+ data-selector-id="label"
327
+ data-test-id="label"
328
+ id="label_premium"
329
+ >
330
+ Premium Feature
331
+ </label>
332
+ <div
333
+ class="flex row alignItems_center"
334
+ data-id="flex"
335
+ data-test-id="flex"
336
+ style="gap: 6px;"
337
+ >
338
+ <span
339
+ style="font-size: 10px; background: rgb(243, 156, 18); color: white; padding: 1px 4px; border-radius: 2px;"
340
+ >
341
+ PRO
342
+ </span>
343
+ </div>
344
+ </div>
345
+ </DocumentFragment>
346
+ `;
347
+
348
+ exports[`Label rendering with renderRightPlaceholderNode 1`] = `
349
+ <DocumentFragment>
350
+ <div
351
+ class="flex row alignItems_center"
352
+ data-id="flex"
353
+ data-test-id="flex"
354
+ >
355
+ <label
356
+ class="label title medium default font_default
357
+ cursor "
358
+ data-id="label"
359
+ data-selector-id="label"
360
+ data-test-id="label"
361
+ id="label_new"
362
+ >
363
+ New Feature
364
+ </label>
365
+ <div
366
+ class="flex row alignItems_center"
367
+ data-id="flex"
368
+ data-test-id="flex"
369
+ >
370
+ <span
371
+ style="background: rgb(39, 174, 96); color: white; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: bold;"
372
+ >
373
+ NEW
374
+ </span>
375
+ </div>
376
+ </div>
377
+ </DocumentFragment>
378
+ `;
@@ -6,6 +6,7 @@ export const defaultProps = {
6
6
  text: 'Label',
7
7
  type: 'title',
8
8
  variant: 'default',
9
+ customProps: {},
9
10
  customClass: '',
10
11
  dataSelectorId: 'label'
11
12
  };
@@ -1,4 +1,5 @@
1
1
  import PropTypes from 'prop-types';
2
+ import FlexPropTypes from '@zohodesk/layout/es/Flex/props/propTypes';
2
3
  export const propTypes = {
3
4
  clipped: PropTypes.bool,
4
5
  dataId: PropTypes.string,
@@ -11,9 +12,14 @@ export const propTypes = {
11
12
  title: PropTypes.string,
12
13
  type: PropTypes.oneOf(['title', 'subtitle']),
13
14
  variant: PropTypes.oneOf(['primary', 'default']),
15
+ customProps: PropTypes.shape({
16
+ containerProps: PropTypes.exact(FlexPropTypes),
17
+ rightPlaceholderNodeProps: PropTypes.exact(FlexPropTypes)
18
+ }),
14
19
  customClass: PropTypes.string,
15
20
  a11y: PropTypes.shape({
16
21
  tabIndex: PropTypes.string
17
22
  }),
18
- id: PropTypes.string
23
+ id: PropTypes.string,
24
+ renderRightPlaceholderNode: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
19
25
  };
@@ -35,7 +35,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with renderValueRightPlacehol
35
35
  tabindex="-1"
36
36
  >
37
37
  <div
38
- class="boxContainer medium filled shrinkOff"
38
+ class="boxContainer medium filled shrinkOff"
39
39
  data-id="boxComponent"
40
40
  data-selector-id="box"
41
41
  data-test-id="boxComponent"
@@ -136,7 +136,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with renderValueRightPlacehol
136
136
  tabindex="-1"
137
137
  >
138
138
  <div
139
- class="boxContainer medium filled shrinkOff"
139
+ class="boxContainer medium filled shrinkOff"
140
140
  data-id="boxComponent"
141
141
  data-selector-id="box"
142
142
  data-test-id="boxComponent"
@@ -237,7 +237,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
237
237
  tabindex="-1"
238
238
  >
239
239
  <div
240
- class="boxContainer medium filled shrinkOff"
240
+ class="boxContainer medium filled shrinkOff"
241
241
  data-id="boxComponent"
242
242
  data-selector-id="box"
243
243
  data-test-id="boxComponent"
@@ -337,7 +337,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
337
337
  tabindex="-1"
338
338
  >
339
339
  <div
340
- class="boxContainer medium filled shrinkOff"
340
+ class="boxContainer medium filled shrinkOff"
341
341
  data-id="boxComponent"
342
342
  data-selector-id="box"
343
343
  data-test-id="boxComponent"
@@ -437,7 +437,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue 1`] = `
437
437
  tabindex="-1"
438
438
  >
439
439
  <div
440
- class="boxContainer medium filled shrinkOff"
440
+ class="boxContainer medium filled shrinkOff"
441
441
  data-id="boxComponent"
442
442
  data-selector-id="box"
443
443
  data-test-id="boxComponent"
@@ -537,7 +537,7 @@ exports[`ListItemWithCheckBox ListItemWithCheckBox with secondaryValue text and
537
537
  tabindex="-1"
538
538
  >
539
539
  <div
540
- class="boxContainer medium filled shrinkOff"
540
+ class="boxContainer medium filled shrinkOff"
541
541
  data-id="boxComponent"
542
542
  data-selector-id="box"
543
543
  data-test-id="boxComponent"
@@ -637,7 +637,7 @@ exports[`ListItemWithCheckBox rendering the defult props 1`] = `
637
637
  tabindex="-1"
638
638
  >
639
639
  <div
640
- class="boxContainer medium filled shrinkOff"
640
+ class="boxContainer medium filled shrinkOff"
641
641
  data-id="boxComponent"
642
642
  data-selector-id="box"
643
643
  data-test-id="boxComponent"
@@ -36,7 +36,7 @@ exports[`ListItemWithRadio ListItemWithRadio with renderValueRightPlaceholderNod
36
36
  >
37
37
  <div
38
38
  class="radio
39
- hoverprimary medium filled centerPathprimary shrinkOff"
39
+ hoverprimary medium filled centerPathprimary shrinkOff"
40
40
  data-id="boxComponent"
41
41
  data-selector-id="box"
42
42
  data-test-id="boxComponent"
@@ -136,7 +136,7 @@ exports[`ListItemWithRadio ListItemWithRadio with renderValueRightPlaceholderNod
136
136
  >
137
137
  <div
138
138
  class="radio
139
- hoverprimary medium filled centerPathprimary shrinkOff"
139
+ hoverprimary medium filled centerPathprimary shrinkOff"
140
140
  data-id="boxComponent"
141
141
  data-selector-id="box"
142
142
  data-test-id="boxComponent"
@@ -236,7 +236,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
236
236
  >
237
237
  <div
238
238
  class="radio
239
- hoverprimary medium filled centerPathprimary shrinkOff"
239
+ hoverprimary medium filled centerPathprimary shrinkOff"
240
240
  data-id="boxComponent"
241
241
  data-selector-id="box"
242
242
  data-test-id="boxComponent"
@@ -335,7 +335,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS a
335
335
  >
336
336
  <div
337
337
  class="radio
338
- hoverprimary medium filled centerPathprimary shrinkOff"
338
+ hoverprimary medium filled centerPathprimary shrinkOff"
339
339
  data-id="boxComponent"
340
340
  data-selector-id="box"
341
341
  data-test-id="boxComponent"
@@ -434,7 +434,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue 1`] = `
434
434
  >
435
435
  <div
436
436
  class="radio
437
- hoverprimary medium filled centerPathprimary shrinkOff"
437
+ hoverprimary medium filled centerPathprimary shrinkOff"
438
438
  data-id="boxComponent"
439
439
  data-selector-id="box"
440
440
  data-test-id="boxComponent"
@@ -533,7 +533,7 @@ exports[`ListItemWithRadio ListItemWithRadio with secondaryValue text and LHS al
533
533
  >
534
534
  <div
535
535
  class="radio
536
- hoverprimary medium filled centerPathprimary shrinkOff"
536
+ hoverprimary medium filled centerPathprimary shrinkOff"
537
537
  data-id="boxComponent"
538
538
  data-selector-id="box"
539
539
  data-test-id="boxComponent"
@@ -632,7 +632,7 @@ exports[`ListItemWithRadio rendering the defult props 1`] = `
632
632
  >
633
633
  <div
634
634
  class="radio
635
- hoverprimary medium filled centerPathprimary shrinkOff"
635
+ hoverprimary medium filled centerPathprimary shrinkOff"
636
636
  data-id="boxComponent"
637
637
  data-selector-id="box"
638
638
  data-test-id="boxComponent"
package/es/Radio/Radio.js CHANGED
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { defaultProps } from "./props/defaultProps";
4
4
  import { propTypes } from "./props/propTypes";
5
5
  import Label from "../Label/Label";
6
+ import Typography from "../Typography/Typography";
6
7
  import { Container, Box } from "../Layout";
7
8
  import CssProvider from "../Provider/CssProvider";
8
9
  import style from "./Radio.module.css";
@@ -51,12 +52,14 @@ export default class Radio extends React.Component {
51
52
  customProps,
52
53
  children,
53
54
  a11y,
55
+ secondaryText,
54
56
  renderRightPlaceholderNode
55
57
  } = this.props;
56
58
  let {
57
59
  customRadioWrap = '',
58
60
  customRadio = '',
59
- customLabel = ''
61
+ customLabel = '',
62
+ customSecondaryText = ''
60
63
  } = customClass;
61
64
  let accessMode = isReadOnly ? style.readonly : disabled ? CssProvider('isDisabled') : style.pointer;
62
65
  let toolTip = disabled ? disabledTitle : title ? title : null;
@@ -72,7 +75,8 @@ export default class Radio extends React.Component {
72
75
  } = a11y;
73
76
  let {
74
77
  ContainerProps = {},
75
- LabelProps = {}
78
+ LabelProps = {},
79
+ secondaryTextProps = {}
76
80
  } = customProps;
77
81
  return /*#__PURE__*/React.createElement(Container, {
78
82
  dataId: value ? value.toLowerCase() : 'RadioComp',
@@ -94,7 +98,8 @@ export default class Radio extends React.Component {
94
98
  ...ContainerProps
95
99
  }, /*#__PURE__*/React.createElement(Box, {
96
100
  className: `${style.radio} ${checked ? `${style[`rdBox${palette}`]}` : ''}
97
- ${!isEditable ? '' : `${style[`hover${palette}`]}`} ${style[size]} ${isFilled ? style.filled : ''} ${style[`centerPath${palette}`]} ${customRadio} ${!isEditable ? `${style.disabled}` : ''}`
101
+ ${!isEditable ? '' : `${style[`hover${palette}`]}`} ${style[size]} ${isFilled ? style.filled : ''} ${style[`centerPath${palette}`]} ${customRadio} ${!isEditable ? `${style.disabled}` : ''} ${secondaryText ? style.withSecondaryText : ''}`,
102
+ align: secondaryText ? "start" : undefined
98
103
  }, /*#__PURE__*/React.createElement("input", {
99
104
  type: "hidden",
100
105
  id: id,
@@ -115,10 +120,10 @@ export default class Radio extends React.Component {
115
120
  cy: "20",
116
121
  r: "11.03",
117
122
  className: `${style.centerPath}`
118
- }) : null))), text && /*#__PURE__*/React.createElement(Box, {
123
+ }) : null))), (text || secondaryText) && /*#__PURE__*/React.createElement(Box, {
119
124
  flexible: true,
120
- className: `${style.text} ${disabled ? `${style.disabled}` : ''}`
121
- }, /*#__PURE__*/React.createElement(Label, {
125
+ className: style.labelContainer
126
+ }, text && /*#__PURE__*/React.createElement(Label, {
122
127
  text: text,
123
128
  palette: labelPalette,
124
129
  size: labelSize,
@@ -127,10 +132,16 @@ export default class Radio extends React.Component {
127
132
  dataId: `${text}_label`,
128
133
  variant: variant,
129
134
  title: toolTip ? toolTip : text,
130
- customClass: `${checked && active ? `${style[`${palette}checkedActive`]}` : ''}
131
- ${style[`${palette}Label`]} ${isEditable ? style.pointer : ''} ${isReadOnly ? style.readonly : ''} ${customLabel}`,
135
+ customClass: `${checked && active ? `${style[`${palette}checkedActive`]}` : ''} ${disabled ? `${style.disabled}` : ''}
136
+ ${style[`${palette}Label`]} ${isEditable ? style.pointer : ''} ${isReadOnly ? style.readonly : ''} ${customLabel}`,
132
137
  ...LabelProps
133
- })), children, renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
138
+ }), secondaryText ? /*#__PURE__*/React.createElement(Typography, {
139
+ $ui_size: "12",
140
+ $ui_lineHeight: "1.2",
141
+ ...secondaryTextProps,
142
+ $i18n_dataTitle: toolTip ? null : secondaryText,
143
+ $ui_className: `${style.secondaryText} ${customSecondaryText}`
144
+ }, secondaryText) : null), children, renderRightPlaceholderNode ? renderRightPlaceholderNode : null);
134
145
  }
135
146
 
136
147
  }
@@ -10,20 +10,25 @@
10
10
  }[dir=ltr] .varClass {
11
11
  --radio_label_margin: 0 0 0 var(--zd_size6);
12
12
  }[dir=rtl] .varClass {
13
- --radio_label_margin: 0 var(--zd_size6) 0 0;
13
+ --radio_label_margin: 0 0 0 var(--zd_size6);
14
14
  }
15
+
15
16
  .container {
16
17
  composes: varClass;
17
18
  }
19
+
18
20
  .pointer {
19
21
  cursor: pointer;
20
22
  }
23
+
21
24
  .readonly, .disabled {
22
25
  cursor: default;
23
26
  }
27
+
24
28
  .disabled {
25
29
  opacity: 0.7
26
30
  }
31
+
27
32
  .radio {
28
33
  composes: offSelection from '../common/common.module.css';
29
34
  width: var(--radio_width);
@@ -32,10 +37,12 @@
32
37
  background: var(--radio_bg_color);
33
38
  border-radius: 50%;
34
39
  }
40
+
35
41
  .radio,
36
42
  .centerPath {
37
43
  fill: var(--radio_fill);
38
44
  }
45
+
39
46
  .filled {
40
47
  --radio_bg_color: var(--zdt_radio_default_bg);
41
48
  }
@@ -44,48 +51,66 @@
44
51
  --radio_width: var(--zd_size16);
45
52
  --radio_height: var(--zd_size16);
46
53
  }
54
+
47
55
  .small {
48
56
  --radio_width: var(--zd_size13);
49
57
  --radio_height: var(--zd_size13);
50
58
  }
59
+
60
+ .medium.withSecondaryText {
61
+ margin-top: var(--zd_size1) ;
62
+ }
63
+
64
+ .small.withSecondaryText {
65
+ margin-top: var(--zd_size3) ;
66
+ }
67
+
51
68
  .radioLabel {
52
69
  font-size: 0 ;
53
70
  display: block;
54
71
  }
72
+
55
73
  .rdBox {
56
74
  fill: none;
57
75
  stroke-width: var(--radio_stroke_width);
58
76
  stroke-linecap: round;
59
77
  stroke: inherit;
60
78
  }
79
+
61
80
  .centerPath {
62
81
  --radio_fill: inherit;
63
82
  stroke-width: var(--radio_inner_stroke_width);
64
83
  transform-origin: center;
65
84
  }
85
+
66
86
  [dir=ltr] .checked .centerPath {
67
87
  animation: circleAnimate var(--zd_transition3) ease forwards;
68
88
  }
89
+
69
90
  [dir=rtl] .checked .centerPath {
70
91
  animation: circleAnimate var(--zd_transition3) ease forwards;
71
92
  }
93
+
72
94
  .rdBoxprimary,
73
95
  .hoverEfffect:hover .hoverprimary
96
+
74
97
  /* .hoverEfffect:focus .hoverprimary */
75
- {
98
+ {
76
99
  --radio_stroke_color: var(--zdt_radio_primary_stroke);
77
100
  }
78
101
 
79
102
  .rdBoxdanger,
80
103
  .hoverEfffect:hover .hoverdanger
104
+
81
105
  /* .hoverEfffect:focus .hoverdanger */
82
- {
106
+ {
83
107
  --radio_stroke_color: var(--zdt_radio_danger_stroke);
84
108
  }
85
109
 
86
110
  .centerPathprimary {
87
111
  --radio_fill: var(--zdt_radio_primary_fill);
88
112
  }
113
+
89
114
  .centerPathdanger {
90
115
  --radio_fill: var(--zdt_radio_danger_fill);
91
116
  }
@@ -102,14 +127,22 @@
102
127
  --label_text_color: var(--zdt_radio_label_danger_text);
103
128
  }
104
129
 
105
- .text {
130
+ .secondaryText {
131
+ color: var(--zdt_radio_secondary_text);
132
+ }
133
+
134
+ .labelContainer {
135
+ composes: dflex flexcolumn from '../common/common.module.css';
136
+ gap: var(--zd_size4) ;
106
137
  margin: var(--radio_label_margin);
107
138
  }
139
+
108
140
  @keyframes circleAnimate {
109
141
  0% {
110
142
  transform: scale(0);
111
143
  }
144
+
112
145
  100% {
113
146
  transform: scale(1);
114
147
  }
115
- }
148
+ }
@@ -235,4 +235,14 @@ describe('Radio', () => {
235
235
  })));
236
236
  expect(asFragment()).toMatchSnapshot();
237
237
  });
238
+ test('rendering secondaryText with checked state', () => {
239
+ const {
240
+ asFragment
241
+ } = render( /*#__PURE__*/React.createElement(Radio, {
242
+ secondaryText: "Secondary text",
243
+ text: "Radio Text",
244
+ checked: true
245
+ }));
246
+ expect(asFragment()).toMatchSnapshot();
247
+ });
238
248
  });