@oscarpalmer/oui 0.31.0 → 0.33.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 +1 -5
- package/dist/css/combobox.css +164 -28
- package/dist/js/index.d.mts +643 -14
- package/dist/js/index.mjs +4875 -18
- package/package.json +5 -5
- package/src/css/combobox.scss +171 -25
- package/src/css/mixins.scss +8 -16
- package/src/js/combobox.ts +1682 -751
- package/src/js/internal/navigable.ts +10 -3
- package/src/js/menu.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oscarpalmer/oui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Styles, components, and utilities for building websites and applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -95,18 +95,18 @@
|
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@oscarpalmer/atoms": "^0.188.1",
|
|
98
|
-
"@oscarpalmer/toretto": "^0.
|
|
98
|
+
"@oscarpalmer/toretto": "^0.49.1"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@oxlint/plugins": "^1.
|
|
101
|
+
"@oxlint/plugins": "^1.77",
|
|
102
102
|
"@vitest/coverage-istanbul": "^4.1",
|
|
103
103
|
"autoprefixer": "^10.5",
|
|
104
104
|
"concurrently": "^10",
|
|
105
|
-
"jsdom": "^
|
|
105
|
+
"jsdom": "^30",
|
|
106
106
|
"postcss-cli": "^11",
|
|
107
107
|
"postcss-input-range": "^6",
|
|
108
108
|
"postcss-scss": "^4",
|
|
109
|
-
"sass": "^1.
|
|
109
|
+
"sass": "^1.102",
|
|
110
110
|
"stylelint": "^17.14",
|
|
111
111
|
"stylelint-config-standard-scss": "^17",
|
|
112
112
|
"tsdown": "^0.22",
|
package/src/css/combobox.scss
CHANGED
|
@@ -8,38 +8,57 @@
|
|
|
8
8
|
|
|
9
9
|
--oui-background-value: var(--oui-absolute);
|
|
10
10
|
|
|
11
|
-
padding: 0.5em 2em .5em 0.75em;
|
|
11
|
+
padding: 0.5em 2em 0.5em 0.75em;
|
|
12
12
|
border-radius: 0.25em;
|
|
13
13
|
background-image: 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");
|
|
14
|
-
background-position: right .5em center;
|
|
14
|
+
background-position: right 0.5em center;
|
|
15
15
|
background-repeat: no-repeat;
|
|
16
16
|
background-size: 1em;
|
|
17
|
+
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
:where(&:not([disabled], [readonly], [aria-disabled='true' i]):focus),
|
|
20
|
-
:where(
|
|
21
|
+
:where(&:not([disabled], [readonly], [aria-disabled='true' i]):focus-within),
|
|
22
|
+
:where(
|
|
23
|
+
&:not([disabled], [readonly], [aria-disabled='true' i]):has(
|
|
24
|
+
+ [oui-combobox-content]:focus-within
|
|
25
|
+
)
|
|
26
|
+
) {
|
|
21
27
|
@include mixins.input-focus;
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
@media (hover: hover) {
|
|
25
|
-
:where(
|
|
31
|
+
:where(
|
|
32
|
+
&:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):hover
|
|
33
|
+
) {
|
|
26
34
|
@include mixins.input-hover;
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
|
|
30
|
-
:where(
|
|
38
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])) {
|
|
31
39
|
--oui-foreground-percentage: 25%;
|
|
32
40
|
|
|
33
41
|
font-style: italic;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
:where(
|
|
44
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):focus) {
|
|
37
45
|
--oui-outline-percentage: 75%;
|
|
38
46
|
}
|
|
39
47
|
|
|
40
|
-
:where(
|
|
48
|
+
:where(&:is([disabled], [aria-disabled='true' i])) {
|
|
41
49
|
--oui-background-percentage: 50%;
|
|
42
50
|
}
|
|
51
|
+
|
|
52
|
+
:where(& > button) {
|
|
53
|
+
border: none;
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
z-index: 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:where(& > button:focus) {
|
|
60
|
+
outline: none;
|
|
61
|
+
}
|
|
43
62
|
}
|
|
44
63
|
|
|
45
64
|
:where([oui-combobox-content]) {
|
|
@@ -50,7 +69,7 @@
|
|
|
50
69
|
height: fit-content;
|
|
51
70
|
max-width: max(25vw, 32rem);
|
|
52
71
|
max-height: max(25vh, 32rem);
|
|
53
|
-
min-width:
|
|
72
|
+
min-width: anchor-size(width);
|
|
54
73
|
flex-flow: column nowrap;
|
|
55
74
|
border-radius: 0.25em;
|
|
56
75
|
|
|
@@ -59,14 +78,88 @@
|
|
|
59
78
|
}
|
|
60
79
|
}
|
|
61
80
|
|
|
62
|
-
:where([oui-combobox-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
81
|
+
:where([oui-combobox-filter], [oui-combobox-header]) {
|
|
82
|
+
&::after {
|
|
83
|
+
content: '';
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 0.25em;
|
|
86
|
+
background-image: linear-gradient(to bottom, rgb(0 0 0 / 12.5%), transparent);
|
|
87
|
+
position: absolute;
|
|
88
|
+
bottom: -0.25em;
|
|
89
|
+
left: 0;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:where([oui-combobox-filter]) {
|
|
94
|
+
padding: 0.75em;
|
|
95
|
+
background-color: var(--oui-yellow-0);
|
|
96
|
+
border-radius: 0.25em 0.25em 0 0;
|
|
97
|
+
position: relative;
|
|
98
|
+
z-index: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:where([oui-combobox-filter-input]) {
|
|
102
|
+
@include mixins.input;
|
|
103
|
+
|
|
104
|
+
--oui-background-value: var(--oui-absolute);
|
|
105
|
+
--oui-border-value: var(--oui-yellow-3);
|
|
106
|
+
|
|
107
|
+
width: 100%;
|
|
108
|
+
padding: 0.5em 0.75em;
|
|
109
|
+
outline-width: 0;
|
|
110
|
+
border-radius: 0.25em;
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
|
|
113
|
+
:where(&:focus) {
|
|
114
|
+
@include mixins.input-focus;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (hover: hover) {
|
|
118
|
+
:where(&:hover) {
|
|
119
|
+
@include mixins.input-hover;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])) {
|
|
124
|
+
--oui-foreground-percentage: 25%;
|
|
125
|
+
|
|
126
|
+
font-style: italic;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):focus) {
|
|
130
|
+
--oui-outline-percentage: 75%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:where(&:is([disabled], [aria-disabled='true' i])) {
|
|
134
|
+
--oui-background-percentage: 50%;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where([oui-combobox-header]) {
|
|
139
|
+
padding: 0.5em calc(0.75em / 0.75);
|
|
140
|
+
background-color: var(--oui-gray-0);
|
|
141
|
+
font-size: 0.75em;
|
|
142
|
+
font-weight: bold;
|
|
143
|
+
position: sticky;
|
|
144
|
+
top: 0;
|
|
145
|
+
z-index: 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:where([oui-combobox-hidden]) {
|
|
149
|
+
@include mixins.visually-hidden;
|
|
150
|
+
|
|
151
|
+
position: absolute;
|
|
66
152
|
}
|
|
67
153
|
|
|
68
154
|
:where([oui-combobox-list]) {
|
|
69
155
|
overflow: auto;
|
|
156
|
+
position: relative;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:where([oui-combobox-message]) {
|
|
160
|
+
padding: 1em;
|
|
161
|
+
text-align: center;
|
|
162
|
+
font-style: italic;
|
|
70
163
|
}
|
|
71
164
|
|
|
72
165
|
[oui-combobox-option] {
|
|
@@ -76,7 +169,7 @@
|
|
|
76
169
|
outline-offset: -4px;
|
|
77
170
|
line-height: 1.25;
|
|
78
171
|
cursor: pointer;
|
|
79
|
-
transition: .125s ease-in-out;
|
|
172
|
+
transition: 0.125s ease-in-out;
|
|
80
173
|
}
|
|
81
174
|
|
|
82
175
|
:where(&[aria-selected='true' i]) {
|
|
@@ -89,7 +182,9 @@
|
|
|
89
182
|
margin: 0 0.75em 0 0;
|
|
90
183
|
}
|
|
91
184
|
|
|
92
|
-
:where(
|
|
185
|
+
:where(
|
|
186
|
+
oui-combobox:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]) &
|
|
187
|
+
) {
|
|
93
188
|
@media (hover: hover) {
|
|
94
189
|
:where(&:hover) {
|
|
95
190
|
background-color: var(--oui-blue-1);
|
|
@@ -108,30 +203,81 @@
|
|
|
108
203
|
:where([oui-combobox-selection]) {
|
|
109
204
|
max-height: 8rem;
|
|
110
205
|
display: flex;
|
|
111
|
-
padding: .5em;
|
|
112
|
-
margin:
|
|
206
|
+
padding: 0.5em;
|
|
207
|
+
margin: -0.5em -0.5em -0.5em -0.75em;
|
|
113
208
|
flex-flow: row wrap;
|
|
114
209
|
gap: 0.5em;
|
|
115
210
|
overflow: auto;
|
|
116
211
|
list-style: none;
|
|
212
|
+
position: relative;
|
|
213
|
+
z-index: 2;
|
|
117
214
|
}
|
|
118
215
|
|
|
119
216
|
[oui-combobox-selection-item] {
|
|
120
217
|
:where(&) {
|
|
121
|
-
@include mixins.
|
|
218
|
+
@include mixins.button;
|
|
219
|
+
|
|
220
|
+
--oui-background-value: var(--oui-blue-1);
|
|
221
|
+
--oui-foreground-percentage: 12.5%;
|
|
222
|
+
--oui-foreground-value: var(--oui-blue-8);
|
|
223
|
+
--oui-shadow-percentage: 90%;
|
|
122
224
|
|
|
123
|
-
border-radius: 3em;
|
|
124
225
|
padding: 0.5em 1em;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
226
|
+
flex-wrap: nowrap;
|
|
227
|
+
border-radius: 5em;
|
|
228
|
+
font-size: 0.75em;
|
|
229
|
+
white-space: nowrap;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:where(
|
|
233
|
+
oui-combobox:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])
|
|
234
|
+
&:focus-visible
|
|
235
|
+
) {
|
|
236
|
+
--oui-outline-percentage: 87.5%;
|
|
237
|
+
--oui-outline-value: var(--oui-blue-6);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:where(
|
|
241
|
+
oui-combobox:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])
|
|
242
|
+
&:focus-visible
|
|
243
|
+
) {
|
|
244
|
+
--oui-background-value: var(--oui-red-1);
|
|
245
|
+
--oui-foreground-value: var(--oui-red-8);
|
|
246
|
+
--oui-outline-percentage: 75%;
|
|
247
|
+
--oui-outline-value: var(--oui-red-6);
|
|
128
248
|
}
|
|
129
249
|
|
|
130
250
|
@media (hover: hover) {
|
|
131
|
-
:where(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
251
|
+
:where(
|
|
252
|
+
oui-combobox:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])
|
|
253
|
+
&:hover
|
|
254
|
+
) {
|
|
255
|
+
--oui-background-value: var(--oui-red-1);
|
|
256
|
+
--oui-foreground-value: var(--oui-red-8);
|
|
257
|
+
--oui-outline-value: var(--oui-red-6);
|
|
258
|
+
|
|
259
|
+
--oui-background-percentage: 50%;
|
|
260
|
+
--oui-foreground-percentage: 25%;
|
|
135
261
|
}
|
|
136
262
|
}
|
|
263
|
+
|
|
264
|
+
:where(
|
|
265
|
+
oui-combobox:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])
|
|
266
|
+
&:active
|
|
267
|
+
) {
|
|
268
|
+
box-shadow:
|
|
269
|
+
0 0 0 1px var(--oui-shadow-value),
|
|
270
|
+
inset 0 1px 2px 0 var(--oui-shadow-value),
|
|
271
|
+
inset 0 2px 4px 0 var(--oui-shadow-value);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
:where(
|
|
275
|
+
oui-combobox:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]) &
|
|
276
|
+
) {
|
|
277
|
+
--oui-background-percentage: 80%;
|
|
278
|
+
--oui-foreground-percentage: 20%;
|
|
279
|
+
--oui-shadow-percentage: 95%;
|
|
280
|
+
|
|
281
|
+
font-style: italic;
|
|
282
|
+
}
|
|
137
283
|
}
|
package/src/css/mixins.scss
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
@mixin badge() {
|
|
2
|
-
--oui-shadow-mixed: color-mix(
|
|
3
|
-
in oklab,
|
|
4
|
-
var(--oui-shadow, var(--oui-gray-6)),
|
|
5
|
-
transparent 92.5%
|
|
6
|
-
);
|
|
2
|
+
--oui-shadow-mixed: color-mix(in oklab, var(--oui-shadow, var(--oui-gray-6)), transparent 92.5%);
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
@include shadow(var(--oui-shadow-mixed));
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
transparent 25%
|
|
17
|
-
);
|
|
18
|
-
color: var(--oui-foreground, var(--oui-gray-8));
|
|
19
|
-
line-height: 1.25;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
flex-flow: row nowrap;
|
|
8
|
+
gap: 0.5em;
|
|
9
|
+
background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-0)), transparent 25%);
|
|
10
|
+
color: var(--oui-foreground, var(--oui-gray-8));
|
|
11
|
+
line-height: 1.25;
|
|
20
12
|
}
|
|
21
13
|
|
|
22
14
|
@mixin button() {
|