@duskmoon-dev/core 1.3.2 → 1.5.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/components/appbar.css +186 -1
- package/dist/components/checkbox.css +2 -1
- package/dist/components/index.css +1046 -30
- package/dist/components/popover.css +329 -3
- package/dist/components/textarea.css +212 -16
- package/dist/components/tree-select.css +36 -3
- package/dist/esm/components/appbar.js +186 -1
- package/dist/esm/components/checkbox.js +2 -1
- package/dist/esm/components/popover.js +329 -3
- package/dist/esm/components/textarea.js +212 -16
- package/dist/esm/components/tree-select.js +36 -3
- package/dist/index.css +1046 -30
- package/package.json +1 -1
|
@@ -39,12 +39,24 @@
|
|
|
39
39
|
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.tree-select-trigger:disabled
|
|
42
|
+
.tree-select-trigger:disabled,
|
|
43
|
+
.tree-select-trigger[aria-disabled="true"] {
|
|
43
44
|
cursor: not-allowed;
|
|
44
45
|
opacity: 0.5;
|
|
45
46
|
background-color: var(--color-surface-container);
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
/* Support for div-based trigger (when using clear button) */
|
|
50
|
+
div.tree-select-trigger {
|
|
51
|
+
user-select: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
div.tree-select-trigger:focus-visible {
|
|
55
|
+
outline: none;
|
|
56
|
+
border-color: var(--color-primary);
|
|
57
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 10%, transparent);
|
|
58
|
+
}
|
|
59
|
+
|
|
48
60
|
/* Value Display */
|
|
49
61
|
.tree-select-value {
|
|
50
62
|
flex: 1;
|
|
@@ -105,6 +117,11 @@
|
|
|
105
117
|
background-color: var(--color-surface-container-high);
|
|
106
118
|
}
|
|
107
119
|
|
|
120
|
+
.tree-select-clear svg {
|
|
121
|
+
width: 1rem;
|
|
122
|
+
height: 1rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
108
125
|
/* Tree Select Dropdown */
|
|
109
126
|
.tree-select-dropdown {
|
|
110
127
|
position: absolute;
|
|
@@ -127,9 +144,10 @@
|
|
|
127
144
|
display: block;
|
|
128
145
|
}
|
|
129
146
|
|
|
130
|
-
/* Popover API Support
|
|
147
|
+
/* Popover API Support */
|
|
131
148
|
.tree-select-dropdown[popover] {
|
|
132
|
-
/* Reset browser defaults
|
|
149
|
+
/* Reset browser defaults for proper positioning */
|
|
150
|
+
position: absolute;
|
|
133
151
|
inset: unset;
|
|
134
152
|
margin: 0;
|
|
135
153
|
border: 1px solid var(--color-outline-variant);
|
|
@@ -139,6 +157,21 @@
|
|
|
139
157
|
display: block;
|
|
140
158
|
}
|
|
141
159
|
|
|
160
|
+
/* CSS Anchor Positioning for modern browsers */
|
|
161
|
+
@supports (anchor-name: --tree-select) {
|
|
162
|
+
.tree-select {
|
|
163
|
+
anchor-name: --tree-select;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.tree-select-dropdown[popover] {
|
|
167
|
+
position-anchor: --tree-select;
|
|
168
|
+
top: anchor(bottom);
|
|
169
|
+
left: anchor(left);
|
|
170
|
+
right: anchor(right);
|
|
171
|
+
position-try-fallbacks: flip-block;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
142
175
|
/* Search Input in Dropdown */
|
|
143
176
|
.tree-select-search {
|
|
144
177
|
display: flex;
|
|
@@ -15,6 +15,12 @@ export const css = `/**
|
|
|
15
15
|
padding: 0 1rem;
|
|
16
16
|
background-color: var(--color-surface);
|
|
17
17
|
color: var(--color-on-surface);
|
|
18
|
+
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Static App Bar (default) */
|
|
22
|
+
.appbar-static {
|
|
23
|
+
position: static;
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
/* Fixed App Bar */
|
|
@@ -33,19 +39,47 @@ export const css = `/**
|
|
|
33
39
|
z-index: 1000;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
/* App Bar
|
|
42
|
+
/* Top App Bar (default) */
|
|
43
|
+
.appbar-top {
|
|
44
|
+
top: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Bottom App Bar */
|
|
48
|
+
.appbar-bottom {
|
|
49
|
+
position: fixed;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
left: 0;
|
|
52
|
+
right: 0;
|
|
53
|
+
top: auto;
|
|
54
|
+
z-index: 1000;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* App Bar with Shadow (elevated) */
|
|
37
58
|
.appbar-elevated {
|
|
38
59
|
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
39
60
|
}
|
|
40
61
|
|
|
62
|
+
/* Flat App Bar (no shadow) */
|
|
63
|
+
.appbar-flat {
|
|
64
|
+
box-shadow: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
41
67
|
/* App Bar with Border */
|
|
42
68
|
.appbar-bordered {
|
|
43
69
|
border-bottom: 1px solid var(--color-outline-variant);
|
|
70
|
+
box-shadow: none;
|
|
44
71
|
}
|
|
45
72
|
|
|
46
73
|
/* Transparent App Bar */
|
|
47
74
|
.appbar-transparent {
|
|
48
75
|
background-color: transparent;
|
|
76
|
+
box-shadow: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Backdrop Blur */
|
|
80
|
+
.appbar-blur {
|
|
81
|
+
backdrop-filter: blur(8px);
|
|
82
|
+
-webkit-backdrop-filter: blur(8px);
|
|
49
83
|
}
|
|
50
84
|
|
|
51
85
|
/* App Bar Navigation Icon */
|
|
@@ -168,6 +202,114 @@ export const css = `/**
|
|
|
168
202
|
font-size: 1.5rem;
|
|
169
203
|
}
|
|
170
204
|
|
|
205
|
+
/* Compact Size */
|
|
206
|
+
.appbar-compact {
|
|
207
|
+
min-height: 3rem;
|
|
208
|
+
padding: 0 0.75rem;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.appbar-compact .appbar-title,
|
|
212
|
+
.appbar-compact .appbar-heading {
|
|
213
|
+
font-size: 1rem;
|
|
214
|
+
line-height: 1.5rem;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.appbar-compact .appbar-nav,
|
|
218
|
+
.appbar-compact .appbar-action,
|
|
219
|
+
.appbar-compact .appbar-back {
|
|
220
|
+
width: 2rem;
|
|
221
|
+
height: 2rem;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Comfortable Size */
|
|
225
|
+
.appbar-comfortable {
|
|
226
|
+
min-height: 5rem;
|
|
227
|
+
padding: 0 1.5rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.appbar-comfortable .appbar-title,
|
|
231
|
+
.appbar-comfortable .appbar-heading {
|
|
232
|
+
font-size: 1.5rem;
|
|
233
|
+
line-height: 2rem;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* Section Classes */
|
|
237
|
+
.appbar-leading {
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 0.25rem;
|
|
241
|
+
flex-shrink: 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.appbar-trailing {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
gap: 0.25rem;
|
|
248
|
+
flex-shrink: 0;
|
|
249
|
+
margin-left: auto;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Heading Text */
|
|
253
|
+
.appbar-heading {
|
|
254
|
+
font-size: 1.25rem;
|
|
255
|
+
font-weight: 500;
|
|
256
|
+
line-height: 1.75rem;
|
|
257
|
+
margin: 0;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
text-overflow: ellipsis;
|
|
260
|
+
white-space: nowrap;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Back Button */
|
|
264
|
+
.appbar-back {
|
|
265
|
+
display: flex;
|
|
266
|
+
align-items: center;
|
|
267
|
+
justify-content: center;
|
|
268
|
+
width: 2.5rem;
|
|
269
|
+
height: 2.5rem;
|
|
270
|
+
color: var(--color-on-surface);
|
|
271
|
+
background-color: transparent;
|
|
272
|
+
border: none;
|
|
273
|
+
border-radius: 50%;
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
transition: background-color 150ms ease-in-out;
|
|
276
|
+
flex-shrink: 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.appbar-back:hover {
|
|
280
|
+
background-color: var(--color-surface-container);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.appbar-back:focus-visible {
|
|
284
|
+
outline: 2px solid var(--color-primary);
|
|
285
|
+
outline-offset: 2px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* Search Input (direct on element) */
|
|
289
|
+
.appbar .appbar-search,
|
|
290
|
+
input.appbar-search {
|
|
291
|
+
flex: 1;
|
|
292
|
+
max-width: 32rem;
|
|
293
|
+
padding: 0.5rem 1rem;
|
|
294
|
+
font-size: 0.875rem;
|
|
295
|
+
color: var(--color-on-surface);
|
|
296
|
+
background-color: var(--color-surface-container);
|
|
297
|
+
border: none;
|
|
298
|
+
border-radius: 9999px;
|
|
299
|
+
transition: background-color 150ms ease-in-out;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.appbar .appbar-search:focus,
|
|
303
|
+
input.appbar-search:focus {
|
|
304
|
+
outline: none;
|
|
305
|
+
background-color: var(--color-surface-container-high);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.appbar .appbar-search::placeholder,
|
|
309
|
+
input.appbar-search::placeholder {
|
|
310
|
+
color: var(--color-on-surface-variant);
|
|
311
|
+
}
|
|
312
|
+
|
|
171
313
|
/* Color Variants */
|
|
172
314
|
.appbar-primary {
|
|
173
315
|
background-color: var(--color-primary);
|
|
@@ -206,10 +348,53 @@ export const css = `/**
|
|
|
206
348
|
color: var(--color-on-secondary-container);
|
|
207
349
|
}
|
|
208
350
|
|
|
351
|
+
.appbar-secondary .appbar-subtitle {
|
|
352
|
+
color: var(--color-on-secondary);
|
|
353
|
+
opacity: 0.8;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.appbar-tertiary {
|
|
357
|
+
background-color: var(--color-tertiary);
|
|
358
|
+
color: var(--color-on-tertiary);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.appbar-tertiary .appbar-nav,
|
|
362
|
+
.appbar-tertiary .appbar-action {
|
|
363
|
+
color: var(--color-on-tertiary);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.appbar-tertiary .appbar-nav:hover,
|
|
367
|
+
.appbar-tertiary .appbar-action:hover {
|
|
368
|
+
background-color: var(--color-tertiary-container);
|
|
369
|
+
color: var(--color-on-tertiary-container);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.appbar-tertiary .appbar-subtitle {
|
|
373
|
+
color: var(--color-on-tertiary);
|
|
374
|
+
opacity: 0.8;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* Surface Variants */
|
|
209
378
|
.appbar-surface {
|
|
379
|
+
background-color: var(--color-surface);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.appbar-surface-container {
|
|
210
383
|
background-color: var(--color-surface-container);
|
|
211
384
|
}
|
|
212
385
|
|
|
386
|
+
.appbar-surface-container-low {
|
|
387
|
+
background-color: var(--color-surface-container-low);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.appbar-surface-container-high {
|
|
391
|
+
background-color: var(--color-surface-container-high);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.appbar-surface-container-highest {
|
|
395
|
+
background-color: var(--color-surface-container-highest);
|
|
396
|
+
}
|
|
397
|
+
|
|
213
398
|
/* Center Title */
|
|
214
399
|
.appbar-center {
|
|
215
400
|
justify-content: space-between;
|
|
@@ -69,7 +69,8 @@ export const css = `/**
|
|
|
69
69
|
border-color: var(--color-on-surface);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.checkbox:checked:hover:not(:disabled)
|
|
72
|
+
.checkbox:checked:hover:not(:disabled),
|
|
73
|
+
.checkbox:indeterminate:hover:not(:disabled) {
|
|
73
74
|
background-color: color-mix(in oklch, var(--checkbox-color), black 10%);
|
|
74
75
|
border-color: color-mix(in oklch, var(--checkbox-color), black 10%);
|
|
75
76
|
}
|
|
@@ -36,6 +36,72 @@ export const css = `/**
|
|
|
36
36
|
transform: scale(1);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/* Direct popover structure (without .popover-content wrapper) */
|
|
40
|
+
.popover.popover-show,
|
|
41
|
+
.popover.show {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
visibility: visible;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Popover as direct overlay (simpler structure) */
|
|
47
|
+
.popover[class*="popover-top"],
|
|
48
|
+
.popover[class*="popover-bottom"],
|
|
49
|
+
.popover[class*="popover-left"],
|
|
50
|
+
.popover[class*="popover-right"] {
|
|
51
|
+
position: absolute;
|
|
52
|
+
z-index: 1050;
|
|
53
|
+
min-width: 12rem;
|
|
54
|
+
max-width: 20rem;
|
|
55
|
+
padding: 1rem;
|
|
56
|
+
background-color: var(--color-surface);
|
|
57
|
+
border: 1px solid var(--color-outline-variant);
|
|
58
|
+
border-radius: 0.75rem;
|
|
59
|
+
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
60
|
+
opacity: 0;
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
transition: opacity 150ms ease-out, visibility 150ms ease-out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.popover[class*="popover-top"].popover-show,
|
|
66
|
+
.popover[class*="popover-bottom"].popover-show,
|
|
67
|
+
.popover[class*="popover-left"].popover-show,
|
|
68
|
+
.popover[class*="popover-right"].popover-show {
|
|
69
|
+
opacity: 1;
|
|
70
|
+
visibility: visible;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Direct position: Top */
|
|
74
|
+
.popover.popover-top:not(:has(.popover-content)) {
|
|
75
|
+
bottom: 100%;
|
|
76
|
+
left: 50%;
|
|
77
|
+
transform: translateX(-50%);
|
|
78
|
+
margin-bottom: 0.75rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Direct position: Bottom */
|
|
82
|
+
.popover.popover-bottom:not(:has(.popover-content)) {
|
|
83
|
+
top: 100%;
|
|
84
|
+
left: 50%;
|
|
85
|
+
transform: translateX(-50%);
|
|
86
|
+
margin-top: 0.75rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Direct position: Left */
|
|
90
|
+
.popover.popover-left:not(:has(.popover-content)) {
|
|
91
|
+
right: 100%;
|
|
92
|
+
top: 50%;
|
|
93
|
+
transform: translateY(-50%);
|
|
94
|
+
margin-right: 0.75rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Direct position: Right */
|
|
98
|
+
.popover.popover-right:not(:has(.popover-content)) {
|
|
99
|
+
left: 100%;
|
|
100
|
+
top: 50%;
|
|
101
|
+
transform: translateY(-50%);
|
|
102
|
+
margin-left: 0.75rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
39
105
|
/* Popover Arrow */
|
|
40
106
|
.popover-arrow {
|
|
41
107
|
position: absolute;
|
|
@@ -212,12 +278,33 @@ export const css = `/**
|
|
|
212
278
|
}
|
|
213
279
|
|
|
214
280
|
/* Color Variants */
|
|
281
|
+
/*
|
|
282
|
+
* Color intensity for themed popovers.
|
|
283
|
+
* Override this variable to adjust how strongly colors appear:
|
|
284
|
+
* - 20% = subtle tint
|
|
285
|
+
* - 30% = moderate (default)
|
|
286
|
+
* - 40% = bold/prominent
|
|
287
|
+
*/
|
|
288
|
+
.popover {
|
|
289
|
+
--popover-color-intensity: 30%;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* Dark variant */
|
|
215
293
|
.popover-dark .popover-content {
|
|
216
294
|
background-color: var(--color-on-surface);
|
|
217
295
|
color: var(--color-surface);
|
|
218
296
|
border-color: transparent;
|
|
219
297
|
}
|
|
220
298
|
|
|
299
|
+
.popover-dark[class*="popover-top"],
|
|
300
|
+
.popover-dark[class*="popover-bottom"],
|
|
301
|
+
.popover-dark[class*="popover-left"],
|
|
302
|
+
.popover-dark[class*="popover-right"] {
|
|
303
|
+
background-color: var(--color-on-surface);
|
|
304
|
+
color: var(--color-surface);
|
|
305
|
+
border-color: transparent;
|
|
306
|
+
}
|
|
307
|
+
|
|
221
308
|
.popover-dark .popover-arrow {
|
|
222
309
|
background-color: var(--color-on-surface);
|
|
223
310
|
border-color: transparent;
|
|
@@ -232,16 +319,106 @@ export const css = `/**
|
|
|
232
319
|
opacity: 0.9;
|
|
233
320
|
}
|
|
234
321
|
|
|
322
|
+
/* Primary variant */
|
|
235
323
|
.popover-primary .popover-content {
|
|
236
|
-
background-color: var(--color-primary-
|
|
324
|
+
background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
|
|
325
|
+
border-color: var(--color-primary);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.popover-primary[class*="popover-top"],
|
|
329
|
+
.popover-primary[class*="popover-bottom"],
|
|
330
|
+
.popover-primary[class*="popover-left"],
|
|
331
|
+
.popover-primary[class*="popover-right"] {
|
|
332
|
+
background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
|
|
237
333
|
border-color: var(--color-primary);
|
|
238
334
|
}
|
|
239
335
|
|
|
240
336
|
.popover-primary .popover-arrow {
|
|
241
|
-
background-color: var(--color-primary-
|
|
337
|
+
background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
|
|
242
338
|
border-color: var(--color-primary);
|
|
243
339
|
}
|
|
244
340
|
|
|
341
|
+
.popover-primary .popover-body {
|
|
342
|
+
color: var(--color-on-surface);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.popover-primary .popover-title {
|
|
346
|
+
color: var(--color-on-surface);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* Secondary variant */
|
|
350
|
+
.popover-secondary .popover-content {
|
|
351
|
+
background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
|
|
352
|
+
border-color: var(--color-secondary);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.popover-secondary[class*="popover-top"],
|
|
356
|
+
.popover-secondary[class*="popover-bottom"],
|
|
357
|
+
.popover-secondary[class*="popover-left"],
|
|
358
|
+
.popover-secondary[class*="popover-right"] {
|
|
359
|
+
background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
|
|
360
|
+
border-color: var(--color-secondary);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.popover-secondary .popover-arrow {
|
|
364
|
+
background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
|
|
365
|
+
border-color: var(--color-secondary);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.popover-secondary .popover-body {
|
|
369
|
+
color: var(--color-on-surface);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.popover-secondary .popover-title {
|
|
373
|
+
color: var(--color-on-surface);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* Tertiary variant */
|
|
377
|
+
.popover-tertiary .popover-content {
|
|
378
|
+
background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
|
|
379
|
+
border-color: var(--color-tertiary);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.popover-tertiary[class*="popover-top"],
|
|
383
|
+
.popover-tertiary[class*="popover-bottom"],
|
|
384
|
+
.popover-tertiary[class*="popover-left"],
|
|
385
|
+
.popover-tertiary[class*="popover-right"] {
|
|
386
|
+
background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
|
|
387
|
+
border-color: var(--color-tertiary);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.popover-tertiary .popover-arrow {
|
|
391
|
+
background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
|
|
392
|
+
border-color: var(--color-tertiary);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.popover-tertiary .popover-body {
|
|
396
|
+
color: var(--color-on-surface);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.popover-tertiary .popover-title {
|
|
400
|
+
color: var(--color-on-surface);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* Surface highest variant */
|
|
404
|
+
.popover-surface-highest .popover-content {
|
|
405
|
+
background-color: var(--color-surface-container-highest);
|
|
406
|
+
border-color: var(--color-outline-variant);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.popover-surface-highest[class*="popover-top"],
|
|
410
|
+
.popover-surface-highest[class*="popover-bottom"],
|
|
411
|
+
.popover-surface-highest[class*="popover-left"],
|
|
412
|
+
.popover-surface-highest[class*="popover-right"] {
|
|
413
|
+
background-color: var(--color-surface-container-highest);
|
|
414
|
+
border-color: var(--color-outline-variant);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.popover-surface-highest .popover-arrow {
|
|
418
|
+
background-color: var(--color-surface-container-highest);
|
|
419
|
+
border-color: var(--color-outline-variant);
|
|
420
|
+
}
|
|
421
|
+
|
|
245
422
|
/* Hover Trigger */
|
|
246
423
|
.popover-hover:hover .popover-content,
|
|
247
424
|
.popover-hover:focus-within .popover-content {
|
|
@@ -316,11 +493,160 @@ export const css = `/**
|
|
|
316
493
|
justify-content: center;
|
|
317
494
|
}
|
|
318
495
|
|
|
496
|
+
/* ========================================
|
|
497
|
+
* HTML Popover API Support
|
|
498
|
+
* Uses native [popover] attribute with :popover-open pseudo-class
|
|
499
|
+
* ======================================== */
|
|
500
|
+
|
|
501
|
+
/* Native popover base styles */
|
|
502
|
+
.popover[popover] {
|
|
503
|
+
position: fixed;
|
|
504
|
+
inset: unset;
|
|
505
|
+
z-index: 1050;
|
|
506
|
+
min-width: 12rem;
|
|
507
|
+
max-width: 20rem;
|
|
508
|
+
padding: 1rem;
|
|
509
|
+
margin: 0;
|
|
510
|
+
background-color: var(--color-surface);
|
|
511
|
+
border: 1px solid var(--color-outline-variant);
|
|
512
|
+
border-radius: 0.75rem;
|
|
513
|
+
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
514
|
+
opacity: 0;
|
|
515
|
+
transform: scale(0.95);
|
|
516
|
+
transition: opacity 150ms ease-out, transform 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/* Popover open state */
|
|
520
|
+
.popover[popover]:popover-open {
|
|
521
|
+
opacity: 1;
|
|
522
|
+
transform: scale(1);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/* Starting state for entry animation */
|
|
526
|
+
@starting-style {
|
|
527
|
+
.popover[popover]:popover-open {
|
|
528
|
+
opacity: 0;
|
|
529
|
+
transform: scale(0.95);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/* Native popover backdrop */
|
|
534
|
+
.popover[popover]::backdrop {
|
|
535
|
+
background-color: rgb(0 0 0 / 0);
|
|
536
|
+
transition: background-color 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.popover[popover]:popover-open::backdrop {
|
|
540
|
+
background-color: rgb(0 0 0 / 0.1);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
@starting-style {
|
|
544
|
+
.popover[popover]:popover-open::backdrop {
|
|
545
|
+
background-color: rgb(0 0 0 / 0);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/* Native popover with modal backdrop */
|
|
550
|
+
.popover-modal[popover]::backdrop {
|
|
551
|
+
background-color: rgb(0 0 0 / 0);
|
|
552
|
+
transition: background-color 150ms ease-out, overlay 150ms ease-out allow-discrete, display 150ms ease-out allow-discrete;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.popover-modal[popover]:popover-open::backdrop {
|
|
556
|
+
background-color: rgb(0 0 0 / 0.3);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
@starting-style {
|
|
560
|
+
.popover-modal[popover]:popover-open::backdrop {
|
|
561
|
+
background-color: rgb(0 0 0 / 0);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/* Native popover color variants */
|
|
566
|
+
.popover-primary[popover] {
|
|
567
|
+
background-color: color-mix(in oklch, var(--color-primary) var(--popover-color-intensity), var(--color-surface));
|
|
568
|
+
border-color: var(--color-primary);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.popover-primary[popover] .popover-body {
|
|
572
|
+
color: var(--color-on-surface);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.popover-primary[popover] .popover-title {
|
|
576
|
+
color: var(--color-on-surface);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.popover-secondary[popover] {
|
|
580
|
+
background-color: color-mix(in oklch, var(--color-secondary) var(--popover-color-intensity), var(--color-surface));
|
|
581
|
+
border-color: var(--color-secondary);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.popover-secondary[popover] .popover-body {
|
|
585
|
+
color: var(--color-on-surface);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.popover-secondary[popover] .popover-title {
|
|
589
|
+
color: var(--color-on-surface);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.popover-tertiary[popover] {
|
|
593
|
+
background-color: color-mix(in oklch, var(--color-tertiary) var(--popover-color-intensity), var(--color-surface));
|
|
594
|
+
border-color: var(--color-tertiary);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.popover-tertiary[popover] .popover-body {
|
|
598
|
+
color: var(--color-on-surface);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.popover-tertiary[popover] .popover-title {
|
|
602
|
+
color: var(--color-on-surface);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.popover-dark[popover] {
|
|
606
|
+
background-color: var(--color-on-surface);
|
|
607
|
+
border-color: transparent;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.popover-dark[popover] .popover-body {
|
|
611
|
+
color: var(--color-surface);
|
|
612
|
+
opacity: 0.9;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.popover-dark[popover] .popover-title {
|
|
616
|
+
color: var(--color-surface);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.popover-surface-highest[popover] {
|
|
620
|
+
background-color: var(--color-surface-container-highest);
|
|
621
|
+
border-color: var(--color-outline-variant);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/* Native popover size variants */
|
|
625
|
+
.popover-sm[popover] {
|
|
626
|
+
min-width: 8rem;
|
|
627
|
+
max-width: 14rem;
|
|
628
|
+
padding: 0.75rem;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.popover-lg[popover] {
|
|
632
|
+
min-width: 16rem;
|
|
633
|
+
max-width: 28rem;
|
|
634
|
+
padding: 1.25rem;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.popover-full[popover] {
|
|
638
|
+
min-width: 0;
|
|
639
|
+
max-width: none;
|
|
640
|
+
width: max-content;
|
|
641
|
+
}
|
|
642
|
+
|
|
319
643
|
/* Reduce Motion */
|
|
320
644
|
@media (prefers-reduced-motion: reduce) {
|
|
321
645
|
.popover-content,
|
|
322
646
|
.popover-close,
|
|
323
|
-
.popover-menu-item
|
|
647
|
+
.popover-menu-item,
|
|
648
|
+
.popover[popover],
|
|
649
|
+
.popover[popover]::backdrop {
|
|
324
650
|
transition: none;
|
|
325
651
|
}
|
|
326
652
|
}
|