@zohodesk/dot 1.0.0-beta.254 → 1.0.0-beta.255

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.
package/README.md CHANGED
@@ -2,10 +2,17 @@
2
2
 
3
3
  In this Library, we Provide Some Basic Components to Build Your Application
4
4
 
5
+ # 1.0.0-beta.255
6
+
7
+ - **TagWithIcon** - New component Added.
8
+
9
+ - **FreezeLayer** - cancel click preventing issue solved.
10
+
5
11
  # 1.0.0-beta.254
6
12
 
7
- - Contrast option implemented through preprocess. Category key value added for all color variables.
8
- - BoxShadow Values Separated for Contrast
13
+ - `Contrast` option implemented through preprocess. Category key value added for all color variables.
14
+
15
+ - BoxShadow Values Separated for Contrast.
9
16
 
10
17
  # 1.0.0-beta.253
11
18
 
@@ -528,4 +528,15 @@
528
528
  --zdt_separator_default_text: hsla(216, 23%, calc(32% + var(--zd_dark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
529
529
  --zdt_separator_primary_text: var(--zdt_cta_primary_text);
530
530
  --zdt_separator_secondary_text: hsla(210, 7%, calc(89% + var(--zd_dark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
531
+
532
+ /* tag with icon */
533
+ --zdt_tagWithIconGrey_bg: rgba(255, 255, 255, 0.03);
534
+ --zdt_tagWithIconGrey_border: hsla(0, calc(0 * 1%), calc(100% + var(--zd_dark_default_inverse_medium_lValue)), calc( 0.2 + var(--zd_alpha_low)));
535
+ --zdt_tagWithIconGrey_text: hsla(210, 7%, calc(89% + var(--zd_dark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
536
+ --zdt_tagWithIconBlue_bg: hsla(215, 28%, calc(20% + var(--zd_dark_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
537
+ --zdt_tagWithIconBlue_border: hsla(213, 40%, calc(29% + var(--zd_dark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
538
+ --zdt_tagWithIconBlue_text: hsla(212, 100%, calc(64% + var(--zd_dark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
539
+ --zdt_tagWithIconYellow_bg: hsla(215, 12%, calc(20% + var(--zd_dark_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
540
+ --zdt_tagWithIconYellow_border: hsla(35, 18%, calc(29% + var(--zd_dark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
541
+ --zdt_tagWithIconYellow_text: hsla(37, 91%, calc(61% + var(--zd_dark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
531
542
  }
@@ -528,4 +528,15 @@
528
528
  --zdt_separator_default_text: hsla(0, calc(0 * 1%), calc(79% + var(--zd_default_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
529
529
  --zdt_separator_primary_text: var(--zdt_cta_primary_text);
530
530
  --zdt_separator_secondary_text: hsla(0, calc(0 * 1%), calc(0% + var(--zd_default_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
531
+
532
+ /* tag with icon */
533
+ --zdt_tagWithIconGrey_bg: var(--zdt_m_cta_grey_20_bg_ignore);
534
+ --zdt_tagWithIconGrey_border: var(--zdt_cta_grey_35_border);
535
+ --zdt_tagWithIconGrey_text: hsla(0, calc(0 * 1%), calc(0% + var(--zd_default_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
536
+ --zdt_tagWithIconBlue_bg: hsla(213, 85%, calc(95% + var(--zd_default_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
537
+ --zdt_tagWithIconBlue_border: hsla(212, 83%, calc(86% + var(--zd_default_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
538
+ --zdt_tagWithIconBlue_text: hsla(212, 92%, calc(48% + var(--zd_default_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
539
+ --zdt_tagWithIconYellow_bg: hsla(49, 92%, calc(95% + var(--zd_default_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
540
+ --zdt_tagWithIconYellow_border: hsla(49, 84%, calc(83% + var(--zd_default_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
541
+ --zdt_tagWithIconYellow_text: hsla(29, 90%, calc(66% + var(--zd_default_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
531
542
  }
@@ -528,4 +528,15 @@
528
528
  --zdt_separator_default_text: hsla(0, calc(0 * 1%), calc(35% + var(--zd_pureDark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
529
529
  --zdt_separator_primary_text: var(--zdt_cta_primary_text);
530
530
  --zdt_separator_secondary_text: hsla(210, 7%, calc(89% + var(--zd_pureDark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
531
+
532
+ /* tag with icon */
533
+ --zdt_tagWithIconGrey_bg: rgba(255, 255, 255, 0.03);
534
+ --zdt_tagWithIconGrey_border: hsla(0, calc(0 * 1%), calc(100% + var(--zd_pureDark_default_inverse_medium_lValue)), calc( 0.2 + var(--zd_alpha_low)));
535
+ --zdt_tagWithIconGrey_text: hsla(210, 7%, calc(89% + var(--zd_pureDark_default_inverse_lValue)), calc(1 + var(--zd_alpha_high)));
536
+ --zdt_tagWithIconBlue_bg: hsla(215, 28%, calc(20% + var(--zd_pureDark_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
537
+ --zdt_tagWithIconBlue_border: hsla(213, 40%, calc(29% + var(--zd_pureDark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
538
+ --zdt_tagWithIconBlue_text: hsla(212, 100%, calc(64% + var(--zd_pureDark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
539
+ --zdt_tagWithIconYellow_bg: hsla(215, 12%, calc(20% + var(--zd_pureDark_darker_lowest_lValue)), calc(1 + var(--zd_alpha_high)));
540
+ --zdt_tagWithIconYellow_border: hsla(35, 18%, calc(29% + var(--zd_pureDark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
541
+ --zdt_tagWithIconYellow_text: hsla(37, 91%, calc(61% + var(--zd_pureDark_default_inverse_low_lValue)), calc(1 + var(--zd_alpha_low)));
531
542
  }
@@ -12,8 +12,6 @@ export default function useFreezeLayer(_ref) {
12
12
  function handleClick(e) {
13
13
  if (onClick && !isTextSelected()) {
14
14
  onClick(e);
15
- } else {
16
- cancelBubblingEffect(e);
17
15
  }
18
16
  }
19
17
  function enableFreeze() {
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { defaultProps } from './props/defaultProps';
3
+ import { propTypes } from './props/propTypes';
4
+ import { Container, Box } from '@zohodesk/components/es/Layout';
5
+ import Icon from '@zohodesk/icons/es/Icon';
6
+ import style from './TagWithIcon.module.css';
7
+ export default class TagWithIcon extends React.Component {
8
+ render() {
9
+ const {
10
+ text,
11
+ iconName,
12
+ iconSize,
13
+ palette,
14
+ iconClass,
15
+ isBold,
16
+ size,
17
+ dataId,
18
+ className,
19
+ title
20
+ } = this.props;
21
+ return /*#__PURE__*/React.createElement(Container, {
22
+ isInline: true,
23
+ alignBox: "row",
24
+ align: "vertical",
25
+ isCover: false,
26
+ className: `${style.wrapper} ${style[palette]} ${style[size]} ${className}`,
27
+ dataId: dataId,
28
+ title: title
29
+ }, iconName ? /*#__PURE__*/React.createElement(Icon, {
30
+ name: iconName,
31
+ size: iconSize,
32
+ iconClass: `${text ? style.iconSpace : ''} ${iconClass} `
33
+ }) : null, text ? /*#__PURE__*/React.createElement(Box, {
34
+ shrink: true,
35
+ "data-title": text,
36
+ className: `${style.text} ${style[size]}_text ${isBold ? style.bold : ''}`
37
+ }, text) : null);
38
+ }
39
+ }
40
+ TagWithIcon.propTypes = propTypes;
41
+ TagWithIcon.defaultProps = defaultProps;
@@ -0,0 +1,56 @@
1
+ .varClass {
2
+ --tag_bg_color: var(--zdt_tagWithIconGrey_bg);
3
+ --tag_text_color: var(--zdt_tagWithIconGrey_text);
4
+ --tag_border_color: var(--zdt_tagWithIconGrey_border);
5
+ --tag_small_fontSize: var(--zd_font_size10);
6
+ --tag_large_fontSize: var(--zd_font_size12);
7
+ }
8
+ .wrapper {
9
+ composes: varClass;
10
+ color: var(--tag_text_color);
11
+ background-color: var(--tag_bg_color);
12
+ }
13
+ .small,
14
+ .large {
15
+ max-width: 100%;
16
+ height: var(--zd_size18);
17
+ }
18
+ .small, .large {
19
+ border: 1px solid;
20
+ border-color: var(--tag_border_color);
21
+ border-radius: var(--zd_size4);
22
+ padding: 0 var(--zd_size6);
23
+ }
24
+ .bold {
25
+ composes: semibold from '~@zohodesk/components/lib/common/common.module.css';
26
+ }
27
+ .small_text {
28
+ font-size: var(--tag_small_fontSize);
29
+ }
30
+ .large_text {
31
+ font-size: var(--tag_large_fontSize);
32
+ }
33
+ .text {
34
+ composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
35
+ }
36
+ [dir=ltr] .iconSpace{
37
+ margin-right: var(--zd_size4);
38
+ }
39
+ [dir=rtl] .iconSpace{
40
+ margin-left: var(--zd_size4);
41
+ }
42
+ .yellow {
43
+ --tag_bg_color: var(--zdt_tagWithIconYellow_bg);
44
+ --tag_text_color: var(--zdt_tagWithIconYellow_text);
45
+ --tag_border_color: var(--zdt_tagWithIconYellow_border);
46
+ }
47
+ .grey {
48
+ --tag_bg_color: var(--zdt_tagWithIconGrey_bg);
49
+ --tag_text_color: var(--zdt_tagWithIconGrey_text);
50
+ --tag_border_color: var(--zdt_tagWithIconGrey_border);
51
+ }
52
+ .blue {
53
+ --tag_bg_color: var(--zdt_tagWithIconBlue_bg);
54
+ --tag_text_color: var(--zdt_tagWithIconBlue_text);
55
+ --tag_border_color: var(--zdt_tagWithIconBlue_border);
56
+ }
@@ -0,0 +1,8 @@
1
+ export const defaultProps = {
2
+ iconSize: '9',
3
+ size: 'large',
4
+ iconClass: '',
5
+ isBold: true,
6
+ palette: 'grey',
7
+ className: ''
8
+ };
@@ -0,0 +1,12 @@
1
+ import PropTypes from 'prop-types';
2
+ export const propTypes = {
3
+ iconClass: PropTypes.string,
4
+ iconName: PropTypes.string,
5
+ iconSize: PropTypes.string,
6
+ title: PropTypes.string,
7
+ isBold: PropTypes.bool,
8
+ palette: PropTypes.oneOf(['yellow', 'blue', 'grey']),
9
+ size: PropTypes.oneOf('small', 'large'),
10
+ className: PropTypes.string,
11
+ text: PropTypes.string
12
+ };
@@ -31,8 +31,6 @@ function useFreezeLayer(_ref) {
31
31
  function handleClick(e) {
32
32
  if (onClick && !(0, _Common.isTextSelected)()) {
33
33
  onClick(e);
34
- } else {
35
- (0, _Common.cancelBubblingEffect)(e);
36
34
  }
37
35
  }
38
36
  function enableFreeze() {
@@ -0,0 +1,71 @@
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
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _defaultProps = require("./props/defaultProps");
10
+ var _propTypes = require("./props/propTypes");
11
+ var _Layout = require("@zohodesk/components/es/Layout");
12
+ var _Icon = _interopRequireDefault(require("@zohodesk/icons/es/Icon"));
13
+ var _TagWithIconModule = _interopRequireDefault(require("./TagWithIcon.module.css"));
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
17
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
+ var TagWithIcon = /*#__PURE__*/function (_React$Component) {
28
+ _inherits(TagWithIcon, _React$Component);
29
+ var _super = _createSuper(TagWithIcon);
30
+ function TagWithIcon() {
31
+ _classCallCheck(this, TagWithIcon);
32
+ return _super.apply(this, arguments);
33
+ }
34
+ _createClass(TagWithIcon, [{
35
+ key: "render",
36
+ value: function render() {
37
+ var _this$props = this.props,
38
+ text = _this$props.text,
39
+ iconName = _this$props.iconName,
40
+ iconSize = _this$props.iconSize,
41
+ palette = _this$props.palette,
42
+ iconClass = _this$props.iconClass,
43
+ isBold = _this$props.isBold,
44
+ size = _this$props.size,
45
+ dataId = _this$props.dataId,
46
+ className = _this$props.className,
47
+ title = _this$props.title;
48
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
49
+ isInline: true,
50
+ alignBox: "row",
51
+ align: "vertical",
52
+ isCover: false,
53
+ className: "".concat(_TagWithIconModule["default"].wrapper, " ").concat(_TagWithIconModule["default"][palette], " ").concat(_TagWithIconModule["default"][size], " ").concat(className),
54
+ dataId: dataId,
55
+ title: title
56
+ }, iconName ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
57
+ name: iconName,
58
+ size: iconSize,
59
+ iconClass: "".concat(text ? _TagWithIconModule["default"].iconSpace : '', " ").concat(iconClass, " ")
60
+ }) : null, text ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
61
+ shrink: true,
62
+ "data-title": text,
63
+ className: "".concat(_TagWithIconModule["default"].text, " ").concat(_TagWithIconModule["default"][size], "_text ").concat(isBold ? _TagWithIconModule["default"].bold : '')
64
+ }, text) : null);
65
+ }
66
+ }]);
67
+ return TagWithIcon;
68
+ }(_react["default"].Component);
69
+ exports["default"] = TagWithIcon;
70
+ TagWithIcon.propTypes = _propTypes.propTypes;
71
+ TagWithIcon.defaultProps = _defaultProps.defaultProps;
@@ -0,0 +1,56 @@
1
+ .varClass {
2
+ --tag_bg_color: var(--zdt_tagWithIconGrey_bg);
3
+ --tag_text_color: var(--zdt_tagWithIconGrey_text);
4
+ --tag_border_color: var(--zdt_tagWithIconGrey_border);
5
+ --tag_small_fontSize: var(--zd_font_size10);
6
+ --tag_large_fontSize: var(--zd_font_size12);
7
+ }
8
+ .wrapper {
9
+ composes: varClass;
10
+ color: var(--tag_text_color);
11
+ background-color: var(--tag_bg_color);
12
+ }
13
+ .small,
14
+ .large {
15
+ max-width: 100%;
16
+ height: var(--zd_size18);
17
+ }
18
+ .small, .large {
19
+ border: 1px solid;
20
+ border-color: var(--tag_border_color);
21
+ border-radius: var(--zd_size4);
22
+ padding: 0 var(--zd_size6);
23
+ }
24
+ .bold {
25
+ composes: semibold from '~@zohodesk/components/lib/common/common.module.css';
26
+ }
27
+ .small_text {
28
+ font-size: var(--tag_small_fontSize);
29
+ }
30
+ .large_text {
31
+ font-size: var(--tag_large_fontSize);
32
+ }
33
+ .text {
34
+ composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
35
+ }
36
+ [dir=ltr] .iconSpace{
37
+ margin-right: var(--zd_size4);
38
+ }
39
+ [dir=rtl] .iconSpace{
40
+ margin-left: var(--zd_size4);
41
+ }
42
+ .yellow {
43
+ --tag_bg_color: var(--zdt_tagWithIconYellow_bg);
44
+ --tag_text_color: var(--zdt_tagWithIconYellow_text);
45
+ --tag_border_color: var(--zdt_tagWithIconYellow_border);
46
+ }
47
+ .grey {
48
+ --tag_bg_color: var(--zdt_tagWithIconGrey_bg);
49
+ --tag_text_color: var(--zdt_tagWithIconGrey_text);
50
+ --tag_border_color: var(--zdt_tagWithIconGrey_border);
51
+ }
52
+ .blue {
53
+ --tag_bg_color: var(--zdt_tagWithIconBlue_bg);
54
+ --tag_text_color: var(--zdt_tagWithIconBlue_text);
55
+ --tag_border_color: var(--zdt_tagWithIconBlue_border);
56
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultProps = void 0;
7
+ var defaultProps = {
8
+ iconSize: '9',
9
+ size: 'large',
10
+ iconClass: '',
11
+ isBold: true,
12
+ palette: 'grey',
13
+ className: ''
14
+ };
15
+ exports.defaultProps = defaultProps;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.propTypes = void 0;
7
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ var propTypes = {
10
+ iconClass: _propTypes["default"].string,
11
+ iconName: _propTypes["default"].string,
12
+ iconSize: _propTypes["default"].string,
13
+ title: _propTypes["default"].string,
14
+ isBold: _propTypes["default"].bool,
15
+ palette: _propTypes["default"].oneOf(['yellow', 'blue', 'grey']),
16
+ size: _propTypes["default"].oneOf('small', 'large'),
17
+ className: _propTypes["default"].string,
18
+ text: _propTypes["default"].string
19
+ };
20
+ exports.propTypes = propTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/dot",
3
- "version": "1.0.0-beta.254",
3
+ "version": "1.0.0-beta.255",
4
4
  "main": "lib/index",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -96,4 +96,4 @@
96
96
  }
97
97
  }
98
98
  }
99
- }
99
+ }