lapikit 0.6.3 → 0.6.5
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/accordion/accordion.svelte +173 -35
- package/dist/components/accordion/accordion.types.d.ts +8 -3
- package/dist/components/accordion/modules/accordion-item.svelte +79 -74
- package/dist/components/alert/alert.svelte +204 -115
- package/dist/components/alert/alert.types.d.ts +8 -6
- package/dist/components/app/app.svelte +76 -37
- package/dist/components/appbar/appbar.svelte +116 -59
- package/dist/components/appbar/appbar.types.d.ts +5 -4
- package/dist/components/aspect-ratio/aspect-ratio.svelte +4 -13
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +2 -1
- package/dist/components/avatar/avatar.svelte +117 -67
- package/dist/components/avatar/avatar.types.d.ts +7 -5
- package/dist/components/btn/btn.svelte +175 -171
- package/dist/components/btn/btn.types.d.ts +5 -2
- package/dist/components/card/card.svelte +11 -3
- package/dist/components/card/modules/card-actions.svelte +1 -1
- package/dist/components/chip/chip.svelte +172 -142
- package/dist/components/chip/chip.types.d.ts +7 -3
- package/dist/components/dialog/dialog.svelte +94 -83
- package/dist/components/dialog/dialog.types.d.ts +7 -5
- package/dist/components/dropdown/dropdown.svelte +47 -31
- package/dist/components/dropdown/dropdown.types.d.ts +4 -2
- package/dist/components/icon/icon.svelte +34 -51
- package/dist/components/list/list.svelte +10 -4
- package/dist/components/list/modules/list-item.svelte +10 -59
- package/dist/components/modal/modal.svelte +114 -102
- package/dist/components/modal/modal.types.d.ts +7 -5
- package/dist/components/popover/popover.svelte +54 -36
- package/dist/components/popover/popover.types.d.ts +4 -2
- package/dist/components/separator/separator.svelte +15 -23
- package/dist/components/separator/separator.types.d.ts +1 -2
- package/dist/components/textfield/textfield.svelte +181 -152
- package/dist/components/textfield/textfield.types.d.ts +4 -3
- package/dist/components/toolbar/toolbar.svelte +127 -103
- package/dist/components/toolbar/toolbar.types.d.ts +6 -7
- package/dist/components/tooltip/tooltip.svelte +40 -40
- package/dist/components/tooltip/tooltip.types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { useClassName, useStyles } from '../../utils';
|
|
2
|
+
import { useClassName, useElevation, useStyles } from '../../utils';
|
|
3
3
|
import { makeComponentProps } from '../../html-mapped';
|
|
4
4
|
import { ripple } from '../../animations';
|
|
5
5
|
import type { ChipProps } from './chip.types.js';
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
's-style': sStyle,
|
|
15
15
|
variant = 'filled',
|
|
16
16
|
density = 'default',
|
|
17
|
+
rounded = 'full',
|
|
17
18
|
loading,
|
|
18
19
|
active = false,
|
|
19
|
-
size = '
|
|
20
|
+
size = 'md',
|
|
20
21
|
labelStyle = false,
|
|
21
22
|
disabled = false,
|
|
22
23
|
href,
|
|
@@ -30,31 +31,18 @@
|
|
|
30
31
|
append,
|
|
31
32
|
prepend,
|
|
32
33
|
readonly = false,
|
|
34
|
+
elevation,
|
|
35
|
+
background,
|
|
36
|
+
color,
|
|
33
37
|
...rest
|
|
34
38
|
}: ChipProps = $props();
|
|
35
39
|
|
|
36
|
-
let safeVariant = $derived(
|
|
37
|
-
variant === 'filled' || variant === 'outline' || variant === 'text' || variant === 'link'
|
|
38
|
-
? variant
|
|
39
|
-
: 'filled'
|
|
40
|
-
);
|
|
41
|
-
let safeSize = $derived(
|
|
42
|
-
size === 'default'
|
|
43
|
-
? 'md'
|
|
44
|
-
: size === 'xs' || size === 'sm' || size === 'md' || size === 'lg' || size === 'xl'
|
|
45
|
-
? size
|
|
46
|
-
: 'md'
|
|
47
|
-
);
|
|
48
|
-
let safeDensity = $derived(
|
|
49
|
-
density === 'compact' || density === 'comfortable' || density === 'default'
|
|
50
|
-
? density
|
|
51
|
-
: 'default'
|
|
52
|
-
);
|
|
53
|
-
|
|
54
40
|
let { classProps, styleProps, restProps } = $derived(
|
|
55
41
|
makeComponentProps(rest as Record<string, unknown>)
|
|
56
42
|
);
|
|
57
43
|
|
|
44
|
+
let elevationState = $derived(useElevation(elevation));
|
|
45
|
+
|
|
58
46
|
let componentClass = $derived(
|
|
59
47
|
useClassName({
|
|
60
48
|
baseClass: 'kit-chip',
|
|
@@ -99,6 +87,16 @@
|
|
|
99
87
|
const resolvedDisabled = $derived((tag === 'button' && isLocked) || undefined);
|
|
100
88
|
|
|
101
89
|
const resolvedType = $derived(tag !== 'button' ? type : (type ?? 'button'));
|
|
90
|
+
|
|
91
|
+
let resolvedStyle = $derived(
|
|
92
|
+
[
|
|
93
|
+
componentStyle,
|
|
94
|
+
color ? `--kit-chip-fg:${color && `var(--kit-color-${color})`}` : '',
|
|
95
|
+
background ? `--kit-chip-bg:${background && `var(--kit-color-${background})`}` : ''
|
|
96
|
+
]
|
|
97
|
+
.filter(Boolean)
|
|
98
|
+
.join('; ')
|
|
99
|
+
);
|
|
102
100
|
</script>
|
|
103
101
|
|
|
104
102
|
{#if isInput}
|
|
@@ -106,24 +104,28 @@
|
|
|
106
104
|
this={inputWrapperTag}
|
|
107
105
|
bind:this={ref}
|
|
108
106
|
class={componentClass}
|
|
109
|
-
style={
|
|
110
|
-
data-size={
|
|
111
|
-
data-variant={
|
|
107
|
+
style={resolvedStyle}
|
|
108
|
+
data-size={size}
|
|
109
|
+
data-variant={variant}
|
|
110
|
+
data-rounded={rounded}
|
|
112
111
|
data-loading={loading}
|
|
113
112
|
data-active={active}
|
|
114
113
|
data-disabled={isDisabled}
|
|
115
114
|
data-readonly={isReadonly}
|
|
116
|
-
data-density={
|
|
115
|
+
data-density={density}
|
|
117
116
|
data-label-style={labelStyle}
|
|
118
117
|
data-interactive={isInteractive}
|
|
119
118
|
aria-busy={loading}
|
|
120
119
|
aria-disabled={isLocked || undefined}
|
|
120
|
+
data-elevation={elevationState.base}
|
|
121
|
+
data-elevation-hover={elevationState.hover}
|
|
122
|
+
data-elevation-active={elevationState.active}
|
|
121
123
|
use:ripple={{
|
|
122
124
|
component: 'chip',
|
|
123
125
|
disabled: noRipple || isLocked
|
|
124
126
|
}}
|
|
125
127
|
>
|
|
126
|
-
{#if
|
|
128
|
+
{#if variant === 'outline'}
|
|
127
129
|
<span class="outline"></span>
|
|
128
130
|
{/if}
|
|
129
131
|
<input
|
|
@@ -149,29 +151,35 @@
|
|
|
149
151
|
this={tag}
|
|
150
152
|
bind:this={ref}
|
|
151
153
|
class={componentClass}
|
|
152
|
-
style={
|
|
153
|
-
{...restProps}
|
|
154
|
+
style={resolvedStyle}
|
|
154
155
|
type={resolvedType}
|
|
155
156
|
href={resolvedHref}
|
|
156
|
-
data-size={
|
|
157
|
-
data-variant={
|
|
157
|
+
data-size={size}
|
|
158
|
+
data-variant={variant}
|
|
159
|
+
data-rounded={rounded}
|
|
158
160
|
data-loading={loading}
|
|
159
161
|
data-active={active}
|
|
160
162
|
data-disabled={isDisabled}
|
|
161
163
|
data-readonly={isReadonly}
|
|
162
|
-
data-density={
|
|
164
|
+
data-density={density}
|
|
163
165
|
data-label-style={labelStyle}
|
|
164
166
|
data-interactive={isInteractive}
|
|
165
167
|
disabled={resolvedDisabled}
|
|
166
168
|
aria-busy={loading}
|
|
169
|
+
data-elevation={elevationState.base}
|
|
170
|
+
data-elevation-hover={elevationState.hover}
|
|
171
|
+
data-elevation-active={elevationState.active}
|
|
167
172
|
aria-disabled={((tag === 'a' || tag === 'div') && isLocked) || undefined}
|
|
168
173
|
tabindex={tag === 'a' && isLocked ? -1 : undefined}
|
|
169
174
|
use:ripple={{
|
|
170
175
|
component: 'chip',
|
|
171
176
|
disabled: noRipple || !isInteractive
|
|
172
177
|
}}
|
|
178
|
+
// style:--kit-chip-fg={color && `var(--kit-color-${color})`}
|
|
179
|
+
// style:--kit-chip-bg={background && `var(--kit-color-${background})`}
|
|
180
|
+
{...restProps}
|
|
173
181
|
>
|
|
174
|
-
{#if
|
|
182
|
+
{#if variant === 'outline'}
|
|
175
183
|
<span class="outline"></span>
|
|
176
184
|
{/if}
|
|
177
185
|
|
|
@@ -227,26 +235,6 @@
|
|
|
227
235
|
}
|
|
228
236
|
|
|
229
237
|
.kit-chip {
|
|
230
|
-
--kit-chip-bg: var(--kit-surface-2);
|
|
231
|
-
--kit-chip-fg: var(--kit-fg);
|
|
232
|
-
--kit-chip-bd: var(--kit-border);
|
|
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%);
|
|
235
|
-
--kit-chip-h-xs: 24px;
|
|
236
|
-
--kit-chip-h-sm: 28px;
|
|
237
|
-
--kit-chip-h-md: 32px;
|
|
238
|
-
--kit-chip-h-lg: 36px;
|
|
239
|
-
--kit-chip-h-xl: 40px;
|
|
240
|
-
--kit-chip-px-xs: 8px;
|
|
241
|
-
--kit-chip-px-sm: 10px;
|
|
242
|
-
--kit-chip-px-md: 12px;
|
|
243
|
-
--kit-chip-px-lg: 14px;
|
|
244
|
-
--kit-chip-px-xl: 16px;
|
|
245
|
-
--kit-chip-density-scale: 1;
|
|
246
|
-
--kit-chip-density-h-scale: 1;
|
|
247
|
-
--kit-chip-radius: 99999px;
|
|
248
|
-
--kit-chip-gap: 0.35em;
|
|
249
|
-
|
|
250
238
|
position: relative;
|
|
251
239
|
display: inline-flex;
|
|
252
240
|
box-sizing: border-box;
|
|
@@ -255,7 +243,7 @@
|
|
|
255
243
|
font-family: var(--kit-font);
|
|
256
244
|
background: var(--kit-chip-bg);
|
|
257
245
|
color: var(--kit-chip-fg);
|
|
258
|
-
height:
|
|
246
|
+
height: calc(var(--kit-chip-h) * var(--kit-chip-density-h-scale));
|
|
259
247
|
padding-inline: calc(var(--kit-chip-px) * var(--kit-chip-density-scale));
|
|
260
248
|
border-radius: var(--kit-chip-radius);
|
|
261
249
|
text-decoration: none;
|
|
@@ -313,96 +301,6 @@
|
|
|
313
301
|
cursor: pointer;
|
|
314
302
|
}
|
|
315
303
|
|
|
316
|
-
.kit-chip[data-variant='filled'] {
|
|
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%);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.kit-chip[data-variant='outline'] {
|
|
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
|
-
}
|
|
330
|
-
|
|
331
|
-
.kit-chip[data-variant='text'] {
|
|
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%);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.kit-chip[data-variant='link'] {
|
|
339
|
-
--kit-chip-bg: transparent;
|
|
340
|
-
--kit-chip-fg: var(--kit-accent);
|
|
341
|
-
--kit-chip-decoration: underline;
|
|
342
|
-
height: inherit;
|
|
343
|
-
padding: 0;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.kit-chip[data-size='xs'] {
|
|
347
|
-
--kit-chip-h: var(--kit-chip-h-xs);
|
|
348
|
-
--kit-chip-px: var(--kit-chip-px-xs);
|
|
349
|
-
font-size: 12px;
|
|
350
|
-
}
|
|
351
|
-
.kit-chip[data-size='xs'] :global(.kit-icon:not([data-size])) {
|
|
352
|
-
--kit-icon-current-size: var(--kit-icon-size-xs);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.kit-chip[data-size='sm'] {
|
|
356
|
-
--kit-chip-h: var(--kit-chip-h-sm);
|
|
357
|
-
--kit-chip-px: var(--kit-chip-px-sm);
|
|
358
|
-
font-size: 13px;
|
|
359
|
-
}
|
|
360
|
-
.kit-chip[data-size='sm'] :global(.kit-icon:not([data-size])) {
|
|
361
|
-
--kit-icon-current-size: var(--kit-icon-size-sm);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.kit-chip[data-size='md'] {
|
|
365
|
-
--kit-chip-h: var(--kit-chip-h-md);
|
|
366
|
-
--kit-chip-px: var(--kit-chip-px-md);
|
|
367
|
-
font-size: 14px;
|
|
368
|
-
}
|
|
369
|
-
.kit-chip[data-size='md'] :global(.kit-icon:not([data-size])) {
|
|
370
|
-
--kit-icon-current-size: var(--kit-icon-size-md);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.kit-chip[data-size='lg'] {
|
|
374
|
-
--kit-chip-h: var(--kit-chip-h-lg);
|
|
375
|
-
--kit-chip-px: var(--kit-chip-px-lg);
|
|
376
|
-
font-size: 15px;
|
|
377
|
-
}
|
|
378
|
-
.kit-chip[data-size='lg'] :global(.kit-icon:not([data-size])) {
|
|
379
|
-
--kit-icon-current-size: var(--kit-icon-size-lg);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.kit-chip[data-size='xl'] {
|
|
383
|
-
--kit-chip-h: var(--kit-chip-h-xl);
|
|
384
|
-
--kit-chip-px: var(--kit-chip-px-xl);
|
|
385
|
-
font-size: 16px;
|
|
386
|
-
}
|
|
387
|
-
.kit-chip[data-size='xl'] :global(.kit-icon:not([data-size])) {
|
|
388
|
-
--kit-icon-current-size: var(--kit-icon-size-xl);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
.kit-chip[data-density='default'] {
|
|
392
|
-
--kit-chip-density-scale: 1;
|
|
393
|
-
--kit-chip-density-h-scale: 1;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
.kit-chip[data-density='compact'] {
|
|
397
|
-
--kit-chip-density-scale: 0.92;
|
|
398
|
-
--kit-chip-density-h-scale: 0.9;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.kit-chip[data-density='comfortable'] {
|
|
402
|
-
--kit-chip-density-scale: 1.08;
|
|
403
|
-
--kit-chip-density-h-scale: 1.08;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
304
|
.kit-chip[data-label-style='true'] {
|
|
407
305
|
font-weight: 600;
|
|
408
306
|
letter-spacing: 0.01em;
|
|
@@ -424,6 +322,7 @@
|
|
|
424
322
|
align-items: center;
|
|
425
323
|
justify-content: center;
|
|
426
324
|
line-height: 1;
|
|
325
|
+
font-weight: normal;
|
|
427
326
|
}
|
|
428
327
|
|
|
429
328
|
.kit-chip__content :global(.kit-icon),
|
|
@@ -489,4 +388,135 @@
|
|
|
489
388
|
.kit-chip[data-disabled='true'] > input {
|
|
490
389
|
cursor: default;
|
|
491
390
|
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* size
|
|
394
|
+
* @link nothing...
|
|
395
|
+
*/
|
|
396
|
+
.kit-chip[data-size='xs'] {
|
|
397
|
+
--kit-chip-h: 24px;
|
|
398
|
+
--kit-chip-px: 8px;
|
|
399
|
+
--kit-chip-gap: 4px;
|
|
400
|
+
--kit-chip-font: 0.75rem;
|
|
401
|
+
}
|
|
402
|
+
.kit-chip[data-size='xs'] :global(.kit-icon:not([data-size])) {
|
|
403
|
+
--kit-icon-current-size: var(--kit-icon-size-xs);
|
|
404
|
+
}
|
|
405
|
+
.kit-chip[data-size='sm'] {
|
|
406
|
+
--kit-chip-h: 28px;
|
|
407
|
+
--kit-chip-px: 10px;
|
|
408
|
+
--kit-chip-gap: 6px;
|
|
409
|
+
--kit-chip-font: 0.875rem;
|
|
410
|
+
}
|
|
411
|
+
.kit-chip[data-size='sm'] :global(.kit-icon:not([data-size])) {
|
|
412
|
+
--kit-icon-current-size: var(--kit-icon-size-sm);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.kit-chip[data-size='md'] {
|
|
416
|
+
--kit-chip-h: 32px;
|
|
417
|
+
--kit-chip-px: 12px;
|
|
418
|
+
--kit-chip-gap: 8px;
|
|
419
|
+
--kit-chip-font: 1rem;
|
|
420
|
+
}
|
|
421
|
+
.kit-chip[data-size='md'] :global(.kit-icon:not([data-size])) {
|
|
422
|
+
--kit-icon-current-size: var(--kit-icon-size-md);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.kit-chip[data-size='lg'] {
|
|
426
|
+
--kit-chip-h: 36px;
|
|
427
|
+
--kit-chip-px: 14px;
|
|
428
|
+
--kit-chip-gap: 10px;
|
|
429
|
+
--kit-chip-font: 1.125rem;
|
|
430
|
+
}
|
|
431
|
+
.kit-chip[data-size='lg'] :global(.kit-icon:not([data-size])) {
|
|
432
|
+
--kit-icon-current-size: var(--kit-icon-size-lg);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.kit-chip[data-size='xl'] {
|
|
436
|
+
--kit-chip-h: 40px;
|
|
437
|
+
--kit-chip-px: 16px;
|
|
438
|
+
--kit-chip-gap: 12px;
|
|
439
|
+
--kit-chip-font: 1.25rem;
|
|
440
|
+
}
|
|
441
|
+
.kit-chip[data-size='xl'] :global(.kit-icon:not([data-size])) {
|
|
442
|
+
--kit-icon-current-size: var(--kit-icon-size-xl);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* density
|
|
447
|
+
* @link no links
|
|
448
|
+
*/
|
|
449
|
+
.kit-chip[data-density='none'] {
|
|
450
|
+
--kit-chip-density-scale: 0;
|
|
451
|
+
--kit-chip-density-h-scale: 0;
|
|
452
|
+
}
|
|
453
|
+
.kit-chip[data-density='compact'] {
|
|
454
|
+
--kit-chip-density-scale: 0.9;
|
|
455
|
+
--kit-chip-density-h-scale: 0.92;
|
|
456
|
+
}
|
|
457
|
+
.kit-chip[data-density='default'] {
|
|
458
|
+
--kit-chip-density-scale: 1;
|
|
459
|
+
--kit-chip-density-h-scale: 1;
|
|
460
|
+
}
|
|
461
|
+
.kit-chip[data-density='comfortable'] {
|
|
462
|
+
--kit-chip-density-scale: 1.1;
|
|
463
|
+
--kit-chip-density-h-scale: 1.15;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* rounded
|
|
468
|
+
* @link ...
|
|
469
|
+
*/
|
|
470
|
+
.kit-chip[data-rounded='0'] {
|
|
471
|
+
--kit-chip-radius: var(--kit-shape-none);
|
|
472
|
+
}
|
|
473
|
+
.kit-chip[data-rounded='xs'] {
|
|
474
|
+
--kit-chip-radius: var(--kit-shape-xs);
|
|
475
|
+
}
|
|
476
|
+
.kit-chip[data-rounded='sm'] {
|
|
477
|
+
--kit-chip-radius: var(--kit-shape-sm);
|
|
478
|
+
}
|
|
479
|
+
.kit-chip[data-rounded='md'] {
|
|
480
|
+
--kit-chip-radius: var(--kit-shape-md);
|
|
481
|
+
}
|
|
482
|
+
.kit-chip[data-rounded='lg'] {
|
|
483
|
+
--kit-chip-radius: var(--kit-shape-lg);
|
|
484
|
+
}
|
|
485
|
+
.kit-chip[data-rounded='xl'] {
|
|
486
|
+
--kit-chip-radius: var(--kit-shape-xl);
|
|
487
|
+
}
|
|
488
|
+
.kit-chip[data-rounded='full'] {
|
|
489
|
+
--kit-chip-radius: var(--kit-shape-full);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* variant
|
|
494
|
+
* @link no links...
|
|
495
|
+
*/
|
|
496
|
+
.kit-chip[data-variant='filled'] {
|
|
497
|
+
--kit-chip-bg: var(--kit-color-surface-2);
|
|
498
|
+
--kit-chip-fg: var(--kit-color-text);
|
|
499
|
+
|
|
500
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-bg), black 10%);
|
|
501
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-bg), black 16%);
|
|
502
|
+
}
|
|
503
|
+
.kit-chip[data-variant='outline'] {
|
|
504
|
+
--kit-chip-bg: transparent;
|
|
505
|
+
--kit-chip-fg: var(--kit-color-text);
|
|
506
|
+
--kit-chip-bd: var(--kit-chip-fg);
|
|
507
|
+
|
|
508
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 80%);
|
|
509
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 92%);
|
|
510
|
+
}
|
|
511
|
+
.kit-chip[data-variant='text'] {
|
|
512
|
+
--kit-chip-bg: transparent;
|
|
513
|
+
--kit-chip-fg: var(--kit-color-text);
|
|
514
|
+
|
|
515
|
+
--kit-chip-hover-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 80%);
|
|
516
|
+
--kit-chip-active-bg: color-mix(in oklab, var(--kit-chip-fg), transparent 92%);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.kit-chip .outline {
|
|
520
|
+
--outline-color: var(--kit-chip-bd);
|
|
521
|
+
}
|
|
492
522
|
</style>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { Component, SizeType } from '../../@types';
|
|
1
|
+
import type { Component, DensityType, ElevationProps, RoundedType, SizeType } from '../../@types';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
export interface ChipProps extends Component {
|
|
4
4
|
ref?: HTMLElement | null;
|
|
5
5
|
is?: 'div' | 'a' | 'input' | 'button';
|
|
6
6
|
input?: boolean;
|
|
7
7
|
href?: string;
|
|
8
|
-
variant?: 'outline' | 'text' | 'filled'
|
|
9
|
-
density?:
|
|
8
|
+
variant?: 'outline' | 'text' | 'filled';
|
|
9
|
+
density?: DensityType;
|
|
10
|
+
rounded?: RoundedType | 'full';
|
|
10
11
|
active?: boolean;
|
|
11
12
|
loading?: boolean;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -21,4 +22,7 @@ export interface ChipProps extends Component {
|
|
|
21
22
|
load?: Snippet;
|
|
22
23
|
append?: Snippet;
|
|
23
24
|
prepend?: Snippet;
|
|
25
|
+
elevation?: ElevationProps;
|
|
26
|
+
background?: string;
|
|
27
|
+
color?: string;
|
|
24
28
|
}
|