@dialpad/dialtone 6.21.0 → 6.22.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [6.22.0](https://github.com/dialpad/dialtone/compare/v6.21.0...v6.22.0) (2022-04-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * badge alignment (min-width and vertical alignment) ([#566](https://github.com/dialpad/dialtone/issues/566)) ([946186c](https://github.com/dialpad/dialtone/commit/946186cc7e6a38c5d5e8986acd284cffe9b100ce))
7
+ * typo in spacing ([#565](https://github.com/dialpad/dialtone/issues/565)) ([729be23](https://github.com/dialpad/dialtone/commit/729be23e5d5c197e3c868b2ae5e65aecb25442b6))
8
+
9
+
10
+ ### Features
11
+
12
+ * **button:** add active styles ([#564](https://github.com/dialpad/dialtone/issues/564)) ([1d4a962](https://github.com/dialpad/dialtone/commit/1d4a962833e2031daf9f9fa1a23092b244fbc34e))
13
+ * **button:** add d-btn--active class ([#567](https://github.com/dialpad/dialtone/issues/567)) ([2a89e25](https://github.com/dialpad/dialtone/commit/2a89e253ddd7f7c15d6de7af0ef13c293dba0a86))
14
+
1
15
  # [6.21.0](https://github.com/dialpad/dialtone/compare/v6.20.3...v6.21.0) (2022-04-04)
2
16
 
3
17
 
@@ -19,11 +19,13 @@
19
19
  --badge--bgc: var(--black-050);
20
20
 
21
21
  display: inline-block;
22
- padding: var(--su2) var(--su6) var(--su1);
22
+ min-width: calc(var(--su6) + var(--su1));
23
+ padding: calc(var(--su6) / 4) var(--su6);
23
24
  color: var(--badge--fc);
24
25
  font-weight: bold;
25
26
  font-size: var(--fs10);
26
27
  line-height: var(--lh6);
28
+ text-align: center;
27
29
  text-transform: uppercase;
28
30
  background-color: var(--badge--bgc);
29
31
  border-radius: var(--su4);
@@ -51,13 +51,19 @@
51
51
 
52
52
  // -- STATES
53
53
  // ------------------------------------------------------------------------
54
+ &:hover {
55
+ --button--fc: var(--primary-color-hover);
56
+ --button--bgc: hsla(var(--primary-color-hsl) ~' / ' 3%);
57
+ }
54
58
 
55
59
  &:active,
56
- &:hover {
60
+ &.d-btn--active,
61
+ &.d-btn--active:active {
57
62
  --button--fc: var(--primary-color-hover);
58
- --button--bgc: hsla(var(--primary-color-hsl) ~' / ' 10%);
63
+ --button--bgc: hsla(var(--primary-color-hsl) ~' / ' 9%);
59
64
  }
60
65
 
66
+
61
67
  &:focus-visible {
62
68
  outline: none;
63
69
  box-shadow: var(--bs-focus-ring);
@@ -213,11 +219,6 @@
213
219
  padding: calc(var(--su8) + var(--su1));
214
220
  transition-duration: 150ms;
215
221
 
216
- &:hover {
217
- --button--fc: var(--black-800);
218
- --button--bgc: var(--black-100);
219
- }
220
-
221
222
  &:focus-visible {
222
223
  box-shadow: var(--bs-focus-ring-circle);
223
224
  }
@@ -234,11 +235,6 @@
234
235
  --button--bc: var(--black-700);
235
236
  }
236
237
 
237
- // &:active {
238
- // border-color: hsla(var(--black-700-h) var(--black-700-s) var(--black-700-l) ~" / " 50%);
239
- // background-color: hsla(var(--black-700-h) var(--black-700-s) var(--black-700-l) ~" / " 10%);
240
- // }
241
-
242
238
  // Adjust padding based on sizes
243
239
  &.d-btn--xs {
244
240
  padding: calc(var(--su8) - var(--su1));
@@ -278,8 +274,15 @@
278
274
  --button--bgc: var(--primary-color);
279
275
 
280
276
  &:hover {
281
- --button--fc: var(--white);
282
- --button--bgc: var(--primary-color-hover);
277
+ --button--fc: var(--white);
278
+ --button--bgc: hsl(var(--primary-color-h), var(--primary-color-s), 65%);
279
+ }
280
+
281
+ &:active,
282
+ &.d-btn--active,
283
+ &.d-btn--active:active {
284
+ --button--fc: var(--white);
285
+ --button--bgc: hsl(var(--primary-color-h), var(--primary-color-s), 42%);
283
286
  }
284
287
  }
285
288
 
@@ -288,9 +291,14 @@
288
291
  .d-btn--muted {
289
292
  --button--fc: var(--muted-color);
290
293
 
291
- &:hover {
294
+ &:hover,
295
+ &:active {
292
296
  --button--fc: var(--muted-color-hover);
293
- --button--bgc: hsla(var(--muted-color-hsl) ~' / ' 7.5%);
297
+ --button--bgc: hsla(var(--black-800-hsl) ~' / ' 3%);
298
+ }
299
+
300
+ &:active {
301
+ --button--bgc: hsla(var(--black-800-hsl) ~' / ' 9%);
294
302
  }
295
303
 
296
304
  &:focus-visible {
@@ -308,8 +316,15 @@
308
316
  --button--fc: var(--error-color);
309
317
 
310
318
  &:hover {
311
- --button--bgc: hsla(var(--error-color-hsl) ~' / ' 10%);
312
319
  --button--fc: var(--error-color-hover);
320
+ --button--bgc: hsla(var(--error-color-hsl) ~' / ' 6%);
321
+ }
322
+
323
+ &:active,
324
+ &.d-btn--active,
325
+ &.d-btn--active:active {
326
+ --button--fc: var(--error-color-hover);
327
+ --button--bgc: hsla(var(--error-color-hsl) ~' / ' 20%);
313
328
  }
314
329
 
315
330
  &:focus-visible {
@@ -325,8 +340,14 @@
325
340
  --button--bgc: var(--error-color);
326
341
 
327
342
  &:hover {
343
+ --button--bgc: hsl(var(--red-500-h), var(--red-500-s), 40%);
344
+ }
345
+
346
+ &:active,
347
+ &.d-btn--active,
348
+ &.d-btn--active:active {
328
349
  --button--fc: var(--white);
329
- --button--bgc: var(--error-color-hover);
350
+ --button--bgc: hsl(var(--red-500-h), var(--red-500-s), 27%);
330
351
  }
331
352
  }
332
353
  }
@@ -343,6 +364,13 @@
343
364
  --button--bgc: hsla(var(--white-hsl) ~' / ' 15%);
344
365
  }
345
366
 
367
+ &:active,
368
+ &.d-btn--active,
369
+ &.d-btn--active:active {
370
+ --button--fc: var(--white);
371
+ --button--bgc: hsla(var(--white-hsl) ~' / ' 30%);
372
+ }
373
+
346
374
  &:focus-visible {
347
375
  box-shadow: var(--bs-focus-ring-inverted);
348
376
  }
@@ -355,11 +383,18 @@
355
383
  // -- PRIMARY
356
384
  &.d-btn--primary {
357
385
  --button--fc: var(--primary-color);
358
- --button--bgc: var(--white);
386
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 100%);
359
387
 
360
388
  &:hover {
361
389
  --button--fc: var(--primary-color-hover);
362
- --button--bgc: hsla(var(--white-hsl) ~' / ' 90%);
390
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 94%);
391
+ }
392
+
393
+ &:active,
394
+ &.d-btn--active,
395
+ &.d-btn--active:active {
396
+ --button--fc: var(--primary-color-hover);
397
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 91%);
363
398
  }
364
399
  }
365
400
  }
@@ -480,11 +480,13 @@ body {
480
480
  --badge--fc: var(--fc-dark);
481
481
  --badge--bgc: var(--black-050);
482
482
  display: inline-block;
483
- padding: var(--su2) var(--su6) var(--su1);
483
+ min-width: calc(var(--su6) + var(--su1));
484
+ padding: calc(var(--su6) / 4) var(--su6);
484
485
  color: var(--badge--fc);
485
486
  font-weight: bold;
486
487
  font-size: var(--fs10);
487
488
  line-height: var(--lh6);
489
+ text-align: center;
488
490
  text-transform: uppercase;
489
491
  background-color: var(--badge--bgc);
490
492
  border-radius: var(--su4);
@@ -690,10 +692,15 @@ body {
690
692
  user-select: none;
691
693
  fill: currentColor;
692
694
  }
693
- .d-btn:active,
694
695
  .d-btn:hover {
695
696
  --button--fc: var(--primary-color-hover);
696
- --button--bgc: hsla(var(--primary-color-hsl) / 10%);
697
+ --button--bgc: hsla(var(--primary-color-hsl) / 3%);
698
+ }
699
+ .d-btn:active,
700
+ .d-btn.d-btn--active,
701
+ .d-btn.d-btn--active:active {
702
+ --button--fc: var(--primary-color-hover);
703
+ --button--bgc: hsla(var(--primary-color-hsl) / 9%);
697
704
  }
698
705
  .d-btn.focus-visible {
699
706
  outline: none;
@@ -806,10 +813,6 @@ body {
806
813
  padding: calc(var(--su8) + var(--su1));
807
814
  transition-duration: 150ms;
808
815
  }
809
- .d-btn--circle:hover {
810
- --button--fc: var(--black-800);
811
- --button--bgc: var(--black-100);
812
- }
813
816
  .d-btn--circle.focus-visible {
814
817
  box-shadow: var(--bs-focus-ring-circle);
815
818
  }
@@ -850,14 +853,24 @@ body {
850
853
  }
851
854
  .d-btn--primary:hover {
852
855
  --button--fc: var(--white);
853
- --button--bgc: var(--primary-color-hover);
856
+ --button--bgc: hsl(var(--primary-color-h), var(--primary-color-s), 65%);
857
+ }
858
+ .d-btn--primary:active,
859
+ .d-btn--primary.d-btn--active,
860
+ .d-btn--primary.d-btn--active:active {
861
+ --button--fc: var(--white);
862
+ --button--bgc: hsl(var(--primary-color-h), var(--primary-color-s), 42%);
854
863
  }
855
864
  .d-btn--muted {
856
865
  --button--fc: var(--muted-color);
857
866
  }
858
- .d-btn--muted:hover {
867
+ .d-btn--muted:hover,
868
+ .d-btn--muted:active {
859
869
  --button--fc: var(--muted-color-hover);
860
- --button--bgc: hsla(var(--muted-color-hsl) / 7.5%);
870
+ --button--bgc: hsla(var(--black-800-hsl) / 3%);
871
+ }
872
+ .d-btn--muted:active {
873
+ --button--bgc: hsla(var(--black-800-hsl) / 9%);
861
874
  }
862
875
  .d-btn--muted.focus-visible {
863
876
  box-shadow: var(--bs-focus-ring-muted);
@@ -872,8 +885,14 @@ body {
872
885
  --button--fc: var(--error-color);
873
886
  }
874
887
  .d-btn--danger:hover {
875
- --button--bgc: hsla(var(--error-color-hsl) / 10%);
876
888
  --button--fc: var(--error-color-hover);
889
+ --button--bgc: hsla(var(--error-color-hsl) / 6%);
890
+ }
891
+ .d-btn--danger:active,
892
+ .d-btn--danger.d-btn--active,
893
+ .d-btn--danger.d-btn--active:active {
894
+ --button--fc: var(--error-color-hover);
895
+ --button--bgc: hsla(var(--error-color-hsl) / 20%);
877
896
  }
878
897
  .d-btn--danger.focus-visible {
879
898
  box-shadow: var(--bs-focus-ring-error);
@@ -889,8 +908,13 @@ body {
889
908
  --button--bgc: var(--error-color);
890
909
  }
891
910
  .d-btn--danger.d-btn--primary:hover {
911
+ --button--bgc: hsl(var(--red-500-h), var(--red-500-s), 40%);
912
+ }
913
+ .d-btn--danger.d-btn--primary:active,
914
+ .d-btn--danger.d-btn--primary.d-btn--active,
915
+ .d-btn--danger.d-btn--primary.d-btn--active:active {
892
916
  --button--fc: var(--white);
893
- --button--bgc: var(--error-color-hover);
917
+ --button--bgc: hsl(var(--red-500-h), var(--red-500-s), 27%);
894
918
  }
895
919
  .d-btn--inverted {
896
920
  --button--fc: var(--white);
@@ -900,6 +924,12 @@ body {
900
924
  --button--fc: var(--white);
901
925
  --button--bgc: hsla(var(--white-hsl) / 15%);
902
926
  }
927
+ .d-btn--inverted:active,
928
+ .d-btn--inverted.d-btn--active,
929
+ .d-btn--inverted.d-btn--active:active {
930
+ --button--fc: var(--white);
931
+ --button--bgc: hsla(var(--white-hsl) / 30%);
932
+ }
903
933
  .d-btn--inverted.focus-visible {
904
934
  box-shadow: var(--bs-focus-ring-inverted);
905
935
  }
@@ -911,11 +941,17 @@ body {
911
941
  }
912
942
  .d-btn--inverted.d-btn--primary {
913
943
  --button--fc: var(--primary-color);
914
- --button--bgc: var(--white);
944
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 100%);
915
945
  }
916
946
  .d-btn--inverted.d-btn--primary:hover {
917
947
  --button--fc: var(--primary-color-hover);
918
- --button--bgc: hsla(var(--white-hsl) / 90%);
948
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 94%);
949
+ }
950
+ .d-btn--inverted.d-btn--primary:active,
951
+ .d-btn--inverted.d-btn--primary.d-btn--active,
952
+ .d-btn--inverted.d-btn--primary.d-btn--active:active {
953
+ --button--fc: var(--primary-color-hover);
954
+ --button--bgc: hsl(var(--purple-100-h), var(--purple-100-s), 91%);
919
955
  }
920
956
  .d-btn--icon-only {
921
957
  padding: calc(var(--su8) + var(--su1));