@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
@@ -55,8 +55,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
55
55
 
56
56
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
57
57
 
58
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
59
-
60
58
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
61
59
 
62
60
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -981,10 +979,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
981
979
  autoComplete = _this$props9.autoComplete,
982
980
  getTargetRef = _this$props9.getTargetRef,
983
981
  isFocus = _this$props9.isFocus,
984
- limit = _this$props9.limit,
985
- customProps = _this$props9.customProps;
986
- var _customProps$Suggesti = customProps.SuggestionsProps,
987
- SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
982
+ limit = _this$props9.limit;
988
983
  var _i18nKeys = i18nKeys,
989
984
  _i18nKeys$clearText = _i18nKeys.clearText,
990
985
  clearText = _i18nKeys$clearText === void 0 ? _constants.MULTISELECT_I18N_KEYS.clearText : _i18nKeys$clearText,
@@ -1150,7 +1145,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
1150
1145
  a11y: {
1151
1146
  role: 'heading'
1152
1147
  }
1153
- })), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({}, SuggestionsProps, {
1148
+ })), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
1154
1149
  suggestions: suggestions,
1155
1150
  selectedOptions: selectedOptionIds,
1156
1151
  getRef: _this5.suggestionItemRef,
@@ -1165,7 +1160,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
1165
1160
  limit: limit,
1166
1161
  limitReachedMessage: limitReachedMessage,
1167
1162
  dataId: "".concat(dataId, "_Options")
1168
- })));
1163
+ }));
1169
1164
  }) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
1170
1165
  options: revampedGroups,
1171
1166
  searchString: searchStr,
@@ -1171,9 +1171,9 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
1171
1171
  isLoading = _this$props15.isLoading,
1172
1172
  selectAllText = _this$props15.selectAllText,
1173
1173
  needSelectAll = _this$props15.needSelectAll,
1174
+ customProps = _this$props15.customProps,
1174
1175
  isVirtualizerEnabled = _this$props15.isVirtualizerEnabled,
1175
- limit = _this$props15.limit,
1176
- customProps = _this$props15.customProps;
1176
+ limit = _this$props15.limit;
1177
1177
  var _this$state9 = this.state,
1178
1178
  selectedOptions = _this$state9.selectedOptions,
1179
1179
  searchStr = _this$state9.searchStr,
@@ -247,19 +247,15 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
247
247
  htmlId = _this$props2.htmlId,
248
248
  a11y = _this$props2.a11y,
249
249
  getVirtualizerPublicMethods = _this$props2.getVirtualizerPublicMethods,
250
- setVirtualizerContainerRefFunction = _this$props2.setVirtualizerContainerRefFunction,
251
- customClass = _this$props2.customClass;
250
+ setVirtualizerContainerRefFunction = _this$props2.setVirtualizerContainerRefFunction;
252
251
  var ariaParentRole = a11y.ariaParentRole,
253
252
  ariaMultiselectable = a11y.ariaMultiselectable;
254
- var _customClass$containe = customClass.containerClass,
255
- containerClass = _customClass$containe === void 0 ? '' : _customClass$containe;
256
253
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
257
254
  isCover: false,
258
255
  role: ariaParentRole,
259
256
  id: htmlId,
260
257
  tabindex: "0",
261
- "aria-multiselectable": ariaMultiselectable,
262
- className: containerClass
258
+ "aria-multiselectable": ariaMultiselectable
263
259
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
264
260
  dataId: "".concat(dataId),
265
261
  className: className ? className : ''
@@ -46,7 +46,6 @@ var AdvancedGroupMultiSelect_defaultProps = {
46
46
  palette: 'default',
47
47
  isLoading: false,
48
48
  dataSelectorId: 'advancedGroupMultiSelect',
49
- customProps: {},
50
49
  allowValueFallback: true
51
50
  };
52
51
  exports.AdvancedGroupMultiSelect_defaultProps = AdvancedGroupMultiSelect_defaultProps;
@@ -185,7 +184,6 @@ exports.SelectedOptions_defaultProps = SelectedOptions_defaultProps;
185
184
  var Suggestions_defaultProps = {
186
185
  a11y: {},
187
186
  isVirtualizerEnabled: false,
188
- customClass: {},
189
187
  needMultiLineText: false
190
188
  };
191
189
  exports.Suggestions_defaultProps = Suggestions_defaultProps;
@@ -133,8 +133,7 @@ var MultiSelect_propTypes = {
133
133
  setAriaId: _propTypes["default"].string,
134
134
  ariaErrorId: _propTypes["default"].string,
135
135
  customProps: _propTypes["default"].shape({
136
- TextBoxIconProps: _propTypes["default"].object,
137
- SuggestionsProps: _propTypes["default"].object
136
+ TextBoxIconProps: _propTypes["default"].object
138
137
  }),
139
138
  isFocus: _propTypes["default"].bool,
140
139
  allowValueFallback: _propTypes["default"].bool,
@@ -190,8 +189,7 @@ var SelectedOptions_propTypes = {
190
189
  limit: _propTypes["default"].number
191
190
  };
192
191
  exports.SelectedOptions_propTypes = SelectedOptions_propTypes;
193
-
194
- var Suggestions_propTypes = _defineProperty({
192
+ var Suggestions_propTypes = {
195
193
  a11y: _propTypes["default"].shape({
196
194
  ariaParentRole: _propTypes["default"].string,
197
195
  ariaMultiselectable: _propTypes["default"].bool
@@ -225,12 +223,8 @@ var Suggestions_propTypes = _defineProperty({
225
223
  })),
226
224
  renderBeforeChildren: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].node]),
227
225
  limit: _propTypes["default"].number,
228
- limitReachedMessage: _propTypes["default"].string,
229
- customClass: _propTypes["default"].shape({
230
- containerClass: _propTypes["default"].string
231
- })
232
- }, "needMultiLineText", _propTypes["default"].bool);
233
-
226
+ limitReachedMessage: _propTypes["default"].string
227
+ };
234
228
  exports.Suggestions_propTypes = Suggestions_propTypes;
235
229
  var AdvancedGroupMultiSelect_propTypes = (_AdvancedGroupMultiSe = {
236
230
  animationStyle: _propTypes["default"].string,
@@ -301,9 +295,7 @@ var AdvancedGroupMultiSelect_propTypes = (_AdvancedGroupMultiSe = {
301
295
  needToCloseOnSelect: _propTypes["default"].func,
302
296
  searchStr: _propTypes["default"].string,
303
297
  children: _propTypes["default"].node
304
- }, _defineProperty(_AdvancedGroupMultiSe, "dataSelectorId", _propTypes["default"].string), _defineProperty(_AdvancedGroupMultiSe, "isFocus", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "allowValueFallback", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "limit", _propTypes["default"].number), _defineProperty(_AdvancedGroupMultiSe, "customProps", _propTypes["default"].shape({
305
- SuggestionsProps: _propTypes["default"].object
306
- })), _AdvancedGroupMultiSe);
298
+ }, _defineProperty(_AdvancedGroupMultiSe, "dataSelectorId", _propTypes["default"].string), _defineProperty(_AdvancedGroupMultiSe, "isFocus", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "allowValueFallback", _propTypes["default"].bool), _defineProperty(_AdvancedGroupMultiSe, "limit", _propTypes["default"].number), _AdvancedGroupMultiSe);
307
299
  exports.AdvancedGroupMultiSelect_propTypes = AdvancedGroupMultiSelect_propTypes;
308
300
 
309
301
  var AdvancedMultiSelect_propTypes = _objectSpread(_objectSpread({}, MultiSelect_propTypes), {}, {
@@ -46,6 +46,8 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
46
46
  hasTagColorInheritedToText = _ref.hasTagColorInheritedToText,
47
47
  shouldIndicateSwitchState = _ref.shouldIndicateSwitchState,
48
48
  shouldStrikeThroughDisabledButton = _ref.shouldStrikeThroughDisabledButton,
49
+ labelRequiredType = _ref.labelRequiredType,
50
+ shouldHighlightRequiredLabel = _ref.shouldHighlightRequiredLabel,
49
51
  children = _ref.children;
50
52
 
51
53
  var _useState = (0, _react.useState)({
@@ -54,7 +56,9 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
54
56
  coloredTagVariant: coloredTagVariant,
55
57
  hasTagColorInheritedToText: hasTagColorInheritedToText,
56
58
  shouldIndicateSwitchState: shouldIndicateSwitchState,
57
- shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton
59
+ shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton,
60
+ labelRequiredType: labelRequiredType,
61
+ shouldHighlightRequiredLabel: shouldHighlightRequiredLabel
58
62
  }),
59
63
  _useState2 = _slicedToArray(_useState, 2),
60
64
  value = _useState2[0],
@@ -80,7 +84,9 @@ LibraryContextProvider.propTypes = {
80
84
  hasTagColorInheritedToText: _propTypes["default"].bool,
81
85
  direction: _propTypes["default"].string,
82
86
  shouldIndicateSwitchState: _propTypes["default"].bool,
83
- shouldStrikeThroughDisabledButton: _propTypes["default"].bool
87
+ shouldStrikeThroughDisabledButton: _propTypes["default"].bool,
88
+ labelRequiredType: _propTypes["default"].oneOf(['asterisk', 'text']),
89
+ shouldHighlightRequiredLabel: _propTypes["default"].bool
84
90
  };
85
91
  LibraryContextProvider.defaultProps = {
86
92
  isReducedMotion: (0, _Config.getLibraryConfig)('isReducedMotion'),
@@ -88,7 +94,9 @@ LibraryContextProvider.defaultProps = {
88
94
  coloredTagVariant: 'bold',
89
95
  hasTagColorInheritedToText: true,
90
96
  shouldIndicateSwitchState: false,
91
- shouldStrikeThroughDisabledButton: false
97
+ shouldStrikeThroughDisabledButton: false,
98
+ labelRequiredType: 'asterisk',
99
+ shouldHighlightRequiredLabel: true
92
100
  };
93
101
  var _default = LibraryContextProvider;
94
102
  exports["default"] = _default;
@@ -700,8 +700,7 @@ var GroupSelectComponent = /*#__PURE__*/function (_PureComponent) {
700
700
  TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
701
701
  _customProps$TextBoxP = customProps.TextBoxProps,
702
702
  TextBoxProps = _customProps$TextBoxP === void 0 ? {} : _customProps$TextBoxP,
703
- _customProps$Suggesti = customProps.SuggestionsProps,
704
- SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
703
+ SuggestionsProps = customProps.SuggestionsProps;
705
704
  return /*#__PURE__*/_react["default"].createElement("div", {
706
705
  className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : '', " ").concat(iconOnHover && (isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? _SelectModule["default"].iconOnHoverStyle : ''),
707
706
  "data-id": dataIdSlctComp,
@@ -221,8 +221,8 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
221
221
  needEffect = _this$props.needEffect,
222
222
  isLoading = _this$props.isLoading,
223
223
  dataSelectorId = _this$props.dataSelectorId,
224
- getTargetRef = _this$props.getTargetRef,
225
- customProps = _this$props.customProps;
224
+ customProps = _this$props.customProps,
225
+ getTargetRef = _this$props.getTargetRef;
226
226
  i18nKeys = Object.assign({}, i18nKeys, {
227
227
  emptyText: i18nKeys.emptyText || emptyMessage,
228
228
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
@@ -245,8 +245,7 @@ var SelectWithAvatarComponent = /*#__PURE__*/function (_SelectComponent) {
245
245
  var ariaErrorId = this.getNextAriaId();
246
246
  var TextBoxProps = customProps.TextBoxProps,
247
247
  DropdownSearchTextBoxProps = customProps.DropdownSearchTextBoxProps,
248
- _customProps$Suggesti = customProps.SuggestionsProps,
249
- SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
248
+ SuggestionsProps = customProps.SuggestionsProps;
250
249
  return /*#__PURE__*/_react["default"].createElement("div", {
251
250
  className: "".concat(_MultiSelectModule["default"].wrapper, " ").concat(isDisabled ? _MultiSelectModule["default"].disabled : '', " ").concat(isReadOnly ? _MultiSelectModule["default"].readOnly : '', " ").concat(needEffect && !(isDisabled || isReadOnly) ? _MultiSelectModule["default"].effect : '', " ").concat(className ? className : ''),
252
251
  "data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : dataId),
@@ -431,8 +431,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
431
431
  htmlId = _this$props7.htmlId,
432
432
  isLoading = _this$props7.isLoading,
433
433
  dataSelectorId = _this$props7.dataSelectorId,
434
- customProps = _this$props7.customProps,
435
- customClass = _this$props7.customClass;
434
+ customProps = _this$props7.customProps;
436
435
  i18nKeys = Object.assign({}, i18nKeys, {
437
436
  emptyText: i18nKeys.emptyText || emptyMessage,
438
437
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
@@ -450,10 +449,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
450
449
  DropdownSearchTextBoxProps = _customProps$Dropdown === void 0 ? {} : _customProps$Dropdown,
451
450
  _customProps$TextBoxI = customProps.TextBoxIconProps,
452
451
  TextBoxIconProps = _customProps$TextBoxI === void 0 ? {} : _customProps$TextBoxI,
453
- _customProps$ListItem = customProps.ListItemProps,
454
- ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem;
455
- var _customClass$dropBoxC = customClass.dropBoxClass,
456
- dropBoxClass = _customClass$dropBoxC === void 0 ? '' : _customClass$dropBoxC;
452
+ ListItemProps = customProps.ListItemProps;
457
453
  return /*#__PURE__*/_react["default"].createElement("div", {
458
454
  className: "".concat(_SelectModule["default"].container, " ").concat(_SelectModule["default"]["box_".concat(size)], " ").concat(isReadOnly ? _SelectModule["default"].readonly : '', " ").concat(borderColor === 'transparent' ? _SelectModule["default"].transparentContainer : ''),
459
455
  "data-title": isDisabled ? title : null,
@@ -546,10 +542,7 @@ var SelectWithIcon = /*#__PURE__*/function (_Component) {
546
542
  size: boxSize,
547
543
  isPadding: false,
548
544
  isResponsivePadding: true,
549
- alignBox: "row",
550
- customClass: {
551
- customDropBox: dropBoxClass
552
- }
545
+ alignBox: "row"
553
546
  }, isLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
554
547
  align: "both",
555
548
  className: _SelectModule["default"].loader
@@ -91,8 +91,7 @@ var GroupSelect_defaultProps = {
91
91
  allowValueFallback: true
92
92
  };
93
93
  exports.GroupSelect_defaultProps = GroupSelect_defaultProps;
94
-
95
- var SelectWithAvatar_defaultProps = _defineProperty({
94
+ var SelectWithAvatar_defaultProps = {
96
95
  animationStyle: 'bounce',
97
96
  defaultDropBoxPosition: 'bottom',
98
97
  dropBoxSize: 'small',
@@ -118,8 +117,7 @@ var SelectWithAvatar_defaultProps = _defineProperty({
118
117
  customProps: {},
119
118
  needEffect: true,
120
119
  isLoading: false
121
- }, "customProps", {});
122
-
120
+ };
123
121
  exports.SelectWithAvatar_defaultProps = SelectWithAvatar_defaultProps;
124
122
  var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
125
123
  isReadOnly: false,
@@ -130,5 +128,5 @@ var SelectWithIcon_defaultProps = (_SelectWithIcon_defau = {
130
128
  needListBorder: false,
131
129
  needSearch: false,
132
130
  boxSize: 'default'
133
- }, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "searchFields", []), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "isAbsolutePositioningNeeded", true), _defineProperty(_SelectWithIcon_defau, "isRestrictScroll", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}), _defineProperty(_SelectWithIcon_defau, "customClass", {}), _SelectWithIcon_defau);
131
+ }, _defineProperty(_SelectWithIcon_defau, "needListBorder", false), _defineProperty(_SelectWithIcon_defau, "needCloseOnSelect", true), _defineProperty(_SelectWithIcon_defau, "borderColor", 'default'), _defineProperty(_SelectWithIcon_defau, "needTick", true), _defineProperty(_SelectWithIcon_defau, "searchBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "size", 'medium'), _defineProperty(_SelectWithIcon_defau, "searchFields", []), _defineProperty(_SelectWithIcon_defau, "textBoxSize", 'medium'), _defineProperty(_SelectWithIcon_defau, "textBoxVariant", 'default'), _defineProperty(_SelectWithIcon_defau, "dataId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dataSelectorId", 'selectWithIcon'), _defineProperty(_SelectWithIcon_defau, "dropBoxSize", 'small'), _defineProperty(_SelectWithIcon_defau, "needIcon", true), _defineProperty(_SelectWithIcon_defau, "iconSize", '14'), _defineProperty(_SelectWithIcon_defau, "i18nKeys", {}), _defineProperty(_SelectWithIcon_defau, "isLoading", false), _defineProperty(_SelectWithIcon_defau, "isAbsolutePositioningNeeded", true), _defineProperty(_SelectWithIcon_defau, "isRestrictScroll", false), _defineProperty(_SelectWithIcon_defau, "customProps", {}), _SelectWithIcon_defau);
134
132
  exports.SelectWithIcon_defaultProps = SelectWithIcon_defaultProps;
@@ -203,8 +203,7 @@ var GroupSelect_propTypes = {
203
203
  isDefaultSelectValue: _propTypes["default"].bool,
204
204
  customProps: _propTypes["default"].shape({
205
205
  TextBoxProps: _propTypes["default"].object,
206
- TextBoxIconProps: _propTypes["default"].object,
207
- SuggestionsProps: _propTypes["default"].object
206
+ TextBoxIconProps: _propTypes["default"].object
208
207
  }),
209
208
  allowValueFallback: _propTypes["default"].bool
210
209
  };
@@ -269,10 +268,7 @@ var SelectWithAvatar_propTypes = _objectSpread(_objectSpread({}, Select_propType
269
268
  htmlId: _propTypes["default"].string,
270
269
  needEffect: _propTypes["default"].bool,
271
270
  isLoading: _propTypes["default"].bool,
272
- dataSelectorId: _propTypes["default"].string,
273
- customProps: _propTypes["default"].shape({
274
- SuggestionsProps: _propTypes["default"].object
275
- })
271
+ dataSelectorId: _propTypes["default"].string
276
272
  });
277
273
 
278
274
  exports.SelectWithAvatar_propTypes = SelectWithAvatar_propTypes;
@@ -339,11 +335,7 @@ var SelectWithIcon_propTypes = {
339
335
  TextBoxProps: _propTypes["default"].object,
340
336
  DropdownSearchTextBoxProps: _propTypes["default"].object,
341
337
  SuggestionsProps: _propTypes["default"].object,
342
- TextBoxIconProps: _propTypes["default"].object,
343
- ListItemProps: _propTypes["default"].object
344
- }),
345
- customClass: _propTypes["default"].shape({
346
- dropBoxClass: _propTypes["default"].string
338
+ TextBoxIconProps: _propTypes["default"].object
347
339
  })
348
340
  };
349
341
  exports.SelectWithIcon_propTypes = SelectWithIcon_propTypes;
@@ -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 {
@@ -3,49 +3,107 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = Label;
6
+ exports["default"] = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _defaultProps = require("./props/defaultProps");
10
+ var _defaultProps = _interopRequireDefault(require("./props/defaultProps"));
11
11
 
12
12
  var _propTypes = require("./props/propTypes");
13
13
 
14
- var _LabelModule = _interopRequireDefault(require("../../Label/Label.module.css"));
14
+ var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
15
15
 
16
- var _LabelColorsModule = _interopRequireDefault(require("../../Label/LabelColors.module.css"));
16
+ var _utils = require("@zohodesk/utils");
17
+
18
+ var _ComponentRegistry = require("@zohodesk/dotkit/es/react/ComponentRegistry");
19
+
20
+ var _Flex = _interopRequireDefault(require("@zohodesk/layout/es/Flex/Flex"));
21
+
22
+ var _Typography = _interopRequireDefault(require("../../Typography/Typography"));
23
+
24
+ var _Label_v1Module = _interopRequireDefault(require("./css/Label_v1.module.css"));
17
25
 
18
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
27
 
20
- function Label(props) {
21
- var text = props.text,
22
- type = props.type,
23
- palette = props.palette,
24
- size = props.size,
25
- clipped = props.clipped,
26
- htmlFor = props.htmlFor,
27
- title = props.title,
28
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
29
+
30
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
+
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
+
34
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
+
36
+ var Label = function Label(props) {
37
+ var htmlFor = props.htmlFor,
28
38
  onClick = props.onClick,
29
- dataId = props.dataId,
30
- dataSelectorId = props.dataSelectorId,
31
- variant = props.variant,
39
+ text = props.text,
40
+ customId = props.customId,
41
+ testId = props.testId,
42
+ tagAttributes = props.tagAttributes,
43
+ a11yAttributes = props.a11yAttributes,
44
+ customProps = props.customProps,
45
+ isRequired = props.isRequired,
46
+ requiredType = props.requiredType,
47
+ isClipped = props.isClipped,
48
+ renderRightPlaceholderNode = props.renderRightPlaceholderNode,
49
+ renderLeftPlaceholderNode = props.renderLeftPlaceholderNode,
32
50
  customClass = props.customClass,
33
- id = props.id,
34
- _props$a11y = props.a11y,
35
- a11y = _props$a11y === void 0 ? {} : _props$a11y;
36
- var tabIndex = a11y.tabIndex;
37
- return /*#__PURE__*/_react["default"].createElement("label", {
38
- className: "".concat(_LabelModule["default"].label, " ").concat(_LabelModule["default"][type], " ").concat(_LabelModule["default"][size], " ").concat(_LabelColorsModule["default"][palette], " ").concat(_LabelModule["default"]["font_".concat(variant)], "\n ").concat(clipped ? _LabelModule["default"].dotted : '', " ").concat(onClick ? _LabelModule["default"].pointer : _LabelModule["default"].cursor, " ").concat(customClass, " "),
39
- htmlFor: htmlFor,
40
- "data-title": title,
41
- "data-id": dataId,
42
- "data-test-id": dataId,
43
- "data-selector-id": dataSelectorId,
44
- onClick: onClick,
45
- id: id,
46
- tabIndex: tabIndex
47
- }, text);
48
- }
49
-
50
- Label.defaultProps = _defaultProps.defaultProps;
51
+ size = props.size;
52
+ var tagAttributes_container = tagAttributes.container,
53
+ tagAttributes_label = tagAttributes.label;
54
+ var a11yAttributes_container = a11yAttributes.container,
55
+ a11yAttributes_label = a11yAttributes.label;
56
+ var customProps_container = customProps.container,
57
+ customProps_label = customProps.label;
58
+ var customClass_container = customClass.container;
59
+ var style = (0, _utils.mergeStyle)(_Label_v1Module["default"]);
60
+
61
+ var _cssJSLogic = (0, _cssJSLogic2["default"])(_objectSpread(_objectSpread({}, props), {}, {
62
+ style: style
63
+ })),
64
+ labelClass = _cssJSLogic.labelClass,
65
+ requiredClass = _cssJSLogic.requiredClass,
66
+ asteriskClass = _cssJSLogic.asteriskClass;
67
+
68
+ var a11yAttributes_requiredText = {
69
+ 'aria-hidden': 'true'
70
+ };
71
+
72
+ var renderRequired = function renderRequired() {
73
+ return /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
74
+ $ui_tagName: "span",
75
+ $ui_className: requiredClass,
76
+ $a11yAttributes_text: a11yAttributes_requiredText
77
+ }, requiredType === 'text' ? '(Required)' : requiredType === 'asterisk' ? '*' : null);
78
+ };
79
+
80
+ return /*#__PURE__*/_react["default"].createElement(_Flex["default"], _extends({}, customProps_container, {
81
+ $tagAttributes_container: _objectSpread({
82
+ 'data-selector-id': customId
83
+ }, tagAttributes_container),
84
+ $ui_displayMode: "inline",
85
+ $ui_alignItems: "center",
86
+ $a11yAttributes_container: a11yAttributes_container,
87
+ testId: testId,
88
+ customId: customId,
89
+ $ui_className: customClass_container
90
+ }), (0, _utils.isRenderable)(renderRightPlaceholderNode) ? (0, _utils.renderNode)(renderRightPlaceholderNode) : null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], _extends({}, customProps_label, {
91
+ $tagAttributes_text: _objectSpread({
92
+ htmlFor: htmlFor,
93
+ onClick: onClick
94
+ }, tagAttributes_label),
95
+ $ui_tagName: "label",
96
+ $ui_className: labelClass,
97
+ $i18n_dataTitle: text,
98
+ $a11yAttributes_text: a11yAttributes_label,
99
+ $ui_size: style[size]
100
+ }), text, isRequired ? !isClipped && renderRequired() : null), isRequired ? isClipped && renderRequired() : null, (0, _utils.isRenderable)(renderLeftPlaceholderNode) ? (0, _utils.renderNode)(renderLeftPlaceholderNode) : null);
101
+ };
102
+
103
+ var _default = (0, _ComponentRegistry.withComponentRegistrar)(Label, {
104
+ name: 'ZDC_v1_Label'
105
+ });
106
+
107
+ exports["default"] = _default;
108
+ Label.defaultProps = _defaultProps["default"];
51
109
  Label.propTypes = _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,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = cssJSLogic;
7
+
8
+ var _compileClassNames4 = _interopRequireDefault(require("@zohodesk/utils/es/compileClassNames"));
9
+
10
+ var _excluded = ["style"];
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+
18
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
19
+
20
+ function cssJSLogic(_ref) {
21
+ var _compileClassNames;
22
+
23
+ var style = _ref.style,
24
+ props = _objectWithoutProperties(_ref, _excluded);
25
+
26
+ var isClipped = props.isClipped,
27
+ shouldHighlightRequired = props.shouldHighlightRequired,
28
+ isRequired = props.isRequired,
29
+ isDisabled = props.isDisabled,
30
+ customClass = props.customClass;
31
+ var customClass_label = customClass.label;
32
+ var labelClass = (0, _compileClassNames4["default"])((_compileClassNames = {}, _defineProperty(_compileClassNames, style.label, true), _defineProperty(_compileClassNames, style.dotted, isClipped), _defineProperty(_compileClassNames, style.required, isRequired && shouldHighlightRequired), _defineProperty(_compileClassNames, style.disabled, isDisabled && !isRequired), _defineProperty(_compileClassNames, customClass_label, !!customClass_label), _compileClassNames));
33
+ var requiredClass = (0, _compileClassNames4["default"])(_defineProperty({}, style.requiredTxt, true));
34
+ var asteriskClass = (0, _compileClassNames4["default"])(_defineProperty({}, style.asterisk, true));
35
+ return {
36
+ labelClass: labelClass,
37
+ requiredClass: requiredClass,
38
+ asteriskClass: asteriskClass
39
+ };
40
+ }
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.defaultProps = void 0;
7
- var defaultProps = {
8
- clipped: false,
9
- dataId: 'label',
10
- palette: 'default',
11
- size: 'medium',
12
- text: 'Label',
13
- type: 'title',
14
- variant: 'default',
15
- customClass: '',
16
- dataSelectorId: 'label'
6
+ exports["default"] = void 0;
7
+ var _default = {
8
+ customProps: {},
9
+ tagAttributes: {},
10
+ a11yAttributes: {},
11
+ customClass: {},
12
+ shouldHighlightRequired: true,
13
+ isDisabled: false,
14
+ isClipped: false,
15
+ requiredType: 'asterisk',
16
+ size: 'medium'
17
17
  };
18
- exports.defaultProps = defaultProps;
18
+ exports["default"] = _default;