@oscarpalmer/oui 0.32.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/combobox.css +93 -42
- package/dist/js/combobox.mjs +192 -250
- package/dist/js/index.d.mts +643 -14
- package/dist/js/index.mjs +4875 -18
- package/dist/js/menu.d.mts +1 -1
- package/dist/js/toolbar.d.mts +1 -1
- package/package.json +4 -4
- package/src/css/combobox.scss +98 -31
- package/src/js/combobox.ts +1623 -847
- package/src/js/internal/navigable.ts +10 -3
package/dist/js/menu.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export { };
|
package/dist/js/toolbar.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export { };
|
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,14 +95,14 @@
|
|
|
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",
|
package/src/css/combobox.scss
CHANGED
|
@@ -14,9 +14,11 @@
|
|
|
14
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),
|
|
21
|
+
:where(&:not([disabled], [readonly], [aria-disabled='true' i]):focus-within),
|
|
20
22
|
:where(
|
|
21
23
|
&:not([disabled], [readonly], [aria-disabled='true' i]):has(
|
|
22
24
|
+ [oui-combobox-content]:focus-within
|
|
@@ -26,24 +28,37 @@
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
@media (hover: hover) {
|
|
29
|
-
:where(
|
|
31
|
+
:where(
|
|
32
|
+
&:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):hover
|
|
33
|
+
) {
|
|
30
34
|
@include mixins.input-hover;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
:where(&:is([disabled], [readonly], [aria-disabled='true' i])) {
|
|
38
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])) {
|
|
35
39
|
--oui-foreground-percentage: 25%;
|
|
36
40
|
|
|
37
41
|
font-style: italic;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
:where(&:is([disabled], [readonly], [aria-disabled='true' i]):focus) {
|
|
44
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):focus) {
|
|
41
45
|
--oui-outline-percentage: 75%;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
:where(&:is([disabled], [aria-disabled='true' i])) {
|
|
45
49
|
--oui-background-percentage: 50%;
|
|
46
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
|
+
}
|
|
47
62
|
}
|
|
48
63
|
|
|
49
64
|
:where([oui-combobox-content]) {
|
|
@@ -54,7 +69,7 @@
|
|
|
54
69
|
height: fit-content;
|
|
55
70
|
max-width: max(25vw, 32rem);
|
|
56
71
|
max-height: max(25vh, 32rem);
|
|
57
|
-
min-width:
|
|
72
|
+
min-width: anchor-size(width);
|
|
58
73
|
flex-flow: column nowrap;
|
|
59
74
|
border-radius: 0.25em;
|
|
60
75
|
|
|
@@ -63,12 +78,6 @@
|
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
|
|
66
|
-
:where([oui-combobox-empty]) {
|
|
67
|
-
padding: 1em;
|
|
68
|
-
text-align: center;
|
|
69
|
-
font-style: italic;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
81
|
:where([oui-combobox-filter], [oui-combobox-header]) {
|
|
73
82
|
&::after {
|
|
74
83
|
content: '';
|
|
@@ -101,23 +110,23 @@
|
|
|
101
110
|
border-radius: 0.25em;
|
|
102
111
|
font-size: 0.875rem;
|
|
103
112
|
|
|
104
|
-
:where(&:
|
|
113
|
+
:where(&:focus) {
|
|
105
114
|
@include mixins.input-focus;
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
@media (hover: hover) {
|
|
109
|
-
:where(&:
|
|
118
|
+
:where(&:hover) {
|
|
110
119
|
@include mixins.input-hover;
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
122
|
|
|
114
|
-
:where(&:is([disabled], [readonly], [aria-disabled='true' i])) {
|
|
123
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i])) {
|
|
115
124
|
--oui-foreground-percentage: 25%;
|
|
116
125
|
|
|
117
126
|
font-style: italic;
|
|
118
127
|
}
|
|
119
128
|
|
|
120
|
-
:where(&:is([disabled], [readonly], [aria-disabled='true' i]):focus) {
|
|
129
|
+
:where(&:is([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]):focus) {
|
|
121
130
|
--oui-outline-percentage: 75%;
|
|
122
131
|
}
|
|
123
132
|
|
|
@@ -126,13 +135,6 @@
|
|
|
126
135
|
}
|
|
127
136
|
}
|
|
128
137
|
|
|
129
|
-
:where([oui-combobox-filter-label]) {
|
|
130
|
-
@include mixins.visually-hidden;
|
|
131
|
-
|
|
132
|
-
display: inline-flex;
|
|
133
|
-
position: absolute;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
138
|
:where([oui-combobox-header]) {
|
|
137
139
|
padding: 0.5em calc(0.75em / 0.75);
|
|
138
140
|
background-color: var(--oui-gray-0);
|
|
@@ -143,11 +145,23 @@
|
|
|
143
145
|
z-index: 1;
|
|
144
146
|
}
|
|
145
147
|
|
|
148
|
+
:where([oui-combobox-hidden]) {
|
|
149
|
+
@include mixins.visually-hidden;
|
|
150
|
+
|
|
151
|
+
position: absolute;
|
|
152
|
+
}
|
|
153
|
+
|
|
146
154
|
:where([oui-combobox-list]) {
|
|
147
155
|
overflow: auto;
|
|
148
156
|
position: relative;
|
|
149
157
|
}
|
|
150
158
|
|
|
159
|
+
:where([oui-combobox-message]) {
|
|
160
|
+
padding: 1em;
|
|
161
|
+
text-align: center;
|
|
162
|
+
font-style: italic;
|
|
163
|
+
}
|
|
164
|
+
|
|
151
165
|
[oui-combobox-option] {
|
|
152
166
|
:where(&) {
|
|
153
167
|
padding: 0.5em 0.75em;
|
|
@@ -168,7 +182,9 @@
|
|
|
168
182
|
margin: 0 0.75em 0 0;
|
|
169
183
|
}
|
|
170
184
|
|
|
171
|
-
:where(
|
|
185
|
+
:where(
|
|
186
|
+
oui-combobox:not([disabled], [readonly], [aria-disabled='true' i], [aria-readonly='true' i]) &
|
|
187
|
+
) {
|
|
172
188
|
@media (hover: hover) {
|
|
173
189
|
:where(&:hover) {
|
|
174
190
|
background-color: var(--oui-blue-1);
|
|
@@ -193,24 +209,75 @@
|
|
|
193
209
|
gap: 0.5em;
|
|
194
210
|
overflow: auto;
|
|
195
211
|
list-style: none;
|
|
212
|
+
position: relative;
|
|
213
|
+
z-index: 2;
|
|
196
214
|
}
|
|
197
215
|
|
|
198
216
|
[oui-combobox-selection-item] {
|
|
199
217
|
:where(&) {
|
|
200
|
-
@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%;
|
|
201
224
|
|
|
202
|
-
border-radius: 3em;
|
|
203
225
|
padding: 0.5em 1em;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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);
|
|
207
248
|
}
|
|
208
249
|
|
|
209
250
|
@media (hover: hover) {
|
|
210
|
-
:where(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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%;
|
|
214
261
|
}
|
|
215
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
|
+
}
|
|
216
283
|
}
|