@dialpad/dialtone 6.11.0 → 6.12.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,12 @@
1
+ # [6.12.0](https://github.com/dialpad/dialtone/compare/v6.11.0...v6.12.0) (2022-01-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * add documentation for new skeleton component ([#521](https://github.com/dialpad/dialtone/issues/521)) ([574f976](https://github.com/dialpad/dialtone/commit/574f97679619e730050d5a75cadb4fbb020e5af8))
7
+ * implement focus visible ([#524](https://github.com/dialpad/dialtone/issues/524)) ([20938ee](https://github.com/dialpad/dialtone/commit/20938ee94efed2a8ea8c7632a631e2f41ff9a1da))
8
+ * implement focus visible polyfill ([#528](https://github.com/dialpad/dialtone/issues/528)) ([0c3a661](https://github.com/dialpad/dialtone/commit/0c3a661eb2748e03a2a2bfcf75642e7b241bd8bf))
9
+
1
10
  # [6.11.0](https://github.com/dialpad/dialtone/compare/v6.10.0...v6.11.0) (2022-01-04)
2
11
 
3
12
 
@@ -58,9 +58,9 @@
58
58
  --button--bgc: hsla(var(--primary-color-hsl) ~' / ' 10%);
59
59
  }
60
60
 
61
- &:focus {
62
- outline: none;
63
- box-shadow: var(--bs-focus-ring);
61
+ &:focus-visible {
62
+ outline: none;
63
+ box-shadow: var(--bs-focus-ring);
64
64
  }
65
65
 
66
66
  &[disabled] {
@@ -192,7 +192,7 @@
192
192
  --button--bgc: var(--black-100);
193
193
  }
194
194
 
195
- &:focus {
195
+ &:focus-visible {
196
196
  box-shadow: var(--bs-focus-ring-circle);
197
197
  }
198
198
 
@@ -267,7 +267,7 @@
267
267
  --button--bgc: hsla(var(--muted-color-hsl) ~' / ' 7.5%);
268
268
  }
269
269
 
270
- &:focus {
270
+ &:focus-visible {
271
271
  box-shadow: var(--bs-focus-ring-muted);
272
272
  }
273
273
 
@@ -286,7 +286,7 @@
286
286
  --button--fc: var(--error-color-hover);
287
287
  }
288
288
 
289
- &:focus {
289
+ &:focus-visible {
290
290
  box-shadow: var(--bs-focus-ring-error);
291
291
  }
292
292
 
@@ -317,7 +317,7 @@
317
317
  --button--bgc: hsla(var(--white-hsl) ~' / ' 15%);
318
318
  }
319
319
 
320
- &:focus {
320
+ &:focus-visible {
321
321
  box-shadow: var(--bs-focus-ring-inverted);
322
322
  }
323
323
 
@@ -363,13 +363,12 @@
363
363
  background-color: hsl(var(--brand-color-h) var(--brand-color-s) var(--brand-color-l));
364
364
 
365
365
  &:hover,
366
- &:focus,
367
366
  &:active {
368
367
  color: hsla(var(--white-hsl) ~' / ' 90%);
369
368
  background-color: hsl(var(--brand-color-h) calc(var(--brand-color-s) + 2.5%) calc(var(--brand-color-l) - 5%));
370
369
  }
371
370
 
372
- &:focus {
371
+ &:focus-visible {
373
372
  box-shadow: 0 0 0 var(--su1) var(--white), 0 0 0 0.25em hsla(var(--brand-color-h) var(--brand-color-s) var(--brand-color-l) ~' / ' 90%);
374
373
  }
375
374
 
@@ -40,7 +40,7 @@
40
40
  cursor: pointer;
41
41
  }
42
42
 
43
- &:focus {
43
+ &:focus-visible {
44
44
  border-radius: 4px;
45
45
  outline: none;
46
46
  box-shadow: 0 0 0 var(--su2) var(--focus-ring);
@@ -60,7 +60,7 @@
60
60
  color: var(--fc-warning-hover);
61
61
  }
62
62
 
63
- &:focus {
63
+ &:focus-visible {
64
64
  box-shadow: 0 0 0 var(--su2) var(--focus-ring-warning);
65
65
  }
66
66
  }
@@ -74,7 +74,7 @@
74
74
  color: var(--error-color-hover);
75
75
  }
76
76
 
77
- &:focus {
77
+ &:focus-visible {
78
78
  box-shadow: 0 0 0 var(--su2) var(--focus-ring-error);
79
79
  }
80
80
  }
@@ -88,7 +88,7 @@
88
88
  color: var(--success-color-hover);
89
89
  }
90
90
 
91
- &:focus {
91
+ &:focus-visible {
92
92
  box-shadow: 0 0 0 var(--su2) var(--focus-ring-success);
93
93
  }
94
94
  }
@@ -102,7 +102,7 @@
102
102
  color: var(--muted-color-hover);
103
103
  }
104
104
 
105
- &:focus {
105
+ &:focus-visible {
106
106
  box-shadow: 0 0 0 var(--su2) var(--focus-ring-muted);
107
107
  }
108
108
  }
@@ -135,7 +135,7 @@
135
135
  color: var(--inverted-color-hover);
136
136
  }
137
137
 
138
- &:focus {
138
+ &:focus-visible {
139
139
  box-shadow: 0 0 0 var(--su2) var(--focus-ring-inverted);
140
140
  }
141
141
  }
@@ -52,12 +52,12 @@
52
52
  display: none;
53
53
  }
54
54
 
55
- &:focus,
56
- &:checked:focus {
57
- --check-radio--bc: var(--check-radio--color);
55
+ &:focus-visible,
56
+ &:checked:focus-visible {
57
+ --check-radio--bc: var(--check-radio--color);
58
58
 
59
- outline: 0;
60
- box-shadow: var(--bs-focus-ring);
59
+ outline: 0;
60
+ box-shadow: var(--bs-focus-ring);
61
61
  }
62
62
 
63
63
  &:checked {
@@ -149,8 +149,8 @@
149
149
  background-size: contain;
150
150
  border-radius: var(--br2);
151
151
 
152
- &:focus,
153
- &:checked:focus {
152
+ &:focus-visible,
153
+ &:checked:focus-visible {
154
154
  border-radius: var(--br2);
155
155
  }
156
156
 
@@ -209,8 +209,8 @@
209
209
  --check-radio--color: var(--warning-color);
210
210
  --check-radio--bc: var(--check-radio--color);
211
211
 
212
- &:focus,
213
- &:checked:focus {
212
+ &:focus-visible,
213
+ &:checked:focus-visible {
214
214
  box-shadow: var(--bs-focus-ring-warning);
215
215
  }
216
216
  }
@@ -219,8 +219,8 @@
219
219
  --check-radio--color: var(--error-color);
220
220
  --check-radio--bc: var(--check-radio--color);
221
221
 
222
- &:focus,
223
- &:checked:focus {
222
+ &:focus-visible,
223
+ &:checked:focus-visible {
224
224
  box-shadow: var(--bs-focus-ring-error);
225
225
  }
226
226
  }
@@ -229,8 +229,8 @@
229
229
  --check-radio--color: var(--success-color);
230
230
  --check-radio--bc: var(--check-radio--color);
231
231
 
232
- &:focus,
233
- &:checked:focus {
232
+ &:focus-visible,
233
+ &:checked:focus-visible {
234
234
  box-shadow: var(--bs-focus-ring-success);
235
235
  }
236
236
  }
@@ -251,9 +251,9 @@
251
251
  --check-radio--bgc: var(--black-075);
252
252
  }
253
253
 
254
- &:focus,
255
- &:checked:focus {
256
- box-shadow: var(--bs-focus-ring), inset 0 0 0 var(--su2) var(--white);
254
+ &:focus-visible,
255
+ &:checked:focus-visible {
256
+ box-shadow: var(--bs-focus-ring), inset 0 0 0 var(--su2) var(--white);
257
257
  }
258
258
 
259
259
  &:checked {
@@ -279,9 +279,9 @@
279
279
  --check-radio--color: var(--warning-color);
280
280
  --check-radio--bc: var(--check-radio--color);
281
281
 
282
- &:focus,
283
- &:checked:focus {
284
- box-shadow: var(--bs-focus-ring-warning), inset 0 0 0 var(--su2) var(--white);
282
+ &:focus-visible,
283
+ &:checked:focus-visible {
284
+ box-shadow: var(--bs-focus-ring-warning), inset 0 0 0 var(--su2) var(--white);
285
285
  }
286
286
  }
287
287
 
@@ -289,9 +289,9 @@
289
289
  --check-radio--color: var(--error-color);
290
290
  --check-radio--bc: var(--check-radio--color);
291
291
 
292
- &:focus,
293
- &:checked:focus {
294
- box-shadow: var(--bs-focus-ring-error), inset 0 0 0 var(--su2) var(--white);
292
+ &:focus-visible,
293
+ &:checked:focus-visible {
294
+ box-shadow: var(--bs-focus-ring-error), inset 0 0 0 var(--su2) var(--white);
295
295
  }
296
296
  }
297
297
 
@@ -299,8 +299,8 @@
299
299
  --check-radio--color: var(--success-color);
300
300
  --check-radio--bc: var(--check-radio--color);
301
301
 
302
- &:focus,
303
- &:checked:focus {
304
- box-shadow: var(--bs-focus-ring-success), inset 0 0 0 var(--su2) var(--white);
302
+ &:focus-visible,
303
+ &:checked:focus-visible {
304
+ box-shadow: var(--bs-focus-ring-success), inset 0 0 0 var(--su2) var(--white);
305
305
  }
306
306
  }
@@ -106,8 +106,8 @@
106
106
  border-color: var(--select--bc);
107
107
  // [1] Reset the appearance
108
108
  -webkit-appearance: none;
109
- -moz-appearance: none;
110
- appearance: none;
109
+ -moz-appearance: none;
110
+ appearance: none;
111
111
 
112
112
  // [2] Update the styles
113
113
  .d-input();
@@ -148,7 +148,7 @@
148
148
  &:focus {
149
149
  --select--bc: var(--success-color);
150
150
 
151
- box-shadow: var(--bs-focus-ring-success);
151
+ box-shadow: var(--bs-focus-ring-success) !important;
152
152
  }
153
153
  }
154
154
 
@@ -158,7 +158,7 @@
158
158
  &:focus {
159
159
  --select--bc: var(--error-color);
160
160
 
161
- box-shadow: var(--bs-focus-ring-error);
161
+ box-shadow: var(--bs-focus-ring-error) !important;
162
162
  }
163
163
  }
164
164
 
@@ -168,7 +168,7 @@
168
168
  &:focus {
169
169
  --select--bc: var(--warning-color);
170
170
 
171
- box-shadow: var(--bs-focus-ring-warning);
171
+ box-shadow: var(--bs-focus-ring-warning) !important;
172
172
  }
173
173
  }
174
174
 
@@ -0,0 +1,43 @@
1
+ //
2
+ // DIALTONE
3
+ // COMPONENTS: SKELETON
4
+ //
5
+ // These are the styles for skeleton component.
6
+ // The --placeholder-from-color and --placeholder-to-color custom properties can be set on the parent class of the
7
+ // placeholder to control the animation colors.
8
+ // For further documentation of these styles, please visit https://dialpad.design/components/skeleton
9
+
10
+ // ============================================================================
11
+ // @ SKELETON CONTAINER
12
+ // ----------------------------------------------------------------------------
13
+ .skeleton-placeholder {
14
+ display: flex;
15
+ width: 100%;
16
+ background: var(--placeholder-from-color, @black-075);
17
+ animation-duration: 1000ms;
18
+ fill: var(--placeholder-from-color, @black-075);
19
+ stroke: none;
20
+
21
+ &--animate {
22
+ animation-name: placeholder-throb;
23
+ animation-iteration-count: infinite;
24
+ }
25
+ }
26
+
27
+ // the animation is used by the skeleton component
28
+ @keyframes placeholder-throb {
29
+ 10% {
30
+ background: var(--placeholder-from-color, @black-075);
31
+ fill: var(--placeholder-from-color, @black-075);
32
+ }
33
+
34
+ 50% {
35
+ background: var(--placeholder-to-color, @black-050);
36
+ fill: var(--placeholder-to-color, @black-050);
37
+ }
38
+
39
+ 90% {
40
+ background: var(--placeholder-from-color, @black-075);
41
+ fill: var(--placeholder-from-color, @black-075);
42
+ }
43
+ }
@@ -82,7 +82,7 @@
82
82
  content: '';
83
83
  }
84
84
 
85
- &:focus {
85
+ &:focus-visible {
86
86
  outline: none;
87
87
  box-shadow: 0 0 0 var(--su2) var(--tab--oc);
88
88
  }
@@ -100,8 +100,8 @@
100
100
  &:extend(.d-tooltip--hide);
101
101
  }
102
102
 
103
- &:focus-visible,
104
- &:hover {
103
+ &:hover,
104
+ &:focus-visible {
105
105
  .d-tooltip {
106
106
  &:extend(.d-tooltip--show);
107
107
  }
@@ -56,3 +56,13 @@ body {
56
56
  .d-svg-primary--fill {
57
57
  fill: var(--primary-color);
58
58
  }
59
+
60
+ // ============================================================================
61
+ // @ FOCUS VISIBLE
62
+ // ----------------------------------------------------------------------------
63
+ // This will hide the focus indicator if the element receives focus via the mouse,
64
+ // but it will still show up on keyboard focus.
65
+ //
66
+ .js-focus-visible :focus:not(.focus-visible) {
67
+ outline: none;
68
+ }
@@ -25,6 +25,7 @@
25
25
  @import 'components/notice';
26
26
  @import 'components/radio-checkbox';
27
27
  @import 'components/selects';
28
+ @import 'components/skeleton';
28
29
  @import 'components/table';
29
30
  @import 'components/tabs';
30
31
  @import 'components/tooltip';
@@ -308,7 +308,7 @@
308
308
  '.d-gr',
309
309
  { .template(@value) { grid-row: span @value ~' / ' span @value !important; } },
310
310
  1 2 3 4 5 6 7 8 9 10 11 12
311
- );;
311
+ );
312
312
 
313
313
  .d-gr-full { grid-row: 1 ~' / ' -1 !important; }
314
314
 
@@ -52,6 +52,10 @@
52
52
  --fco: 100%;
53
53
  color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--fco)) !important;
54
54
  }
55
+ .fv\:d-fc-@{color-name}:focus-visible {
56
+ --fco: 100%;
57
+ color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--fco)) !important;
58
+ }
55
59
  #d-internals #dark-mode('.d\:d-fc-@{color-name}', {
56
60
  --fco: 100%;
57
61
  color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--fco)) !important;
@@ -69,6 +73,10 @@
69
73
  --bco: 100%;
70
74
  border-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bco)) !important;
71
75
  }
76
+ .fv\:d-bc-@{color-name}:focus-visible {
77
+ --bco: 100%;
78
+ border-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bco)) !important;
79
+ }
72
80
  #d-internals #dark-mode('.d\:d-bc-@{color-name}', {
73
81
  --bco: 100%;
74
82
  border-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bco)) !important;
@@ -95,6 +103,10 @@
95
103
  --bgo: 100%;
96
104
  background-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bgo)) !important;
97
105
  }
106
+ .fv\:d-bgc-@{color-name}:focus-visible {
107
+ --bgo: 100%;
108
+ background-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bgo)) !important;
109
+ }
98
110
  #d-internals #dark-mode('.d\:d-bgc-@{color-name}', {
99
111
  --bgo: 100%;
100
112
  background-color: hsla(var(~'--@{color-name}-h') var(~'--@{color-name}-s') var(~'--@{color-name}-l') ~' / ' var(--bgo)) !important;
@@ -141,6 +153,9 @@
141
153
  .f\:@{className}:focus-within {
142
154
  @mixin();
143
155
  }
156
+ .fv\:@{className}:focus-visible {
157
+ @mixin();
158
+ }
144
159
  }
145
160
 
146
161
  // ========================================================================
@@ -161,6 +176,9 @@
161
176
  .f\:d-fco@{opacity}:focus-within {
162
177
  --fco: ~'@{opacity}%' !important;
163
178
  }
179
+ .fv\:d-fco@{opacity}:focus-visible {
180
+ --fco: ~'@{opacity}%' !important;
181
+ }
164
182
  #d-internals #dark-mode('.d\:d-fco@{opacity}', {
165
183
  --fco: ~'@{opacity}%' !important;
166
184
  });
@@ -175,6 +193,9 @@
175
193
  .f\:d-bco@{opacity}:focus-within {
176
194
  --bco: ~'@{opacity}%' !important;
177
195
  }
196
+ .fv\:d-bco@{opacity}:focus-visible {
197
+ --bco: ~'@{opacity}%' !important;
198
+ }
178
199
  #d-internals #dark-mode('.d\:d-bco@{opacity}', {
179
200
  --bco: ~'@{opacity}%' !important;
180
201
  });
@@ -196,6 +217,9 @@
196
217
  .f\:d-bgo@{opacity}:focus-within {
197
218
  --bgo: ~'@{opacity}%' !important;
198
219
  }
220
+ .fv\:d-bgo@{opacity}:focus-visible {
221
+ --bgo: ~'@{opacity}%' !important;
222
+ }
199
223
  #d-internals #dark-mode('.d\:d-bgo@{opacity}', {
200
224
  --bgo: ~'@{opacity}%' !important;
201
225
  });
@@ -209,6 +233,9 @@
209
233
  .f\:d-bgg-from-@{opacity}:focus-within {
210
234
  --bgg-from-opacity: ~'@{opacity}%' !important;
211
235
  }
236
+ .fv\:d-bgg-from-@{opacity}:focus-visible {
237
+ --bgg-from-opacity: ~'@{opacity}%' !important;
238
+ }
212
239
  #d-internals #dark-mode('.d\:d-bgg-from-@{opacity}', {
213
240
  --bgg-from-opacity: ~'@{opacity}%' !important;
214
241
  });
@@ -222,6 +249,9 @@
222
249
  .f\:d-bgg-to-@{opacity}:focus-within {
223
250
  --bgg-to-opacity: ~'@{opacity}%' !important;
224
251
  }
252
+ .fv\:d-bgg-to-@{opacity}:focus-visible {
253
+ --bgg-to-opacity: ~'@{opacity}%' !important;
254
+ }
225
255
  #d-internals #dark-mode('.d\:d-bgg-to-@{opacity}', {
226
256
  --bgg-to-opacity: ~'@{opacity}%' !important;
227
257
  });
@@ -377,6 +407,11 @@
377
407
  --bgg-from: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-from-opacity));
378
408
  --bgg-to: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " 0%);
379
409
  }
410
+ .fv\:d-bgg-from-@{color}:focus-visible {
411
+ --bgg-from-opacity: 100%;
412
+ --bgg-from: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-from-opacity));
413
+ --bgg-to: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " 0%);
414
+ }
380
415
  #d-internals #dark-mode('.d\:d-bgg-from-@{color}', {
381
416
  --bgg-from-opacity: 100%;
382
417
  --bgg-from: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-from-opacity));
@@ -394,6 +429,10 @@
394
429
  --bgg-to-opacity: 100%;
395
430
  --bgg-to: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-to-opacity)) !important;
396
431
  }
432
+ .fv\:d-bgg-to-@{color}:focus-visible {
433
+ --bgg-to-opacity: 100%;
434
+ --bgg-to: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-to-opacity)) !important;
435
+ }
397
436
  #d-internals #dark-mode('.d\:d-bgg-to-@{color}', {
398
437
  --bgg-to-opacity: 100%;
399
438
  --bgg-to: hsla(var(~"--@{color}-h") var(~"--@{color}-s") var(~"--@{color}-l") ~" / " var(--bgg-to-opacity)) !important;
@@ -120,15 +120,15 @@
120
120
  // ============================================================================
121
121
  // $ DISPLAY
122
122
  // ----------------------------------------------------------------------------
123
- .d-d-block { display: block !important; };;;;
124
- .d-d-flex { display: flex !important; };;;;
125
- .d-d-grid { display: grid !important; };;;;
126
- .d-d-inline { display: inline !important; };;;;
127
- .d-d-inline-block { display: inline-block !important; };;;;
128
- .d-d-inline-flex { display: inline-flex !important; };;;;
129
- .d-d-inline-grid { display: inline-grid !important; };;;;
130
- .d-d-none { display: none !important; };;;;
131
- .d-d-unset { display: unset !important; };;
123
+ .d-d-block { display: block !important; }
124
+ .d-d-flex { display: flex !important; }
125
+ .d-d-grid { display: grid !important; }
126
+ .d-d-inline { display: inline !important; }
127
+ .d-d-inline-block { display: inline-block !important; }
128
+ .d-d-inline-flex { display: inline-flex !important; }
129
+ .d-d-inline-grid { display: inline-grid !important; }
130
+ .d-d-none { display: none !important; }
131
+ .d-d-unset { display: unset !important; }
132
132
 
133
133
 
134
134
  // ============================================================================
@@ -152,12 +152,12 @@
152
152
  // ============================================================================
153
153
  // $ POSITION
154
154
  // ----------------------------------------------------------------------------
155
- .d-ps-static { position: static !important; };;;;
156
- .d-ps-relative { position: relative !important; };;;;
157
- .d-ps-absolute { position: absolute !important; };;;;
158
- .d-ps-fixed { position: fixed !important; };;;;
159
- .d-ps-sticky { position: sticky !important; };;;;
160
- .d-ps-unset { position: unset !important; };;
155
+ .d-ps-static { position: static !important; }
156
+ .d-ps-relative { position: relative !important; }
157
+ .d-ps-absolute { position: absolute !important; }
158
+ .d-ps-fixed { position: fixed !important; }
159
+ .d-ps-sticky { position: sticky !important; }
160
+ .d-ps-unset { position: unset !important; }
161
161
 
162
162
 
163
163
  // ============================================================================