@zohodesk/components 1.0.0-temp-246 → 1.0.0-temp-242.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 (95) hide show
  1. package/README.md +23 -7
  2. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +0 -2
  3. package/assets/Appearance/light/mode/Component_LightMode.module.css +0 -2
  4. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +0 -2
  5. package/es/AppContainer/AppContainer.js +1 -0
  6. package/es/AppContainer/AppContainer.module.css +3 -2
  7. package/es/Button/css/Button.module.css +13 -4
  8. package/es/CheckBox/CheckBox.js +10 -21
  9. package/es/CheckBox/CheckBox.module.css +6 -21
  10. package/es/CheckBox/__tests__/CheckBox.spec.js +0 -9
  11. package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +93 -162
  12. package/es/CheckBox/props/propTypes.js +1 -4
  13. package/es/DateTime/DateTime.module.css +12 -9
  14. package/es/DateTime/YearView.module.css +1 -1
  15. package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
  16. package/es/DropBox/utils/isMobilePopover.js +3 -14
  17. package/es/Heading/Heading.module.css +1 -1
  18. package/es/Label/Label.js +1 -19
  19. package/es/Label/Label.module.css +8 -8
  20. package/es/Label/__tests__/Label.spec.js +0 -58
  21. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -66
  22. package/es/Label/props/defaultProps.js +0 -1
  23. package/es/Label/props/propTypes.js +1 -7
  24. package/es/MultiSelect/MultiSelect.module.css +1 -1
  25. package/es/Popup/Popup.js +21 -1045
  26. package/es/Radio/Radio.js +9 -20
  27. package/es/Radio/Radio.module.css +5 -38
  28. package/es/Radio/__tests__/Radio.spec.js +0 -10
  29. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +81 -238
  30. package/es/Radio/props/propTypes.js +1 -4
  31. package/es/Tab/Tabs.module.css +1 -1
  32. package/es/TextBox/TextBox.module.css +4 -4
  33. package/es/TextBoxIcon/TextBoxIcon.module.css +0 -6
  34. package/es/Textarea/Textarea.module.css +1 -1
  35. package/es/Tooltip/Tooltip.module.css +1 -1
  36. package/es/Typography/css/Typography.module.css +4 -4
  37. package/es/common/basic.module.css +39 -6
  38. package/es/common/basicReset.module.css +2 -2
  39. package/es/common/common.module.css +5 -5
  40. package/es/shared/InputFieldLine/InputFieldLine.module.css +1 -1
  41. package/es/utils/Common.js +1 -1
  42. package/es/v1/Popup/Popup.js +1 -1
  43. package/es/v1/Tab/v1Tabs.module.css +1 -1
  44. package/es/v1/Typography/css/v1_Typography.module.css +4 -4
  45. package/lib/AppContainer/AppContainer.js +2 -0
  46. package/lib/AppContainer/AppContainer.module.css +3 -2
  47. package/lib/Button/css/Button.module.css +13 -4
  48. package/lib/CheckBox/CheckBox.js +9 -23
  49. package/lib/CheckBox/CheckBox.module.css +6 -21
  50. package/lib/CheckBox/__tests__/CheckBox.spec.js +12 -21
  51. package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +93 -162
  52. package/lib/CheckBox/props/propTypes.js +1 -5
  53. package/lib/DateTime/DateTime.module.css +12 -9
  54. package/lib/DateTime/YearView.module.css +1 -1
  55. package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -5
  56. package/lib/DropBox/utils/isMobilePopover.js +4 -14
  57. package/lib/Heading/Heading.module.css +1 -1
  58. package/lib/Label/Label.js +1 -21
  59. package/lib/Label/Label.module.css +8 -8
  60. package/lib/Label/__tests__/Label.spec.js +0 -58
  61. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -66
  62. package/lib/Label/props/defaultProps.js +0 -1
  63. package/lib/Label/props/propTypes.js +1 -8
  64. package/lib/MultiSelect/MultiSelect.module.css +1 -1
  65. package/lib/Popup/Popup.js +25 -1152
  66. package/lib/Radio/Radio.js +8 -22
  67. package/lib/Radio/Radio.module.css +5 -38
  68. package/lib/Radio/__tests__/Radio.spec.js +0 -10
  69. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +81 -238
  70. package/lib/Radio/props/propTypes.js +1 -5
  71. package/lib/Tab/Tabs.module.css +1 -1
  72. package/lib/TextBox/TextBox.module.css +4 -4
  73. package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -6
  74. package/lib/Textarea/Textarea.module.css +1 -1
  75. package/lib/Tooltip/Tooltip.module.css +1 -1
  76. package/lib/Typography/css/Typography.module.css +4 -4
  77. package/lib/common/basic.module.css +39 -6
  78. package/lib/common/basicReset.module.css +2 -2
  79. package/lib/common/common.module.css +5 -5
  80. package/lib/shared/InputFieldLine/InputFieldLine.module.css +1 -1
  81. package/lib/utils/Common.js +1 -1
  82. package/lib/v1/Popup/Popup.js +1 -1
  83. package/lib/v1/Tab/v1Tabs.module.css +1 -1
  84. package/lib/v1/Typography/css/v1_Typography.module.css +4 -4
  85. package/package.json +5 -5
  86. package/es/DropBox/DropBoxPositionMapping.js +0 -142
  87. package/es/Popup/PositionMapping.js +0 -72
  88. package/es/Popup/Registry.js +0 -36
  89. package/es/Popup/intersectionObserver.js +0 -49
  90. package/es/Popup/viewPort.js +0 -373
  91. package/lib/DropBox/DropBoxPositionMapping.js +0 -149
  92. package/lib/Popup/PositionMapping.js +0 -81
  93. package/lib/Popup/Registry.js +0 -46
  94. package/lib/Popup/intersectionObserver.js +0 -72
  95. package/lib/Popup/viewPort.js +0 -367
@@ -1,12 +1,10 @@
1
1
  import PropTypes from 'prop-types';
2
- import { propTypes as TypographyPropTypes } from "../../Typography/props/propTypes";
3
2
  export const propTypes = {
4
3
  active: PropTypes.bool,
5
4
  activeStyle: PropTypes.oneOf(['tick', 'minus']),
6
5
  checked: PropTypes.bool,
7
6
  dataId: PropTypes.string,
8
7
  dataSelectorId: PropTypes.string,
9
- secondaryText: PropTypes.string,
10
8
  disabled: PropTypes.bool,
11
9
  disabledTitle: PropTypes.string,
12
10
  getRef: PropTypes.func,
@@ -38,8 +36,7 @@ export const propTypes = {
38
36
  }),
39
37
  customProps: PropTypes.shape({
40
38
  CheckBoxProps: PropTypes.object,
41
- LabelProps: PropTypes.object,
42
- secondaryTextProps: PropTypes.exact(TypographyPropTypes)
39
+ LabelProps: PropTypes.object
43
40
  }),
44
41
  renderRightPlaceholderNode: PropTypes.node
45
42
  };
@@ -1,5 +1,5 @@
1
1
  .semibold {
2
- font-family: var(--zd_semibold);
2
+ font-weight: var(--zd-fw-semibold);
3
3
  }
4
4
 
5
5
  [dir=ltr] .boxPadding {
@@ -29,7 +29,7 @@
29
29
  }
30
30
 
31
31
  .datesStr {
32
- font-family: var(--zd_regular);
32
+ font-weight: var(--zd-fw-normal);
33
33
  }
34
34
 
35
35
  .grid {
@@ -122,7 +122,8 @@
122
122
  color: var(--zdt_datetime_invalid_text);
123
123
  }
124
124
 
125
- .invalidDate.holiday,.inActiveDate.holiday:hover {
125
+ .invalidDate.holiday,
126
+ .inActiveDate.holiday:hover {
126
127
  color: var(--zdt_datetime_invaliddate_text);
127
128
  }
128
129
 
@@ -147,15 +148,17 @@
147
148
  background-color: var(--zdt_datetime_selected_bg);
148
149
  border-radius: 50%;
149
150
  }
150
- .inActiveDate{
151
- color: var(--zdt_datetime_invalid_text);
152
- cursor: no-drop;
151
+
152
+ .inActiveDate {
153
+ color: var(--zdt_datetime_invalid_text);
154
+ cursor: no-drop;
153
155
  }
154
- .inActiveDate:hover
155
- {
156
+
157
+ .inActiveDate:hover {
156
158
  color: var(--zdt_datetime_invalid_text);
157
159
  }
158
- .inActiveDate:hover, .inActiveDate.holiday:hover{
160
+
161
+ .inActiveDate:hover, .inActiveDate.holiday:hover {
159
162
  background-color: var(--zdt_datetime_inactivedate_hover_bg);
160
163
 
161
164
  }
@@ -61,7 +61,7 @@
61
61
  }
62
62
 
63
63
  .isActive .yearText {
64
- font-family: var(--zd_semibold);
64
+ font-weight: var(--zd-fw-semibold);
65
65
  color: var(--zdt_yearview_year_hover_text);
66
66
  font-size: var(--zd_font_size11) ;
67
67
  }
@@ -2,7 +2,7 @@
2
2
  import React from 'react';
3
3
  import useDropboxPosCalc from "./useDropboxPosCalc";
4
4
  import cssJSLogic from "./css/cssJSLogic";
5
- import { positionMapping } from "../DropBoxPositionMapping.js";
5
+ import { positionMapping } from '@zohodesk/dotkit/es/react/components/Popup/utils/positioning';
6
6
  import { DropBoxElementDefaultProps } from "./props/defaultProps";
7
7
  import { DropBoxElementPropTypes } from "./props/propTypes";
8
8
  import { mergeStyle } from '@zohodesk/utils';
@@ -1,17 +1,6 @@
1
1
  import { getLibraryConfig } from "../../Provider/Config";
2
+ import { isMobilePopover as isMobile } from '@zohodesk/dotkit/es/react/components/Popup/utils';
2
3
  export default function isMobilePopover(needResponsive) {
3
- // let { needResponsive } = props;
4
- let windowWidth,
5
- mobileWidth = getLibraryConfig('mobileWidth'),
6
- isModel = false;
7
-
8
- if (needResponsive) {
9
- windowWidth = window.innerWidth;
10
-
11
- if (windowWidth <= mobileWidth) {
12
- isModel = true;
13
- }
14
- }
15
-
16
- return isModel ? true : false;
4
+ const mobileWidth = getLibraryConfig('mobileWidth');
5
+ return isMobile(needResponsive, mobileWidth);
17
6
  }
@@ -1,5 +1,5 @@
1
1
  .reset {
2
2
  font-size: inherit ;
3
- font-weight: initial;
3
+ font-weight: var(--zd-fw-semibold);
4
4
  margin: initial ;
5
5
  }
package/es/Label/Label.js CHANGED
@@ -4,8 +4,6 @@
4
4
  import React from 'react';
5
5
  import { defaultProps } from "./props/defaultProps";
6
6
  import { propTypes } from "./props/propTypes";
7
- import Flex from '@zohodesk/layout/es/Flex/Flex';
8
- import { renderNode, isRenderable } from '@zohodesk/utils';
9
7
  import style from "./Label.module.css";
10
8
  import colors from "./LabelColors.module.css";
11
9
  export default class Label extends React.Component {
@@ -22,20 +20,14 @@ export default class Label extends React.Component {
22
20
  dataId,
23
21
  dataSelectorId,
24
22
  variant,
25
- customProps,
26
23
  customClass,
27
24
  id,
28
- renderRightPlaceholderNode,
29
25
  a11y = {}
30
26
  } = this.props;
31
- const {
32
- containerProps,
33
- rightPlaceholderNodeProps
34
- } = customProps;
35
27
  const {
36
28
  tabIndex
37
29
  } = a11y;
38
- const labelElement = /*#__PURE__*/React.createElement("label", {
30
+ return /*#__PURE__*/React.createElement("label", {
39
31
  className: `${style.label} ${style[type]} ${style[size]} ${colors[palette]} ${style[`font_${variant}`]}
40
32
  ${clipped ? style.dotted : ''} ${onClick ? style.pointer : style.cursor} ${customClass} `,
41
33
  htmlFor: htmlFor,
@@ -47,16 +39,6 @@ export default class Label extends React.Component {
47
39
  id: id,
48
40
  tabIndex: tabIndex
49
41
  }, text);
50
- return /*#__PURE__*/React.createElement(React.Fragment, null, isRenderable(renderRightPlaceholderNode) ? /*#__PURE__*/React.createElement(Flex, {
51
- $ui_displayMode: "flex",
52
- $ui_direction: "row",
53
- $ui_alignItems: "center",
54
- ...containerProps
55
- }, labelElement, /*#__PURE__*/React.createElement(Flex, {
56
- $ui_displayMode: "flex",
57
- $ui_alignItems: "center",
58
- ...rightPlaceholderNodeProps
59
- }, renderNode(renderRightPlaceholderNode))) : /*#__PURE__*/React.createElement(React.Fragment, null, labelElement));
60
42
  }
61
43
 
62
44
  }
@@ -2,7 +2,7 @@
2
2
  /* label default variables */
3
3
  --label_font_size: var(--zd_font_size14);
4
4
  --label_text_color: var(--zdt_label_default_text);
5
- --label_font_family: var(--zd_regular);
5
+ --label_font_weight: var(--zd-fw-normal);
6
6
  --label_cursor: default;
7
7
  --label_line_height: 1.286;
8
8
  }
@@ -13,24 +13,24 @@
13
13
  line-height: var(--label_line_height);
14
14
  font-size: var(--label_font_size);
15
15
  color: var(--label_text_color);
16
- font-family: var(--label_font_family);
16
+ font-weight: var(--label_font_weight);
17
17
  cursor: var(--label_cursor);
18
18
  }
19
19
  .xsmall {
20
20
  --label_font_size: var(--zd_font_size12);
21
- --label_line_height:1.5;
21
+ --label_line_height: 1.5;
22
22
  }
23
23
  .small {
24
24
  --label_font_size: var(--zd_font_size13);
25
- --label_line_height:1.385;
25
+ --label_line_height: 1.385;
26
26
  }
27
27
  .medium {
28
28
  --label_font_size: var(--zd_font_size14);
29
- --label_line_height:1.286;
29
+ --label_line_height: 1.286;
30
30
  }
31
31
  .large {
32
32
  --label_font_size: var(--zd_font_size26);
33
- --label_line_height:0.6923;
33
+ --label_line_height: 0.6923;
34
34
  composes: semibold from '../common/common.module.css';
35
35
  }
36
36
  .pointer {
@@ -46,10 +46,10 @@
46
46
  display: inline-block;
47
47
  }
48
48
  .font_default {
49
- --label_font_family: var(--zd_regular);
49
+ --label_font_weight: var(--zd-fw-normal);
50
50
  }
51
51
  .font_primary {
52
- --label_font_family: var(--zd_semibold);
52
+ --label_font_weight: var(--zd-fw-semibold);
53
53
  composes: ftsmooth from '../common/common.module.css';
54
54
  }
55
55
  .dotted {
@@ -96,62 +96,4 @@ describe('Label', () => {
96
96
  }));
97
97
  expect(asFragment()).toMatchSnapshot();
98
98
  });
99
- test('rendering with renderRightPlaceholderNode', () => {
100
- const {
101
- asFragment
102
- } = render( /*#__PURE__*/React.createElement(Label, {
103
- text: "New Feature",
104
- id: "label_new",
105
- renderRightPlaceholderNode: /*#__PURE__*/React.createElement("span", {
106
- style: {
107
- background: '#27ae60',
108
- color: 'white',
109
- padding: '2px 6px',
110
- borderRadius: '3px',
111
- fontSize: '10px',
112
- fontWeight: 'bold'
113
- }
114
- }, "NEW")
115
- }));
116
- expect(asFragment()).toMatchSnapshot();
117
- });
118
- test('rendering with customProps - containerProps & rightPlaceholderNodeProps', () => {
119
- const {
120
- asFragment
121
- } = render( /*#__PURE__*/React.createElement(Label, {
122
- text: "Premium Feature",
123
- id: "label_premium",
124
- size: "large",
125
- palette: "danger",
126
- renderRightPlaceholderNode: /*#__PURE__*/React.createElement("span", {
127
- style: {
128
- fontSize: '10px',
129
- background: '#f39c12',
130
- color: 'white',
131
- padding: '1px 4px',
132
- borderRadius: '2px'
133
- }
134
- }, "PRO"),
135
- customProps: {
136
- containerProps: {
137
- $ui_alignItems: 'center',
138
- $tagAttributes_container: {
139
- style: {
140
- gap: '6px'
141
- }
142
- }
143
- },
144
- rightPlaceholderNodeProps: {
145
- $ui_displayMode: 'flex',
146
- $ui_alignItems: 'center',
147
- $tagAttributes_container: {
148
- style: {
149
- gap: '6px'
150
- }
151
- }
152
- }
153
- }
154
- }));
155
- expect(asFragment()).toMatchSnapshot();
156
- });
157
99
  });
@@ -310,69 +310,3 @@ exports[`Label rendering the variant of- primary 1`] = `
310
310
  </label>
311
311
  </DocumentFragment>
312
312
  `;
313
-
314
- exports[`Label rendering with customProps - containerProps & rightPlaceholderNodeProps 1`] = `
315
- <DocumentFragment>
316
- <div
317
- class="flex row alignItems_center"
318
- data-id="flex"
319
- data-test-id="flex"
320
- style="gap: 6px;"
321
- >
322
- <label
323
- class="label title large danger font_default
324
- cursor "
325
- data-id="label"
326
- data-selector-id="label"
327
- data-test-id="label"
328
- id="label_premium"
329
- >
330
- Premium Feature
331
- </label>
332
- <div
333
- class="flex row alignItems_center"
334
- data-id="flex"
335
- data-test-id="flex"
336
- style="gap: 6px;"
337
- >
338
- <span
339
- style="font-size: 10px; background: rgb(243, 156, 18); color: white; padding: 1px 4px; border-radius: 2px;"
340
- >
341
- PRO
342
- </span>
343
- </div>
344
- </div>
345
- </DocumentFragment>
346
- `;
347
-
348
- exports[`Label rendering with renderRightPlaceholderNode 1`] = `
349
- <DocumentFragment>
350
- <div
351
- class="flex row"
352
- data-id="flex"
353
- data-test-id="flex"
354
- >
355
- <label
356
- class="label title medium default font_default
357
- cursor "
358
- data-id="label"
359
- data-selector-id="label"
360
- data-test-id="label"
361
- id="label_new"
362
- >
363
- New Feature
364
- </label>
365
- <div
366
- class=""
367
- data-id="flex"
368
- data-test-id="flex"
369
- >
370
- <span
371
- style="background: rgb(39, 174, 96); color: white; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: bold;"
372
- >
373
- NEW
374
- </span>
375
- </div>
376
- </div>
377
- </DocumentFragment>
378
- `;
@@ -6,7 +6,6 @@ export const defaultProps = {
6
6
  text: 'Label',
7
7
  type: 'title',
8
8
  variant: 'default',
9
- customProps: {},
10
9
  customClass: '',
11
10
  dataSelectorId: 'label'
12
11
  };
@@ -1,5 +1,4 @@
1
1
  import PropTypes from 'prop-types';
2
- import FlexPropTypes from '@zohodesk/layout/es/Flex/props/propTypes';
3
2
  export const propTypes = {
4
3
  clipped: PropTypes.bool,
5
4
  dataId: PropTypes.string,
@@ -12,14 +11,9 @@ export const propTypes = {
12
11
  title: PropTypes.string,
13
12
  type: PropTypes.oneOf(['title', 'subtitle']),
14
13
  variant: PropTypes.oneOf(['primary', 'default']),
15
- customProps: PropTypes.shape({
16
- containerProps: PropTypes.exact(FlexPropTypes),
17
- rightPlaceholderNodeProps: PropTypes.exact(FlexPropTypes)
18
- }),
19
14
  customClass: PropTypes.string,
20
15
  a11y: PropTypes.shape({
21
16
  tabIndex: PropTypes.string
22
17
  }),
23
- id: PropTypes.string,
24
- renderRightPlaceholderNode: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
18
+ id: PropTypes.string
25
19
  };
@@ -196,7 +196,7 @@
196
196
  .more {
197
197
  font-size: var(--zd_font_size14) ;
198
198
  color: var(--zdt_multiselect_more_text);
199
- font-family: inherit;
199
+ font-weight: var(--zd-fw-normal);
200
200
  cursor: pointer;
201
201
  margin-top: var(--zd_size5) ;
202
202
  background-color: var(--zdt_multiselect_delete_bg);