@zohodesk/components 1.2.60 → 1.2.62

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,9 +32,19 @@ In this Package, we Provide Some Basic Components to Build Web App
32
32
  - TextBoxIcon
33
33
  - Tooltip
34
34
 
35
+ # 1.2.62
36
+
37
+ - **Button**: Added new `palette` options: `plainDanger`, `plainSuccess`, and `success`.
38
+ - **RippleEffect**: Added new `palette` option: `secondary`.
39
+ - **Tag**: Enhanced the `onRemove` event to the `event` object `e` as the second argument for better event handling.
40
+
41
+ # 1.2.61
42
+
43
+ - **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
44
+
35
45
  # 1.2.60
36
46
 
37
- - **Textarea** - Handle the default height and width appropriately based on the rows and cols props.
47
+ - **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
38
48
 
39
49
  # 1.2.59
40
50
 
@@ -46,6 +46,10 @@
46
46
  --zdt_button_secondary_border: var(--zdt_cta_grey_35_border);
47
47
  --zdt_button_secondary_hover_border: hsla(217, 7.76%, calc(54.51% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
48
48
  --zdt_button_danger_border: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
49
+ --zdt_button_success_hover_border: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
50
+ --zdt_button_success_border: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
51
+ --zdt_button_success_hover_text: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
52
+ --zdt_button_success_text: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
49
53
  --zdt_button_danger_text: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
50
54
  --zdt_button_danger_hover_border: hsla(1, 63.86%, calc(48.82% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
51
55
  --zdt_button_danger_hover_text: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
@@ -285,6 +289,10 @@
285
289
  --zdt_rippleeffect_navy_border: var(--zdt_cta_grey_40_border);
286
290
  --zdt_rippleeffect_danger_border: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
287
291
  --zdt_rippleeffect_danger_bg: hsla(0, 100.00%, calc(70.98% + var(--zdc_default)), calc( 0.05 + var(--zdc_alpha_high)));
292
+ --zdt_rippleeffect_secondary_border: var(--zdt_cta_grey_40_border);
293
+ --zdt_rippleeffect_secondary_bg: var(--zdt_cta_grey_20_bg);
294
+ --zdt_rippleeffect_secondary_active_border: var(--zdt_cta_secondary_light_border);
295
+ --zdt_rippleeffect_secondary_active_bg: var(--zdtm_cta_primary_light_bg_default_inverse_low);
288
296
 
289
297
  /* date time */
290
298
  --zdt_datetime_default_bg: hsla(217, 23.08%, calc(17.84% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
@@ -46,6 +46,10 @@
46
46
  --zdt_button_secondary_border: var(--zdt_cta_grey_35_border);
47
47
  --zdt_button_secondary_hover_border: hsla(218, 9.76%, calc(51.76% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
48
48
  --zdt_button_danger_border: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
49
+ --zdt_button_success_hover_border: hsla(134, 78.63%, calc(25.69% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
50
+ --zdt_button_success_border: hsla(133, 63.29%, calc(40.59% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
51
+ --zdt_button_success_hover_text: hsla(134, 78.63%, calc(25.69% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
52
+ --zdt_button_success_text: hsla(133, 63.29%, calc(40.59% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
49
53
  --zdt_button_danger_text: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
50
54
  --zdt_button_danger_hover_border: hsla(1, 75.38%, calc(38.24% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
51
55
  --zdt_button_danger_hover_text: hsla(1, 75.38%, calc(38.24% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
@@ -285,6 +289,10 @@
285
289
  --zdt_rippleeffect_navy_border: var(--zdt_cta_grey_40_border);
286
290
  --zdt_rippleeffect_danger_border: hsla(0, 71.91%, calc(53.92% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
287
291
  --zdt_rippleeffect_danger_bg: hsla(0, 71.43%, calc(97.25% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
292
+ --zdt_rippleeffect_secondary_border: var(--zdt_cta_grey_40_border);
293
+ --zdt_rippleeffect_secondary_bg: var(--zdt_cta_grey_20_bg);
294
+ --zdt_rippleeffect_secondary_active_border: var(--zdt_cta_secondary_light_border);
295
+ --zdt_rippleeffect_secondary_active_bg: var(--zdtm_cta_primary_light_bg_default_inverse_low);
288
296
 
289
297
  /* date time */
290
298
  --zdt_datetime_default_bg: hsla(0, 0.00%, calc(100.00% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
@@ -46,6 +46,10 @@
46
46
  --zdt_button_secondary_border: var(--zdt_cta_grey_35_border);
47
47
  --zdt_button_secondary_hover_border: hsla(217, 7.76%, calc(54.51% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
48
48
  --zdt_button_danger_border: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
49
+ --zdt_button_success_hover_border: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
50
+ --zdt_button_success_border: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
51
+ --zdt_button_success_hover_text: hsla(134, 67.66%, calc(32.75% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
52
+ --zdt_button_success_text: hsla(133, 48.36%, calc(52.16% + var(--zdc_default_inverse_low)), calc(1 + var(--zdc_alpha_low)));
49
53
  --zdt_button_danger_text: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
50
54
  --zdt_button_danger_hover_border: hsla(1, 63.86%, calc(48.82% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
51
55
  --zdt_button_danger_hover_text: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
@@ -285,6 +289,10 @@
285
289
  --zdt_rippleeffect_navy_border: var(--zdt_cta_grey_40_border);
286
290
  --zdt_rippleeffect_danger_border: hsla(0, 100.00%, calc(70.98% + var(--zdc_default_inverse_lower)), calc(1 + var(--zdc_alpha_low)));
287
291
  --zdt_rippleeffect_danger_bg: hsla(0, 100.00%, calc(70.98% + var(--zdc_default)), calc( 0.05 + var(--zdc_alpha_high)));
292
+ --zdt_rippleeffect_secondary_border: var(--zdt_cta_grey_40_border);
293
+ --zdt_rippleeffect_secondary_bg: var(--zdt_cta_grey_20_bg);
294
+ --zdt_rippleeffect_secondary_active_border: var(--zdt_cta_secondary_light_border);
295
+ --zdt_rippleeffect_secondary_active_bg: var(--zdtm_cta_primary_light_bg_default_inverse_low);
288
296
 
289
297
  /* date time */
290
298
  --zdt_datetime_default_bg: hsla(0, 0.00%, calc(12.94% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
@@ -139,7 +139,7 @@ exports[`Button component Should render CustomStatusclassname of buttons - succe
139
139
  class="overlay"
140
140
  >
141
141
  <div
142
- class="success"
142
+ class="successstate"
143
143
  >
144
144
  <div
145
145
  class="customStautusClassName successelement primarysuccess"
@@ -260,7 +260,7 @@ exports[`Button component Should render Status of buttons - success 1`] = `
260
260
  class="overlay"
261
261
  >
262
262
  <div
263
- class="success"
263
+ class="successstate"
264
264
  >
265
265
  <div
266
266
  class="successelement primarysuccess"
@@ -25,6 +25,7 @@
25
25
  /* button success status default variable */
26
26
  --button_success_border_color: var(--zdt_button_success_default_border);
27
27
  }
28
+
28
29
  .native {
29
30
  composes: varClass;
30
31
  /* transition: all var(--zd_transition2) ease 0s; */
@@ -130,22 +131,43 @@
130
131
  composes: container;
131
132
  }
132
133
 
133
- .plainprimary {
134
- --button_text_color: var(--zdt_button_default_text);
134
+ .plainprimary,
135
+ .plaindanger,
136
+ .plainsuccess,
137
+ .plainsecondary {
135
138
  --button_padding: var(--zd_size5);
136
139
  --button_min_width: initial;
137
140
  --button_bg_color: var(--zdt_button_default_bg);
138
141
  }
142
+
143
+ .plainprimary {
144
+ --button_text_color: var(--zdt_button_default_text);
145
+ }
146
+
139
147
  .plainprimary:hover {
140
148
  --button_text_color: var(--zdt_button_plainprimary_hover_text);
141
149
  }
142
150
 
151
+ .plaindanger {
152
+ --button_text_color: var(--zdt_button_danger_text);
153
+ }
154
+
155
+ .plaindanger:hover {
156
+ --button_text_color: var(--zdt_button_danger_hover_text);
157
+ }
158
+
159
+ .plainsuccess {
160
+ --button_text_color: var(--zdt_button_success_text);
161
+ }
162
+
163
+ .plainsuccess:hover {
164
+ --button_text_color: var(--zdt_button_success_hover_text);
165
+ }
166
+
143
167
  .plainsecondary {
144
168
  --button_text_color: var(--zdt_button_secondary_text);
145
- --button_padding: var(--zd_size5);
146
- --button_min_width: initial;
147
- --button_bg_color: var(--zdt_button_default_bg);
148
169
  }
170
+
149
171
  .plainsecondary:hover {
150
172
  --button_text_color: var(--zdt_button_secondary_hover_text);
151
173
  }
@@ -156,10 +178,12 @@
156
178
  .dangerfilled,
157
179
  .secondary,
158
180
  .secondaryfilled,
181
+ .success,
159
182
  .successfilled,
160
183
  .tertiaryfilled {
161
184
  --button_border_width: 1px;
162
185
  }
186
+
163
187
  .primary:hover {
164
188
  --button_border_color: var(--zdt_button_primary_hover_border);
165
189
  --button_text_color: var(--zdt_button_primary_hover_text);
@@ -170,6 +194,7 @@
170
194
  --button_bg_color: var(--zdt_button_primaryfill_bg);
171
195
  --button_text_color: var(--zdt_button_primaryfill_text);
172
196
  }
197
+
173
198
  .primaryfilled:hover {
174
199
  --button_bg_color: var(--zdt_button_primaryfill_hover_bg);
175
200
  }
@@ -179,16 +204,29 @@
179
204
  --button_bg_color: var(--zdt_button_default_bg);
180
205
  --button_text_color: var(--zdt_button_danger_text);
181
206
  }
207
+
182
208
  .danger:hover {
183
209
  --button_border_color: var(--zdt_button_danger_hover_border);
184
210
  --button_text_color: var(--zdt_button_danger_hover_text);
185
211
  }
186
212
 
213
+ .success {
214
+ --button_border_color: var(--zdt_button_success_border);
215
+ --button_bg_color: var(--zdt_button_default_bg);
216
+ --button_text_color: var(--zdt_button_success_text);
217
+ }
218
+
219
+ .success:hover {
220
+ --button_border_color: var(--zdt_button_success_hover_border);
221
+ --button_text_color: var(--zdt_button_success_hover_text);
222
+ }
223
+
187
224
  .dangerfilled {
188
225
  --button_border_color: var(--zdt_button_primaryfill_border);
189
226
  --button_bg_color: var(--zdt_button_dangerfill_bg);
190
227
  --button_text_color: var(--zdt_button_dangerfill_text);
191
228
  }
229
+
192
230
  .dangerfilled:hover {
193
231
  --button_bg_color: var(--zdt_button_dangerfill_hover_bg);
194
232
  }
@@ -198,6 +236,7 @@
198
236
  --button_bg_color: var(--zdt_button_default_bg);
199
237
  --button_text_color: var(--zdt_button_secondary_text);
200
238
  }
239
+
201
240
  .secondary:hover {
202
241
  --button_border_color: var(--zdt_button_secondary_hover_border);
203
242
  --button_text_color: var(--zdt_button_secondary_hover_text);
@@ -208,6 +247,7 @@
208
247
  --button_bg_color: var(--zdt_button_secondaryfill_bg);
209
248
  --button_text_color: var(--zdt_button_secondary_text);
210
249
  }
250
+
211
251
  .secondaryfilled:hover {
212
252
  --button_text_color: var(--zdt_button_secondary_hover_text);
213
253
  }
@@ -217,6 +257,7 @@
217
257
  --button_bg_color: var(--zdt_button_successfill_bg);
218
258
  --button_text_color: var(--zdt_button_dangerfill_text);
219
259
  }
260
+
220
261
  .successfilled:hover {
221
262
  --button_border_color: var(--zdt_button_successfill_hover_border);
222
263
  --button_bg_color: var(--zdt_button_successfill_hover_bg);
@@ -227,6 +268,7 @@
227
268
  --button_bg_color: var(--zdt_button_tertiaryfill_bg);
228
269
  --button_text_color: var(--zdt_button_dangerfill_text);
229
270
  }
271
+
230
272
  .tertiaryfilled:hover {
231
273
  --button_bg_color: var(--zdt_button_tertiaryfill_hover_bg);
232
274
  }
@@ -326,18 +368,23 @@
326
368
  .loadingelement {
327
369
  --button_loading_bg_color: var(--zdt_button_primaryfill_bg);
328
370
  }
371
+
329
372
  .primaryelement {
330
373
  --button_loading_bg_color: var(--zdt_button_loading_default_bg);
331
374
  }
375
+
332
376
  .primaryfilledelement {
333
377
  --button_loading_bg_color: var(--zdt_button_primaryfill_bg);
334
378
  }
379
+
335
380
  .dangerelement {
336
381
  --button_loading_bg_color: var(--zdt_button_loading_default_bg);
337
382
  }
383
+
338
384
  .dangerfilledelement {
339
385
  --button_loading_bg_color: var(--zdt_button_dangerfill_bg);
340
386
  }
387
+
341
388
  .loadingelement:after,
342
389
  .primaryelement:after,
343
390
  .primaryfilledelement:after,
@@ -366,13 +413,13 @@
366
413
 
367
414
  .primaryelement:before {
368
415
  --button_loading_bg_color: var(--zdt_button_primaryfill_bg);
369
- --zdt_button_loading_linear_gradient:var(--zdt_button_loading_primary_linear_gradient);
416
+ --zdt_button_loading_linear_gradient: var(--zdt_button_loading_primary_linear_gradient);
370
417
  transform: rotateX(180deg);
371
418
  }
372
419
 
373
420
  .dangerelement:before {
374
421
  --button_loading_bg_color: var(--zdt_button_dangerfill_bg);
375
- --zdt_button_loading_linear_gradient:var(--zdt_button_loading_danger_linear_gradient);
422
+ --zdt_button_loading_linear_gradient: var(--zdt_button_loading_danger_linear_gradient);
376
423
  transform: rotateX(180deg);
377
424
  }
378
425
 
@@ -447,7 +494,7 @@
447
494
  -webkit-transform: scaleX(-1) rotate(360deg);
448
495
  }
449
496
  }
450
- .success {
497
+ .successstate {
451
498
  position: absolute;
452
499
  top: 50% ;
453
500
  left: 50% ;
@@ -523,6 +570,6 @@
523
570
  }
524
571
  }
525
572
 
526
- .loader{
527
- color:var(--dot_mirror)
573
+ .loader {
574
+ color: var(--dot_mirror)
528
575
  }
@@ -36,7 +36,7 @@ export default function cssJSLogic(_ref) {
36
36
  [customStatusSize]: !!customStatusSize,
37
37
  [style.loading]: statusLower === 'loading',
38
38
  [style[`${size}loading`]]: statusLower === 'loading',
39
- [style.success]: statusLower != 'loading'
39
+ [style.successstate]: statusLower != 'loading'
40
40
  });
41
41
  let loaderChildClass = compileClassNames({
42
42
  [customStatus]: !!customStatus,
@@ -8,7 +8,7 @@ export const propTypes = {
8
8
  isBold: PropTypes.bool,
9
9
  needAppearance: PropTypes.bool,
10
10
  onClick: PropTypes.func,
11
- palette: PropTypes.oneOf(['plainPrimary', 'plainSecondary', 'primary', 'primaryFilled', 'danger', 'dangerFilled', 'secondary', 'secondaryFilled', 'successFilled', 'info', 'tertiaryFilled']),
11
+ palette: PropTypes.oneOf(['plainPrimary', 'plainSecondary', 'plainDanger', 'plainSuccess', 'primary', 'primaryFilled', 'danger', 'dangerFilled', 'secondary', 'secondaryFilled', 'success', 'successFilled', 'info', 'tertiaryFilled']),
12
12
  rounded: PropTypes.bool,
13
13
  size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']),
14
14
  status: PropTypes.oneOf(['loading', 'success', 'none']),
@@ -90,3 +90,19 @@
90
90
  .notAllowed {
91
91
  cursor: not-allowed;
92
92
  }
93
+ .secondary.defaultHover, .hoverEffect:hover.secondary.borderHover
94
+ /* .hoverEffect:focus.secondary.borderHover */
95
+ {
96
+ border-color: var(--zdt_rippleeffect_secondary_border);
97
+ }
98
+ .hoverEffect:hover.secondary.bgHover
99
+ /* .hoverEffect:focus.secondary.bgHover */
100
+ {
101
+ background-color: var(--zdt_rippleeffect_secondary_bg);
102
+ }
103
+ .secondary.active {
104
+ background-color: var(--zdt_rippleeffect_secondary_active_bg);
105
+ }
106
+ .secondary.active.border {
107
+ border-color: var(--zdt_rippleeffect_secondary_active_border);
108
+ }
@@ -6,7 +6,7 @@ export const propTypes = {
6
6
  isDisabled: PropTypes.bool,
7
7
  isNeedEffect: PropTypes.bool,
8
8
  needBorder: PropTypes.bool,
9
- palette: PropTypes.oneOf(['default', 'primary', 'primaryLight', 'primaryFilled', 'primaryDark', 'green', 'danger']),
9
+ palette: PropTypes.oneOf(['default', 'secondary', 'primary', 'primaryLight', 'primaryFilled', 'primaryDark', 'green', 'danger']),
10
10
  cssClassPropOfChild: PropTypes.string,
11
11
  isCopyTextEnabled: PropTypes.bool
12
12
  };
package/es/Tag/Tag.js CHANGED
@@ -47,7 +47,7 @@ export default class Tag extends PureComponent {
47
47
  e && e.preventDefault();
48
48
  e.stopPropagation && e.stopPropagation();
49
49
  e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
50
- onRemove && onRemove(id);
50
+ onRemove && onRemove(id, e);
51
51
  }
52
52
 
53
53
  getRef(el) {
@@ -89,7 +89,7 @@ export default class Textarea extends React.Component {
89
89
  }
90
90
 
91
91
  const isEditable = !(isReadOnly || isDisabled);
92
- let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${!rows ? style.defaultHeight : ''} ${!cols ? style.defaultWidth : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
92
+ let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${!rows && size === 'default' ? style.defaultHeight : ''} ${!cols ? style.defaultWidth : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
93
93
  return /*#__PURE__*/React.createElement("textarea", {
94
94
  "aria-label": ariaLabel,
95
95
  "aria-labelledby": ariaLabelledby,
@@ -235,6 +235,24 @@ describe('Textarea component', () => {
235
235
  }));
236
236
  expect(asFragment()).toMatchSnapshot();
237
237
  });
238
+ test('Should be render rows only ', () => {
239
+ const {
240
+ asFragment
241
+ } = render( /*#__PURE__*/React.createElement(Textarea, {
242
+ size: "default",
243
+ rows: "3"
244
+ }));
245
+ expect(asFragment()).toMatchSnapshot();
246
+ });
247
+ test('Should be render cols only ', () => {
248
+ const {
249
+ asFragment
250
+ } = render( /*#__PURE__*/React.createElement(Textarea, {
251
+ size: "default",
252
+ cols: "3"
253
+ }));
254
+ expect(asFragment()).toMatchSnapshot();
255
+ });
238
256
  test('Should be render custom Attributes ', () => {
239
257
  const {
240
258
  asFragment