@zohodesk/components 1.0.0-temp-199.19 → 1.0.0-temp-245.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.
Files changed (40) hide show
  1. package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +5 -0
  2. package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +5 -0
  3. package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +5 -0
  4. package/es/ListItem/ListItem.module.css +2 -7
  5. package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -6
  6. package/es/MultiSelect/MultiSelect.js +2 -2
  7. package/es/MultiSelect/Suggestions.js +2 -7
  8. package/es/MultiSelect/props/defaultProps.js +0 -2
  9. package/es/MultiSelect/props/propTypes.js +3 -11
  10. package/es/Provider/LibraryContext.js +11 -3
  11. package/es/Select/GroupSelect.js +1 -1
  12. package/es/Select/SelectWithAvatar.js +3 -3
  13. package/es/Select/SelectWithIcon.js +3 -10
  14. package/es/Select/props/defaultProps.js +2 -4
  15. package/es/Select/props/propTypes.js +3 -11
  16. package/es/common/common.module.css +1 -1
  17. package/es/v1/Label/Label.js +81 -30
  18. package/es/v1/Label/css/Label_v1.module.css +58 -0
  19. package/es/v1/Label/css/cssJSLogic.js +35 -0
  20. package/es/v1/Label/props/defaultProps.js +10 -10
  21. package/es/v1/Label/props/propTypes.js +22 -14
  22. package/lib/ListItem/ListItem.module.css +2 -7
  23. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
  24. package/lib/MultiSelect/MultiSelect.js +2 -2
  25. package/lib/MultiSelect/Suggestions.js +2 -6
  26. package/lib/MultiSelect/props/defaultProps.js +0 -2
  27. package/lib/MultiSelect/props/propTypes.js +5 -13
  28. package/lib/Provider/LibraryContext.js +11 -3
  29. package/lib/Select/GroupSelect.js +1 -2
  30. package/lib/Select/SelectWithAvatar.js +3 -4
  31. package/lib/Select/SelectWithIcon.js +3 -10
  32. package/lib/Select/props/defaultProps.js +3 -5
  33. package/lib/Select/props/propTypes.js +3 -11
  34. package/lib/common/common.module.css +1 -1
  35. package/lib/v1/Label/Label.js +91 -33
  36. package/lib/v1/Label/css/Label_v1.module.css +58 -0
  37. package/lib/v1/Label/css/cssJSLogic.js +40 -0
  38. package/lib/v1/Label/props/defaultProps.js +12 -12
  39. package/lib/v1/Label/props/propTypes.js +24 -16
  40. package/package.json +2 -2
@@ -8,4 +8,9 @@
8
8
  --zdt_v1_switch_onLabel: hsla(217, 23.08%, calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
9
9
  --zdt_v1_switch_offLabel: hsla(217, 13.73%, calc(70.00% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
10
10
  --zdt_v1_switch_offLabel_hover: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
11
+
12
+ /* label */
13
+ --zdt_v1_label_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
14
+ --zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
15
+ --zdt_v1_label_disabled_text: var(--dot_inputDisable);
11
16
  }
@@ -8,4 +8,9 @@
8
8
  --zdt_v1_switch_onLabel: hsla(0, 0.00%, calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
9
9
  --zdt_v1_switch_offLabel: hsla(220, 10.45%, calc(39.41% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
10
10
  --zdt_v1_switch_offLabel_hover: hsla(0, 0.00%, calc(0.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
11
+
12
+ /* label */
13
+ --zdt_v1_label_text: hsla(0, 0.00%, calc(0.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
14
+ --zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
15
+ --zdt_v1_label_disabled_text: var(--dot_inputDisable);
11
16
  }
@@ -8,4 +8,9 @@
8
8
  --zdt_v1_switch_onLabel: hsla(0, 0.00%, calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
9
9
  --zdt_v1_switch_offLabel: hsla(0, 0.00%, calc(60.00% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
10
10
  --zdt_v1_switch_offLabel_hover: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
11
+
12
+ /* label */
13
+ --zdt_v1_label_text: hsla(210, 7.41%, calc(89.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
14
+ --zdt_v1_label_required_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
15
+ --zdt_v1_label_disabled_text: var(--dot_inputDisable);
11
16
  }
@@ -15,9 +15,6 @@
15
15
 
16
16
  /* listitem tick icon default variables */
17
17
  --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
18
-
19
- /* multiLine value for list item */
20
- --listitem_multiline_lineheight: 1.5385;
21
18
  }[dir=ltr] .varClass {
22
19
  --listitem_avatar_margin: 0 var(--zd_size15) 0 0;
23
20
  }[dir=rtl] .varClass {
@@ -79,9 +76,8 @@
79
76
  [dir=rtl] .beforeChild{
80
77
  margin-left: var(--zd_size10) ;
81
78
  }
82
- /* css:lineheight-validation:ignore */
83
79
  .value, .multiLineValue {
84
- line-height: var(--listitem_multiline_lineheight);
80
+ line-height: 1.5385;
85
81
  }
86
82
  .multiLineValue,.multiLine{
87
83
  composes: lineClamp from '../common/common.module.css';
@@ -127,8 +123,7 @@
127
123
  .lhsBox_medium,
128
124
  .lhsBox_large{
129
125
  composes: varClass;
130
- /* --listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 ); */
131
- --listitem_doubleline_content_height: calc((var(--listitem_font_size) * var(--listitem_multiline_lineheight)) * 2 );
126
+ --listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 );
132
127
  height: 100% ;
133
128
  composes: dflex alignVertical from '../common/common.module.css';
134
129
  }
@@ -889,12 +889,8 @@ class AdvancedGroupMultiSelect extends React.Component {
889
889
  autoComplete,
890
890
  getTargetRef,
891
891
  isFocus,
892
- limit,
893
- customProps
892
+ limit
894
893
  } = this.props;
895
- const {
896
- SuggestionsProps = {}
897
- } = customProps;
898
894
  let {
899
895
  clearText = MULTISELECT_I18N_KEYS.clearText,
900
896
  limitReachedMessage = MULTISELECT_I18N_KEYS.limitReachedMessage
@@ -1063,7 +1059,7 @@ class AdvancedGroupMultiSelect extends React.Component {
1063
1059
  a11y: {
1064
1060
  role: 'heading'
1065
1061
  }
1066
- })), /*#__PURE__*/React.createElement(Suggestions, { ...SuggestionsProps,
1062
+ })), /*#__PURE__*/React.createElement(Suggestions, {
1067
1063
  suggestions: suggestions,
1068
1064
  selectedOptions: selectedOptionIds,
1069
1065
  getRef: this.suggestionItemRef,
@@ -1095,9 +1095,9 @@ export class MultiSelectComponent extends React.Component {
1095
1095
  isLoading,
1096
1096
  selectAllText,
1097
1097
  needSelectAll,
1098
+ customProps,
1098
1099
  isVirtualizerEnabled,
1099
- limit,
1100
- customProps
1100
+ limit
1101
1101
  } = this.props;
1102
1102
  const {
1103
1103
  selectedOptions,
@@ -193,23 +193,18 @@ export default class Suggestions extends React.PureComponent {
193
193
  htmlId,
194
194
  a11y,
195
195
  getVirtualizerPublicMethods,
196
- setVirtualizerContainerRefFunction,
197
- customClass
196
+ setVirtualizerContainerRefFunction
198
197
  } = this.props;
199
198
  const {
200
199
  ariaParentRole,
201
200
  ariaMultiselectable
202
201
  } = a11y;
203
- const {
204
- containerClass = ''
205
- } = customClass;
206
202
  return /*#__PURE__*/React.createElement(Container, {
207
203
  isCover: false,
208
204
  role: ariaParentRole,
209
205
  id: htmlId,
210
206
  tabindex: "0",
211
- "aria-multiselectable": ariaMultiselectable,
212
- className: containerClass
207
+ "aria-multiselectable": ariaMultiselectable
213
208
  }, /*#__PURE__*/React.createElement(Box, {
214
209
  dataId: `${dataId}`,
215
210
  className: className ? className : ''
@@ -38,7 +38,6 @@ export const AdvancedGroupMultiSelect_defaultProps = {
38
38
  palette: 'default',
39
39
  isLoading: false,
40
40
  dataSelectorId: 'advancedGroupMultiSelect',
41
- customProps: {},
42
41
  allowValueFallback: true
43
42
  };
44
43
  export const AdvancedMultiSelect_defaultProps = {
@@ -170,6 +169,5 @@ export const SelectedOptions_defaultProps = {
170
169
  export const Suggestions_defaultProps = {
171
170
  a11y: {},
172
171
  isVirtualizerEnabled: false,
173
- customClass: {},
174
172
  needMultiLineText: false
175
173
  };
@@ -114,8 +114,7 @@ export const MultiSelect_propTypes = {
114
114
  setAriaId: PropTypes.string,
115
115
  ariaErrorId: PropTypes.string,
116
116
  customProps: PropTypes.shape({
117
- TextBoxIconProps: PropTypes.object,
118
- SuggestionsProps: PropTypes.object
117
+ TextBoxIconProps: PropTypes.object
119
118
  }),
120
119
  isFocus: PropTypes.bool,
121
120
  allowValueFallback: PropTypes.bool,
@@ -200,11 +199,7 @@ export const Suggestions_propTypes = {
200
199
  })),
201
200
  renderBeforeChildren: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
202
201
  limit: PropTypes.number,
203
- limitReachedMessage: PropTypes.string,
204
- customClass: PropTypes.shape({
205
- containerClass: PropTypes.string
206
- }),
207
- needMultiLineText: PropTypes.bool
202
+ limitReachedMessage: PropTypes.string
208
203
  };
209
204
  export const AdvancedGroupMultiSelect_propTypes = {
210
205
  animationStyle: PropTypes.string,
@@ -278,10 +273,7 @@ export const AdvancedGroupMultiSelect_propTypes = {
278
273
  dataSelectorId: PropTypes.string,
279
274
  isFocus: PropTypes.bool,
280
275
  allowValueFallback: PropTypes.bool,
281
- limit: PropTypes.number,
282
- customProps: PropTypes.shape({
283
- SuggestionsProps: PropTypes.object
284
- })
276
+ limit: PropTypes.number
285
277
  };
286
278
  export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
287
279
  selectedOptionDetails: PropTypes.string,
@@ -11,6 +11,8 @@ const LibraryContextProvider = _ref => {
11
11
  hasTagColorInheritedToText,
12
12
  shouldIndicateSwitchState,
13
13
  shouldStrikeThroughDisabledButton,
14
+ labelRequiredType,
15
+ shouldHighlightRequiredLabel,
14
16
  children
15
17
  } = _ref;
16
18
  const [value, setValue] = useState({
@@ -19,7 +21,9 @@ const LibraryContextProvider = _ref => {
19
21
  coloredTagVariant,
20
22
  hasTagColorInheritedToText,
21
23
  shouldIndicateSwitchState,
22
- shouldStrikeThroughDisabledButton
24
+ shouldStrikeThroughDisabledButton,
25
+ labelRequiredType,
26
+ shouldHighlightRequiredLabel
23
27
  });
24
28
 
25
29
  function setGlobalContext(key, data) {
@@ -44,7 +48,9 @@ LibraryContextProvider.propTypes = {
44
48
  hasTagColorInheritedToText: PropTypes.bool,
45
49
  direction: PropTypes.string,
46
50
  shouldIndicateSwitchState: PropTypes.bool,
47
- shouldStrikeThroughDisabledButton: PropTypes.bool
51
+ shouldStrikeThroughDisabledButton: PropTypes.bool,
52
+ labelRequiredType: PropTypes.oneOf(['asterisk', 'text']),
53
+ shouldHighlightRequiredLabel: PropTypes.bool
48
54
  };
49
55
  LibraryContextProvider.defaultProps = {
50
56
  isReducedMotion: getLibraryConfig('isReducedMotion'),
@@ -52,6 +58,8 @@ LibraryContextProvider.defaultProps = {
52
58
  coloredTagVariant: 'bold',
53
59
  hasTagColorInheritedToText: true,
54
60
  shouldIndicateSwitchState: false,
55
- shouldStrikeThroughDisabledButton: false
61
+ shouldStrikeThroughDisabledButton: false,
62
+ labelRequiredType: 'asterisk',
63
+ shouldHighlightRequiredLabel: true
56
64
  };
57
65
  export default LibraryContextProvider;
@@ -623,7 +623,7 @@ export class GroupSelectComponent extends PureComponent {
623
623
  let {
624
624
  TextBoxIconProps = {},
625
625
  TextBoxProps = {},
626
- SuggestionsProps = {}
626
+ SuggestionsProps
627
627
  } = customProps;
628
628
  return /*#__PURE__*/React.createElement("div", {
629
629
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
@@ -169,8 +169,8 @@ class SelectWithAvatarComponent extends SelectComponent {
169
169
  needEffect,
170
170
  isLoading,
171
171
  dataSelectorId,
172
- getTargetRef,
173
- customProps
172
+ customProps,
173
+ getTargetRef
174
174
  } = this.props;
175
175
  i18nKeys = Object.assign({}, i18nKeys, {
176
176
  emptyText: i18nKeys.emptyText || emptyMessage,
@@ -195,7 +195,7 @@ class SelectWithAvatarComponent extends SelectComponent {
195
195
  let {
196
196
  TextBoxProps,
197
197
  DropdownSearchTextBoxProps,
198
- SuggestionsProps = {}
198
+ SuggestionsProps
199
199
  } = customProps;
200
200
  return /*#__PURE__*/React.createElement("div", {
201
201
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
@@ -357,8 +357,7 @@ class SelectWithIcon extends Component {
357
357
  htmlId,
358
358
  isLoading,
359
359
  dataSelectorId,
360
- customProps,
361
- customClass
360
+ customProps
362
361
  } = this.props;
363
362
  i18nKeys = Object.assign({}, i18nKeys, {
364
363
  emptyText: i18nKeys.emptyText || emptyMessage,
@@ -376,11 +375,8 @@ class SelectWithIcon extends Component {
376
375
  TextBoxProps = {},
377
376
  DropdownSearchTextBoxProps = {},
378
377
  TextBoxIconProps = {},
379
- ListItemProps = {}
378
+ ListItemProps
380
379
  } = customProps;
381
- const {
382
- dropBoxClass = ''
383
- } = customClass;
384
380
  return /*#__PURE__*/React.createElement("div", {
385
381
  className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
386
382
  "data-title": isDisabled ? title : null,
@@ -477,10 +473,7 @@ class SelectWithIcon extends Component {
477
473
  size: boxSize,
478
474
  isPadding: false,
479
475
  isResponsivePadding: true,
480
- alignBox: "row",
481
- customClass: {
482
- customDropBox: dropBoxClass
483
- }
476
+ alignBox: "row"
484
477
  }, isLoading ? /*#__PURE__*/React.createElement(Container, {
485
478
  align: "both",
486
479
  className: style.loader
@@ -102,8 +102,7 @@ export const SelectWithAvatar_defaultProps = {
102
102
  i18nKeys: {},
103
103
  customProps: {},
104
104
  needEffect: true,
105
- isLoading: false,
106
- customProps: {}
105
+ isLoading: false
107
106
  };
108
107
  export const SelectWithIcon_defaultProps = {
109
108
  isReadOnly: false,
@@ -132,6 +131,5 @@ export const SelectWithIcon_defaultProps = {
132
131
  isLoading: false,
133
132
  isAbsolutePositioningNeeded: true,
134
133
  isRestrictScroll: false,
135
- customProps: {},
136
- customClass: {}
134
+ customProps: {}
137
135
  };
@@ -186,8 +186,7 @@ export const GroupSelect_propTypes = {
186
186
  isDefaultSelectValue: PropTypes.bool,
187
187
  customProps: PropTypes.shape({
188
188
  TextBoxProps: PropTypes.object,
189
- TextBoxIconProps: PropTypes.object,
190
- SuggestionsProps: PropTypes.object
189
+ TextBoxIconProps: PropTypes.object
191
190
  }),
192
191
  allowValueFallback: PropTypes.bool
193
192
  };
@@ -250,10 +249,7 @@ export const SelectWithAvatar_propTypes = { ...Select_propTypes,
250
249
  htmlId: PropTypes.string,
251
250
  needEffect: PropTypes.bool,
252
251
  isLoading: PropTypes.bool,
253
- dataSelectorId: PropTypes.string,
254
- customProps: PropTypes.shape({
255
- SuggestionsProps: PropTypes.object
256
- })
252
+ dataSelectorId: PropTypes.string
257
253
  };
258
254
  export const SelectWithIcon_propTypes = {
259
255
  animationStyle: PropTypes.oneOf(['default', 'bounce']),
@@ -318,10 +314,6 @@ export const SelectWithIcon_propTypes = {
318
314
  TextBoxProps: PropTypes.object,
319
315
  DropdownSearchTextBoxProps: PropTypes.object,
320
316
  SuggestionsProps: PropTypes.object,
321
- TextBoxIconProps: PropTypes.object,
322
- ListItemProps: PropTypes.object
323
- }),
324
- customClass: PropTypes.shape({
325
- dropBoxClass: PropTypes.string
317
+ TextBoxIconProps: PropTypes.object
326
318
  })
327
319
  };
@@ -501,7 +501,7 @@
501
501
  }
502
502
  .lineClamp {
503
503
  composes: wbreak clamp;
504
- -webkit-line-clamp: var(--line-clamp, 3);
504
+ -webkit-line-clamp: var(--line-clamp,2);
505
505
  }
506
506
 
507
507
  .offSelection {
@@ -1,40 +1,91 @@
1
1
  import React from 'react';
2
- import { defaultProps } from "./props/defaultProps";
2
+ import defaultProps from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
- import style from "../../Label/Label.module.css";
5
- import colors from "../../Label/LabelColors.module.css";
6
- export default function Label(props) {
4
+ import cssJSLogic from "./css/cssJSLogic";
5
+ import { mergeStyle, renderNode, isRenderable } from '@zohodesk/utils';
6
+ import { withComponentRegistrar } from '@zohodesk/dotkit/es/react/ComponentRegistry';
7
+ import Flex from '@zohodesk/layout/es/Flex/Flex';
8
+ import Typography from "../../Typography/Typography";
9
+ import defaultStyle from "./css/Label_v1.module.css";
10
+
11
+ const Label = props => {
7
12
  const {
8
- text,
9
- type,
10
- palette,
11
- size,
12
- clipped,
13
13
  htmlFor,
14
- title,
15
14
  onClick,
16
- dataId,
17
- dataSelectorId,
18
- variant,
15
+ text,
16
+ customId,
17
+ testId,
18
+ tagAttributes,
19
+ a11yAttributes,
20
+ customProps,
21
+ isRequired,
22
+ requiredType,
23
+ isClipped,
24
+ renderRightPlaceholderNode,
25
+ renderLeftPlaceholderNode,
19
26
  customClass,
20
- id,
21
- a11y = {}
27
+ size
22
28
  } = props;
23
29
  const {
24
- tabIndex
25
- } = a11y;
26
- return /*#__PURE__*/React.createElement("label", {
27
- className: `${style.label} ${style[type]} ${style[size]} ${colors[palette]} ${style[`font_${variant}`]}
28
- ${clipped ? style.dotted : ''} ${onClick ? style.pointer : style.cursor} ${customClass} `,
29
- htmlFor: htmlFor,
30
- "data-title": title,
31
- "data-id": dataId,
32
- "data-test-id": dataId,
33
- "data-selector-id": dataSelectorId,
34
- onClick: onClick,
35
- id: id,
36
- tabIndex: tabIndex
37
- }, text);
38
- }
30
+ container: tagAttributes_container,
31
+ label: tagAttributes_label
32
+ } = tagAttributes;
33
+ const {
34
+ container: a11yAttributes_container,
35
+ label: a11yAttributes_label
36
+ } = a11yAttributes;
37
+ const {
38
+ container: customProps_container,
39
+ label: customProps_label
40
+ } = customProps;
41
+ const {
42
+ container: customClass_container
43
+ } = customClass;
44
+ const style = mergeStyle(defaultStyle);
45
+ const {
46
+ labelClass,
47
+ requiredClass,
48
+ asteriskClass
49
+ } = cssJSLogic({ ...props,
50
+ style
51
+ });
52
+ const a11yAttributes_requiredText = {
53
+ 'aria-hidden': 'true'
54
+ };
55
+
56
+ const renderRequired = () => /*#__PURE__*/React.createElement(Typography, {
57
+ $ui_tagName: "span",
58
+ $ui_className: requiredClass,
59
+ $a11yAttributes_text: a11yAttributes_requiredText
60
+ }, requiredType === 'text' ? '(Required)' : requiredType === 'asterisk' ? '*' : null);
61
+
62
+ return /*#__PURE__*/React.createElement(Flex, { ...customProps_container,
63
+ $tagAttributes_container: {
64
+ 'data-selector-id': customId,
65
+ ...tagAttributes_container
66
+ },
67
+ $ui_displayMode: "inline",
68
+ $ui_alignItems: "center",
69
+ $a11yAttributes_container: a11yAttributes_container,
70
+ testId: testId,
71
+ customId: customId,
72
+ $ui_className: customClass_container
73
+ }, isRenderable(renderRightPlaceholderNode) ? renderNode(renderRightPlaceholderNode) : null, /*#__PURE__*/React.createElement(Typography, { ...customProps_label,
74
+ $tagAttributes_text: {
75
+ htmlFor,
76
+ onClick,
77
+ ...tagAttributes_label
78
+ },
79
+ $ui_tagName: "label",
80
+ $ui_className: labelClass,
81
+ $i18n_dataTitle: text,
82
+ $a11yAttributes_text: a11yAttributes_label,
83
+ $ui_size: style[size]
84
+ }, text, isRequired ? !isClipped && renderRequired() : null), isRequired ? isClipped && renderRequired() : null, isRenderable(renderLeftPlaceholderNode) ? renderNode(renderLeftPlaceholderNode) : null);
85
+ };
86
+
87
+ export default withComponentRegistrar(Label, {
88
+ name: 'ZDC_v1_Label'
89
+ });
39
90
  Label.defaultProps = defaultProps;
40
91
  Label.propTypes = propTypes;
@@ -0,0 +1,58 @@
1
+ :root {
2
+ --label_text_color: var(--zdt_v1_label_text);
3
+ --label_required_color: var(--zdt_v1_label_required_text);
4
+ --label_disabled_color: var(--zdt_v1_label_disabled_text);
5
+ }
6
+ .label {
7
+ font-size: var(--zd_font_size14) ;
8
+ color: var(--label_text_color);
9
+ cursor: pointer;
10
+ }
11
+
12
+ .dotted {
13
+ composes: dotted from '../../../common/common.module.css';
14
+ max-width: 100% ;
15
+ }
16
+
17
+ .required {
18
+ color: var(--label_required_color);
19
+ }
20
+
21
+ /* .asterisk{
22
+ height: 16px;
23
+ } */
24
+ .asterisk:after {
25
+ content: "*";
26
+ color: var(--label_required_color);
27
+ }
28
+ [dir=ltr] .asterisk:after {
29
+ margin-left: var(--zd_size2) ;
30
+ }
31
+ [dir=rtl] .asterisk:after {
32
+ margin-right: var(--zd_size2) ;
33
+ }
34
+
35
+ .requiredTxt {
36
+ color: var(--label_required_color);
37
+ font-size: var(--zd_font_size14) ;
38
+ }
39
+
40
+ [dir=ltr] .requiredTxt {
41
+ margin-left: var(--zd_size5) ;
42
+ }
43
+
44
+ [dir=rtl] .requiredTxt {
45
+ margin-right: var(--zd_size5) ;
46
+ }
47
+
48
+ .disabled {
49
+ color: var(--label_disabled_color);
50
+ }
51
+
52
+ .medium{
53
+ font-size: var(--zd_font_size14) ;
54
+ }
55
+
56
+ .small{
57
+ font-size: var(--zd_font_size13) ;
58
+ }
@@ -0,0 +1,35 @@
1
+ import compileClassNames from '@zohodesk/utils/es/compileClassNames';
2
+ export default function cssJSLogic(_ref) {
3
+ let {
4
+ style,
5
+ ...props
6
+ } = _ref;
7
+ const {
8
+ isClipped,
9
+ shouldHighlightRequired,
10
+ isRequired,
11
+ isDisabled,
12
+ customClass
13
+ } = props;
14
+ const {
15
+ label: customClass_label
16
+ } = customClass;
17
+ const labelClass = compileClassNames({
18
+ [style.label]: true,
19
+ [style.dotted]: isClipped,
20
+ [style.required]: isRequired && shouldHighlightRequired,
21
+ [style.disabled]: isDisabled && !isRequired,
22
+ [customClass_label]: !!customClass_label
23
+ });
24
+ const requiredClass = compileClassNames({
25
+ [style.requiredTxt]: true
26
+ });
27
+ const asteriskClass = compileClassNames({
28
+ [style.asterisk]: true
29
+ });
30
+ return {
31
+ labelClass,
32
+ requiredClass,
33
+ asteriskClass
34
+ };
35
+ }
@@ -1,11 +1,11 @@
1
- export const defaultProps = {
2
- clipped: false,
3
- dataId: 'label',
4
- palette: 'default',
5
- size: 'medium',
6
- text: 'Label',
7
- type: 'title',
8
- variant: 'default',
9
- customClass: '',
10
- dataSelectorId: 'label'
1
+ export default {
2
+ customProps: {},
3
+ tagAttributes: {},
4
+ a11yAttributes: {},
5
+ customClass: {},
6
+ shouldHighlightRequired: true,
7
+ isDisabled: false,
8
+ isClipped: false,
9
+ requiredType: 'asterisk',
10
+ size: 'medium'
11
11
  };
@@ -1,19 +1,27 @@
1
1
  import PropTypes from 'prop-types';
2
- export const propTypes = {
3
- clipped: PropTypes.bool,
4
- dataId: PropTypes.string,
5
- dataSelectorId: PropTypes.string,
2
+ export default {
6
3
  htmlFor: PropTypes.string,
7
- onClick: PropTypes.func,
8
- palette: PropTypes.oneOf(['default', 'primary', 'secondary', 'danger', 'mandatory', 'disable', 'dark']),
9
- size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large']),
10
4
  text: PropTypes.string,
11
- title: PropTypes.string,
12
- type: PropTypes.oneOf(['title', 'subtitle']),
13
- variant: PropTypes.oneOf(['primary', 'default']),
14
- customClass: PropTypes.string,
15
- a11y: PropTypes.shape({
16
- tabIndex: PropTypes.string
5
+ onClick: PropTypes.func,
6
+ a11yAttributes: PropTypes.shape({
7
+ container: PropTypes.object,
8
+ label: PropTypes.object
9
+ }),
10
+ tagAttributes: PropTypes.shape({
11
+ container: PropTypes.object,
12
+ label: PropTypes.object
13
+ }),
14
+ customProps: PropTypes.shape({
15
+ container: PropTypes.object,
16
+ label: PropTypes.object
17
17
  }),
18
- id: PropTypes.string
18
+ customId: PropTypes.string,
19
+ testId: PropTypes.string,
20
+ customClass: PropTypes.object,
21
+ requiredType: PropTypes.oneOf(['asterisk', 'text']),
22
+ shouldHighlightRequired: PropTypes.bool,
23
+ isClipped: PropTypes.bool,
24
+ isRequired: PropTypes.bool,
25
+ isDisabled: PropTypes.bool,
26
+ size: PropTypes.oneOf(['small', 'medium'])
19
27
  };
@@ -15,9 +15,6 @@
15
15
 
16
16
  /* listitem tick icon default variables */
17
17
  --listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
18
-
19
- /* multiLine value for list item */
20
- --listitem_multiline_lineheight: 1.5385;
21
18
  }[dir=ltr] .varClass {
22
19
  --listitem_avatar_margin: 0 var(--zd_size15) 0 0;
23
20
  }[dir=rtl] .varClass {
@@ -79,9 +76,8 @@
79
76
  [dir=rtl] .beforeChild{
80
77
  margin-left: var(--zd_size10) ;
81
78
  }
82
- /* css:lineheight-validation:ignore */
83
79
  .value, .multiLineValue {
84
- line-height: var(--listitem_multiline_lineheight);
80
+ line-height: 1.5385;
85
81
  }
86
82
  .multiLineValue,.multiLine{
87
83
  composes: lineClamp from '../common/common.module.css';
@@ -127,8 +123,7 @@
127
123
  .lhsBox_medium,
128
124
  .lhsBox_large{
129
125
  composes: varClass;
130
- /* --listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 ); */
131
- --listitem_doubleline_content_height: calc((var(--listitem_font_size) * var(--listitem_multiline_lineheight)) * 2 );
126
+ --listitem_doubleline_content_height: calc(var(--listitem_font_size) * 2 );
132
127
  height: 100% ;
133
128
  composes: dflex alignVertical from '../common/common.module.css';
134
129
  }