@zohodesk/components 1.2.51 → 1.2.52

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
@@ -32,6 +32,10 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.2.52
36
+
37
+ - **Typography** - component added in v0
38
+
35
39
  # 1.2.51
36
40
 
37
41
  - **Popup** - Fixed issue: Error on unmount when target ref is not available.
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { defaultProps } from "./props/defaultProps";
3
+ import { propTypes } from "./props/propTypes";
4
+ import cssJSLogic from "./css/cssJSLogic";
5
+ import { mergeStyle } from '@zohodesk/utils';
6
+ import defaultStyle from "./css/Typography.module.css";
7
+
8
+ const Typography = props => {
9
+ const {
10
+ children,
11
+ $ui_tagName,
12
+ $i18n_dataTitle,
13
+ testId,
14
+ customId,
15
+ $tagAttributes_text,
16
+ $a11yAttributes_text,
17
+ customStyle
18
+ } = props;
19
+ const style = mergeStyle(defaultStyle, customStyle);
20
+ const {
21
+ typographyClass
22
+ } = cssJSLogic({
23
+ props,
24
+ style
25
+ });
26
+ return /*#__PURE__*/React.createElement($ui_tagName, {
27
+ className: typographyClass,
28
+ 'data-title': $i18n_dataTitle,
29
+ 'data-id': customId,
30
+ 'data-test-id': testId,
31
+ ...$tagAttributes_text,
32
+ ...$a11yAttributes_text
33
+ }, children);
34
+ };
35
+
36
+ Typography.propTypes = propTypes;
37
+ Typography.defaultProps = defaultProps;
38
+ export default Typography;
@@ -0,0 +1,489 @@
1
+ .reset {
2
+ font-weight: initial;
3
+ margin: initial ;
4
+ padding: initial ;
5
+ }
6
+
7
+ .dotted {
8
+ composes: dotted from '../../common/common.module.css';
9
+ }
10
+
11
+ .display_block {
12
+ display: block;
13
+ }
14
+
15
+ .display_inlineBlock {
16
+ display: inline-block;
17
+ }
18
+
19
+ .display_inline {
20
+ display: inline;
21
+ }
22
+
23
+ .display_initial {
24
+ display: initial;
25
+ }
26
+
27
+ .font_regular {
28
+ font-family: var(--zd_regular);
29
+ }
30
+
31
+ .font_light {
32
+ font-family: var(--zd_light);
33
+ }
34
+
35
+ .font_semibold {
36
+ font-family: var(--zd_semibold);
37
+ composes: ftsmooth from '../../common/common.module.css';
38
+ }
39
+
40
+ .font_bold {
41
+ font-family: var(--zd_bold);
42
+ composes: ftsmooth from '../../common/common.module.css';
43
+ }
44
+
45
+ .fontStyles_normal {
46
+ font-style: normal;
47
+ }
48
+
49
+ .fontStyles_italic {
50
+ font-style: italic;
51
+ }
52
+
53
+ .decoration_default {
54
+ text-decoration: none;
55
+ }
56
+
57
+ .decoration_underline {
58
+ text-decoration: underline;
59
+ }
60
+
61
+ .decoration_strike {
62
+ text-decoration: line-through;
63
+ }
64
+
65
+ .decoration_overline {
66
+ text-decoration: overline;
67
+ }
68
+
69
+ [dir=ltr] .textalign_left {
70
+ text-align: left;
71
+ }
72
+
73
+ [dir=rtl] .textalign_left {
74
+ text-align: right;
75
+ }
76
+
77
+ [dir=ltr] .textalign_right {
78
+ text-align: right;
79
+ }
80
+
81
+ [dir=rtl] .textalign_right {
82
+ text-align: left;
83
+ }
84
+
85
+ .textalign_center {
86
+ text-align: center;
87
+ }
88
+
89
+ .textalign_justify {
90
+ text-align: justify;
91
+ }
92
+
93
+ .transform_default {
94
+ text-transform: none;
95
+ }
96
+
97
+ .transform_upper {
98
+ text-transform: uppercase;
99
+ }
100
+
101
+ .transform_lower {
102
+ text-transform: lowercase;
103
+ }
104
+
105
+ .transform_capital {
106
+ text-transform: capitalize;
107
+ }
108
+
109
+ .dotted_clamp {
110
+ display: -webkit-box;
111
+ -webkit-box-orient: vertical;
112
+ overflow: hidden;
113
+ }
114
+
115
+ .lineclamp_1 {
116
+ -webkit-line-clamp: 1;
117
+ composes: dotted_clamp;
118
+ }
119
+
120
+ .lineclamp_2 {
121
+ -webkit-line-clamp: 2;
122
+ composes: dotted_clamp;
123
+ }
124
+
125
+ .lineclamp_3 {
126
+ -webkit-line-clamp: 3;
127
+ composes: dotted_clamp;
128
+ }
129
+
130
+ .lineclamp_4 {
131
+ -webkit-line-clamp: 4;
132
+ composes: dotted_clamp;
133
+ }
134
+
135
+ .lineclamp_5 {
136
+ -webkit-line-clamp: 5;
137
+ composes: dotted_clamp;
138
+ }
139
+
140
+ .wordBreak_breakAll {
141
+ word-break: break-all
142
+ }
143
+
144
+ .wordBreak_keepAll {
145
+ word-break: keep-all
146
+ }
147
+
148
+ .wordBreak_breakWord {
149
+ word-break: break-word
150
+ }
151
+
152
+ .wordWrap_normal {
153
+ word-wrap: normal;
154
+ }
155
+
156
+ .wordWrap_break {
157
+ word-wrap: break-word
158
+ }
159
+
160
+ .whiteSpace_normal {
161
+ white-space: normal
162
+ }
163
+
164
+ .whiteSpace_noWrap {
165
+ white-space: nowrap
166
+ }
167
+
168
+ .whiteSpace_pre {
169
+ white-space: pre
170
+ }
171
+
172
+ .whiteSpace_preLine {
173
+ white-space: pre-line
174
+ }
175
+
176
+ .whiteSpace_preWrap {
177
+ white-space: pre-wrap
178
+ }
179
+
180
+
181
+
182
+ /*...............Font Size Start.........*/
183
+
184
+ .size7 {
185
+ font-size: var(--zd_font_size7) ;
186
+ }
187
+
188
+ .size8 {
189
+ font-size: var(--zd_font_size8) ;
190
+ }
191
+
192
+ .size9 {
193
+ font-size: var(--zd_font_size9) ;
194
+ }
195
+
196
+ .size10 {
197
+ font-size: var(--zd_font_size10) ;
198
+ }
199
+
200
+ .size11 {
201
+ font-size: var(--zd_font_size11) ;
202
+ }
203
+
204
+ .size12 {
205
+ font-size: var(--zd_font_size12) ;
206
+ }
207
+
208
+ .size13 {
209
+ font-size: var(--zd_font_size13) ;
210
+ }
211
+
212
+ .size14 {
213
+ font-size: var(--zd_font_size14) ;
214
+ }
215
+
216
+ .size15 {
217
+ font-size: var(--zd_font_size15) ;
218
+ }
219
+
220
+ .size16 {
221
+ font-size: var(--zd_font_size16) ;
222
+ }
223
+
224
+ .size17 {
225
+ font-size: var(--zd_font_size17) ;
226
+ }
227
+
228
+ .size18 {
229
+ font-size: var(--zd_font_size18) ;
230
+ }
231
+
232
+ .size19 {
233
+ font-size: var(--zd_font_size19) ;
234
+ }
235
+
236
+ .size20 {
237
+ font-size: var(--zd_font_size20) ;
238
+ }
239
+
240
+ .size21 {
241
+ font-size: var(--zd_font_size21) ;
242
+ }
243
+
244
+ .size22 {
245
+ font-size: var(--zd_font_size22) ;
246
+ }
247
+
248
+ .size24 {
249
+ font-size: var(--zd_font_size24) ;
250
+ }
251
+
252
+ .size25 {
253
+ font-size: var(--zd_font_size25) ;
254
+ }
255
+
256
+ .size26 {
257
+ font-size: var(--zd_font_size26) ;
258
+ }
259
+
260
+ .size28 {
261
+ font-size: var(--zd_font_size28) ;
262
+ }
263
+
264
+ .size29 {
265
+ font-size: var(--zd_font_size29) ;
266
+ }
267
+
268
+ .size30 {
269
+ font-size: var(--zd_font_size30) ;
270
+ }
271
+
272
+ .size32 {
273
+ font-size: var(--zd_font_size32) ;
274
+ }
275
+
276
+ .size34 {
277
+ font-size: var(--zd_font_size34) ;
278
+ }
279
+
280
+ .size35 {
281
+ font-size: var(--zd_font_size35) ;
282
+ }
283
+
284
+ .size36 {
285
+ font-size: var(--zd_font_size36) ;
286
+ }
287
+
288
+ .size40 {
289
+ font-size: var(--zd_font_size40) ;
290
+ }
291
+
292
+ .size50 {
293
+ font-size: var(--zd_font_size50) ;
294
+ }
295
+
296
+ .sizeinherit {
297
+ font-size: inherit ;
298
+ }
299
+
300
+ /*...............Font Size End.........*/
301
+
302
+ /*............... Lineheight Start.........*/
303
+
304
+ .lineheight_inherit {
305
+ line-height: inherit;
306
+ }
307
+
308
+ .lineheight_initial {
309
+ line-height: initial;
310
+ }
311
+
312
+ .lineheight_normal {
313
+ line-height: normal;
314
+ }
315
+
316
+ .lineheight_0 {
317
+ line-height: 0;
318
+ }
319
+
320
+ .lineheight_0_1 {
321
+ line-height: 0.1;
322
+ }
323
+
324
+ .lineheight_0_2 {
325
+ line-height: 0.2;
326
+ }
327
+
328
+ .lineheight_0_3 {
329
+ line-height: 0.3;
330
+ }
331
+
332
+ .lineheight_0_4 {
333
+ line-height: 0.4;
334
+ }
335
+
336
+ .lineheight_0_5 {
337
+ line-height: 0.5;
338
+ }
339
+
340
+ .lineheight_0_6 {
341
+ line-height: 0.6;
342
+ }
343
+
344
+ .lineheight_0_7 {
345
+ line-height: 0.7;
346
+ }
347
+
348
+ .lineheight_0_8 {
349
+ line-height: 0.8;
350
+ }
351
+
352
+ .lineheight_0_9 {
353
+ line-height: 0.9;
354
+ }
355
+
356
+ .lineheight_1 {
357
+ line-height: 1;
358
+ }
359
+
360
+ .lineheight_1_1 {
361
+ line-height: 1.1;
362
+ }
363
+
364
+ .lineheight_1_2 {
365
+ line-height: 1.2;
366
+ }
367
+
368
+ .lineheight_1_3 {
369
+ line-height: 1.3;
370
+ }
371
+
372
+ .lineheight_1_4 {
373
+ line-height: 1.4;
374
+ }
375
+
376
+ .lineheight_1_5 {
377
+ line-height: 1.5;
378
+ }
379
+
380
+ .lineheight_1_6 {
381
+ line-height: 1.6;
382
+ }
383
+
384
+ .lineheight_1_7 {
385
+ line-height: 1.7;
386
+ }
387
+
388
+ .lineheight_1_8 {
389
+ line-height: 1.8;
390
+ }
391
+
392
+ .lineheight_1_9 {
393
+ line-height: 1.9;
394
+ }
395
+
396
+ .lineheight_2 {
397
+ line-height: 2;
398
+ }
399
+
400
+
401
+ /*............... Lineheight End.........*/
402
+
403
+ /*............... Letterspacing Start.........*/
404
+
405
+ .letterspacing_inherit {
406
+ letter-spacing: inherit;
407
+ }
408
+
409
+ .letterspacing_0_1 {
410
+ letter-spacing: 0.1px;
411
+ }
412
+
413
+ .letterspacing_0_2 {
414
+ letter-spacing: 0.2px;
415
+ }
416
+
417
+ .letterspacing_0_3 {
418
+ letter-spacing: 0.3px;
419
+ }
420
+
421
+ .letterspacing_0_4 {
422
+ letter-spacing: 0.4px;
423
+ }
424
+
425
+ .letterspacing_0_5 {
426
+ letter-spacing: 0.5px;
427
+ }
428
+
429
+ .letterspacing_0_6 {
430
+ letter-spacing: 0.6px;
431
+ }
432
+
433
+ .letterspacing_0_7 {
434
+ letter-spacing: 0.7px;
435
+ }
436
+
437
+ .letterspacing_0_8 {
438
+ letter-spacing: 0.8px;
439
+ }
440
+
441
+ .letterspacing_0_9 {
442
+ letter-spacing: 0.9px;
443
+ }
444
+
445
+ .letterspacing_1 {
446
+ letter-spacing: 1px;
447
+ }
448
+
449
+ .letterspacing_1_1 {
450
+ letter-spacing: 1.1px;
451
+ }
452
+
453
+ .letterspacing_1_2 {
454
+ letter-spacing: 1.2px;
455
+ }
456
+
457
+ .letterspacing_1_3 {
458
+ letter-spacing: 1.3px;
459
+ }
460
+
461
+ .letterspacing_1_4 {
462
+ letter-spacing: 1.4px;
463
+ }
464
+
465
+ .letterspacing_1_5 {
466
+ letter-spacing: 1.5px;
467
+ }
468
+
469
+ .letterspacing_1_6 {
470
+ letter-spacing: 1.6px;
471
+ }
472
+
473
+ .letterspacing_1_7 {
474
+ letter-spacing: 1.7px;
475
+ }
476
+
477
+ .letterspacing_1_8 {
478
+ letter-spacing: 1.8px;
479
+ }
480
+
481
+ .letterspacing_1_9 {
482
+ letter-spacing: 1.9px;
483
+ }
484
+
485
+ .letterspacing_2 {
486
+ letter-spacing: 2px;
487
+ }
488
+
489
+ /*............... Letterspacing End.........*/
@@ -0,0 +1,56 @@
1
+ import { compileClassNames } from '@zohodesk/utils';
2
+ import { letterspacingMapping, lineheightMapping } from "../utils";
3
+ export default function cssJSLogic(_ref) {
4
+ let {
5
+ props,
6
+ style
7
+ } = _ref;
8
+ let {
9
+ $flag_reset,
10
+ $flag_dotted,
11
+ $ui_size,
12
+ $ui_lineClamp,
13
+ $ui_lineHeight,
14
+ $ui_display,
15
+ $ui_weight,
16
+ $ui_typeFace,
17
+ $ui_textAlign,
18
+ $ui_letterSpacing,
19
+ $ui_transform,
20
+ $ui_decoration,
21
+ $ui_className,
22
+ $ui_wordBreak,
23
+ $ui_wordWrap,
24
+ $ui_whiteSpace
25
+ } = props;
26
+
27
+ if ($ui_letterSpacing) {
28
+ $ui_letterSpacing = letterspacingMapping[$ui_letterSpacing];
29
+ }
30
+
31
+ if ($ui_lineHeight) {
32
+ $ui_lineHeight = lineheightMapping[$ui_lineHeight];
33
+ }
34
+
35
+ let typographyClass = compileClassNames({
36
+ [style.reset]: $flag_reset,
37
+ [style.dotted]: $flag_dotted,
38
+ [style[`size${$ui_size}`]]: !!$ui_size,
39
+ [style[`lineclamp_${$ui_lineClamp}`]]: !!$ui_lineClamp,
40
+ [style[`lineheight_${$ui_lineHeight}`]]: !!$ui_lineHeight,
41
+ [style[`display_${$ui_display}`]]: !!$ui_display,
42
+ [style[`font_${$ui_weight}`]]: !!$ui_weight,
43
+ [style[`fontStyles_${$ui_typeFace}`]]: !!$ui_typeFace,
44
+ [style[`textalign_${$ui_textAlign}`]]: !!$ui_textAlign,
45
+ [style[`letterspacing_${$ui_letterSpacing}`]]: !!$ui_letterSpacing,
46
+ [style[`transform_${$ui_transform}`]]: !!$ui_transform,
47
+ [style[`decoration_${$ui_decoration}`]]: !!$ui_decoration,
48
+ [$ui_className]: !!$ui_className,
49
+ [style[`wordBreak_${$ui_wordBreak}`]]: !!$ui_wordBreak,
50
+ [style[`wordWrap_${$ui_wordWrap}`]]: !!$ui_wordWrap,
51
+ [style[`whiteSpace_${$ui_whiteSpace}`]]: !!$ui_whiteSpace
52
+ });
53
+ return {
54
+ typographyClass
55
+ };
56
+ }
@@ -0,0 +1,8 @@
1
+ export const defaultProps = {
2
+ $ui_className: '',
3
+ $ui_tagName: 'div',
4
+ $flag_reset: false,
5
+ $flag_dotted: false,
6
+ $tagAttributes_text: {},
7
+ $a11yAttributes_text: {}
8
+ };
@@ -0,0 +1,27 @@
1
+ import PropTypes from 'prop-types';
2
+ export const propTypes = {
3
+ children: PropTypes.node,
4
+ $ui_className: PropTypes.string,
5
+ $ui_tagName: PropTypes.string,
6
+ $flag_reset: PropTypes.bool,
7
+ $flag_dotted: PropTypes.bool,
8
+ $ui_display: PropTypes.oneOf(['block', 'inlineBlock', 'inline', 'initial']),
9
+ $ui_weight: PropTypes.oneOf(['regular', 'light', 'semibold', 'bold']),
10
+ $ui_textAlign: PropTypes.oneOf(['left', 'right', 'center', 'justify']),
11
+ $ui_transform: PropTypes.oneOf(['default', 'upper', 'lower', 'capital']),
12
+ $ui_lineClamp: PropTypes.oneOf(['1', '2', '3', '4', '5']),
13
+ $ui_typeFace: PropTypes.oneOf(['normal', 'italic']),
14
+ $ui_decoration: PropTypes.oneOf(['default', 'underline', 'strike', 'overline']),
15
+ $ui_size: PropTypes.oneOf(['7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '28', '29', '30', '32', '34', '35', '36', '40', '50', 'inherit']),
16
+ $ui_lineHeight: PropTypes.oneOf(['0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'normal', 'initial', 'inherit']),
17
+ $ui_letterSpacing: PropTypes.oneOf(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'inherit']),
18
+ $ui_wordBreak: PropTypes.oneOf(['breakAll', 'keepAll', 'breakWord']),
19
+ $ui_wordWrap: PropTypes.oneOf(['normal', 'break']),
20
+ $ui_whiteSpace: PropTypes.oneOf(['normal', 'noWrap', 'pre', 'preLine', 'preWrap']),
21
+ $i18n_dataTitle: PropTypes.string,
22
+ testId: PropTypes.string,
23
+ customId: PropTypes.string,
24
+ customStyle: PropTypes.object,
25
+ $a11yAttributes_text: PropTypes.object,
26
+ $tagAttributes_text: PropTypes.object
27
+ };
@@ -0,0 +1,50 @@
1
+ /* eslint-disable */
2
+ export const letterspacingMapping = {
3
+ 'inherit': 'inherit',
4
+ '0.1': '0_1',
5
+ '0.2': '0_2',
6
+ '0.3': '0_3',
7
+ '0.4': '0_4',
8
+ '0.5': '0_5',
9
+ '0.6': '0_6',
10
+ '0.7': '0_7',
11
+ '0.8': '0_8',
12
+ '0.9': '0_9',
13
+ '1': '1',
14
+ '1.1': '1_1',
15
+ '1.2': '1_2',
16
+ '1.3': '1_3',
17
+ '1.4': '1_4',
18
+ '1.5': '1_5',
19
+ '1.6': '1_6',
20
+ '1.7': '1_7',
21
+ '1.8': '1_8',
22
+ '1.9': '1_9',
23
+ '2': '2'
24
+ };
25
+ export const lineheightMapping = {
26
+ 'inherit': 'inherit',
27
+ 'initial': 'initial',
28
+ 'normal': 'normal',
29
+ '0': '0',
30
+ '0.1': '0_1',
31
+ '0.2': '0_2',
32
+ '0.3': '0_3',
33
+ '0.4': '0_4',
34
+ '0.5': '0_5',
35
+ '0.6': '0_6',
36
+ '0.7': '0_7',
37
+ '0.8': '0_8',
38
+ '0.9': '0_9',
39
+ '1': '1',
40
+ '1.1': '1_1',
41
+ '1.2': '1_2',
42
+ '1.3': '1_3',
43
+ '1.4': '1_4',
44
+ '1.5': '1_5',
45
+ '1.6': '1_6',
46
+ '1.7': '1_7',
47
+ '1.8': '1_8',
48
+ '1.9': '1_9',
49
+ '2': '2'
50
+ };
package/es/index.js CHANGED
@@ -39,4 +39,4 @@ import * as _utils from "./utils";
39
39
  export { _utils as utils };
40
40
  export * from "./VelocityAnimation";
41
41
  export * from "./semantic";
42
- export { default as Typography } from "./v1/Typography/Typography";
42
+ export { default as Typography } from "./Typography/Typography";
@@ -3,7 +3,7 @@ import { defaultProps } from "./props/defaultProps";
3
3
  import { propTypes } from "./props/propTypes";
4
4
  import cssJSLogic from "./css/cssJSLogic";
5
5
  import { mergeStyle } from '@zohodesk/utils';
6
- import defaultStyle from "./css/Typography.module.css";
6
+ import defaultStyle from "./css/v1_Typography.module.css";
7
7
 
8
8
  const Typography = props => {
9
9
  const {