lapikit 0.5.0 → 0.5.2
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/bin/{helper.js → helpers.js} +41 -0
- package/bin/hooks.js +68 -0
- package/bin/index.js +30 -6
- package/dist/components/accordion/accordion.svelte +6 -19
- package/dist/components/accordion/accordion.types.d.ts +0 -4
- package/dist/components/accordion/modules/accordion-item.svelte +8 -24
- package/dist/components/alert/alert.svelte +3 -10
- package/dist/components/app/app.svelte +4 -51
- package/dist/components/appbar/appbar.svelte +12 -27
- package/dist/components/appbar/appbar.types.d.ts +1 -3
- package/dist/components/avatar/avatar.svelte +22 -12
- package/dist/components/btn/btn.svelte +71 -89
- package/dist/components/card/card.svelte +31 -44
- package/dist/components/chip/chip.svelte +57 -66
- package/dist/components/dropdown/dropdown.svelte +8 -23
- package/dist/components/dropdown/dropdown.types.d.ts +0 -2
- package/dist/components/list/list.svelte +44 -24
- package/dist/components/list/modules/list-item.svelte +10 -10
- package/dist/components/popover/popover.svelte +8 -23
- package/dist/components/popover/popover.types.d.ts +0 -2
- package/dist/components/separator/separator.svelte +0 -12
- package/dist/components/separator/separator.types.d.ts +0 -2
- package/dist/components/textfield/textfield.svelte +10 -25
- package/dist/components/textfield/textfield.types.d.ts +0 -2
- package/dist/components/toolbar/toolbar.svelte +12 -27
- package/dist/components/toolbar/toolbar.types.d.ts +0 -2
- package/dist/components/tooltip/tooltip.svelte +12 -27
- package/dist/components/tooltip/tooltip.types.d.ts +0 -2
- package/package.json +2 -5
- package/bin/configuration.js +0 -303
- package/bin/presets.js +0 -26
- package/bin/prompts.js +0 -67
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
let componentClass = $derived(
|
|
59
59
|
useClassName({
|
|
60
60
|
baseClass: 'kit-chip',
|
|
61
|
-
className: `${className ?? ''}
|
|
61
|
+
className: `${className ?? ''}`.trim(),
|
|
62
62
|
sClass,
|
|
63
63
|
classProps
|
|
64
64
|
})
|
|
@@ -230,9 +230,8 @@
|
|
|
230
230
|
--kit-chip-bg: var(--kit-surface-2);
|
|
231
231
|
--kit-chip-fg: var(--kit-fg);
|
|
232
232
|
--kit-chip-bd: var(--kit-border);
|
|
233
|
-
--kit-chip-bg
|
|
234
|
-
--kit-chip-bg
|
|
235
|
-
--kit-chip-font: var(--kit-font);
|
|
233
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-bg), var(--kit-chip-fg) 6%);
|
|
234
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-bg), var(--kit-chip-fg) 10%);
|
|
236
235
|
--kit-chip-h-xs: 24px;
|
|
237
236
|
--kit-chip-h-sm: 28px;
|
|
238
237
|
--kit-chip-h-md: 32px;
|
|
@@ -243,9 +242,9 @@
|
|
|
243
242
|
--kit-chip-px-md: 12px;
|
|
244
243
|
--kit-chip-px-lg: 14px;
|
|
245
244
|
--kit-chip-px-xl: 16px;
|
|
246
|
-
--chip-density-scale: 1;
|
|
247
|
-
--chip-density-
|
|
248
|
-
--chip-radius: 99999px;
|
|
245
|
+
--kit-chip-density-scale: 1;
|
|
246
|
+
--kit-chip-density-h-scale: 1;
|
|
247
|
+
--kit-chip-radius: 99999px;
|
|
249
248
|
--kit-chip-gap: 0.35em;
|
|
250
249
|
|
|
251
250
|
position: relative;
|
|
@@ -253,12 +252,12 @@
|
|
|
253
252
|
box-sizing: border-box;
|
|
254
253
|
align-items: center;
|
|
255
254
|
justify-content: center;
|
|
256
|
-
font-family: var(--kit-
|
|
257
|
-
background: var(--chip-bg);
|
|
258
|
-
color: var(--chip-fg);
|
|
259
|
-
height: max(24px, calc(var(--chip-h) * var(--chip-density-
|
|
260
|
-
padding-inline: calc(var(--chip-px) * var(--chip-density-scale));
|
|
261
|
-
border-radius: var(--chip-radius);
|
|
255
|
+
font-family: var(--kit-font);
|
|
256
|
+
background: var(--kit-chip-bg);
|
|
257
|
+
color: var(--kit-chip-fg);
|
|
258
|
+
height: max(24px, calc(var(--kit-chip-h) * var(--kit-chip-density-h-scale)));
|
|
259
|
+
padding-inline: calc(var(--kit-chip-px) * var(--kit-chip-density-scale));
|
|
260
|
+
border-radius: var(--kit-chip-radius);
|
|
262
261
|
text-decoration: none;
|
|
263
262
|
white-space: nowrap;
|
|
264
263
|
user-select: none;
|
|
@@ -274,23 +273,23 @@
|
|
|
274
273
|
}
|
|
275
274
|
|
|
276
275
|
.kit-chip[data-interactive='true']:hover {
|
|
277
|
-
background: var(--chip-hover-bg);
|
|
278
|
-
color: var(--chip-
|
|
279
|
-
text-decoration: var(--chip-decoration);
|
|
276
|
+
background: var(--kit-chip-hover-bg);
|
|
277
|
+
color: var(--kit-chip-fg);
|
|
278
|
+
text-decoration: var(--kit-chip-decoration);
|
|
280
279
|
}
|
|
281
280
|
|
|
282
281
|
.kit-chip[data-interactive='true']:active,
|
|
283
282
|
.kit-chip[data-active='true'] {
|
|
284
|
-
background: var(--chip-active-bg);
|
|
285
|
-
color: var(--chip-
|
|
286
|
-
text-decoration: var(--chip-decoration);
|
|
283
|
+
background: var(--kit-chip-active-bg);
|
|
284
|
+
color: var(--kit-chip-fg);
|
|
285
|
+
text-decoration: var(--kit-chip-decoration);
|
|
287
286
|
transform: translateY(1px);
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
.kit-chip[data-active='true'][data-interactive='true']:hover {
|
|
291
|
-
background: var(--chip-hover-bg);
|
|
292
|
-
color: var(--chip-
|
|
293
|
-
text-decoration: var(--chip-decoration);
|
|
290
|
+
background: var(--kit-chip-hover-bg);
|
|
291
|
+
color: var(--kit-chip-fg);
|
|
292
|
+
text-decoration: var(--kit-chip-decoration);
|
|
294
293
|
}
|
|
295
294
|
|
|
296
295
|
:is(.kit-chip:focus-visible, .kit-chip:has(> input:focus-visible)) {
|
|
@@ -310,47 +309,43 @@
|
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
.kit-chip > :is(input[type='checkbox'], input[type='radio']):after {
|
|
313
|
-
|
|
314
|
-
content: var(--chip-content);
|
|
312
|
+
content: attr(aria-label);
|
|
315
313
|
cursor: pointer;
|
|
316
314
|
}
|
|
317
315
|
|
|
318
316
|
.kit-chip[data-variant='filled'] {
|
|
319
|
-
--chip-bg: var(--kit-accent);
|
|
320
|
-
--chip-fg: white;
|
|
321
|
-
--chip-hover-bg: color-mix(in oklab, var(--kit-
|
|
322
|
-
--chip-
|
|
323
|
-
--chip-active-bg: color-mix(in oklab, var(--kit-accent), black 16%);
|
|
324
|
-
--chip-active-fg: var(--chip-fg);
|
|
317
|
+
--kit-chip-bg: var(--kit-accent);
|
|
318
|
+
--kit-chip-fg: white;
|
|
319
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-bg), black 10%);
|
|
320
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-bg), black 16%);
|
|
325
321
|
}
|
|
326
322
|
|
|
327
323
|
.kit-chip[data-variant='outline'] {
|
|
328
324
|
--outline-color: var(--kit-accent);
|
|
325
|
+
--kit-chip-bg: transparent;
|
|
326
|
+
--kit-chip-fg: var(--kit-accent);
|
|
327
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 80%);
|
|
328
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 92%);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
.kit-chip[data-variant='outline'],
|
|
332
331
|
.kit-chip[data-variant='text'] {
|
|
333
|
-
--chip-bg: transparent;
|
|
334
|
-
--chip-fg: var(--kit-accent);
|
|
335
|
-
--chip-hover-bg: color-mix(in oklab, var(--kit-
|
|
336
|
-
--chip-
|
|
337
|
-
--chip-active-bg: color-mix(in oklab, var(--kit-accent), transparent 92%);
|
|
338
|
-
--chip-active-fg: var(--chip-fg);
|
|
332
|
+
--kit-chip-bg: transparent;
|
|
333
|
+
--kit-chip-fg: var(--kit-accent);
|
|
334
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 80%);
|
|
335
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 92%);
|
|
339
336
|
}
|
|
340
337
|
|
|
341
338
|
.kit-chip[data-variant='link'] {
|
|
342
|
-
--chip-bg: transparent;
|
|
343
|
-
--chip-fg: var(--kit-accent);
|
|
344
|
-
--chip-
|
|
345
|
-
--chip-active-fg: var(--chip-fg);
|
|
346
|
-
--chip-decoration: underline;
|
|
339
|
+
--kit-chip-bg: transparent;
|
|
340
|
+
--kit-chip-fg: var(--kit-accent);
|
|
341
|
+
--kit-chip-decoration: underline;
|
|
347
342
|
height: inherit;
|
|
348
343
|
padding: 0;
|
|
349
344
|
}
|
|
350
345
|
|
|
351
346
|
.kit-chip[data-size='xs'] {
|
|
352
|
-
--chip-h: var(--kit-chip-h-xs);
|
|
353
|
-
--chip-px: var(--kit-chip-px-xs);
|
|
347
|
+
--kit-chip-h: var(--kit-chip-h-xs);
|
|
348
|
+
--kit-chip-px: var(--kit-chip-px-xs);
|
|
354
349
|
font-size: 12px;
|
|
355
350
|
}
|
|
356
351
|
.kit-chip[data-size='xs'] :global(.kit-icon:not([data-size])) {
|
|
@@ -358,8 +353,8 @@
|
|
|
358
353
|
}
|
|
359
354
|
|
|
360
355
|
.kit-chip[data-size='sm'] {
|
|
361
|
-
--chip-h: var(--kit-chip-h-sm);
|
|
362
|
-
--chip-px: var(--kit-chip-px-sm);
|
|
356
|
+
--kit-chip-h: var(--kit-chip-h-sm);
|
|
357
|
+
--kit-chip-px: var(--kit-chip-px-sm);
|
|
363
358
|
font-size: 13px;
|
|
364
359
|
}
|
|
365
360
|
.kit-chip[data-size='sm'] :global(.kit-icon:not([data-size])) {
|
|
@@ -367,8 +362,8 @@
|
|
|
367
362
|
}
|
|
368
363
|
|
|
369
364
|
.kit-chip[data-size='md'] {
|
|
370
|
-
--chip-h: var(--kit-chip-h-md);
|
|
371
|
-
--chip-px: var(--kit-chip-px-md);
|
|
365
|
+
--kit-chip-h: var(--kit-chip-h-md);
|
|
366
|
+
--kit-chip-px: var(--kit-chip-px-md);
|
|
372
367
|
font-size: 14px;
|
|
373
368
|
}
|
|
374
369
|
.kit-chip[data-size='md'] :global(.kit-icon:not([data-size])) {
|
|
@@ -376,8 +371,8 @@
|
|
|
376
371
|
}
|
|
377
372
|
|
|
378
373
|
.kit-chip[data-size='lg'] {
|
|
379
|
-
--chip-h: var(--kit-chip-h-lg);
|
|
380
|
-
--chip-px: var(--kit-chip-px-lg);
|
|
374
|
+
--kit-chip-h: var(--kit-chip-h-lg);
|
|
375
|
+
--kit-chip-px: var(--kit-chip-px-lg);
|
|
381
376
|
font-size: 15px;
|
|
382
377
|
}
|
|
383
378
|
.kit-chip[data-size='lg'] :global(.kit-icon:not([data-size])) {
|
|
@@ -385,8 +380,8 @@
|
|
|
385
380
|
}
|
|
386
381
|
|
|
387
382
|
.kit-chip[data-size='xl'] {
|
|
388
|
-
--chip-h: var(--kit-chip-h-xl);
|
|
389
|
-
--chip-px: var(--kit-chip-px-xl);
|
|
383
|
+
--kit-chip-h: var(--kit-chip-h-xl);
|
|
384
|
+
--kit-chip-px: var(--kit-chip-px-xl);
|
|
390
385
|
font-size: 16px;
|
|
391
386
|
}
|
|
392
387
|
.kit-chip[data-size='xl'] :global(.kit-icon:not([data-size])) {
|
|
@@ -394,18 +389,18 @@
|
|
|
394
389
|
}
|
|
395
390
|
|
|
396
391
|
.kit-chip[data-density='default'] {
|
|
397
|
-
--chip-density-scale: 1;
|
|
398
|
-
--chip-density-
|
|
392
|
+
--kit-chip-density-scale: 1;
|
|
393
|
+
--kit-chip-density-h-scale: 1;
|
|
399
394
|
}
|
|
400
395
|
|
|
401
396
|
.kit-chip[data-density='compact'] {
|
|
402
|
-
--chip-density-scale: 0.92;
|
|
403
|
-
--chip-density-
|
|
397
|
+
--kit-chip-density-scale: 0.92;
|
|
398
|
+
--kit-chip-density-h-scale: 0.9;
|
|
404
399
|
}
|
|
405
400
|
|
|
406
401
|
.kit-chip[data-density='comfortable'] {
|
|
407
|
-
--chip-density-scale: 1.08;
|
|
408
|
-
--chip-density-
|
|
402
|
+
--kit-chip-density-scale: 1.08;
|
|
403
|
+
--kit-chip-density-h-scale: 1.08;
|
|
409
404
|
}
|
|
410
405
|
|
|
411
406
|
.kit-chip[data-label-style='true'] {
|
|
@@ -414,10 +409,6 @@
|
|
|
414
409
|
text-transform: uppercase;
|
|
415
410
|
}
|
|
416
411
|
|
|
417
|
-
.kit-chip .outline {
|
|
418
|
-
pointer-events: none;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
412
|
.kit-chip__inner {
|
|
422
413
|
display: inline-flex;
|
|
423
414
|
align-items: center;
|
|
@@ -479,14 +470,14 @@
|
|
|
479
470
|
}
|
|
480
471
|
|
|
481
472
|
.kit-chip[data-disabled='true'] {
|
|
482
|
-
background: color-mix(in oklab, var(--chip-bg), transparent 70%);
|
|
483
|
-
color: color-mix(in oklab, var(--chip-fg), transparent 45%);
|
|
473
|
+
background: color-mix(in oklab, var(--kit-chip-bg), transparent 70%);
|
|
474
|
+
color: color-mix(in oklab, var(--kit-chip-fg), transparent 45%);
|
|
484
475
|
}
|
|
485
476
|
|
|
486
477
|
.kit-chip[data-disabled='true'] :global(.kit-icon),
|
|
487
478
|
.kit-chip[data-readonly='true'] :global(.kit-icon) {
|
|
488
|
-
color: color-mix(in oklab, var(--chip-fg), transparent 45%) !important;
|
|
489
|
-
--kit-icon-color: color-mix(in oklab, var(--chip-fg), transparent 45%) !important;
|
|
479
|
+
color: color-mix(in oklab, var(--kit-chip-fg), transparent 45%) !important;
|
|
480
|
+
--kit-icon-color: color-mix(in oklab, var(--kit-chip-fg), transparent 45%) !important;
|
|
490
481
|
}
|
|
491
482
|
|
|
492
483
|
.kit-chip[data-disabled='true'] :global(.kit-icon img),
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
ref = $bindable(),
|
|
10
10
|
children,
|
|
11
11
|
activator,
|
|
12
|
-
dark = false,
|
|
13
|
-
light = false,
|
|
14
12
|
rounded,
|
|
15
13
|
position = 'bottom',
|
|
16
14
|
closeOnClick = false,
|
|
@@ -54,8 +52,8 @@
|
|
|
54
52
|
let mergedStyle = $derived(
|
|
55
53
|
[
|
|
56
54
|
componentStyle,
|
|
57
|
-
background ? `--kit-dropdown-
|
|
58
|
-
color ? `--kit-dropdown-
|
|
55
|
+
background ? `--kit-dropdown-bg:${background}` : '',
|
|
56
|
+
color ? `--kit-dropdown-fg:${color}` : '',
|
|
59
57
|
typeof rounded === 'string' && rounded.includes('px')
|
|
60
58
|
? `--kit-dropdown-radius:${rounded}`
|
|
61
59
|
: ''
|
|
@@ -171,8 +169,6 @@
|
|
|
171
169
|
class={componentClass}
|
|
172
170
|
style={`left:${axis.x}px; top:${axis.y}px; ${mergedStyle}`}
|
|
173
171
|
role="menu"
|
|
174
|
-
data-light={light || undefined}
|
|
175
|
-
data-dark={dark || undefined}
|
|
176
172
|
data-rounded={rounded}
|
|
177
173
|
data-position={axis.location ?? safePosition}
|
|
178
174
|
onmouseover={() => handleMouseEvent('open', activatorRef)}
|
|
@@ -190,10 +186,10 @@
|
|
|
190
186
|
|
|
191
187
|
<style>
|
|
192
188
|
.kit-dropdown-content {
|
|
193
|
-
--kit-dropdown-
|
|
194
|
-
--kit-dropdown-
|
|
189
|
+
--kit-dropdown-bg: var(--kit-surface-1);
|
|
190
|
+
--kit-dropdown-fg: var(--kit-fg);
|
|
195
191
|
--kit-dropdown-radius: 12px;
|
|
196
|
-
--kit-dropdown-
|
|
192
|
+
--kit-dropdown-bd: color-mix(in oklab, var(--kit-fg), transparent 88%);
|
|
197
193
|
--kit-dropdown-shadow: 0 18px 40px -18px color-mix(in oklab, black 24%, transparent);
|
|
198
194
|
|
|
199
195
|
position: fixed;
|
|
@@ -201,26 +197,15 @@
|
|
|
201
197
|
min-width: 12rem;
|
|
202
198
|
max-width: min(22rem, calc(100vw - 1rem));
|
|
203
199
|
padding: 0.375rem;
|
|
204
|
-
border: 1px solid var(--kit-dropdown-
|
|
200
|
+
border: 1px solid var(--kit-dropdown-bd);
|
|
205
201
|
border-radius: var(--kit-dropdown-radius);
|
|
206
|
-
background: var(--kit-dropdown-
|
|
207
|
-
color: var(--kit-dropdown-
|
|
202
|
+
background: var(--kit-dropdown-bg);
|
|
203
|
+
color: var(--kit-dropdown-fg);
|
|
208
204
|
box-shadow: var(--kit-dropdown-shadow);
|
|
209
205
|
transform-origin: top left;
|
|
210
206
|
animation: kit-dropdown-enter 140ms ease;
|
|
211
207
|
}
|
|
212
208
|
|
|
213
|
-
.kit-dropdown-content[data-light='true'] {
|
|
214
|
-
--kit-dropdown-background: color-mix(in oklab, white 94%, var(--kit-surface-1));
|
|
215
|
-
--kit-dropdown-color: var(--kit-fg);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.kit-dropdown-content[data-dark='true'] {
|
|
219
|
-
--kit-dropdown-background: color-mix(in oklab, black 78%, var(--kit-surface-3));
|
|
220
|
-
--kit-dropdown-color: white;
|
|
221
|
-
--kit-dropdown-border: color-mix(in oklab, white, transparent 80%);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
209
|
.kit-dropdown-content[data-rounded='0'] {
|
|
225
210
|
--kit-dropdown-radius: 0;
|
|
226
211
|
}
|
|
@@ -12,8 +12,6 @@ export type ModelDropdownProps = {
|
|
|
12
12
|
};
|
|
13
13
|
export interface DropdownProps extends Component {
|
|
14
14
|
ref?: HTMLElement | null;
|
|
15
|
-
dark?: boolean;
|
|
16
|
-
light?: boolean;
|
|
17
15
|
rounded?: RoundedType | string;
|
|
18
16
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
19
17
|
openOnHover?: boolean;
|
|
@@ -94,10 +94,30 @@
|
|
|
94
94
|
--kit-list-fg: var(--kit-fg);
|
|
95
95
|
--kit-list-bd: var(--kit-border);
|
|
96
96
|
--kit-list-radius: 10px;
|
|
97
|
-
--kit-list-item-h: 2.
|
|
98
|
-
--kit-list-item-
|
|
99
|
-
--kit-list-item-
|
|
100
|
-
--kit-list-item-
|
|
97
|
+
--kit-list-item-h-xs: 2.125rem;
|
|
98
|
+
--kit-list-item-h-sm: 2.375rem;
|
|
99
|
+
--kit-list-item-h-md: 2.75rem;
|
|
100
|
+
--kit-list-item-h-lg: 3.125rem;
|
|
101
|
+
--kit-list-item-h-xl: 3.5rem;
|
|
102
|
+
--kit-list-item-px-xs: 0.625rem;
|
|
103
|
+
--kit-list-item-px-sm: 0.75rem;
|
|
104
|
+
--kit-list-item-px-md: 0.875rem;
|
|
105
|
+
--kit-list-item-px-lg: 1rem;
|
|
106
|
+
--kit-list-item-px-xl: 1.125rem;
|
|
107
|
+
--kit-list-item-gap-xs: 0.5rem;
|
|
108
|
+
--kit-list-item-gap-sm: 0.5rem;
|
|
109
|
+
--kit-list-item-gap-md: 0.625rem;
|
|
110
|
+
--kit-list-item-gap-lg: 0.75rem;
|
|
111
|
+
--kit-list-item-gap-xl: 0.875rem;
|
|
112
|
+
--kit-list-item-font-xs: 0.75rem;
|
|
113
|
+
--kit-list-item-font-sm: 0.875rem;
|
|
114
|
+
--kit-list-item-font-md: 0.9375rem;
|
|
115
|
+
--kit-list-item-font-lg: 1rem;
|
|
116
|
+
--kit-list-item-font-xl: 1.0625rem;
|
|
117
|
+
--kit-list-item-h: var(--kit-list-item-h-md);
|
|
118
|
+
--kit-list-item-px: var(--kit-list-item-px-md);
|
|
119
|
+
--kit-list-item-gap: var(--kit-list-item-gap-md);
|
|
120
|
+
--kit-list-item-font: var(--kit-list-item-font-md);
|
|
101
121
|
|
|
102
122
|
display: flex;
|
|
103
123
|
flex-direction: column;
|
|
@@ -114,38 +134,38 @@
|
|
|
114
134
|
}
|
|
115
135
|
|
|
116
136
|
.kit-list[data-size='xs'] {
|
|
117
|
-
--kit-list-item-h:
|
|
118
|
-
--kit-list-item-px:
|
|
119
|
-
--kit-list-item-gap:
|
|
120
|
-
--kit-list-item-font:
|
|
137
|
+
--kit-list-item-h: var(--kit-list-item-h-xs);
|
|
138
|
+
--kit-list-item-px: var(--kit-list-item-px-xs);
|
|
139
|
+
--kit-list-item-gap: var(--kit-list-item-gap-xs);
|
|
140
|
+
--kit-list-item-font: var(--kit-list-item-font-xs);
|
|
121
141
|
}
|
|
122
142
|
|
|
123
143
|
.kit-list[data-size='sm'] {
|
|
124
|
-
--kit-list-item-h:
|
|
125
|
-
--kit-list-item-px:
|
|
126
|
-
--kit-list-item-gap:
|
|
127
|
-
--kit-list-item-font:
|
|
144
|
+
--kit-list-item-h: var(--kit-list-item-h-sm);
|
|
145
|
+
--kit-list-item-px: var(--kit-list-item-px-sm);
|
|
146
|
+
--kit-list-item-gap: var(--kit-list-item-gap-sm);
|
|
147
|
+
--kit-list-item-font: var(--kit-list-item-font-sm);
|
|
128
148
|
}
|
|
129
149
|
|
|
130
150
|
.kit-list[data-size='md'] {
|
|
131
|
-
--kit-list-item-h:
|
|
132
|
-
--kit-list-item-px:
|
|
133
|
-
--kit-list-item-gap:
|
|
134
|
-
--kit-list-item-font:
|
|
151
|
+
--kit-list-item-h: var(--kit-list-item-h-md);
|
|
152
|
+
--kit-list-item-px: var(--kit-list-item-px-md);
|
|
153
|
+
--kit-list-item-gap: var(--kit-list-item-gap-md);
|
|
154
|
+
--kit-list-item-font: var(--kit-list-item-font-md);
|
|
135
155
|
}
|
|
136
156
|
|
|
137
157
|
.kit-list[data-size='lg'] {
|
|
138
|
-
--kit-list-item-h:
|
|
139
|
-
--kit-list-item-px:
|
|
140
|
-
--kit-list-item-gap:
|
|
141
|
-
--kit-list-item-font:
|
|
158
|
+
--kit-list-item-h: var(--kit-list-item-h-lg);
|
|
159
|
+
--kit-list-item-px: var(--kit-list-item-px-lg);
|
|
160
|
+
--kit-list-item-gap: var(--kit-list-item-gap-lg);
|
|
161
|
+
--kit-list-item-font: var(--kit-list-item-font-lg);
|
|
142
162
|
}
|
|
143
163
|
|
|
144
164
|
.kit-list[data-size='xl'] {
|
|
145
|
-
--kit-list-item-h:
|
|
146
|
-
--kit-list-item-px:
|
|
147
|
-
--kit-list-item-gap:
|
|
148
|
-
--kit-list-item-font:
|
|
165
|
+
--kit-list-item-h: var(--kit-list-item-h-xl);
|
|
166
|
+
--kit-list-item-px: var(--kit-list-item-px-xl);
|
|
167
|
+
--kit-list-item-gap: var(--kit-list-item-gap-xl);
|
|
168
|
+
--kit-list-item-font: var(--kit-list-item-font-xl);
|
|
149
169
|
}
|
|
150
170
|
|
|
151
171
|
.kit-list[data-density='compact'] {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
.kit-list-item {
|
|
100
100
|
--kit-list-item-bg: transparent;
|
|
101
101
|
--kit-list-item-fg: inherit;
|
|
102
|
-
--list-item-
|
|
102
|
+
--kit-list-item-radius: 8px;
|
|
103
103
|
|
|
104
104
|
position: relative;
|
|
105
105
|
display: grid;
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
min-height: var(--kit-list-item-h, 2.75rem);
|
|
110
110
|
padding-inline: var(--kit-list-item-px, 0.875rem);
|
|
111
111
|
border: 0;
|
|
112
|
-
border-radius: var(--list-item-
|
|
112
|
+
border-radius: var(--kit-list-item-radius);
|
|
113
113
|
background: var(--kit-list-item-bg);
|
|
114
114
|
color: var(--kit-list-item-fg);
|
|
115
115
|
text-decoration: none;
|
|
@@ -119,34 +119,34 @@
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.kit-list-item[data-rounded='0'] {
|
|
122
|
-
--list-item-
|
|
122
|
+
--kit-list-item-radius: 0;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
.kit-list-item[data-rounded='xs'] {
|
|
126
|
-
--list-item-
|
|
126
|
+
--kit-list-item-radius: 2px;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.kit-list-item[data-rounded='sm'] {
|
|
130
|
-
--list-item-
|
|
130
|
+
--kit-list-item-radius: 8px;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
.kit-list-item[data-rounded='md'] {
|
|
134
|
-
--list-item-
|
|
134
|
+
--kit-list-item-radius: 12px;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
.kit-list-item[data-rounded='lg'] {
|
|
138
|
-
--list-item-
|
|
138
|
+
--kit-list-item-radius: 16px;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
.kit-list-item[data-rounded='xl'] {
|
|
142
|
-
--list-item-
|
|
142
|
+
--kit-list-item-radius: 9999px;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.kit-list[data-variant='filled'] .kit-list-item {
|
|
145
|
+
:global(.kit-list[data-variant='filled']) .kit-list-item {
|
|
146
146
|
background: var(--kit-list-item-bg, transparent);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.kit-list[data-variant='outline'] .kit-list-item::before {
|
|
149
|
+
:global(.kit-list[data-variant='outline']) .kit-list-item::before {
|
|
150
150
|
content: '';
|
|
151
151
|
position: absolute;
|
|
152
152
|
inset: 0;
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
open = $bindable(false),
|
|
10
10
|
children,
|
|
11
11
|
activator,
|
|
12
|
-
dark = false,
|
|
13
|
-
light = false,
|
|
14
12
|
rounded,
|
|
15
13
|
position = 'bottom',
|
|
16
14
|
color,
|
|
@@ -52,8 +50,8 @@
|
|
|
52
50
|
let mergedStyle = $derived(
|
|
53
51
|
[
|
|
54
52
|
componentStyle,
|
|
55
|
-
background ? `--kit-popover-
|
|
56
|
-
color ? `--kit-popover-
|
|
53
|
+
background ? `--kit-popover-bg:${background}` : '',
|
|
54
|
+
color ? `--kit-popover-fg:${color}` : '',
|
|
57
55
|
typeof rounded === 'string' && rounded.includes('px') ? `--kit-popover-radius:${rounded}` : ''
|
|
58
56
|
]
|
|
59
57
|
.filter(Boolean)
|
|
@@ -122,8 +120,6 @@
|
|
|
122
120
|
class={componentClass}
|
|
123
121
|
style={`left:${axis.x}px; top:${axis.y}px; ${mergedStyle}`}
|
|
124
122
|
role="dialog"
|
|
125
|
-
data-light={light || undefined}
|
|
126
|
-
data-dark={dark || undefined}
|
|
127
123
|
data-rounded={rounded}
|
|
128
124
|
data-position={axis.location ?? safePosition}
|
|
129
125
|
use:clickOutside={{ exclude: [contentRef, activatorRef], onClose: () => (open = false) }}
|
|
@@ -135,10 +131,10 @@
|
|
|
135
131
|
|
|
136
132
|
<style>
|
|
137
133
|
.kit-popover-content {
|
|
138
|
-
--kit-popover-
|
|
139
|
-
--kit-popover-
|
|
134
|
+
--kit-popover-bg: var(--kit-surface-1);
|
|
135
|
+
--kit-popover-fg: var(--kit-fg);
|
|
140
136
|
--kit-popover-radius: 12px;
|
|
141
|
-
--kit-popover-
|
|
137
|
+
--kit-popover-bd: color-mix(in oklab, var(--kit-fg), transparent 88%);
|
|
142
138
|
--kit-popover-shadow: 0 18px 40px -18px color-mix(in oklab, black 24%, transparent);
|
|
143
139
|
|
|
144
140
|
position: fixed;
|
|
@@ -147,26 +143,15 @@
|
|
|
147
143
|
width: auto;
|
|
148
144
|
max-width: min(28rem, calc(100vw - 1rem));
|
|
149
145
|
padding: 1rem;
|
|
150
|
-
border: 1px solid var(--kit-popover-
|
|
146
|
+
border: 1px solid var(--kit-popover-bd);
|
|
151
147
|
border-radius: var(--kit-popover-radius);
|
|
152
|
-
background: var(--kit-popover-
|
|
153
|
-
color: var(--kit-popover-
|
|
148
|
+
background: var(--kit-popover-bg);
|
|
149
|
+
color: var(--kit-popover-fg);
|
|
154
150
|
box-shadow: var(--kit-popover-shadow);
|
|
155
151
|
opacity: 1;
|
|
156
152
|
transition: opacity 140ms ease;
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
.kit-popover-content[data-light='true'] {
|
|
160
|
-
--kit-popover-background: color-mix(in oklab, white 94%, var(--kit-surface-1));
|
|
161
|
-
--kit-popover-color: var(--kit-fg);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.kit-popover-content[data-dark='true'] {
|
|
165
|
-
--kit-popover-background: color-mix(in oklab, black 78%, var(--kit-surface-3));
|
|
166
|
-
--kit-popover-color: white;
|
|
167
|
-
--kit-popover-border: color-mix(in oklab, white, transparent 80%);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
155
|
.kit-popover-content[data-rounded='0'] {
|
|
171
156
|
--kit-popover-radius: 0;
|
|
172
157
|
}
|
|
@@ -11,8 +11,6 @@ export type ModelPopoverProps = {
|
|
|
11
11
|
export interface PopoverProps extends Component {
|
|
12
12
|
ref?: HTMLElement | null;
|
|
13
13
|
open?: boolean;
|
|
14
|
-
dark?: boolean;
|
|
15
|
-
light?: boolean;
|
|
16
14
|
rounded?: RoundedType | string;
|
|
17
15
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
18
16
|
color?: string;
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(),
|
|
8
8
|
is = 'hr',
|
|
9
|
-
light = false,
|
|
10
|
-
dark = false,
|
|
11
9
|
inset = false,
|
|
12
10
|
thickness,
|
|
13
11
|
orientation = 'horizontal',
|
|
@@ -72,8 +70,6 @@
|
|
|
72
70
|
style={mergedStyle}
|
|
73
71
|
role="separator"
|
|
74
72
|
aria-orientation={safeOrientation}
|
|
75
|
-
data-light={light || undefined}
|
|
76
|
-
data-dark={dark || undefined}
|
|
77
73
|
data-inset={inset || undefined}
|
|
78
74
|
data-orientation={safeOrientation}
|
|
79
75
|
/>
|
|
@@ -96,14 +92,6 @@
|
|
|
96
92
|
transition: inherit;
|
|
97
93
|
}
|
|
98
94
|
|
|
99
|
-
.kit-separator[data-light='true'] {
|
|
100
|
-
--kit-separator-color: color-mix(in oklab, var(--kit-fg), white 40%);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.kit-separator[data-dark='true'] {
|
|
104
|
-
--kit-separator-color: color-mix(in oklab, white, transparent 18%);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
95
|
.kit-separator[data-inset]:not([data-orientation='vertical']) {
|
|
108
96
|
max-width: calc(100% - 4.5rem);
|
|
109
97
|
margin-inline-start: 4.5rem;
|