lapikit 0.1.5 → 0.1.7
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/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/assets/icons/arrow-down.svelte +10 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
- package/dist/assets/icons/arrow-up.svelte +10 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
- package/dist/assets/icons/close-fill.svelte +10 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
- package/dist/components/accordion/accordion.css +113 -0
- package/dist/components/accordion/accordion.svelte +37 -0
- package/dist/components/accordion/accordion.svelte.d.ts +4 -0
- package/dist/components/accordion/accordion.svelte.js +24 -0
- package/dist/components/accordion/modules/accordion-item.svelte +94 -0
- package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/alert/alert.css +127 -0
- package/dist/components/alert/alert.svelte +89 -0
- package/dist/components/alert/alert.svelte.d.ts +4 -0
- package/dist/components/alert/types.d.ts +28 -0
- package/dist/components/alert/types.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
- package/dist/components/aspect-ratio/types.d.ts +5 -0
- package/dist/components/aspect-ratio/types.js +1 -0
- package/dist/components/avatar/avatar.css +109 -0
- package/dist/components/avatar/avatar.svelte +46 -0
- package/dist/components/avatar/avatar.svelte.d.ts +4 -0
- package/dist/components/avatar/types.d.ts +22 -0
- package/dist/components/avatar/types.js +1 -0
- package/dist/components/card/card.css +109 -0
- package/dist/components/card/card.svelte +50 -0
- package/dist/components/card/card.svelte.d.ts +4 -0
- package/dist/components/card/types.d.ts +18 -0
- package/dist/components/card/types.js +1 -0
- package/dist/components/chip/chip.css +199 -0
- package/dist/components/chip/chip.svelte +118 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +30 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +10 -0
- package/dist/components/list/list.css +195 -0
- package/dist/components/list/list.svelte +46 -0
- package/dist/components/list/list.svelte.d.ts +4 -0
- package/dist/components/list/modules/list-item.svelte +68 -0
- package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
- package/dist/components/list/types.d.ts +36 -0
- package/dist/components/list/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +142 -0
- package/dist/components/toolbar/toolbar.svelte +47 -0
- package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +27 -0
- package/dist/components/toolbar/types.js +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.kit-aspect-ratio {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 0 auto;
|
|
4
|
+
max-height: 100%;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.kit-aspect-ratio--inline {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
flex: 0 0 auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kit-aspect-ratio--sizer {
|
|
16
|
+
flex: 1 0 0px;
|
|
17
|
+
transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { AspectRationProps } from './types.js';
|
|
3
|
+
let { children, aspectRatio, inline, ...rest }: AspectRationProps = $props();
|
|
4
|
+
|
|
5
|
+
let paddingBottom = $state(0);
|
|
6
|
+
|
|
7
|
+
$effect.pre(() => {
|
|
8
|
+
if (aspectRatio) {
|
|
9
|
+
const [width, height] = aspectRatio.split('/').map(Number);
|
|
10
|
+
paddingBottom = (height / width) * 100;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
$effect(() => {
|
|
15
|
+
if (aspectRatio) {
|
|
16
|
+
const [width, height] = aspectRatio.split('/').map(Number);
|
|
17
|
+
paddingBottom = (height / width) * 100;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div {...rest} class={['kit-aspect-ratio', inline && 'kit-aspect-ratio--inline', rest.class]}>
|
|
23
|
+
<div class="kit-aspect-ratio--sizer" style={`padding-bottom: ${paddingBottom}%;`}></div>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
.kit-avatar {
|
|
2
|
+
--avatar-color: var(--on, var(--kit-on-neutral));
|
|
3
|
+
--avatar-background: var(--base, var(--kit-neutral));
|
|
4
|
+
--avatar-radius: var(--shape, var(--kit-radius-full));
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
padding-top: var(--avatar-spacing-x);
|
|
11
|
+
padding-bottom: var(--avatar-spacing-x);
|
|
12
|
+
padding-right: var(--avatar-spacing-y);
|
|
13
|
+
padding-left: var(--avatar-spacing-y);
|
|
14
|
+
|
|
15
|
+
border-width: 1px;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
border-radius: var(--avatar-radius);
|
|
18
|
+
|
|
19
|
+
/* theme */
|
|
20
|
+
color: var(--avatar-color);
|
|
21
|
+
background-color: var(--avatar-background);
|
|
22
|
+
border-color: var(--avatar-background);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.kit-avatar.kit-avatar--image {
|
|
26
|
+
position: relative;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.kit-avatar.kit-avatar--image img {
|
|
31
|
+
position: relative;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
object-fit: cover;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* size */
|
|
40
|
+
.kit-avatar[breakpoint]kit-avatar--size-xs {
|
|
41
|
+
--avatar-height: 1.75rem;
|
|
42
|
+
--avatar-multiplier-y: 2;
|
|
43
|
+
font-size: 0.75rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.kit-avatar[breakpoint]kit-avatar--size-sm {
|
|
47
|
+
--avatar-height: 2rem;
|
|
48
|
+
--avatar-multiplier-y: 3;
|
|
49
|
+
font-size: 0.875rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.kit-avatar[breakpoint]kit-avatar--size-md {
|
|
53
|
+
--avatar-height: 2.25rem;
|
|
54
|
+
--avatar-multiplier-y: 4;
|
|
55
|
+
font-size: 0.875rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.kit-avatar[breakpoint]kit-avatar--size-lg {
|
|
59
|
+
--avatar-height: 2.5rem;
|
|
60
|
+
--avatar-multiplier-y: 5;
|
|
61
|
+
font-size: 1rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.kit-avatar[breakpoint]kit-avatar--size-xl {
|
|
65
|
+
--avatar-height: 2.75rem;
|
|
66
|
+
--avatar-multiplier-y: 6;
|
|
67
|
+
font-size: 1.125rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* density */
|
|
71
|
+
.kit-avatar[breakpoint]kit-avatar--density-default {
|
|
72
|
+
height: calc(var(--avatar-height));
|
|
73
|
+
width: calc(var(--avatar-height));
|
|
74
|
+
--avatar-spacing-x: 0;
|
|
75
|
+
--avatar-spacing-y: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.kit-avatar[breakpoint]kit-avatar--density-compact {
|
|
79
|
+
height: calc(var(--avatar-height) - 0.25rem);
|
|
80
|
+
width: calc(var(--avatar-height) - 0.25rem);
|
|
81
|
+
--avatar-spacing-x: 0;
|
|
82
|
+
--avatar-spacing-y: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.kit-avatar[breakpoint]kit-avatar--density-comfortable {
|
|
86
|
+
height: calc(var(--avatar-height) + 0.25rem);
|
|
87
|
+
width: calc(var(--avatar-height) + 0.25rem);
|
|
88
|
+
--avatar-spacing-x: 0;
|
|
89
|
+
--avatar-spacing-y: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* variant */
|
|
93
|
+
.kit-avatar[breakpoint]kit-avatar--variant-outline {
|
|
94
|
+
--avatar-color: var(--base, var(--kit-neutral));
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
border: 1px solid currentColor;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.kit-avatar[breakpoint]kit-avatar--variant-text {
|
|
100
|
+
--avatar-color: var(--base, var(--kit-neutral));
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
border-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.kit-avatar[breakpoint]kit-avatar--variant-dash {
|
|
106
|
+
--avatar-color: var(--base, var(--kit-neutral));
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
border: 1px dashed currentColor;
|
|
109
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/assets.svelte.js';
|
|
3
|
+
import type { AvatarProps } from './types.js';
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
ref = $bindable(),
|
|
7
|
+
light,
|
|
8
|
+
dark,
|
|
9
|
+
size = 'md',
|
|
10
|
+
rounded,
|
|
11
|
+
alt,
|
|
12
|
+
background,
|
|
13
|
+
color,
|
|
14
|
+
image,
|
|
15
|
+
variant,
|
|
16
|
+
density = 'default',
|
|
17
|
+
...rest
|
|
18
|
+
}: AvatarProps = $props();
|
|
19
|
+
|
|
20
|
+
const assets = getAssets();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<svelte:element
|
|
24
|
+
this={'div'}
|
|
25
|
+
bind:this={ref}
|
|
26
|
+
{...rest}
|
|
27
|
+
class={[
|
|
28
|
+
'kit-avatar',
|
|
29
|
+
light && 'light',
|
|
30
|
+
dark && 'dark',
|
|
31
|
+
image && 'kit-avatar--image',
|
|
32
|
+
size && assets.className('avatar', 'size', size),
|
|
33
|
+
variant && assets.className('avatar', 'variant', variant),
|
|
34
|
+
density && assets.className('avatar', 'density', density),
|
|
35
|
+
rest.class
|
|
36
|
+
]}
|
|
37
|
+
style:--base={assets.color(background)}
|
|
38
|
+
style:--on={assets.color(color)}
|
|
39
|
+
style:--shape={assets.shape(rounded)}
|
|
40
|
+
>
|
|
41
|
+
{#if image}
|
|
42
|
+
<img src={image} {alt} />
|
|
43
|
+
{:else}
|
|
44
|
+
{@render children?.()}
|
|
45
|
+
{/if}
|
|
46
|
+
</svelte:element>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
|
+
type AvatarDensity = 'compact' | 'comfortable' | 'default';
|
|
4
|
+
type AvatarVariant = 'outline' | 'text' | 'dash';
|
|
5
|
+
export interface AvatarProps extends Component {
|
|
6
|
+
ref?: HTMLElement | null;
|
|
7
|
+
dark?: boolean;
|
|
8
|
+
light?: boolean;
|
|
9
|
+
color?: string;
|
|
10
|
+
background?: string;
|
|
11
|
+
image?: string;
|
|
12
|
+
size?: AvatarSize | {
|
|
13
|
+
[key: string]: AvatarSize;
|
|
14
|
+
};
|
|
15
|
+
variant?: AvatarVariant | {
|
|
16
|
+
[key: string]: AvatarVariant;
|
|
17
|
+
};
|
|
18
|
+
density?: AvatarDensity | {
|
|
19
|
+
[key: string]: AvatarDensity;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
.kit-card {
|
|
2
|
+
--card-color: var(--on, var(--kit-on-neutral));
|
|
3
|
+
--card-background: var(--base, var(--kit-neutral));
|
|
4
|
+
--card-radius: var(--shape, var(--kit-radius-md));
|
|
5
|
+
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
text-align: start;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
transition:
|
|
12
|
+
color 0.5s,
|
|
13
|
+
background-color 0.5s;
|
|
14
|
+
|
|
15
|
+
padding-top: var(--card-spacing-x);
|
|
16
|
+
padding-bottom: var(--card-spacing-x);
|
|
17
|
+
padding-right: var(--card-spacing-y);
|
|
18
|
+
padding-left: var(--card-spacing-y);
|
|
19
|
+
|
|
20
|
+
border-width: 1px;
|
|
21
|
+
border-style: solid;
|
|
22
|
+
border-radius: var(--card-radius);
|
|
23
|
+
|
|
24
|
+
/* theme */
|
|
25
|
+
color: var(--card-color);
|
|
26
|
+
background-color: var(--card-background);
|
|
27
|
+
border-color: var(--card-background);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* density */
|
|
31
|
+
.kit-card[breakpoint]kit-card--density-default {
|
|
32
|
+
--card-spacing-x: 0.25rem;
|
|
33
|
+
--card-spacing-y: 0.25rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.kit-card[breakpoint]kit-card--density-compact {
|
|
37
|
+
--card-spacing-x: 0;
|
|
38
|
+
--card-spacing-y: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.kit-card[breakpoint]kit-card--density-comfortable {
|
|
42
|
+
--card-spacing-x: 0.5rem;
|
|
43
|
+
--card-spacing-y: 0.5rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
a.kit-card {
|
|
47
|
+
text-decoration: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.kit-card:hover:not(div) {
|
|
51
|
+
background-color: color-mix(in oklab, var(--card-background) 90%, black);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.kit-card:focus:not(div) {
|
|
55
|
+
background-color: color-mix(in oklab, var(--card-background) 95%, black);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.kit-card:active:not(div),
|
|
59
|
+
.kit-card.kit-card--active {
|
|
60
|
+
background-color: color-mix(in oklab, var(--card-background) 95%, black);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.kit-card:not(div) {
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.kit-card.kit-card--variant-outline {
|
|
68
|
+
border-color: currentColor;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.kit-card.kit-card--variant-text {
|
|
72
|
+
border-color: transparent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.kit-card.kit-card--variant-outline,
|
|
76
|
+
.kit-card.kit-card--variant-text {
|
|
77
|
+
--card-color: var(--base, var(--kit-neutral));
|
|
78
|
+
background-color: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.kit-card.kit-card--variant-outline:hover:not(div),
|
|
82
|
+
.kit-card.kit-card--variant-text:hover:not(div) {
|
|
83
|
+
background-color: color-mix(in oklab, currentColor 7%, transparent);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.kit-card.kit-card--variant-outline:focus:not(div),
|
|
87
|
+
.kit-card.kit-card--variant-text:focus:not(div) {
|
|
88
|
+
background-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.kit-card.kit-card--variant-outline:active:not(div),
|
|
92
|
+
.kit-card.kit-card--variant-text:active:not(div),
|
|
93
|
+
.kit-card.kit-card--variant-outline.kit-card--active,
|
|
94
|
+
.kit-card.kit-card--variant-text.kit-card--active {
|
|
95
|
+
background-color: color-mix(in oklab, currentColor 10%, transparent);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kit-card.kit-card--disabled,
|
|
99
|
+
.kit-card[disabled],
|
|
100
|
+
.kit-card:disabled {
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
user-select: none;
|
|
103
|
+
opacity: 0.6;
|
|
104
|
+
}
|
|
105
|
+
.kit-card.kit-card--disabled > *,
|
|
106
|
+
.kit-card[disabled] > *,
|
|
107
|
+
.kit-card:disabled > * {
|
|
108
|
+
opacity: 0.6;
|
|
109
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { CardProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
is = 'div',
|
|
9
|
+
href,
|
|
10
|
+
dark,
|
|
11
|
+
light,
|
|
12
|
+
active,
|
|
13
|
+
density = 'default',
|
|
14
|
+
variant,
|
|
15
|
+
disabled,
|
|
16
|
+
rounded,
|
|
17
|
+
color,
|
|
18
|
+
background,
|
|
19
|
+
...rest
|
|
20
|
+
}: CardProps = $props();
|
|
21
|
+
|
|
22
|
+
const assets = getAssets();
|
|
23
|
+
|
|
24
|
+
$effect(() => {
|
|
25
|
+
if (href) is = 'a';
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<svelte:element
|
|
30
|
+
this={is}
|
|
31
|
+
bind:this={ref}
|
|
32
|
+
{...rest}
|
|
33
|
+
href={href && !disabled ? href : undefined}
|
|
34
|
+
class={[
|
|
35
|
+
'kit-card',
|
|
36
|
+
light && 'light',
|
|
37
|
+
dark && 'dark',
|
|
38
|
+
variant && assets.className('card', 'variant', variant),
|
|
39
|
+
density && assets.className('card', 'density', density),
|
|
40
|
+
active && 'kit-card--active',
|
|
41
|
+
disabled && 'kit-card--disabled',
|
|
42
|
+
rest.class
|
|
43
|
+
]}
|
|
44
|
+
disabled={href ? undefined : disabled}
|
|
45
|
+
style:--base={assets.color(background)}
|
|
46
|
+
style:--on={assets.color(color)}
|
|
47
|
+
style:--shape={assets.shape(rounded)}
|
|
48
|
+
>
|
|
49
|
+
{@render children?.()}
|
|
50
|
+
</svelte:element>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type Density = 'compact' | 'comfortable' | 'default';
|
|
3
|
+
export interface CardProps extends Component {
|
|
4
|
+
is?: 'a' | 'button' | 'div';
|
|
5
|
+
dark?: boolean;
|
|
6
|
+
light?: boolean;
|
|
7
|
+
href?: string;
|
|
8
|
+
variant?: 'outline' | 'text';
|
|
9
|
+
density?: Density | {
|
|
10
|
+
[key: string]: Density;
|
|
11
|
+
};
|
|
12
|
+
active?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
rounded?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
background?: string;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
.kit-chip {
|
|
2
|
+
--chip-color: var(--on, var(--kit-on-neutral));
|
|
3
|
+
--chip-background: var(--base, var(--kit-neutral));
|
|
4
|
+
--chip-radius: var(--shape, var(--kit-radius-full));
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
padding-top: var(--chip-spacing-x);
|
|
11
|
+
padding-bottom: var(--chip-spacing-x);
|
|
12
|
+
padding-right: var(--chip-spacing-y);
|
|
13
|
+
padding-left: var(--chip-spacing-y);
|
|
14
|
+
|
|
15
|
+
border-width: 1px;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
border-radius: var(--chip-radius);
|
|
18
|
+
|
|
19
|
+
/* theme */
|
|
20
|
+
color: var(--chip-color);
|
|
21
|
+
background-color: var(--chip-background);
|
|
22
|
+
border-color: var(--chip-background);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
a.kit-chip,
|
|
26
|
+
button.kit-chip {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.kit-chip .kit-chip-content,
|
|
31
|
+
.kit-chip .kit-chip-append,
|
|
32
|
+
.kit-chip .kit-chip-prepend,
|
|
33
|
+
.kit-chip .kit-chip--close,
|
|
34
|
+
.kit-chip .kit-chip-loading {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
gap: var(--chip-gap);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* size */
|
|
43
|
+
.kit-chip[breakpoint]kit-chip--size-xs {
|
|
44
|
+
--chip-height: 1.25rem;
|
|
45
|
+
--chip-multiplier-y: 2;
|
|
46
|
+
--chip-gap: 0.25rem;
|
|
47
|
+
font-size: 0.625rem;
|
|
48
|
+
gap: var(--chip-gap);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.kit-chip[breakpoint]kit-chip--size-sm {
|
|
52
|
+
--chip-height: 1.625rem;
|
|
53
|
+
--chip-multiplier-y: 3;
|
|
54
|
+
--chip-gap: 0.5rem;
|
|
55
|
+
font-size: 0.75rem;
|
|
56
|
+
gap: var(--chip-gap);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.kit-chip[breakpoint]kit-chip--size-md {
|
|
60
|
+
--chip-height: 2rem;
|
|
61
|
+
--chip-multiplier-y: 4;
|
|
62
|
+
--chip-gap: 0.5rem;
|
|
63
|
+
font-size: 0.875rem;
|
|
64
|
+
gap: var(--chip-gap);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.kit-chip[breakpoint]kit-chip--size-lg {
|
|
68
|
+
--chip-height: 2.375rem;
|
|
69
|
+
--chip-multiplier-y: 5;
|
|
70
|
+
--chip-gap: 0.5rem;
|
|
71
|
+
font-size: 1rem;
|
|
72
|
+
gap: var(--chip-gap);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.kit-chip[breakpoint]kit-chip--size-xl {
|
|
76
|
+
--chip-height: 2.75rem;
|
|
77
|
+
--chip-multiplier-y: 6;
|
|
78
|
+
--chip-gap: 0.675rem;
|
|
79
|
+
font-size: 1.125rem;
|
|
80
|
+
gap: var(--chip-gap);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* variant */
|
|
84
|
+
.kit-chip[breakpoint]kit-chip--variant-outline {
|
|
85
|
+
--chip-color: var(--base, var(--kit-neutral));
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
border: 1px solid currentColor;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* density */
|
|
91
|
+
.kit-chip[breakpoint]kit-chip--density-default {
|
|
92
|
+
height: calc(var(--chip-height));
|
|
93
|
+
min-width: calc(var(--chip-height));
|
|
94
|
+
--chip-spacing-x: 0;
|
|
95
|
+
--chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kit-chip[breakpoint]kit-chip--density-compact {
|
|
99
|
+
height: calc(var(--chip-height) - 0.25rem);
|
|
100
|
+
min-width: calc(var(--chip-height - 0.25rem));
|
|
101
|
+
--chip-spacing-x: 0;
|
|
102
|
+
--chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y) - 0.25rem);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.kit-chip[breakpoint]kit-chip--density-comfortable {
|
|
106
|
+
height: calc(var(--chip-height) + 0.25rem);
|
|
107
|
+
min-width: calc(var(--chip-height) + 0.25rem);
|
|
108
|
+
--chip-spacing-x: 0;
|
|
109
|
+
--chip-spacing-y: calc(var(--kit-spacing) * var(--chip-multiplier-y) + 0.25rem);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* state */
|
|
113
|
+
.kit-chip.kit-chip--info:not([class*='chip--variant-']) {
|
|
114
|
+
--on: var(--kit-on-info);
|
|
115
|
+
--base: var(--kit-info);
|
|
116
|
+
}
|
|
117
|
+
.kit-chip.kit-chip--info[class*='chip--variant-'] {
|
|
118
|
+
--base: var(--kit-info);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.kit-chip.kit-chip--success:not([class*='chip--variant-']) {
|
|
122
|
+
--on: var(--kit-on-success);
|
|
123
|
+
--base: var(--kit-success);
|
|
124
|
+
}
|
|
125
|
+
.kit-chip.kit-chip--success[class*='chip--variant-'] {
|
|
126
|
+
--base: var(--kit-success);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.kit-chip.kit-chip--warning:not([class*='chip--variant-']) {
|
|
130
|
+
--on: var(--kit-on-warning);
|
|
131
|
+
--base: var(--kit-warning);
|
|
132
|
+
}
|
|
133
|
+
.kit-chip.kit-chip--warning[class*='chip--variant-'] {
|
|
134
|
+
--base: var(--kit-warning);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.kit-chip.kit-chip--error:not([class*='chip--variant-']) {
|
|
138
|
+
--on: var(--kit-on-error);
|
|
139
|
+
--base: var(--kit-error);
|
|
140
|
+
}
|
|
141
|
+
.kit-chip.kit-chip--error[class*='chip--variant-'] {
|
|
142
|
+
--base: var(--kit-error);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* events */
|
|
146
|
+
.kit-chip.kit-chip--active:not([class*='chip--variant-']) {
|
|
147
|
+
background-color: color-mix(in oklab, var(--chip-background) 90%, var(--kit-scrim));
|
|
148
|
+
border-color: color-mix(in oklab, var(--chip-background) 90%, var(--kit-scrim));
|
|
149
|
+
}
|
|
150
|
+
.kit-chip.kit-chip--active[class*='chip--variant-'] {
|
|
151
|
+
background-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
152
|
+
border-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.kit-chip:hover:not([class*='chip--variant-']) {
|
|
156
|
+
background-color: color-mix(in oklab, var(--chip-background) 85%, var(--kit-scrim));
|
|
157
|
+
border-color: color-mix(in oklab, var(--chip-background) 85%, var(--kit-scrim));
|
|
158
|
+
}
|
|
159
|
+
.kit-chip:hover[class*='chip--variant-'] {
|
|
160
|
+
background-color: color-mix(in oklab, currentColor 25%, transparent);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* disabled */
|
|
164
|
+
.kit-chip.kit-chip--disabled,
|
|
165
|
+
.kit-chip[disabled] {
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
user-select: none;
|
|
168
|
+
cursor: default;
|
|
169
|
+
}
|
|
170
|
+
.kit-chip:not([class*='chip--variant-']).kit-chip--disabled {
|
|
171
|
+
color: color-mix(in oklab, var(--chip-color) 40%, transparent) !important;
|
|
172
|
+
background-color: color-mix(in oklab, var(--chip-background) 70%, transparent) !important;
|
|
173
|
+
border-color: color-mix(in oklab, var(--chip-background) 70%, transparent) !important;
|
|
174
|
+
}
|
|
175
|
+
.kit-chip:not([class*='chip--variant-']).kit-chip--disabled i:before {
|
|
176
|
+
color: color-mix(in oklab, var(--chip-color) 40%, transparent) !important;
|
|
177
|
+
}
|
|
178
|
+
.kit-chip[class*='chip--variant-'].kit-chip--disabled,
|
|
179
|
+
.kit-chip[class*='chip--variant-'].kit-chip--disabled i:before {
|
|
180
|
+
color: color-mix(in oklab, var(--chip-background) 40%, transparent) !important;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* loading */
|
|
184
|
+
.kit-chip.kit-chip--loading {
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
user-select: none;
|
|
187
|
+
cursor: default;
|
|
188
|
+
}
|
|
189
|
+
.kit-chip.kit-chip--loading > .kit-chip-content {
|
|
190
|
+
color: transparent;
|
|
191
|
+
opacity: 0;
|
|
192
|
+
}
|
|
193
|
+
.kit-chip.kit-chip--loading > .kit-chip-loading {
|
|
194
|
+
position: absolute;
|
|
195
|
+
min-width: fit-content;
|
|
196
|
+
}
|
|
197
|
+
.kit-chip.kit-chip--loading > .kit-chip-loading .kit-icon-load {
|
|
198
|
+
animation: icon-rotate 1s ease-out infinite;
|
|
199
|
+
}
|