@zohodesk/components 1.0.0-temp-221.1 → 1.0.0-temp-199.13

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 (56) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/es/ListItem/ListContainer.js +3 -2
  3. package/es/ListItem/ListItem.js +5 -3
  4. package/es/ListItem/ListItem.module.css +25 -2
  5. package/es/ListItem/ListItemWithAvatar.js +10 -4
  6. package/es/ListItem/ListItemWithCheckBox.js +9 -3
  7. package/es/ListItem/ListItemWithIcon.js +11 -4
  8. package/es/ListItem/ListItemWithRadio.js +9 -3
  9. package/es/ListItem/props/defaultProps.js +12 -6
  10. package/es/ListItem/props/propTypes.js +7 -1
  11. package/es/MultiSelect/AdvancedGroupMultiSelect.js +7 -2
  12. package/es/MultiSelect/MultiSelect.js +7 -2
  13. package/es/MultiSelect/Suggestions.js +9 -2
  14. package/es/MultiSelect/props/defaultProps.js +4 -1
  15. package/es/MultiSelect/props/propTypes.js +11 -3
  16. package/es/Select/GroupSelect.js +5 -1
  17. package/es/Select/SelectWithAvatar.js +7 -2
  18. package/es/Select/SelectWithIcon.js +4 -2
  19. package/es/Select/props/defaultProps.js +2 -1
  20. package/es/Select/props/propTypes.js +8 -3
  21. package/es/common/common.module.css +5 -0
  22. package/lib/ListItem/ListContainer.js +3 -2
  23. package/lib/ListItem/ListItem.js +5 -3
  24. package/lib/ListItem/ListItem.module.css +25 -2
  25. package/lib/ListItem/ListItemWithAvatar.js +10 -4
  26. package/lib/ListItem/ListItemWithCheckBox.js +9 -3
  27. package/lib/ListItem/ListItemWithIcon.js +11 -4
  28. package/lib/ListItem/ListItemWithRadio.js +9 -3
  29. package/lib/ListItem/props/defaultProps.js +12 -6
  30. package/lib/ListItem/props/propTypes.js +7 -2
  31. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +8 -3
  32. package/lib/MultiSelect/MultiSelect.js +6 -3
  33. package/lib/MultiSelect/Suggestions.js +9 -3
  34. package/lib/MultiSelect/props/defaultProps.js +4 -1
  35. package/lib/MultiSelect/props/propTypes.js +10 -3
  36. package/lib/Select/GroupSelect.js +4 -2
  37. package/lib/Select/SelectWithAvatar.js +8 -3
  38. package/lib/Select/SelectWithIcon.js +5 -3
  39. package/lib/Select/props/defaultProps.js +2 -1
  40. package/lib/Select/props/propTypes.js +8 -3
  41. package/lib/common/common.module.css +5 -0
  42. package/package.json +2 -2
  43. package/result.json +1 -1
  44. package/assets/Appearance/dark/mode/Component_v2_DarkMode.module.css +0 -4
  45. package/assets/Appearance/light/mode/Component_v2_LightMode.module.css +0 -4
  46. package/assets/Appearance/pureDark/mode/Component_v2_PureDarkMode.module.css +0 -4
  47. package/es/components-v2/Label/Label.js +0 -86
  48. package/es/components-v2/Label/css/Label_v2.module.css +0 -41
  49. package/es/components-v2/Label/css/cssJSLogic.js +0 -27
  50. package/es/components-v2/Label/props/defaultProps.js +0 -8
  51. package/es/components-v2/Label/props/propTypes.js +0 -26
  52. package/lib/components-v2/Label/Label.js +0 -104
  53. package/lib/components-v2/Label/css/Label_v2.module.css +0 -41
  54. package/lib/components-v2/Label/css/cssJSLogic.js +0 -30
  55. package/lib/components-v2/Label/props/defaultProps.js +0 -15
  56. package/lib/components-v2/Label/props/propTypes.js +0 -37
@@ -1,4 +0,0 @@
1
- [data-mode='dark'] {
2
- /* label */
3
- --zdt_v2_label_mandatory_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
4
- }
@@ -1,4 +0,0 @@
1
- [data-mode='light'] {
2
- /* label */
3
- --zdt_v2_label_mandatory_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
4
- }
@@ -1,4 +0,0 @@
1
- [data-mode='pureDark'] {
2
- /* label */
3
- --zdt_v2_label_mandatory_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
4
- }
@@ -1,86 +0,0 @@
1
- import React, { useContext, useEffect, useState } from 'react'; // props
2
-
3
- import defaultProps from "./props/defaultProps";
4
- import { propTypes } from "./props/propTypes"; // methods
5
-
6
- import cssJSLogic from "./css/cssJSLogic";
7
- import { mergeStyle } from '@zohodesk/utils'; // components
8
-
9
- import Flex from '@zohodesk/layout/es/Flex/Flex';
10
- import Typography from "../../Typography/Typography"; // css
11
-
12
- import defaultStyle from "./css/Label_v2.module.css";
13
- import LibraryContext from "../../Provider/LibraryContextInit";
14
-
15
- const Label = props => {
16
- const {
17
- htmlFor,
18
- onClick,
19
- text,
20
- customId,
21
- testId,
22
- customStyle,
23
- tagAttributes,
24
- a11yAttributes,
25
- customProps,
26
- isMandatory
27
- } = props;
28
- const {
29
- labelMandatoryType,
30
- shouldHighlightMandatoryLabel
31
- } = useContext(LibraryContext);
32
- const {
33
- container: tagAttributes_container,
34
- label: tagAttributes_label
35
- } = tagAttributes;
36
- const {
37
- container: a11yAttributes_container,
38
- label: a11yAttributes_label
39
- } = a11yAttributes;
40
- const {
41
- container: customProps_container,
42
- label: customProps_label
43
- } = customProps;
44
- const style = mergeStyle(defaultStyle, customStyle);
45
- const {
46
- labelClass,
47
- requiredClass
48
- } = cssJSLogic({
49
- props: { ...props,
50
- labelMandatoryType,
51
- shouldHighlightMandatoryLabel,
52
- isMandatory
53
- },
54
- style
55
- });
56
- return /*#__PURE__*/React.createElement(Flex, {
57
- $ui_displayMode: "inline",
58
- $ui_alignItems: "center",
59
- $tagAttributes_container: {
60
- 'data-selector-id': customId,
61
- ...tagAttributes_container
62
- },
63
- $a11yAttributes_container: a11yAttributes_container,
64
- testId: testId,
65
- customId: customId,
66
- ...customProps_container
67
- }, /*#__PURE__*/React.createElement(Typography, {
68
- $ui_tagName: "label",
69
- $ui_className: labelClass,
70
- $i18n_dataTitle: text,
71
- $tagAttributes_text: {
72
- htmlFor: htmlFor,
73
- onClick: onClick,
74
- ...tagAttributes_label
75
- },
76
- $a11yAttributes_text: a11yAttributes_label,
77
- ...customProps_label
78
- }, text), isMandatory && labelMandatoryType === 'text' ? /*#__PURE__*/React.createElement(Typography, {
79
- $ui_tagName: "span",
80
- $ui_className: requiredClass
81
- }, "(Required)") : '');
82
- };
83
-
84
- export default Label;
85
- Label.defaultProps = defaultProps;
86
- Label.propTypes = propTypes;
@@ -1,41 +0,0 @@
1
- .label {
2
- font-size: var(--zd_font_size14) ;
3
- line-height: 1.286;
4
- color: var(--zdt_v2_label_text);
5
- cursor: pointer;
6
- }
7
-
8
- .dotted {
9
- composes: dotted from '../../../common/common.module.css';
10
- }
11
-
12
- .mandatory {
13
- color: var(--zdt_v2_label_mandatory_text);
14
- }
15
-
16
- .asterisk:after {
17
- content: "*";
18
- color: var(--zdt_v2_label_mandatory_text);
19
- }
20
-
21
- [dir=ltr] .asterisk:after {
22
- padding-left: var(--zd_size2) ;
23
- }
24
-
25
- [dir=rtl] .asterisk:after {
26
- padding-right: var(--zd_size2) ;
27
- }
28
-
29
- .requiredTxt {
30
- color: var(--zdt_v2_label_mandatory_text);
31
- font-size: var(--zd_font_size14) ;
32
- line-height: 1.286;
33
- }
34
-
35
- [dir=ltr] .requiredTxt {
36
- margin-left: var(--zd_size5) ;
37
- }
38
-
39
- [dir=rtl] .requiredTxt {
40
- margin-right: var(--zd_size5) ;
41
- }
@@ -1,27 +0,0 @@
1
- import compileClassNames from '@zohodesk/utils/es/compileClassNames';
2
- export default function cssJSLogic(_ref) {
3
- let {
4
- props,
5
- style
6
- } = _ref;
7
- const {
8
- clipped,
9
- labelMandatoryType,
10
- shouldHighlightMandatoryLabel,
11
- isMandatory
12
- } = props; // const shouldHighlightMandatory = localStorage?.getItem('mandatoryAppearance') === 'true';
13
-
14
- let labelClass = compileClassNames({
15
- [style.label]: true,
16
- [style.dotted]: clipped,
17
- [style.asterisk]: isMandatory && labelMandatoryType === 'asterisk',
18
- [style.mandatory]: isMandatory && shouldHighlightMandatoryLabel
19
- });
20
- let requiredClass = compileClassNames({
21
- [style.requiredTxt]: true
22
- });
23
- return {
24
- labelClass,
25
- requiredClass
26
- };
27
- }
@@ -1,8 +0,0 @@
1
- export default {
2
- customProps: {},
3
- tagAttributes: {},
4
- a11yAttributes: {},
5
- customStyle: {},
6
- shouldHighlightMandatory: false,
7
- clipped: true
8
- };
@@ -1,26 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- export default {
3
- htmlFor: PropTypes.string,
4
- text: PropTypes.string,
5
- onClick: PropTypes.func,
6
- tabIndex: PropTypes.number,
7
- a11yAttributes: PropTypes.shape({
8
- container: PropTypes.object,
9
- label: PropTypes.object
10
- }),
11
- tagAttributes: PropTypes.shape({
12
- container: PropTypes.object,
13
- label: PropTypes.object
14
- }),
15
- customProps: PropTypes.shape({
16
- container: PropTypes.object,
17
- label: PropTypes.object
18
- }),
19
- customId: PropTypes.string,
20
- testId: PropTypes.string,
21
- customStyle: PropTypes.object,
22
- mandatoryType: PropTypes.oneOf(['asterisk', 'text']),
23
- shouldHighlightMandatory: PropTypes.bool,
24
- clipped: PropTypes.bool,
25
- isMandatory: PropTypes.bool
26
- };
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _defaultProps = _interopRequireDefault(require("./props/defaultProps"));
13
-
14
- var _propTypes = require("./props/propTypes");
15
-
16
- var _cssJSLogic2 = _interopRequireDefault(require("./css/cssJSLogic"));
17
-
18
- var _utils = require("@zohodesk/utils");
19
-
20
- var _Flex = _interopRequireDefault(require("@zohodesk/layout/es/Flex/Flex"));
21
-
22
- var _Typography = _interopRequireDefault(require("../../Typography/Typography"));
23
-
24
- var _Label_v2Module = _interopRequireDefault(require("./css/Label_v2.module.css"));
25
-
26
- var _LibraryContextInit = _interopRequireDefault(require("../../Provider/LibraryContextInit"));
27
-
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
-
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
-
34
- 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); }
35
-
36
- 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; }
37
-
38
- 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; }
39
-
40
- 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; }
41
-
42
- var Label = function Label(props) {
43
- var htmlFor = props.htmlFor,
44
- onClick = props.onClick,
45
- text = props.text,
46
- customId = props.customId,
47
- testId = props.testId,
48
- customStyle = props.customStyle,
49
- tagAttributes = props.tagAttributes,
50
- a11yAttributes = props.a11yAttributes,
51
- customProps = props.customProps,
52
- isMandatory = props.isMandatory;
53
-
54
- var _useContext = (0, _react.useContext)(_LibraryContextInit["default"]),
55
- labelMandatoryType = _useContext.labelMandatoryType,
56
- shouldHighlightMandatoryLabel = _useContext.shouldHighlightMandatoryLabel;
57
-
58
- var tagAttributes_container = tagAttributes.container,
59
- tagAttributes_label = tagAttributes.label;
60
- var a11yAttributes_container = a11yAttributes.container,
61
- a11yAttributes_label = a11yAttributes.label;
62
- var customProps_container = customProps.container,
63
- customProps_label = customProps.label;
64
- var style = (0, _utils.mergeStyle)(_Label_v2Module["default"], customStyle);
65
-
66
- var _cssJSLogic = (0, _cssJSLogic2["default"])({
67
- props: _objectSpread(_objectSpread({}, props), {}, {
68
- labelMandatoryType: labelMandatoryType,
69
- shouldHighlightMandatoryLabel: shouldHighlightMandatoryLabel,
70
- isMandatory: isMandatory
71
- }),
72
- style: style
73
- }),
74
- labelClass = _cssJSLogic.labelClass,
75
- requiredClass = _cssJSLogic.requiredClass;
76
-
77
- return /*#__PURE__*/_react["default"].createElement(_Flex["default"], _extends({
78
- $ui_displayMode: "inline",
79
- $ui_alignItems: "center",
80
- $tagAttributes_container: _objectSpread({
81
- 'data-selector-id': customId
82
- }, tagAttributes_container),
83
- $a11yAttributes_container: a11yAttributes_container,
84
- testId: testId,
85
- customId: customId
86
- }, customProps_container), /*#__PURE__*/_react["default"].createElement(_Typography["default"], _extends({
87
- $ui_tagName: "label",
88
- $ui_className: labelClass,
89
- $i18n_dataTitle: text,
90
- $tagAttributes_text: _objectSpread({
91
- htmlFor: htmlFor,
92
- onClick: onClick
93
- }, tagAttributes_label),
94
- $a11yAttributes_text: a11yAttributes_label
95
- }, customProps_label), text), isMandatory && labelMandatoryType === 'text' ? /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
96
- $ui_tagName: "span",
97
- $ui_className: requiredClass
98
- }, "(Required)") : '');
99
- };
100
-
101
- var _default = Label;
102
- exports["default"] = _default;
103
- Label.defaultProps = _defaultProps["default"];
104
- Label.propTypes = _propTypes.propTypes;
@@ -1,41 +0,0 @@
1
- .label {
2
- font-size: var(--zd_font_size14) ;
3
- line-height: 1.286;
4
- color: var(--zdt_v2_label_text);
5
- cursor: pointer;
6
- }
7
-
8
- .dotted {
9
- composes: dotted from '../../../common/common.module.css';
10
- }
11
-
12
- .mandatory {
13
- color: var(--zdt_v2_label_mandatory_text);
14
- }
15
-
16
- .asterisk:after {
17
- content: "*";
18
- color: var(--zdt_v2_label_mandatory_text);
19
- }
20
-
21
- [dir=ltr] .asterisk:after {
22
- padding-left: var(--zd_size2) ;
23
- }
24
-
25
- [dir=rtl] .asterisk:after {
26
- padding-right: var(--zd_size2) ;
27
- }
28
-
29
- .requiredTxt {
30
- color: var(--zdt_v2_label_mandatory_text);
31
- font-size: var(--zd_font_size14) ;
32
- line-height: 1.286;
33
- }
34
-
35
- [dir=ltr] .requiredTxt {
36
- margin-left: var(--zd_size5) ;
37
- }
38
-
39
- [dir=rtl] .requiredTxt {
40
- margin-right: var(--zd_size5) ;
41
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = cssJSLogic;
7
-
8
- var _compileClassNames3 = _interopRequireDefault(require("@zohodesk/utils/es/compileClassNames"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
- 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; }
13
-
14
- function cssJSLogic(_ref) {
15
- var _compileClassNames;
16
-
17
- var props = _ref.props,
18
- style = _ref.style;
19
- var clipped = props.clipped,
20
- labelMandatoryType = props.labelMandatoryType,
21
- shouldHighlightMandatoryLabel = props.shouldHighlightMandatoryLabel,
22
- isMandatory = props.isMandatory; // const shouldHighlightMandatory = localStorage?.getItem('mandatoryAppearance') === 'true';
23
-
24
- var labelClass = (0, _compileClassNames3["default"])((_compileClassNames = {}, _defineProperty(_compileClassNames, style.label, true), _defineProperty(_compileClassNames, style.dotted, clipped), _defineProperty(_compileClassNames, style.asterisk, isMandatory && labelMandatoryType === 'asterisk'), _defineProperty(_compileClassNames, style.mandatory, isMandatory && shouldHighlightMandatoryLabel), _compileClassNames));
25
- var requiredClass = (0, _compileClassNames3["default"])(_defineProperty({}, style.requiredTxt, true));
26
- return {
27
- labelClass: labelClass,
28
- requiredClass: requiredClass
29
- };
30
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _default = {
8
- customProps: {},
9
- tagAttributes: {},
10
- a11yAttributes: {},
11
- customStyle: {},
12
- shouldHighlightMandatory: false,
13
- clipped: true
14
- };
15
- exports["default"] = _default;
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
- var _default = {
13
- htmlFor: _propTypes["default"].string,
14
- text: _propTypes["default"].string,
15
- onClick: _propTypes["default"].func,
16
- tabIndex: _propTypes["default"].number,
17
- a11yAttributes: _propTypes["default"].shape({
18
- container: _propTypes["default"].object,
19
- label: _propTypes["default"].object
20
- }),
21
- tagAttributes: _propTypes["default"].shape({
22
- container: _propTypes["default"].object,
23
- label: _propTypes["default"].object
24
- }),
25
- customProps: _propTypes["default"].shape({
26
- container: _propTypes["default"].object,
27
- label: _propTypes["default"].object
28
- }),
29
- customId: _propTypes["default"].string,
30
- testId: _propTypes["default"].string,
31
- customStyle: _propTypes["default"].object,
32
- mandatoryType: _propTypes["default"].oneOf(['asterisk', 'text']),
33
- shouldHighlightMandatory: _propTypes["default"].bool,
34
- clipped: _propTypes["default"].bool,
35
- isMandatory: _propTypes["default"].bool
36
- };
37
- exports["default"] = _default;