@oscarpalmer/oui 0.36.0 → 0.37.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 +18 -15
- package/dist/css/button.css +35 -31
- package/dist/css/color.css +20 -20
- package/dist/css/combobox.css +133 -34
- package/dist/css/content.css +29 -10
- package/dist/css/floatable.css +10 -10
- package/dist/css/form.css +393 -129
- package/dist/css/listbox.css +41 -17
- package/dist/css/message.css +13 -10
- package/dist/css/reset.css +29 -88
- package/dist/css/splitter.css +2 -2
- package/dist/css/tabs.css +103 -0
- package/dist/js/focus-trap/focus-trap.embedded.mjs +6 -10
- package/dist/js/index.d.mts +2 -1
- package/dist/js/index.mjs +2 -1
- package/dist/js/internal/draggable.mjs +16 -22
- package/dist/js/internal/listbox/listbox.form.mjs +1 -1
- package/dist/js/internal/listbox/listbox.state.mjs +1 -1
- package/dist/js/internal/navigable.d.mts +11 -5
- package/dist/js/internal/navigable.mjs +44 -18
- package/dist/js/movable/movable.embedded.mjs +3 -6
- package/dist/js/resizable/resizable.embedded.mjs +16 -26
- package/dist/js/splitter.mjs +15 -12
- package/dist/js/tabs.d.mts +25 -0
- package/dist/js/tabs.mjs +240 -0
- package/dist/js/tooltip.mjs +13 -12
- package/package.json +1 -1
- package/src/css/badge.scss +6 -18
- package/src/css/button.scss +6 -45
- package/src/css/color.scss +20 -20
- package/src/css/combobox.scss +20 -51
- package/src/css/content.scss +30 -3
- package/src/css/floatable.scss +17 -17
- package/src/css/form.scss +84 -72
- package/src/css/listbox.scss +2 -31
- package/src/css/message.scss +13 -28
- package/src/css/mixins.scss +253 -28
- package/src/css/reset.scss +37 -86
- package/src/css/splitter.scss +2 -2
- package/src/css/tabs.scss +85 -0
- package/src/js/focus-trap/focus-trap.embedded.ts +11 -19
- package/src/js/index.ts +1 -0
- package/src/js/internal/draggable.ts +29 -33
- package/src/js/internal/listbox/listbox.form.ts +1 -1
- package/src/js/internal/listbox/listbox.state.ts +1 -1
- package/src/js/internal/navigable.ts +80 -23
- package/src/js/movable/movable.embedded.ts +11 -13
- package/src/js/resizable/resizable.embedded.ts +25 -39
- package/src/js/splitter.ts +21 -18
- package/src/js/tabs.ts +447 -0
- package/src/js/tooltip.ts +20 -17
package/src/css/mixins.scss
CHANGED
|
@@ -1,30 +1,72 @@
|
|
|
1
1
|
@mixin badge() {
|
|
2
|
-
--oui-shadow-
|
|
2
|
+
--oui-shadow-inset: color-mix(in oklab, var(--oui-absolute), transparent 50%);
|
|
3
|
+
--oui-shadow-value: var(--oui-gray-6);
|
|
4
|
+
--oui-shadow-mixed: color-mix(in oklab, var(--oui-shadow-value), transparent 87.5%);
|
|
3
5
|
|
|
4
|
-
@include shadow(var(--oui-shadow-mixed));
|
|
6
|
+
@include shadow-1(var(--oui-shadow-mixed), var(--oui-shadow-inset));
|
|
5
7
|
|
|
6
8
|
display: inline-flex;
|
|
7
9
|
flex-flow: row nowrap;
|
|
8
10
|
gap: 0.5em;
|
|
9
|
-
background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-
|
|
11
|
+
background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-1)), transparent 25%);
|
|
10
12
|
color: var(--oui-foreground, var(--oui-gray-8));
|
|
13
|
+
text-shadow: 0 1px 0 var(--oui-absolute);
|
|
11
14
|
line-height: 1.25;
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
@mixin badge-blue() {
|
|
18
|
+
--oui-background: var(--oui-blue-1);
|
|
19
|
+
--oui-foreground: var(--oui-blue-8);
|
|
20
|
+
--oui-shadow-value: var(--oui-blue-6);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin badge-green() {
|
|
24
|
+
--oui-background: var(--oui-green-1);
|
|
25
|
+
--oui-foreground: var(--oui-green-8);
|
|
26
|
+
--oui-shadow-value: var(--oui-green-6);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@mixin badge-orange() {
|
|
30
|
+
--oui-background: var(--oui-orange-1);
|
|
31
|
+
--oui-foreground: var(--oui-orange-8);
|
|
32
|
+
--oui-shadow-value: var(--oui-orange-6);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin badge-purple() {
|
|
36
|
+
--oui-background: var(--oui-purple-1);
|
|
37
|
+
--oui-foreground: var(--oui-purple-8);
|
|
38
|
+
--oui-shadow-value: var(--oui-purple-6);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin badge-red() {
|
|
42
|
+
--oui-background: var(--oui-red-1);
|
|
43
|
+
--oui-foreground: var(--oui-red-8);
|
|
44
|
+
--oui-shadow-value: var(--oui-red-6);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@mixin badge-yellow() {
|
|
48
|
+
--oui-background: var(--oui-yellow-1);
|
|
49
|
+
--oui-foreground: var(--oui-yellow-8);
|
|
50
|
+
--oui-shadow-value: var(--oui-yellow-6);
|
|
51
|
+
}
|
|
52
|
+
|
|
14
53
|
@mixin button() {
|
|
15
54
|
--oui-background-percentage: 25%;
|
|
55
|
+
--oui-background-value: var(--oui-gray-2);
|
|
16
56
|
--oui-foreground-percentage: 0%;
|
|
57
|
+
--oui-foreground-value: var(--oui-gray-8);
|
|
17
58
|
--oui-outline-percentage: 100%;
|
|
18
|
-
--oui-
|
|
59
|
+
--oui-outline-value: var(--oui-gray-6);
|
|
60
|
+
--oui-shadow-inset: color-mix(in oklab, var(--oui-absolute), transparent 75%);
|
|
19
61
|
--oui-shadow-percentage: 82.5%;
|
|
20
62
|
|
|
21
63
|
--oui-shadow-value: color-mix(
|
|
22
64
|
in oklab,
|
|
23
|
-
var(--oui-outline-value
|
|
65
|
+
var(--oui-outline-value),
|
|
24
66
|
transparent var(--oui-shadow-percentage)
|
|
25
67
|
);
|
|
26
68
|
|
|
27
|
-
@include shadow(var(--oui-shadow-value), var(--oui-shadow-inset));
|
|
69
|
+
@include shadow-2(var(--oui-shadow-value), var(--oui-shadow-inset));
|
|
28
70
|
|
|
29
71
|
padding: 0.5em 0.75em;
|
|
30
72
|
display: inline-flex;
|
|
@@ -34,30 +76,91 @@
|
|
|
34
76
|
border-radius: 0.25em;
|
|
35
77
|
background-color: color-mix(
|
|
36
78
|
in oklab,
|
|
37
|
-
var(--oui-background-value
|
|
79
|
+
var(--oui-background-value),
|
|
38
80
|
transparent var(--oui-background-percentage)
|
|
39
81
|
);
|
|
40
82
|
outline: 4px solid
|
|
41
|
-
color-mix(
|
|
42
|
-
in oklab,
|
|
43
|
-
var(--oui-outline-value, var(--oui-gray-6)),
|
|
44
|
-
transparent var(--oui-outline-percentage)
|
|
45
|
-
);
|
|
83
|
+
color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
|
|
46
84
|
border: none;
|
|
47
85
|
color: color-mix(
|
|
48
86
|
in oklab,
|
|
49
|
-
var(--oui-foreground-value
|
|
87
|
+
var(--oui-foreground-value),
|
|
50
88
|
transparent var(--oui-foreground-percentage)
|
|
51
89
|
);
|
|
52
90
|
line-height: 1.25;
|
|
53
91
|
transition: 0.125s ease-in-out;
|
|
92
|
+
transition-property: background, outline, box-shadow, color;
|
|
93
|
+
|
|
94
|
+
&:focus-visible {
|
|
95
|
+
--oui-outline-percentage: 75%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (hover: hover) {
|
|
99
|
+
&:not([disabled], [aria-disabled='true' i]):hover {
|
|
100
|
+
--oui-background-percentage: 50%;
|
|
101
|
+
--oui-foreground-percentage: 25%;
|
|
102
|
+
--oui-shadow-percentage: 90%;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&:not([disabled], [aria-disabled='true' i]):active {
|
|
107
|
+
box-shadow:
|
|
108
|
+
0 0 0 1px var(--oui-shadow-value),
|
|
109
|
+
inset 0 1px 2px 0 var(--oui-shadow-value),
|
|
110
|
+
inset 0 2px 4px 0 var(--oui-shadow-value);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&[disabled],
|
|
114
|
+
&[aria-disabled='true' i] {
|
|
115
|
+
--oui-background-percentage: 80%;
|
|
116
|
+
--oui-foreground-percentage: 25%;
|
|
117
|
+
--oui-shadow-percentage: 92.5%;
|
|
118
|
+
|
|
119
|
+
font-style: italic;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@mixin button-blue() {
|
|
124
|
+
--oui-background-value: var(--oui-blue-3);
|
|
125
|
+
--oui-foreground-value: var(--oui-blue-8);
|
|
126
|
+
--oui-outline-value: var(--oui-blue-6);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@mixin button-green() {
|
|
130
|
+
--oui-background-value: var(--oui-green-3);
|
|
131
|
+
--oui-foreground-value: var(--oui-green-8);
|
|
132
|
+
--oui-outline-value: var(--oui-green-6);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@mixin button-orange() {
|
|
136
|
+
--oui-background-value: var(--oui-orange-3);
|
|
137
|
+
--oui-foreground-value: var(--oui-orange-8);
|
|
138
|
+
--oui-outline-value: var(--oui-orange-6);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@mixin button-purple() {
|
|
142
|
+
--oui-background-value: var(--oui-purple-3);
|
|
143
|
+
--oui-foreground-value: var(--oui-purple-8);
|
|
144
|
+
--oui-outline-value: var(--oui-purple-6);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@mixin button-red() {
|
|
148
|
+
--oui-background-value: var(--oui-red-3);
|
|
149
|
+
--oui-foreground-value: var(--oui-red-8);
|
|
150
|
+
--oui-outline-value: var(--oui-red-6);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@mixin button-yellow() {
|
|
154
|
+
--oui-background-value: var(--oui-yellow-3);
|
|
155
|
+
--oui-foreground-value: var(--oui-yellow-8);
|
|
156
|
+
--oui-outline-value: var(--oui-yellow-6);
|
|
54
157
|
}
|
|
55
158
|
|
|
56
159
|
@mixin card(
|
|
57
160
|
$backgroundColor: var(--oui-absolute),
|
|
58
161
|
$boxShadowColor: color-mix(in oklab, var(--oui-gray-6), transparent 92.5%)
|
|
59
162
|
) {
|
|
60
|
-
@include shadow($boxShadowColor);
|
|
163
|
+
@include shadow-1($boxShadowColor);
|
|
61
164
|
|
|
62
165
|
padding: 1em 1.25em;
|
|
63
166
|
background-color: $backgroundColor;
|
|
@@ -73,29 +176,29 @@
|
|
|
73
176
|
inset-block: var(--margin-top) var(--margin-bottom);
|
|
74
177
|
inset-inline: var(--margin-left) var(--margin-right);
|
|
75
178
|
|
|
76
|
-
&[oui-position$='bottom'] {
|
|
179
|
+
&[oui-position$='bottom' i] {
|
|
77
180
|
--margin-bottom: 0;
|
|
78
181
|
}
|
|
79
182
|
|
|
80
|
-
&[oui-position$='end'] {
|
|
183
|
+
&[oui-position$='end' i] {
|
|
81
184
|
--margin-right: 0;
|
|
82
185
|
}
|
|
83
186
|
|
|
84
|
-
&[oui-position$='start'] {
|
|
187
|
+
&[oui-position$='start' i] {
|
|
85
188
|
--margin-left: 0;
|
|
86
189
|
}
|
|
87
190
|
|
|
88
|
-
&[oui-position$='top'] {
|
|
191
|
+
&[oui-position$='top' i] {
|
|
89
192
|
--margin-top: 0;
|
|
90
193
|
}
|
|
91
194
|
}
|
|
92
195
|
|
|
93
196
|
@mixin input {
|
|
197
|
+
@include input-outlined;
|
|
198
|
+
|
|
94
199
|
--oui-background-percentage: 0%;
|
|
95
200
|
--oui-foreground-percentage: 0%;
|
|
96
201
|
|
|
97
|
-
@include input-outlined;
|
|
98
|
-
|
|
99
202
|
align-content: center;
|
|
100
203
|
background-color: color-mix(
|
|
101
204
|
in oklab,
|
|
@@ -114,6 +217,57 @@
|
|
|
114
217
|
var(--oui-foreground-value, inherit),
|
|
115
218
|
transparent var(--oui-foreground-percentage)
|
|
116
219
|
);
|
|
220
|
+
transition: 0.125s ease-in-out;
|
|
221
|
+
transition-property: background, outline, border, box-shadow, color;
|
|
222
|
+
|
|
223
|
+
&.oui-validate:not(
|
|
224
|
+
[disabled],
|
|
225
|
+
[readonly],
|
|
226
|
+
[aria-disabled='true' i],
|
|
227
|
+
[aria-readonly='true' i],
|
|
228
|
+
:focus-visible,
|
|
229
|
+
:focus-within
|
|
230
|
+
):is(:user-invalid:not([aria-invalid='false' i]), [aria-invalid='true' i]) {
|
|
231
|
+
@include input-invalid;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
&.oui-validate:not(
|
|
235
|
+
[disabled],
|
|
236
|
+
[readonly],
|
|
237
|
+
[aria-disabled='true' i],
|
|
238
|
+
[aria-readonly='true' i],
|
|
239
|
+
:focus-visible,
|
|
240
|
+
:focus-within
|
|
241
|
+
):is(:user-valid:not([aria-invalid='true' i]), [aria-invalid='false' i]) {
|
|
242
|
+
@include input-valid;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]) {
|
|
246
|
+
&:focus-visible,
|
|
247
|
+
&:focus-within {
|
|
248
|
+
@include input-focus;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@media (hover: hover) {
|
|
252
|
+
&:hover {
|
|
253
|
+
@include input-hover;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]) {
|
|
259
|
+
--oui-foreground-percentage: 25%;
|
|
260
|
+
|
|
261
|
+
font-style: italic;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):focus-visible {
|
|
265
|
+
--oui-outline-percentage: 75%;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&:is([disabled], [aria-disabled='true' i]) {
|
|
269
|
+
--oui-background-percentage: 50%;
|
|
270
|
+
}
|
|
117
271
|
}
|
|
118
272
|
|
|
119
273
|
@mixin input-focus() {
|
|
@@ -145,7 +299,6 @@
|
|
|
145
299
|
outline: 4px solid
|
|
146
300
|
color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
|
|
147
301
|
outline-offset: 0;
|
|
148
|
-
transition: 0.125s ease-in-out;
|
|
149
302
|
}
|
|
150
303
|
|
|
151
304
|
@mixin input-valid() {
|
|
@@ -155,7 +308,56 @@
|
|
|
155
308
|
--oui-outline-value: var(--oui-green-6);
|
|
156
309
|
}
|
|
157
310
|
|
|
158
|
-
@mixin
|
|
311
|
+
@mixin message-blue() {
|
|
312
|
+
--oui-background: var(--oui-blue-1);
|
|
313
|
+
--oui-border: var(--oui-blue-2);
|
|
314
|
+
--oui-foreground: var(--oui-blue-8);
|
|
315
|
+
--oui-shadow-value: var(--oui-blue-6);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
@mixin message-green() {
|
|
319
|
+
--oui-background: var(--oui-green-1);
|
|
320
|
+
--oui-border: var(--oui-green-2);
|
|
321
|
+
--oui-foreground: var(--oui-green-8);
|
|
322
|
+
--oui-shadow-value: var(--oui-green-6);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
@mixin message-orange() {
|
|
326
|
+
--oui-background: var(--oui-orange-1);
|
|
327
|
+
--oui-border: var(--oui-orange-2);
|
|
328
|
+
--oui-foreground: var(--oui-orange-8);
|
|
329
|
+
--oui-shadow-value: var(--oui-orange-6);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@mixin message-purple() {
|
|
333
|
+
--oui-background: var(--oui-purple-1);
|
|
334
|
+
--oui-border: var(--oui-purple-2);
|
|
335
|
+
--oui-foreground: var(--oui-purple-8);
|
|
336
|
+
--oui-shadow-value: var(--oui-purple-6);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@mixin message-red() {
|
|
340
|
+
--oui-background: var(--oui-red-1);
|
|
341
|
+
--oui-border: var(--oui-red-2);
|
|
342
|
+
--oui-foreground: var(--oui-red-8);
|
|
343
|
+
--oui-shadow-value: var(--oui-red-6);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@mixin message-yellow() {
|
|
347
|
+
--oui-background: var(--oui-yellow-1);
|
|
348
|
+
--oui-border: var(--oui-yellow-2);
|
|
349
|
+
--oui-foreground: var(--oui-yellow-8);
|
|
350
|
+
--oui-shadow-value: var(--oui-yellow-6);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
@mixin shadow-0($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
354
|
+
box-shadow:
|
|
355
|
+
inset 0 1px 0 0 $inset,
|
|
356
|
+
0 0 0 1px $color,
|
|
357
|
+
0 1px 2px -0.5px $color;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@mixin shadow-1($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
159
361
|
box-shadow:
|
|
160
362
|
inset 0 1px 0 0 $inset,
|
|
161
363
|
0 0 0 1px $color,
|
|
@@ -163,7 +365,26 @@
|
|
|
163
365
|
0 2px 4px -1px $color;
|
|
164
366
|
}
|
|
165
367
|
|
|
166
|
-
@mixin shadow-
|
|
368
|
+
@mixin shadow-2($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
369
|
+
box-shadow:
|
|
370
|
+
inset 0 1px 0 0 $inset,
|
|
371
|
+
0 0 0 1px $color,
|
|
372
|
+
0 1px 2px -0.5px $color,
|
|
373
|
+
0 2px 4px -1px $color,
|
|
374
|
+
0 4px 8px -2px $color;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@mixin shadow-3($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
378
|
+
box-shadow:
|
|
379
|
+
inset 0 1px 0 0 $inset,
|
|
380
|
+
0 0 0 1px $color,
|
|
381
|
+
0 1px 2px -0.5px $color,
|
|
382
|
+
0 2px 4px -1px $color,
|
|
383
|
+
0 4px 8px -2px $color,
|
|
384
|
+
0 8px 16px -4px $color;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
@mixin shadow-4($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
167
388
|
box-shadow:
|
|
168
389
|
inset 0 1px 0 0 $inset,
|
|
169
390
|
0 0 0 1px $color,
|
|
@@ -171,16 +392,20 @@
|
|
|
171
392
|
0 2px 4px -1px $color,
|
|
172
393
|
0 4px 8px -2px $color,
|
|
173
394
|
0 8px 16px -4px $color,
|
|
174
|
-
0 16px 32px -8px $color
|
|
175
|
-
0 32px 64px -16px $color,
|
|
176
|
-
0 64px 128px -32px $color;
|
|
395
|
+
0 16px 32px -8px $color;
|
|
177
396
|
}
|
|
178
397
|
|
|
179
|
-
@mixin shadow-
|
|
398
|
+
@mixin shadow-5($color: rgb(0 0 0 / 5%), $inset: transparent) {
|
|
180
399
|
box-shadow:
|
|
181
400
|
inset 0 1px 0 0 $inset,
|
|
182
401
|
0 0 0 1px $color,
|
|
183
|
-
0 1px 2px -0.5px $color
|
|
402
|
+
0 1px 2px -0.5px $color,
|
|
403
|
+
0 2px 4px -1px $color,
|
|
404
|
+
0 4px 8px -2px $color,
|
|
405
|
+
0 8px 16px -4px $color,
|
|
406
|
+
0 16px 32px -8px $color,
|
|
407
|
+
0 32px 64px -16px $color,
|
|
408
|
+
0 64px 128px -32px $color;
|
|
184
409
|
}
|
|
185
410
|
|
|
186
411
|
@mixin visually-hidden() {
|