@oscarpalmer/oui 0.18.0 → 0.19.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/dist/css/badge.css +10 -10
- package/dist/css/button.css +9 -9
- package/dist/css/color.css +99 -99
- package/dist/css/content.css +1 -1
- package/dist/css/flex.css +39 -39
- package/dist/css/form.css +29 -56
- package/dist/css/message.css +6 -6
- package/dist/css/reset.css +3 -2
- package/dist/css/table.css +4 -4
- package/dist/css/tooltip.css +18 -1
- package/dist/js/attributable.full.js +29 -41
- package/dist/js/floatable.full.js +322 -337
- package/dist/js/focus-trap/embedded.full.js +252 -195
- package/dist/js/focus-trap/standalone.full.js +283 -238
- package/dist/js/index.js +3 -3
- package/dist/js/oui.full.js +1170 -1193
- package/dist/js/popover.full.js +568 -630
- package/dist/js/popover.js +1 -1
- package/dist/js/splitter.full.js +533 -369
- package/dist/js/splitter.js +2 -2
- package/dist/js/tooltip.full.js +488 -554
- package/dist/js/tooltip.js +1 -1
- package/package.json +19 -19
- package/src/css/a11y.scss +1 -1
- package/src/css/badge.scss +23 -19
- package/src/css/button.scss +9 -9
- package/src/css/color.scss +99 -99
- package/src/css/content.scss +6 -8
- package/src/css/flex.scss +21 -20
- package/src/css/form.scss +37 -60
- package/src/css/message.scss +8 -12
- package/src/css/mixins.scss +11 -12
- package/src/css/popover.scss +2 -2
- package/src/css/reset.scss +14 -14
- package/src/css/splitter.scss +15 -13
- package/src/css/table.scss +11 -11
- package/src/css/tooltip.scss +25 -4
- package/src/js/attributable.ts +3 -10
- package/src/js/floatable.ts +7 -25
- package/src/js/focus-trap/embedded.ts +6 -24
- package/src/js/popover.ts +3 -3
- package/src/js/splitter.ts +9 -39
- package/src/js/tooltip.ts +5 -17
- package/dist/css/value.css +0 -1
package/src/css/form.scss
CHANGED
|
@@ -54,11 +54,7 @@
|
|
|
54
54
|
--oui-outline-value: var(--oui-blue-6);
|
|
55
55
|
|
|
56
56
|
outline: 4px solid
|
|
57
|
-
color-mix(
|
|
58
|
-
in oklab,
|
|
59
|
-
var(--oui-outline-value),
|
|
60
|
-
transparent var(--oui-outline-percentage)
|
|
61
|
-
);
|
|
57
|
+
color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
|
|
62
58
|
outline-offset: 0;
|
|
63
59
|
transition: 0.125s ease-in-out;
|
|
64
60
|
}
|
|
@@ -105,17 +101,17 @@
|
|
|
105
101
|
}
|
|
106
102
|
|
|
107
103
|
:where(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
&:is(
|
|
105
|
+
[type='date' i],
|
|
106
|
+
[type='datetime-local' i],
|
|
107
|
+
[type='month' i],
|
|
108
|
+
[type='number' i],
|
|
109
|
+
[type='tel' i],
|
|
110
|
+
[type='time' i],
|
|
111
|
+
[type='url' i],
|
|
112
|
+
[type='week' i]
|
|
113
|
+
)
|
|
114
|
+
) {
|
|
119
115
|
font-variant-numeric: tabular-nums;
|
|
120
116
|
}
|
|
121
117
|
|
|
@@ -164,7 +160,7 @@
|
|
|
164
160
|
);
|
|
165
161
|
border: 1px solid var(--oui-absolute);
|
|
166
162
|
border-radius: 1.25em;
|
|
167
|
-
box-shadow: 0 1px 2px 2px
|
|
163
|
+
box-shadow: 0 1px 2px 2px rgb(0 0 0 / 12.5%);
|
|
168
164
|
cursor: pointer;
|
|
169
165
|
}
|
|
170
166
|
|
|
@@ -176,15 +172,11 @@
|
|
|
176
172
|
}
|
|
177
173
|
|
|
178
174
|
:where(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
:user-invalid:not([aria-invalid='false' i]),
|
|
185
|
-
[aria-invalid='true' i]
|
|
186
|
-
)
|
|
187
|
-
) {
|
|
175
|
+
&.oui-validate:not([disabled], [readonly], [aria-disabled='true' i]):is(
|
|
176
|
+
:user-invalid:not([aria-invalid='false' i]),
|
|
177
|
+
[aria-invalid='true' i]
|
|
178
|
+
)
|
|
179
|
+
) {
|
|
188
180
|
@include invalid;
|
|
189
181
|
|
|
190
182
|
&::file-selector-button {
|
|
@@ -208,12 +200,11 @@
|
|
|
208
200
|
}
|
|
209
201
|
|
|
210
202
|
:where(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
) {
|
|
203
|
+
&.oui-validate:not([disabled], [readonly], [aria-disabled='true' i]):is(
|
|
204
|
+
:user-valid:not([aria-invalid='true' i]),
|
|
205
|
+
[aria-invalid='false' i]
|
|
206
|
+
)
|
|
207
|
+
) {
|
|
217
208
|
@include valid;
|
|
218
209
|
|
|
219
210
|
&::file-selector-button {
|
|
@@ -246,11 +237,7 @@
|
|
|
246
237
|
|
|
247
238
|
@media (hover: hover) {
|
|
248
239
|
&:hover {
|
|
249
|
-
outline-color: color-mix(
|
|
250
|
-
in oklab,
|
|
251
|
-
var(--oui-blue-6),
|
|
252
|
-
transparent 75%
|
|
253
|
-
);
|
|
240
|
+
outline-color: color-mix(in oklab, var(--oui-blue-6), transparent 75%);
|
|
254
241
|
}
|
|
255
242
|
}
|
|
256
243
|
|
|
@@ -278,7 +265,7 @@
|
|
|
278
265
|
&::range-thumb {
|
|
279
266
|
--oui-background-value: var(--oui-blue-6);
|
|
280
267
|
|
|
281
|
-
box-shadow: 0 1px 2px 2px
|
|
268
|
+
box-shadow: 0 1px 2px 2px rgb(0 0 0 / 25%);
|
|
282
269
|
}
|
|
283
270
|
}
|
|
284
271
|
|
|
@@ -386,7 +373,9 @@ select.oui-input:is([multiple]) {
|
|
|
386
373
|
:where(textarea.oui-input) {
|
|
387
374
|
min-height: 4em;
|
|
388
375
|
resize: vertical;
|
|
389
|
-
transition:
|
|
376
|
+
transition:
|
|
377
|
+
all 0.125s ease-in-out,
|
|
378
|
+
height 0s;
|
|
390
379
|
}
|
|
391
380
|
|
|
392
381
|
:where(.oui-label, .oui-legend) {
|
|
@@ -441,19 +430,11 @@ select.oui-input:is([multiple]) {
|
|
|
441
430
|
transparent var(--oui-background-percentage)
|
|
442
431
|
);
|
|
443
432
|
outline: 4px solid
|
|
444
|
-
color-mix(
|
|
445
|
-
in oklab,
|
|
446
|
-
var(--oui-outline-value),
|
|
447
|
-
transparent var(--oui-outline-percentage)
|
|
448
|
-
);
|
|
433
|
+
color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
|
|
449
434
|
outline-offset: 0;
|
|
450
435
|
border: 1px solid var(--oui-border-value);
|
|
451
436
|
box-shadow: inset 0 1px 2px 0
|
|
452
|
-
color-mix(
|
|
453
|
-
in oklab,
|
|
454
|
-
var(--oui-shadow-value),
|
|
455
|
-
transparent var(--oui-shadow-percentage)
|
|
456
|
-
);
|
|
437
|
+
color-mix(in oklab, var(--oui-shadow-value), transparent var(--oui-shadow-percentage));
|
|
457
438
|
}
|
|
458
439
|
|
|
459
440
|
&::after {
|
|
@@ -483,7 +464,7 @@ select.oui-input:is([multiple]) {
|
|
|
483
464
|
height: 1.5em;
|
|
484
465
|
background-color: var(--oui-absolute);
|
|
485
466
|
border-radius: 1.5em;
|
|
486
|
-
box-shadow: 0 1px 2px 1px
|
|
467
|
+
box-shadow: 0 1px 2px 1px rgb(0 0 0 / 12.5%);
|
|
487
468
|
font-size: 0.75em;
|
|
488
469
|
font-weight: bold;
|
|
489
470
|
line-height: 1.5em;
|
|
@@ -499,7 +480,7 @@ select.oui-input:is([multiple]) {
|
|
|
499
480
|
|
|
500
481
|
&::after {
|
|
501
482
|
content: attr(oui-on, '\2713');
|
|
502
|
-
box-shadow: 0 1px 2px 1px
|
|
483
|
+
box-shadow: 0 1px 2px 1px rgb(0 0 0 / 25%);
|
|
503
484
|
right: 0.25em;
|
|
504
485
|
}
|
|
505
486
|
}
|
|
@@ -536,7 +517,7 @@ select.oui-input:is([multiple]) {
|
|
|
536
517
|
content: attr(oui-on, '\2713');
|
|
537
518
|
width: 1.5em;
|
|
538
519
|
height: 1.5em;
|
|
539
|
-
text-shadow: 0 1px 2px
|
|
520
|
+
text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
|
|
540
521
|
font-weight: bold;
|
|
541
522
|
line-height: 1.5em;
|
|
542
523
|
text-align: center;
|
|
@@ -557,7 +538,7 @@ select.oui-input:is([multiple]) {
|
|
|
557
538
|
width: 0.75em;
|
|
558
539
|
height: 0.75em;
|
|
559
540
|
background-color: var(--oui-absolute);
|
|
560
|
-
box-shadow: 0 1px 2px 0
|
|
541
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 50%);
|
|
561
542
|
inset: 0.375em auto auto 0.375em;
|
|
562
543
|
}
|
|
563
544
|
}
|
|
@@ -599,11 +580,7 @@ select.oui-input:is([multiple]) {
|
|
|
599
580
|
color: var(--oui-blue-8);
|
|
600
581
|
}
|
|
601
582
|
|
|
602
|
-
:where(
|
|
603
|
-
&:has(
|
|
604
|
-
input:not([disabled], [aria-disabled='true' i]):is(:checked)
|
|
605
|
-
):hover
|
|
606
|
-
) {
|
|
583
|
+
:where(&:has(input:not([disabled], [aria-disabled='true' i]):is(:checked)):hover) {
|
|
607
584
|
--oui-background-percentage: 50%;
|
|
608
585
|
--oui-background-value: var(--oui-blue-6);
|
|
609
586
|
}
|
|
@@ -614,7 +591,7 @@ select.oui-input:is([multiple]) {
|
|
|
614
591
|
--oui-background-value: var(--oui-gray-0);
|
|
615
592
|
--oui-border-value: var(--oui-gray-3);
|
|
616
593
|
--oui-foreground-percentage: 25%;
|
|
617
|
-
--oui-foreground-value:
|
|
594
|
+
--oui-foreground-value: currentcolor;
|
|
618
595
|
|
|
619
596
|
color: color-mix(
|
|
620
597
|
in oklab,
|
|
@@ -642,5 +619,5 @@ select.oui-input:is([multiple]) {
|
|
|
642
619
|
}
|
|
643
620
|
|
|
644
621
|
:where(.oui-switch input, .oui-toggle input) {
|
|
645
|
-
@include mixins.
|
|
622
|
+
@include mixins.visually-hidden;
|
|
646
623
|
}
|
package/src/css/message.scss
CHANGED
|
@@ -11,12 +11,8 @@
|
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
@include mixins.card(
|
|
14
|
-
color-mix(
|
|
15
|
-
|
|
16
|
-
var(--oui-background, var(--oui-gray-0)),
|
|
17
|
-
transparent 25%
|
|
18
|
-
),
|
|
19
|
-
var(--oui-shadow-mixed),
|
|
14
|
+
color-mix(in oklab, var(--oui-background, var(--oui-gray-0)), transparent 25%),
|
|
15
|
+
var(--oui-shadow-mixed)
|
|
20
16
|
);
|
|
21
17
|
|
|
22
18
|
max-width: fit-content;
|
|
@@ -47,42 +43,42 @@
|
|
|
47
43
|
gap: 1em;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
:where(
|
|
46
|
+
:where(&--blue, &--info) {
|
|
51
47
|
--oui-background: var(--oui-blue-0);
|
|
52
48
|
--oui-border: var(--oui-blue-2);
|
|
53
49
|
--oui-foreground: var(--oui-blue-8);
|
|
54
50
|
--oui-shadow-value: var(--oui-blue-6);
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
:where(
|
|
53
|
+
:where(&--green, &--success) {
|
|
58
54
|
--oui-background: var(--oui-green-0);
|
|
59
55
|
--oui-border: var(--oui-green-2);
|
|
60
56
|
--oui-foreground: var(--oui-green-8);
|
|
61
57
|
--oui-shadow-value: var(--oui-green-6);
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
:where(
|
|
60
|
+
:where(&--orange, &--warning) {
|
|
65
61
|
--oui-background: var(--oui-orange-0);
|
|
66
62
|
--oui-border: var(--oui-orange-2);
|
|
67
63
|
--oui-foreground: var(--oui-orange-8);
|
|
68
64
|
--oui-shadow-value: var(--oui-orange-6);
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
:where(
|
|
67
|
+
:where(&--purple, &--special) {
|
|
72
68
|
--oui-background: var(--oui-purple-0);
|
|
73
69
|
--oui-border: var(--oui-purple-2);
|
|
74
70
|
--oui-foreground: var(--oui-purple-8);
|
|
75
71
|
--oui-shadow-value: var(--oui-purple-6);
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
:where(
|
|
74
|
+
:where(&--red, &--error) {
|
|
79
75
|
--oui-background: var(--oui-red-0);
|
|
80
76
|
--oui-border: var(--oui-red-2);
|
|
81
77
|
--oui-foreground: var(--oui-red-8);
|
|
82
78
|
--oui-shadow-value: var(--oui-red-6);
|
|
83
79
|
}
|
|
84
80
|
|
|
85
|
-
:where(
|
|
81
|
+
:where(&--yellow, &--notice) {
|
|
86
82
|
--oui-background: var(--oui-yellow-0);
|
|
87
83
|
--oui-border: var(--oui-yellow-2);
|
|
88
84
|
--oui-foreground: var(--oui-yellow-8);
|
package/src/css/mixins.scss
CHANGED
|
@@ -40,11 +40,10 @@
|
|
|
40
40
|
transition: 0.125s ease-in-out;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
@mixin card(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)) {
|
|
43
|
+
@mixin card(
|
|
44
|
+
$backgroundColor: var(--oui-absolute),
|
|
45
|
+
$boxShadowColor: color-mix(in oklab, var(--oui-gray-6), transparent 92.5%)
|
|
46
|
+
) {
|
|
48
47
|
@include shadow($boxShadowColor);
|
|
49
48
|
|
|
50
49
|
padding: 1em 1.25em;
|
|
@@ -52,19 +51,19 @@
|
|
|
52
51
|
border-radius: 0.5em;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
@mixin shadow($color:
|
|
54
|
+
@mixin shadow($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
56
55
|
box-shadow:
|
|
57
56
|
inset 0 1px 0 0 $inset,
|
|
58
57
|
0 0 0 1px $color,
|
|
59
|
-
0 1px 2px
|
|
58
|
+
0 1px 2px -0.5px $color,
|
|
60
59
|
0 2px 4px -1px $color;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
@mixin
|
|
62
|
+
@mixin shadow-overlay($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
64
63
|
box-shadow:
|
|
65
64
|
inset 0 1px 0 0 $inset,
|
|
66
65
|
0 0 0 1px $color,
|
|
67
|
-
0 1px 2px
|
|
66
|
+
0 1px 2px -0.5px $color,
|
|
68
67
|
0 2px 4px -1px $color,
|
|
69
68
|
0 4px 8px -2px $color,
|
|
70
69
|
0 8px 16px -4px $color,
|
|
@@ -73,14 +72,14 @@
|
|
|
73
72
|
0 64px 128px -32px $color;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
@mixin
|
|
75
|
+
@mixin shadow-small($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
77
76
|
box-shadow:
|
|
78
77
|
inset 0 1px 0 0 $inset,
|
|
79
78
|
0 0 0 1px $color,
|
|
80
|
-
0 1px 2px
|
|
79
|
+
0 1px 2px -0.5px $color;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
@mixin
|
|
82
|
+
@mixin visually-hidden() {
|
|
84
83
|
width: 1px !important;
|
|
85
84
|
height: 1px !important;
|
|
86
85
|
padding: 0 !important;
|
package/src/css/popover.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use 'mixins.scss' as mixins;
|
|
2
2
|
|
|
3
3
|
:where([oui-popover-content]) {
|
|
4
|
-
@include mixins.
|
|
4
|
+
@include mixins.shadow-overlay;
|
|
5
5
|
|
|
6
6
|
padding: 1rem;
|
|
7
7
|
background-color: var(--oui-absolute);
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
&:focus {
|
|
11
11
|
outline: none;
|
|
12
12
|
}
|
|
13
|
-
}
|
|
13
|
+
}
|
package/src/css/reset.scss
CHANGED
|
@@ -93,17 +93,17 @@
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
:where(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
button,
|
|
97
|
+
input[type='button' i],
|
|
98
|
+
input[type='checkbox' i],
|
|
99
|
+
input[type='file' i],
|
|
100
|
+
input[type='image' i],
|
|
101
|
+
input[type='radio' i],
|
|
102
|
+
input[type='reset' i],
|
|
103
|
+
input[type='submit' i],
|
|
104
|
+
summary
|
|
105
|
+
) {
|
|
106
|
+
/** Correct the inability to style clickable types in iOS [HR][RS][SE] */
|
|
107
107
|
appearance: button;
|
|
108
108
|
/** Ditto */
|
|
109
109
|
cursor: pointer;
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
:where(table) {
|
|
192
192
|
border-collapse: collapse;
|
|
193
193
|
/** Correct table border colour in Chrome, Edge, and Safari [SE] */
|
|
194
|
-
border-color:
|
|
194
|
+
border-color: currentcolor;
|
|
195
195
|
/** Modernized border spacing [HR] */
|
|
196
196
|
border-spacing: 0;
|
|
197
197
|
/** More legible numbers [HR] */
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
|
|
293
293
|
::-webkit-search-decoration {
|
|
294
294
|
/** Remove the inner padding in Chrome, Edge, and Safari on macOS [SE] */
|
|
295
|
-
|
|
295
|
+
appearance: none;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
/**
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
:where(svg:not([fill])) {
|
|
349
|
-
fill:
|
|
349
|
+
fill: currentcolor;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
/**
|
package/src/css/splitter.scss
CHANGED
|
@@ -8,20 +8,20 @@ oui-splitter {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
:where(& > :first-child) {
|
|
11
|
-
flex: var(--oui-splitter-size, .5);
|
|
11
|
+
flex: var(--oui-splitter-size, 0.5);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:where(& > :last-child) {
|
|
15
|
-
flex: calc(1 - var(--oui-splitter-size, .5));
|
|
15
|
+
flex: calc(1 - var(--oui-splitter-size, 0.5));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
:where([oui-splitter-separator]) {
|
|
20
|
-
width: .25rem;
|
|
21
|
-
background-color:
|
|
22
|
-
border-radius: .25rem;
|
|
20
|
+
width: 0.25rem;
|
|
21
|
+
background-color: rgb(0 0 0 / 10%);
|
|
22
|
+
border-radius: 0.25rem;
|
|
23
23
|
position: relative;
|
|
24
|
-
transition: background .125s ease-in-out;
|
|
24
|
+
transition: background 0.125s ease-in-out;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
:where([oui-splitter-separator]:has([oui-splitter-handle]:focus)),
|
|
@@ -33,7 +33,7 @@ oui-splitter {
|
|
|
33
33
|
:where([oui-splitter-handle]) {
|
|
34
34
|
width: 2rem;
|
|
35
35
|
height: 4rem;
|
|
36
|
-
padding: .875rem;
|
|
36
|
+
padding: 0.875rem;
|
|
37
37
|
position: absolute;
|
|
38
38
|
inset: 50% auto auto 50%;
|
|
39
39
|
transform: translate3d(-50%, -50%, 0);
|
|
@@ -48,11 +48,13 @@ oui-splitter {
|
|
|
48
48
|
width: 100%;
|
|
49
49
|
height: 100%;
|
|
50
50
|
display: block;
|
|
51
|
-
background-color:
|
|
52
|
-
outline: .25rem solid transparent;
|
|
53
|
-
outline-offset: .25rem;
|
|
54
|
-
border-radius: .25rem;
|
|
55
|
-
transition:
|
|
51
|
+
background-color: rgb(0 0 0 / 25%);
|
|
52
|
+
outline: 0.25rem solid transparent;
|
|
53
|
+
outline-offset: 0.25rem;
|
|
54
|
+
border-radius: 0.25rem;
|
|
55
|
+
transition:
|
|
56
|
+
background 0.125s ease-in-out,
|
|
57
|
+
outline 0.125s ease-in-out;
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -76,7 +78,7 @@ oui-splitter[oui-splitter-horizontal] {
|
|
|
76
78
|
|
|
77
79
|
:where(& [oui-splitter-separator]) {
|
|
78
80
|
width: 100%;
|
|
79
|
-
height: .25rem;
|
|
81
|
+
height: 0.25rem;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
:where(& [oui-splitter-handle]) {
|
package/src/css/table.scss
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
background-color: var(--oui-absolute);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
:where(
|
|
9
|
+
:where(&_wrapper) {
|
|
10
10
|
max-height: 32em;
|
|
11
11
|
overflow: auto;
|
|
12
12
|
border: 1px solid var(--oui-gray-3);
|
|
13
|
-
border-radius: .25em;
|
|
13
|
+
border-radius: 0.25em;
|
|
14
14
|
position: relative;
|
|
15
15
|
overscroll-behavior-y: none;
|
|
16
16
|
}
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
align-content: center;
|
|
21
21
|
background-color: var(--oui-gray-1);
|
|
22
22
|
border: solid var(--oui-gray-3);
|
|
23
|
-
border-width: 0 0 1px
|
|
24
|
-
font-size: .875rem;
|
|
23
|
+
border-width: 0 0 1px;
|
|
24
|
+
font-size: 0.875rem;
|
|
25
25
|
text-align: left;
|
|
26
|
-
text-indent: .5rem;
|
|
26
|
+
text-indent: 0.5rem;
|
|
27
27
|
position: sticky;
|
|
28
28
|
top: 0;
|
|
29
29
|
z-index: 2;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
height: 4px;
|
|
51
51
|
background-image: linear-gradient(
|
|
52
52
|
to var(--oui-shadow-direction),
|
|
53
|
-
|
|
53
|
+
rgb(0 0 0 / 10%),
|
|
54
54
|
transparent
|
|
55
55
|
);
|
|
56
56
|
position: absolute;
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
:where(& th, & td) {
|
|
61
|
-
padding: .5em .625rem;
|
|
61
|
+
padding: 0.5em 0.625rem;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
:where(& thead th) {
|
|
65
|
-
font-size: .75rem;
|
|
65
|
+
font-size: 0.75rem;
|
|
66
66
|
font-weight: bold;
|
|
67
|
-
letter-spacing: .1em;
|
|
67
|
+
letter-spacing: 0.1em;
|
|
68
68
|
text-align: left;
|
|
69
69
|
text-transform: uppercase;
|
|
70
70
|
top: 0;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
--oui-shadow-direction: bottom;
|
|
74
74
|
|
|
75
75
|
border-top: 1px solid var(--oui-gray-3);
|
|
76
|
-
inset: 100
|
|
76
|
+
inset: 100%;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
--oui-shadow-direction: top;
|
|
89
89
|
|
|
90
90
|
border-bottom: 1px solid var(--oui-gray-3);
|
|
91
|
-
inset: -4px
|
|
91
|
+
inset: -4px;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
package/src/css/tooltip.scss
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
@use 'mixins.scss' as mixins;
|
|
2
2
|
|
|
3
|
-
:where(
|
|
3
|
+
:where(
|
|
4
|
+
[oui-tooltip]:is(
|
|
5
|
+
abbr,
|
|
6
|
+
b,
|
|
7
|
+
cite,
|
|
8
|
+
dfn,
|
|
9
|
+
code,
|
|
10
|
+
em,
|
|
11
|
+
i,
|
|
12
|
+
kbd,
|
|
13
|
+
mark,
|
|
14
|
+
q,
|
|
15
|
+
samp,
|
|
16
|
+
small,
|
|
17
|
+
span,
|
|
18
|
+
strong,
|
|
19
|
+
sub,
|
|
20
|
+
sup,
|
|
21
|
+
time,
|
|
22
|
+
var
|
|
23
|
+
)
|
|
24
|
+
) {
|
|
4
25
|
text-decoration: underline dotted;
|
|
5
26
|
text-decoration-skip-ink: auto;
|
|
6
27
|
text-underline-offset: 0.25em;
|
|
@@ -8,7 +29,7 @@
|
|
|
8
29
|
}
|
|
9
30
|
|
|
10
31
|
:where([oui-tooltip-content]) {
|
|
11
|
-
@include mixins.
|
|
32
|
+
@include mixins.shadow-overlay;
|
|
12
33
|
|
|
13
34
|
max-width: 48ch;
|
|
14
35
|
padding: 0.75em 1em;
|
|
@@ -16,11 +37,11 @@
|
|
|
16
37
|
background-color: var(--oui-absolute);
|
|
17
38
|
border-radius: 0.25rem;
|
|
18
39
|
font-size: 0.875rem;
|
|
19
|
-
transition: opacity .125s ease-in-out;
|
|
40
|
+
transition: opacity 0.125s ease-in-out;
|
|
20
41
|
transition-delay: 0s;
|
|
21
42
|
}
|
|
22
43
|
|
|
23
44
|
:where([oui-tooltip-content][oui-tooltip-content-active]) {
|
|
24
45
|
opacity: 1;
|
|
25
|
-
transition-delay: .25s;
|
|
46
|
+
transition-delay: 0.25s;
|
|
26
47
|
}
|
package/src/js/attributable.ts
CHANGED
|
@@ -39,9 +39,7 @@ function handleAdded(
|
|
|
39
39
|
nodes: Node[] | NodeList,
|
|
40
40
|
add: (element: HTMLElement) => void,
|
|
41
41
|
): void {
|
|
42
|
-
const elements = [...nodes].filter(
|
|
43
|
-
node => node instanceof HTMLElement,
|
|
44
|
-
) as HTMLElement[];
|
|
42
|
+
const elements = [...nodes].filter(node => node instanceof HTMLElement) as HTMLElement[];
|
|
45
43
|
|
|
46
44
|
const {length} = elements;
|
|
47
45
|
|
|
@@ -54,13 +52,8 @@ function handleAdded(
|
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
|
|
57
|
-
function handleRemoved(
|
|
58
|
-
|
|
59
|
-
remove: (element: HTMLElement) => void,
|
|
60
|
-
): void {
|
|
61
|
-
const elements = [...nodes].filter(
|
|
62
|
-
node => node instanceof HTMLElement,
|
|
63
|
-
) as HTMLElement[];
|
|
55
|
+
function handleRemoved(nodes: Node[] | NodeList, remove: (element: HTMLElement) => void): void {
|
|
56
|
+
const elements = [...nodes].filter(node => node instanceof HTMLElement) as HTMLElement[];
|
|
64
57
|
|
|
65
58
|
const {length} = elements;
|
|
66
59
|
|
package/src/js/floatable.ts
CHANGED
|
@@ -151,9 +151,7 @@ function closeAbove(element: HTMLElement): void {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const index = state.order.findIndex(
|
|
154
|
-
floatable =>
|
|
155
|
-
floatable.options.anchor === element ||
|
|
156
|
-
floatable.options.content === element,
|
|
154
|
+
floatable => floatable.options.anchor === element || floatable.options.content === element,
|
|
157
155
|
);
|
|
158
156
|
|
|
159
157
|
if (index === -1 || index === state.order.length - 1) {
|
|
@@ -190,10 +188,7 @@ export function deactivate(floatable: Floatable): void {
|
|
|
190
188
|
|
|
191
189
|
floatable.options.content.hidden = true;
|
|
192
190
|
|
|
193
|
-
floatable.options.anchor.insertAdjacentElement(
|
|
194
|
-
INSERT_AFTEREND,
|
|
195
|
-
floatable.options.content,
|
|
196
|
-
);
|
|
191
|
+
floatable.options.anchor.insertAdjacentElement(INSERT_AFTEREND, floatable.options.content);
|
|
197
192
|
|
|
198
193
|
floatable.options.onAfter?.(false);
|
|
199
194
|
}
|
|
@@ -212,9 +207,7 @@ function getX(anchor: DOMRect, content: DOMRect, position: Position): number {
|
|
|
212
207
|
if (position.endsWith(POSITION_SUFFIX_START)) {
|
|
213
208
|
const start = anchor.left;
|
|
214
209
|
|
|
215
|
-
return start + content.width > window.innerWidth
|
|
216
|
-
? window.innerWidth - content.width
|
|
217
|
-
: start;
|
|
210
|
+
return start + content.width > window.innerWidth ? window.innerWidth - content.width : start;
|
|
218
211
|
}
|
|
219
212
|
|
|
220
213
|
if (position.startsWith(POSITION_END)) {
|
|
@@ -238,12 +231,7 @@ function getX(anchor: DOMRect, content: DOMRect, position: Position): number {
|
|
|
238
231
|
return left < 0 ? 0 : left;
|
|
239
232
|
}
|
|
240
233
|
|
|
241
|
-
function getY(
|
|
242
|
-
anchor: DOMRect,
|
|
243
|
-
content: DOMRect,
|
|
244
|
-
position: Position,
|
|
245
|
-
preferAbove: boolean,
|
|
246
|
-
): number {
|
|
234
|
+
function getY(anchor: DOMRect, content: DOMRect, position: Position, preferAbove: boolean): number {
|
|
247
235
|
if (position.startsWith(POSITION_ABOVE)) {
|
|
248
236
|
return anchor.top - content.height;
|
|
249
237
|
}
|
|
@@ -261,9 +249,7 @@ function getY(
|
|
|
261
249
|
if (position.endsWith(POSITION_TOP)) {
|
|
262
250
|
const top = anchor.top;
|
|
263
251
|
|
|
264
|
-
return top + content.height > window.innerHeight
|
|
265
|
-
? window.innerHeight - content.height
|
|
266
|
-
: top;
|
|
252
|
+
return top + content.height > window.innerHeight ? window.innerHeight - content.height : top;
|
|
267
253
|
}
|
|
268
254
|
|
|
269
255
|
if (position.startsWith(POSITION_VERTICAL)) {
|
|
@@ -399,12 +385,8 @@ function updatePosition(floatable: Floatable): void {
|
|
|
399
385
|
if (calculated) {
|
|
400
386
|
if (previousAnchor != null && previousContent != null) {
|
|
401
387
|
if (
|
|
402
|
-
PROPERTIES.every(
|
|
403
|
-
|
|
404
|
-
) &&
|
|
405
|
-
PROPERTIES.every(
|
|
406
|
-
property => content[property] === previousContent[property],
|
|
407
|
-
)
|
|
388
|
+
PROPERTIES.every(property => anchor[property] === previousAnchor[property]) &&
|
|
389
|
+
PROPERTIES.every(property => content[property] === previousContent[property])
|
|
408
390
|
) {
|
|
409
391
|
floatable.frame = requestAnimationFrame(run);
|
|
410
392
|
|