@oscarpalmer/oui 0.9.0 → 0.10.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/a11y.css +3 -0
- package/dist/css/badge.css +30 -22
- package/dist/css/button.css +89 -0
- package/dist/css/color.css +103 -99
- package/dist/css/flex.css +2 -0
- package/dist/css/form.css +354 -52
- package/dist/css/message.css +30 -22
- package/dist/css/reset.css +66 -50
- package/dist/css/table.css +4 -1
- package/dist/js/focus-trap.cjs +4 -4
- package/dist/js/focus-trap.js +4 -4
- package/package.json +19 -11
- package/src/css/badge.scss +33 -22
- package/src/css/button.scss +121 -0
- package/src/css/color.scss +101 -99
- package/src/css/form.scss +233 -60
- package/src/css/message.scss +36 -23
- package/src/css/reset.scss +12 -17
- package/src/css/table.scss +3 -1
- package/src/js/focus-trap.ts +4 -4
package/src/css/message.scss
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
+
/*! https://github.com/oscarpalmer/oui */
|
|
2
|
+
|
|
1
3
|
.oui-message {
|
|
2
4
|
:where(&) {
|
|
5
|
+
--oui-shadow-value: color-mix(
|
|
6
|
+
in oklch,
|
|
7
|
+
var(--oui-shadow, var(--oui-gray-6)),
|
|
8
|
+
transparent 95%
|
|
9
|
+
);
|
|
10
|
+
|
|
3
11
|
padding: 1em;
|
|
4
12
|
display: inline-flex;
|
|
5
13
|
flex-flow: column nowrap;
|
|
6
14
|
gap: 1em;
|
|
7
|
-
background-color:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
background-color: color-mix(
|
|
16
|
+
in oklab,
|
|
17
|
+
var(--oui-background, var(--oui-gray-0)),
|
|
18
|
+
transparent 25%
|
|
19
|
+
);
|
|
20
|
+
border-radius: 0.5em;
|
|
21
|
+
box-shadow: 0 0 0 1px var(--oui-shadow-value),
|
|
22
|
+
0 1px 2px 0 var(--oui-shadow-value), 0 2px 4px 0 var(--oui-shadow-value);
|
|
23
|
+
color: var(--oui-foreground, var(--oui-gray-8));
|
|
11
24
|
line-height: 1.25;
|
|
12
25
|
}
|
|
13
26
|
|
|
@@ -19,7 +32,7 @@
|
|
|
19
32
|
:where(& hr) {
|
|
20
33
|
height: 1px;
|
|
21
34
|
margin: 0 -1em;
|
|
22
|
-
background-color: var(--
|
|
35
|
+
background-color: var(--oui-shadow-value, var(--oui-gray-2));
|
|
23
36
|
border: none;
|
|
24
37
|
}
|
|
25
38
|
|
|
@@ -30,38 +43,38 @@
|
|
|
30
43
|
}
|
|
31
44
|
|
|
32
45
|
:where(&-blue, &-info) {
|
|
33
|
-
--background: var(--oui-blue-0);
|
|
34
|
-
--
|
|
35
|
-
--
|
|
46
|
+
--oui-background: var(--oui-blue-0);
|
|
47
|
+
--oui-foreground: var(--oui-blue-8);
|
|
48
|
+
--oui-shadow: var(--oui-blue-6);
|
|
36
49
|
}
|
|
37
50
|
|
|
38
51
|
:where(&-green, &-success) {
|
|
39
|
-
--background: var(--oui-green-0);
|
|
40
|
-
--
|
|
41
|
-
--
|
|
52
|
+
--oui-background: var(--oui-green-0);
|
|
53
|
+
--oui-foreground: var(--oui-green-8);
|
|
54
|
+
--oui-shadow: var(--oui-green-6);
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
:where(&-orange, &-warning) {
|
|
45
|
-
--background: var(--oui-orange-0);
|
|
46
|
-
--
|
|
47
|
-
--
|
|
58
|
+
--oui-background: var(--oui-orange-0);
|
|
59
|
+
--oui-foreground: var(--oui-orange-8);
|
|
60
|
+
--oui-shadow: var(--oui-orange-6);
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
:where(&-purple, &-special) {
|
|
51
|
-
--background: var(--oui-purple-0);
|
|
52
|
-
--
|
|
53
|
-
--
|
|
64
|
+
--oui-background: var(--oui-purple-0);
|
|
65
|
+
--oui-foreground: var(--oui-purple-8);
|
|
66
|
+
--oui-shadow: var(--oui-purple-6);
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
:where(&-red, &-error) {
|
|
57
|
-
--background: var(--oui-red-0);
|
|
58
|
-
--
|
|
59
|
-
--
|
|
70
|
+
--oui-background: var(--oui-red-0);
|
|
71
|
+
--oui-foreground: var(--oui-red-8);
|
|
72
|
+
--oui-shadow: var(--oui-red-6);
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
:where(&-yellow, &-notice) {
|
|
63
|
-
--background: var(--oui-yellow-0);
|
|
64
|
-
--
|
|
65
|
-
--
|
|
76
|
+
--oui-background: var(--oui-yellow-0);
|
|
77
|
+
--oui-foreground: var(--oui-yellow-8);
|
|
78
|
+
--oui-shadow: var(--oui-yellow-6);
|
|
66
79
|
}
|
|
67
80
|
}
|
package/src/css/reset.scss
CHANGED
|
@@ -45,10 +45,7 @@
|
|
|
45
45
|
font-family: system-ui, sans-serif;
|
|
46
46
|
font-size: 100%;
|
|
47
47
|
line-height: 1.5;
|
|
48
|
-
|
|
49
|
-
-webkit-text-size-adjust: none; // ditto
|
|
50
|
-
text-size-adjust: none; // ditto
|
|
51
|
-
-moz-tab-size: 4;
|
|
48
|
+
text-size-adjust: none; // Prevent text size inflation (e.g., after orientation change) [AB][RE][SE]
|
|
52
49
|
tab-size: 4;
|
|
53
50
|
}
|
|
54
51
|
|
|
@@ -80,7 +77,7 @@
|
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
:where(button, [type='button' i], [type='reset' i], [type='submit' i]) {
|
|
83
|
-
|
|
80
|
+
appearance: button; // Correct the inability to style clickable types in iOS [RS][SE]
|
|
84
81
|
cursor: pointer;
|
|
85
82
|
}
|
|
86
83
|
|
|
@@ -178,10 +175,8 @@
|
|
|
178
175
|
vertical-align: baseline; // Add the correct vertical alignment in Chrome, Edge, and Firefox [RS][SE]
|
|
179
176
|
}
|
|
180
177
|
|
|
181
|
-
:where(select) {
|
|
182
|
-
|
|
183
|
-
-webkit-appearance: none; // ditto
|
|
184
|
-
appearance: none; // ditto
|
|
178
|
+
:where(select, input[list]) {
|
|
179
|
+
appearance: none; // Change the inconsistent appearance in all browsers [SE]
|
|
185
180
|
padding-right: 1em; // ditto
|
|
186
181
|
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E")
|
|
187
182
|
no-repeat right center / 1em; // ditto
|
|
@@ -202,27 +197,27 @@
|
|
|
202
197
|
}
|
|
203
198
|
|
|
204
199
|
:where([type='search' i]) {
|
|
205
|
-
|
|
200
|
+
appearance: textfield; // Correct the odd appearance in Chrome, Edge, and Safari [RS][SE]
|
|
206
201
|
outline-offset: -2px; // Correct the outline style in Safari [RS][SE]
|
|
207
202
|
}
|
|
208
203
|
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
::file-selector-button {
|
|
205
|
+
appearance: button; // Correct the inability to style upload buttons in iOS and Safari [RS][SE]
|
|
211
206
|
color: inherit;
|
|
212
207
|
font: inherit;
|
|
213
208
|
line-height: 1.25;
|
|
214
209
|
}
|
|
215
210
|
|
|
211
|
+
::placeholder {
|
|
212
|
+
opacity: 0.54; // Correct the text style of placeholders in Chrome, Edge, and Safari. [SE]
|
|
213
|
+
color: inherit; // Correct the text style of placeholders in Chrome, Edge, and Safari. [SE]
|
|
214
|
+
}
|
|
215
|
+
|
|
216
216
|
::-webkit-inner-spin-button,
|
|
217
217
|
::-webkit-outer-spin-button {
|
|
218
218
|
height: auto; // Correct the cursor style of increment and decrement buttons in Safari [RS][SE]
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
::-webkit-input-placeholder {
|
|
222
|
-
opacity: 0.54; // Correct the text style of placeholders in Chrome, Edge, and Safari. [SE]
|
|
223
|
-
color: inherit; // Correct the text style of placeholders in Chrome, Edge, and Safari. [SE]
|
|
224
|
-
}
|
|
225
|
-
|
|
226
221
|
::-webkit-search-decoration {
|
|
227
222
|
-webkit-appearance: none; // Remove the inner padding in Chrome, Edge, and Safari on macOS [SE]
|
|
228
223
|
}
|
package/src/css/table.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! https://github.com/oscarpalmer/oui */
|
|
2
|
+
|
|
1
3
|
.oui-table {
|
|
2
4
|
:where(&) {
|
|
3
5
|
width: 100%;
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
z-index: 2;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
:where(& tbody tr:nth-
|
|
31
|
+
:where(& tbody tr:nth-of-type(2n)) {
|
|
30
32
|
background-color: color-mix(in oklab, var(--oui-blue-0), transparent 67%);
|
|
31
33
|
}
|
|
32
34
|
|
package/src/js/focus-trap.ts
CHANGED
|
@@ -65,7 +65,7 @@ function onFocusOut(): void {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
requestAnimationFrame(() => {
|
|
69
69
|
const element = findAncestor(
|
|
70
70
|
document.activeElement as never,
|
|
71
71
|
`[${selector}]`,
|
|
@@ -76,7 +76,7 @@ function onFocusOut(): void {
|
|
|
76
76
|
focusTrap.activate();
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function onTab(event: KeyboardEvent): void {
|
|
@@ -163,7 +163,7 @@ observer.observe(document, {
|
|
|
163
163
|
subtree: true,
|
|
164
164
|
});
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
requestAnimationFrame(() => {
|
|
167
167
|
addFocusTraps(document.querySelectorAll(`[${selector}]`));
|
|
168
168
|
|
|
169
169
|
on(document, 'focusout', onFocusOut, {
|
|
@@ -178,4 +178,4 @@ setTimeout(() => {
|
|
|
178
178
|
on(document, 'keydown', onEscape, {
|
|
179
179
|
passive: false,
|
|
180
180
|
});
|
|
181
|
-
}
|
|
181
|
+
});
|