@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.
@@ -1,11 +1,7 @@
1
1
  /*! https://github.com/oscarpalmer/oui */
2
2
 
3
3
  :where(.oui-pill, .oui-tag) {
4
- --oui-shadow-mixed: color-mix(
5
- in oklab,
6
- var(--oui-shadow, var(--oui-gray-6)),
7
- transparent 92.5%
8
- );
4
+ --oui-shadow-mixed: color-mix(in oklab, var(--oui-shadow, var(--oui-gray-6)), transparent 92.5%);
9
5
  box-shadow: inset 0 1px 0 0 transparent, 0 0 0 1px var(--oui-shadow-mixed), 0 1px 2px -0.5px var(--oui-shadow-mixed), 0 2px 4px -1px var(--oui-shadow-mixed);
10
6
  display: inline-flex;
11
7
  flex-flow: row nowrap;
@@ -22,15 +22,16 @@
22
22
  background-position: right 0.5em center;
23
23
  background-repeat: no-repeat;
24
24
  background-size: 1em;
25
+ position: relative;
25
26
  }
26
- :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i]):focus), :where([oui-combobox]:focus-within [oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i])) {
27
+ :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i]):focus), :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i]):focus-within), :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i]):has(+ [oui-combobox-content]:focus-within)) {
27
28
  --oui-border-value: var(--oui-blue-5);
28
29
  --oui-foreground-value: inherit;
29
30
  --oui-outline-percentage: 75%;
30
31
  --oui-outline-value: var(--oui-blue-6);
31
32
  }
32
33
  @media (hover: hover) {
33
- :where(:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]:hover) {
34
+ :where([oui-combobox-anchor]:not([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]):hover) {
34
35
  --oui-border-value: var(--oui-blue-4);
35
36
  --oui-foreground-percentage: 0%;
36
37
  --oui-foreground-value: inherit;
@@ -38,16 +39,25 @@
38
39
  --oui-outline-value: var(--oui-blue-6);
39
40
  }
40
41
  }
41
- :where(:is([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]) {
42
+ :where([oui-combobox-anchor]:is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i])) {
42
43
  --oui-foreground-percentage: 25%;
43
44
  font-style: italic;
44
45
  }
45
- :where(:is([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-anchor]:focus) {
46
+ :where([oui-combobox-anchor]:is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]):focus) {
46
47
  --oui-outline-percentage: 75%;
47
48
  }
48
- :where(:is([disabled], [aria-disabled=true i]) [oui-combobox-anchor]) {
49
+ :where([oui-combobox-anchor]:is([disabled], [aria-disabled=true i])) {
49
50
  --oui-background-percentage: 50%;
50
51
  }
52
+ :where([oui-combobox-anchor] > button) {
53
+ border: none;
54
+ position: absolute;
55
+ inset: 0;
56
+ z-index: 1;
57
+ }
58
+ :where([oui-combobox-anchor] > button:focus) {
59
+ outline: none;
60
+ }
51
61
 
52
62
  :where([oui-combobox-content]) {
53
63
  --margin-bottom: 0.5em;
@@ -77,7 +87,7 @@
77
87
  height: fit-content;
78
88
  max-width: max(25vw, 32rem);
79
89
  max-height: max(25vh, 32rem);
80
- min-width: var(--oui-combobox-width, auto);
90
+ min-width: anchor-size(width);
81
91
  flex-flow: column nowrap;
82
92
  border-radius: 0.25em;
83
93
  }
@@ -85,14 +95,102 @@
85
95
  display: flex !important;
86
96
  }
87
97
 
88
- :where([oui-combobox-empty]) {
89
- padding: 1em;
90
- text-align: center;
98
+ :where([oui-combobox-filter], [oui-combobox-header])::after {
99
+ content: "";
100
+ width: 100%;
101
+ height: 0.25em;
102
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.125), transparent);
103
+ position: absolute;
104
+ bottom: -0.25em;
105
+ left: 0;
106
+ }
107
+
108
+ :where([oui-combobox-filter]) {
109
+ padding: 0.75em;
110
+ background-color: var(--oui-yellow-0);
111
+ border-radius: 0.25em 0.25em 0 0;
112
+ position: relative;
113
+ z-index: 1;
114
+ }
115
+
116
+ :where([oui-combobox-filter-input]) {
117
+ --oui-background-percentage: 0%;
118
+ --oui-foreground-percentage: 0%;
119
+ --oui-outline-percentage: 100%;
120
+ --oui-outline-value: var(--oui-blue-6);
121
+ outline: 4px solid color-mix(in oklab, var(--oui-outline-value), transparent var(--oui-outline-percentage));
122
+ outline-offset: 0;
123
+ transition: 0.125s ease-in-out;
124
+ align-content: center;
125
+ background-color: color-mix(in oklab, var(--oui-background-value), transparent var(--oui-background-percentage));
126
+ border: 1px solid var(--oui-border-value, var(--oui-gray-3));
127
+ box-shadow: inset 0 2px 4px -1px var(--oui-gray-3);
128
+ color: color-mix(in oklab, var(--oui-foreground-value, inherit), transparent var(--oui-foreground-percentage));
129
+ -webkit-text-fill-color: color-mix(in oklab, var(--oui-foreground-value, inherit), transparent var(--oui-foreground-percentage));
130
+ --oui-background-value: var(--oui-absolute);
131
+ --oui-border-value: var(--oui-yellow-3);
132
+ width: 100%;
133
+ padding: 0.5em 0.75em;
134
+ outline-width: 0;
135
+ border-radius: 0.25em;
136
+ font-size: 0.875rem;
137
+ }
138
+ :where(:where([oui-combobox-filter-input]):focus) {
139
+ --oui-border-value: var(--oui-blue-5);
140
+ --oui-foreground-value: inherit;
141
+ --oui-outline-percentage: 75%;
142
+ --oui-outline-value: var(--oui-blue-6);
143
+ }
144
+ @media (hover: hover) {
145
+ :where(:where([oui-combobox-filter-input]):hover) {
146
+ --oui-border-value: var(--oui-blue-4);
147
+ --oui-foreground-percentage: 0%;
148
+ --oui-foreground-value: inherit;
149
+ --oui-outline-percentage: 90%;
150
+ --oui-outline-value: var(--oui-blue-6);
151
+ }
152
+ }
153
+ :where(:where([oui-combobox-filter-input]):is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i])) {
154
+ --oui-foreground-percentage: 25%;
91
155
  font-style: italic;
92
156
  }
157
+ :where(:where([oui-combobox-filter-input]):is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]):focus) {
158
+ --oui-outline-percentage: 75%;
159
+ }
160
+ :where(:where([oui-combobox-filter-input]):is([disabled], [aria-disabled=true i])) {
161
+ --oui-background-percentage: 50%;
162
+ }
163
+
164
+ :where([oui-combobox-header]) {
165
+ padding: 0.5em 1em;
166
+ background-color: var(--oui-gray-0);
167
+ font-size: 0.75em;
168
+ font-weight: bold;
169
+ position: sticky;
170
+ top: 0;
171
+ z-index: 1;
172
+ }
173
+
174
+ :where([oui-combobox-hidden]) {
175
+ width: 1px !important;
176
+ height: 1px !important;
177
+ padding: 0 !important;
178
+ clip-path: inset(50%) !important;
179
+ overflow: hidden !important;
180
+ border: 0 !important;
181
+ white-space: nowrap !important;
182
+ position: absolute;
183
+ }
93
184
 
94
185
  :where([oui-combobox-list]) {
95
186
  overflow: auto;
187
+ position: relative;
188
+ }
189
+
190
+ :where([oui-combobox-message]) {
191
+ padding: 1em;
192
+ text-align: center;
193
+ font-style: italic;
96
194
  }
97
195
 
98
196
  :where([oui-combobox-option]) {
@@ -112,7 +210,7 @@
112
210
  margin: 0 0.75em 0 0;
113
211
  }
114
212
  @media (hover: hover) {
115
- :where(:where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-option]):hover) {
213
+ :where(:where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-option]):hover) {
116
214
  background-color: var(--oui-blue-1);
117
215
  color: var(--oui-blue-8);
118
216
  }
@@ -133,33 +231,71 @@
133
231
  gap: 0.5em;
134
232
  overflow: auto;
135
233
  list-style: none;
234
+ position: relative;
235
+ z-index: 2;
136
236
  }
137
237
 
138
238
  :where([oui-combobox-selection-item]) {
139
- --oui-shadow-mixed: color-mix(
140
- in oklab,
141
- var(--oui-shadow, var(--oui-gray-6)),
142
- transparent 92.5%
143
- );
144
- box-shadow: inset 0 1px 0 0 transparent, 0 0 0 1px var(--oui-shadow-mixed), 0 1px 2px -0.5px var(--oui-shadow-mixed), 0 2px 4px -1px var(--oui-shadow-mixed);
239
+ --oui-background-percentage: 25%;
240
+ --oui-foreground-percentage: 0%;
241
+ --oui-outline-percentage: 100%;
242
+ --oui-shadow-inset: color-mix(in oklab, white, transparent 75%);
243
+ --oui-shadow-percentage: 82.5%;
244
+ --oui-shadow-value: color-mix(
245
+ in oklab,
246
+ var(--oui-outline-value, var(--oui-gray-6)),
247
+ transparent var(--oui-shadow-percentage)
248
+ );
249
+ box-shadow: inset 0 1px 0 0 var(--oui-shadow-inset), 0 0 0 1px var(--oui-shadow-value), 0 1px 2px -0.5px var(--oui-shadow-value), 0 2px 4px -1px var(--oui-shadow-value);
250
+ padding: 0.5em 0.75em;
145
251
  display: inline-flex;
146
- flex-flow: row nowrap;
147
- gap: 0.5em;
148
- background-color: color-mix(in oklab, var(--oui-background, var(--oui-gray-0)), transparent 25%);
149
- color: var(--oui-foreground, var(--oui-gray-8));
150
- line-height: 1.25;
151
- border-radius: 3em;
152
- padding: 0.5em 1em;
252
+ flex-flow: row wrap;
153
253
  gap: 0.75em;
154
- font-size: 0.875em;
254
+ align-items: center;
255
+ border-radius: 0.25em;
256
+ background-color: color-mix(in oklab, var(--oui-background-value, var(--oui-gray-2)), transparent var(--oui-background-percentage));
257
+ outline: 4px solid color-mix(in oklab, var(--oui-outline-value, var(--oui-gray-6)), transparent var(--oui-outline-percentage));
258
+ border: none;
259
+ color: color-mix(in oklab, var(--oui-foreground-value, var(--oui-gray-8)), transparent var(--oui-foreground-percentage));
260
+ line-height: 1.25;
155
261
  transition: 0.125s ease-in-out;
262
+ --oui-background-value: var(--oui-blue-1);
263
+ --oui-foreground-percentage: 12.5%;
264
+ --oui-foreground-value: var(--oui-blue-8);
265
+ --oui-shadow-percentage: 90%;
266
+ padding: 0.5em 1em;
267
+ flex-wrap: nowrap;
268
+ border-radius: 5em;
269
+ font-size: 0.75em;
270
+ white-space: nowrap;
271
+ }
272
+ :where(oui-combobox:is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-selection-item]:focus-visible) {
273
+ --oui-outline-percentage: 87.5%;
274
+ --oui-outline-value: var(--oui-blue-6);
275
+ }
276
+ :where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-selection-item]:focus-visible) {
277
+ --oui-background-value: var(--oui-red-1);
278
+ --oui-foreground-value: var(--oui-red-8);
279
+ --oui-outline-percentage: 75%;
280
+ --oui-outline-value: var(--oui-red-6);
156
281
  }
157
282
  @media (hover: hover) {
158
- :where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i]) [oui-combobox-selection-item]:hover) {
159
- --oui-background: var(--oui-red-0);
160
- --oui-foreground: var(--oui-red-8);
161
- --oui-shadow: var(--oui-red-6);
283
+ :where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-selection-item]:hover) {
284
+ --oui-background-value: var(--oui-red-1);
285
+ --oui-foreground-value: var(--oui-red-8);
286
+ --oui-outline-value: var(--oui-red-6);
287
+ --oui-background-percentage: 50%;
288
+ --oui-foreground-percentage: 25%;
162
289
  }
163
290
  }
291
+ :where(oui-combobox:not([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-selection-item]:active) {
292
+ box-shadow: 0 0 0 1px var(--oui-shadow-value), inset 0 1px 2px 0 var(--oui-shadow-value), inset 0 2px 4px 0 var(--oui-shadow-value);
293
+ }
294
+ :where(oui-combobox:is([disabled], [readonly], [aria-disabled=true i], [aria-readonly=true i]) [oui-combobox-selection-item]) {
295
+ --oui-background-percentage: 80%;
296
+ --oui-foreground-percentage: 20%;
297
+ --oui-shadow-percentage: 95%;
298
+ font-style: italic;
299
+ }
164
300
 
165
301