lapikit 0.7.2 → 0.7.4
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/@types/components.d.ts +1 -7
- package/dist/@types/dom.d.ts +4 -3
- package/dist/@types/props.d.ts +3 -3
- package/dist/animations/ripple.js +33 -17
- package/dist/components/accordion/accordion.svelte +192 -228
- package/dist/components/accordion/accordion.types.d.ts +5 -7
- package/dist/components/accordion/modules/accordion-item.svelte +144 -140
- package/dist/components/alert/alert.svelte +246 -293
- package/dist/components/alert/alert.types.d.ts +5 -5
- package/dist/components/app/app.svelte +29 -44
- package/dist/components/appbar/appbar.svelte +205 -190
- package/dist/components/appbar/appbar.types.d.ts +6 -6
- package/dist/components/aspect-ratio/aspect-ratio.svelte +43 -63
- package/dist/components/avatar/avatar.svelte +169 -161
- package/dist/components/avatar/avatar.types.d.ts +3 -4
- package/dist/components/btn/btn.svelte +431 -465
- package/dist/components/btn/btn.types.d.ts +5 -6
- package/dist/components/card/card.svelte +214 -176
- package/dist/components/card/card.types.d.ts +6 -3
- package/dist/components/card/modules/card-actions.svelte +11 -35
- package/dist/components/card/modules/card-container.svelte +9 -33
- package/dist/components/card/modules/card-content.svelte +18 -44
- package/dist/components/card/modules/card-media.svelte +10 -34
- package/dist/components/card/modules/card-title.svelte +22 -48
- package/dist/components/chip/chip.svelte +416 -464
- package/dist/components/chip/chip.types.d.ts +5 -5
- package/dist/components/dialog/dialog.svelte +174 -171
- package/dist/components/dialog/dialog.types.d.ts +6 -6
- package/dist/components/dropdown/dropdown.svelte +149 -144
- package/dist/components/dropdown/dropdown.types.d.ts +4 -11
- package/dist/components/field/field.svelte +474 -0
- package/dist/components/field/field.svelte.d.ts +4 -0
- package/dist/components/field/field.types.d.ts +46 -0
- package/dist/components/field/field.types.js +1 -0
- package/dist/components/icon/icon.svelte +67 -96
- package/dist/components/icon/icon.types.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/list/list.svelte +193 -194
- package/dist/components/list/list.types.d.ts +5 -7
- package/dist/components/list/modules/list-item.svelte +134 -147
- package/dist/components/modal/modal.svelte +239 -222
- package/dist/components/modal/modal.types.d.ts +6 -6
- package/dist/components/popover/popover.svelte +125 -127
- package/dist/components/popover/popover.types.d.ts +4 -11
- package/dist/components/separator/separator.svelte +56 -87
- package/dist/components/separator/separator.types.d.ts +1 -1
- package/dist/components/spacer/spacer.svelte +6 -25
- package/dist/components/textfield/textfield.svelte +94 -543
- package/dist/components/textfield/textfield.types.d.ts +13 -33
- package/dist/components/toolbar/toolbar.svelte +216 -211
- package/dist/components/toolbar/toolbar.types.d.ts +8 -9
- package/dist/components/tooltip/tooltip.svelte +201 -266
- package/dist/components/tooltip/tooltip.types.d.ts +3 -10
- package/dist/constants.js +1 -0
- package/dist/html-mapped.d.ts +1 -15
- package/dist/html-mapped.js +0 -19
- package/dist/labs/sheet/sheet.svelte +145 -19
- package/dist/labs/sheet/sheet.svelte.d.ts +2 -10
- package/dist/labs/sheet/sheet.types.d.ts +16 -0
- package/dist/labs/sheet/sheet.types.js +1 -0
- package/dist/utils/color.d.ts +2 -2
- package/dist/utils/color.js +2 -1
- package/dist/utils/components.d.ts +10 -10
- package/dist/utils/components.js +16 -75
- package/dist/utils/floating.d.ts +58 -0
- package/dist/utils/floating.js +131 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +3 -3
- package/dist/components/dropdown/dropdown.svelte.js +0 -148
- package/dist/components/popover/popover.svelte.js +0 -134
- package/dist/components/tooltip/tooltip.svelte.js +0 -131
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { makeComponentProps } from '../../html-mapped';
|
|
2
|
+
import { useComponentAttrs } from '../../utils';
|
|
4
3
|
import type { AspectRatioProps, AspectRatioValue } from './aspect-ratio.types.js';
|
|
5
4
|
|
|
6
5
|
const FALLBACK_RATIO = 16 / 9;
|
|
@@ -36,8 +35,8 @@
|
|
|
36
35
|
ref = $bindable(),
|
|
37
36
|
is = 'div',
|
|
38
37
|
children = undefined,
|
|
39
|
-
class: className
|
|
40
|
-
style: styleAttr
|
|
38
|
+
class: className,
|
|
39
|
+
style: styleAttr,
|
|
41
40
|
's-class': sClass,
|
|
42
41
|
's-style': sStyle,
|
|
43
42
|
ratio = undefined,
|
|
@@ -47,75 +46,56 @@
|
|
|
47
46
|
...rest
|
|
48
47
|
}: AspectRatioProps = $props();
|
|
49
48
|
|
|
50
|
-
let { classProps, styleProps, restProps } = $derived(
|
|
51
|
-
makeComponentProps(rest as Record<string, unknown>)
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
let componentClass = $derived(
|
|
55
|
-
useClassName({
|
|
56
|
-
baseClass: 'kit-aspect-ratio',
|
|
57
|
-
className: `${className ?? ''}`.trim(),
|
|
58
|
-
sClass,
|
|
59
|
-
classProps
|
|
60
|
-
})
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
let componentStyle = $derived(
|
|
64
|
-
useStyles({
|
|
65
|
-
styleAttr,
|
|
66
|
-
sStyle,
|
|
67
|
-
styleProps
|
|
68
|
-
})
|
|
69
|
-
);
|
|
70
|
-
|
|
71
49
|
let resolvedRatio = $derived(resolveRatio(ratio ?? aspectRatio));
|
|
50
|
+
let attrs = $derived(
|
|
51
|
+
useComponentAttrs(
|
|
52
|
+
'kit-aspect-ratio',
|
|
53
|
+
{
|
|
54
|
+
className,
|
|
55
|
+
sClass,
|
|
56
|
+
styleAttr,
|
|
57
|
+
sStyle: { '--kit-aspect-ratio': String(resolvedRatio), '--kit-aspect-fit': fit, ...sStyle }
|
|
58
|
+
},
|
|
59
|
+
rest
|
|
60
|
+
)
|
|
61
|
+
);
|
|
72
62
|
</script>
|
|
73
63
|
|
|
74
64
|
<svelte:element
|
|
75
65
|
this={is}
|
|
76
66
|
bind:this={ref}
|
|
77
|
-
class={
|
|
78
|
-
style={
|
|
67
|
+
class={attrs.class}
|
|
68
|
+
style={attrs.style}
|
|
79
69
|
data-inline={inline}
|
|
80
|
-
|
|
81
|
-
style:--kit-aspect-fit={fit}
|
|
82
|
-
{...restProps}
|
|
70
|
+
{...attrs.rest}
|
|
83
71
|
>
|
|
84
72
|
<div class="kit-aspect-ratio__inner">
|
|
85
73
|
{@render children?.()}
|
|
86
74
|
</div>
|
|
87
75
|
</svelte:element>
|
|
88
76
|
|
|
89
|
-
<style
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
.kit-aspect-ratio :global(canvas),
|
|
115
|
-
.kit-aspect-ratio :global(svg) {
|
|
116
|
-
display: block;
|
|
117
|
-
width: 100%;
|
|
118
|
-
height: 100%;
|
|
119
|
-
object-fit: var(--kit-aspect-fit, cover);
|
|
120
|
-
}
|
|
121
|
-
</style>
|
|
77
|
+
<style>.kit-aspect-ratio {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: block;
|
|
80
|
+
width: 100%;
|
|
81
|
+
max-width: 100%;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
aspect-ratio: var(--kit-aspect-ratio, 1.7777777778);
|
|
84
|
+
}
|
|
85
|
+
.kit-aspect-ratio[data-inline=true] {
|
|
86
|
+
display: inline-block;
|
|
87
|
+
width: auto;
|
|
88
|
+
}
|
|
89
|
+
.kit-aspect-ratio__inner {
|
|
90
|
+
position: absolute;
|
|
91
|
+
inset: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
}
|
|
95
|
+
.kit-aspect-ratio__inner > :global(:is(img, video, iframe, canvas, svg, picture)),
|
|
96
|
+
.kit-aspect-ratio__inner > :global(picture > img) {
|
|
97
|
+
display: block;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 100%;
|
|
100
|
+
object-fit: var(--kit-aspect-fit, cover);
|
|
101
|
+
}</style>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { makeComponentProps } from '../../html-mapped';
|
|
2
|
+
import { useComponentAttrs, useElevation } from '../../utils';
|
|
4
3
|
import type { AvatarProps } from './avatar.types.js';
|
|
5
4
|
|
|
6
5
|
let {
|
|
7
6
|
ref = $bindable(),
|
|
8
7
|
children = undefined,
|
|
9
|
-
class: className
|
|
10
|
-
style: styleAttr
|
|
8
|
+
class: className,
|
|
9
|
+
style: styleAttr,
|
|
11
10
|
's-class': sClass,
|
|
12
11
|
's-style': sStyle,
|
|
13
12
|
label = undefined,
|
|
@@ -16,180 +15,189 @@
|
|
|
16
15
|
rounded = 'full',
|
|
17
16
|
elevation,
|
|
18
17
|
color,
|
|
19
|
-
background,
|
|
20
18
|
...rest
|
|
21
19
|
}: AvatarProps = $props();
|
|
22
20
|
|
|
23
|
-
let
|
|
24
|
-
|
|
21
|
+
let attrs = $derived(
|
|
22
|
+
useComponentAttrs('kit-avatar', { className, sClass, styleAttr, sStyle, color }, rest)
|
|
25
23
|
);
|
|
26
|
-
|
|
27
|
-
let componentClass = $derived(
|
|
28
|
-
useClassName({
|
|
29
|
-
baseClass: 'kit-avatar',
|
|
30
|
-
className: `${className ?? ''}`.trim(),
|
|
31
|
-
sClass,
|
|
32
|
-
classProps
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
let componentStyle = $derived(
|
|
37
|
-
useStyles({
|
|
38
|
-
styleAttr,
|
|
39
|
-
sStyle,
|
|
40
|
-
styleProps
|
|
41
|
-
})
|
|
42
|
-
);
|
|
43
|
-
|
|
44
24
|
let elevationState = $derived(useElevation(elevation));
|
|
45
|
-
let contentType = $derived(label && label.trim().length > 0 ? 'label' : children);
|
|
46
25
|
let displayLabel = $derived(label?.trim() ?? '');
|
|
47
|
-
|
|
48
|
-
let resolvedStyle = $derived(
|
|
49
|
-
[
|
|
50
|
-
componentStyle,
|
|
51
|
-
color ? `--kit-avatar-fg:${color && `var(--kit-color-${color})`}` : '',
|
|
52
|
-
background ? `--kit-avatar-bg:${background && `var(--kit-color-${background})`}` : ''
|
|
53
|
-
]
|
|
54
|
-
.filter(Boolean)
|
|
55
|
-
.join('; ')
|
|
56
|
-
);
|
|
57
26
|
</script>
|
|
58
27
|
|
|
59
|
-
<
|
|
60
|
-
this={'div'}
|
|
28
|
+
<div
|
|
61
29
|
bind:this={ref}
|
|
62
|
-
class={
|
|
63
|
-
style={
|
|
64
|
-
data-type={
|
|
30
|
+
class={attrs.class}
|
|
31
|
+
style={attrs.style}
|
|
32
|
+
data-type={displayLabel ? 'label' : 'content'}
|
|
65
33
|
data-size={size}
|
|
66
34
|
data-density={density}
|
|
67
35
|
data-rounded={rounded}
|
|
68
36
|
data-elevation={elevationState.base}
|
|
69
37
|
data-elevation-hover={elevationState.hover}
|
|
70
38
|
data-elevation-active={elevationState.active}
|
|
71
|
-
{...
|
|
39
|
+
{...attrs.rest}
|
|
72
40
|
>
|
|
73
|
-
{#if
|
|
41
|
+
{#if displayLabel}
|
|
74
42
|
<span class="kit-avatar__label">{displayLabel}</span>
|
|
75
43
|
{:else}
|
|
76
44
|
{@render children?.()}
|
|
77
45
|
{/if}
|
|
78
|
-
</
|
|
79
|
-
|
|
80
|
-
<style
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<style>:where(.kit-avatar) {
|
|
49
|
+
--kit-avatar-color: initial;
|
|
50
|
+
--kit-avatar-on-color: initial;
|
|
51
|
+
--kit-avatar-active-fg: initial;
|
|
52
|
+
--kit-avatar-active-shade: initial;
|
|
53
|
+
--kit-avatar-hover-fg: initial;
|
|
54
|
+
--kit-avatar-pressed-fg: initial;
|
|
55
|
+
--kit-avatar-bg: var(--kit-avatar-color, var(--kit-color-surface-3));
|
|
56
|
+
--kit-avatar-fg: var(--kit-avatar-on-color, var(--kit-avatar-contrast, var(--kit-color-text)));
|
|
57
|
+
--kit-avatar-ink: var(--kit-avatar-color, var(--kit-color-text));
|
|
58
|
+
--kit-avatar-hover: color-mix(in oklab, var(--kit-avatar-bg), var(--kit-avatar-fg) 8%);
|
|
59
|
+
--kit-avatar-pressed: color-mix(in oklab, var(--kit-avatar-bg), var(--kit-avatar-fg) 14%);
|
|
60
|
+
--kit-avatar-soft: color-mix(in oklab, var(--kit-avatar-bg) 16%, transparent);
|
|
61
|
+
--kit-avatar-border: color-mix(in oklab, var(--kit-avatar-bg), var(--kit-avatar-fg) 20%);
|
|
62
|
+
--kit-avatar-active: color-mix(
|
|
63
|
+
in oklab,
|
|
64
|
+
var(--kit-avatar-color),
|
|
65
|
+
var(--kit-avatar-fg) var(--kit-avatar-active-shade, 14%)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
@supports (color: color(from red srgb-linear r g b)) {
|
|
69
|
+
:where(.kit-avatar) {
|
|
70
|
+
--kit-avatar-contrast: color(from var(--kit-avatar-color) srgb-linear clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1) clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1) clamp(0, (0.1791 - (0.2126 * r + 0.7152 * g + 0.0722 * b)) * 100000, 1)/1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
:where(.kit-avatar) {
|
|
74
|
+
--kit-avatar-size: calc(var(--kit-avatar-h) + var(--kit-avatar-density-offset) / 2);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.kit-avatar {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
flex: none;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
width: var(--kit-avatar-size);
|
|
84
|
+
height: var(--kit-avatar-size);
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
border: 0;
|
|
87
|
+
border-radius: var(--kit-avatar-radius);
|
|
88
|
+
background-color: var(--kit-avatar-bg);
|
|
89
|
+
color: var(--kit-avatar-fg);
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
user-select: none;
|
|
93
|
+
transition-property: background-color, color, box-shadow;
|
|
94
|
+
transition-duration: var(--kit-animation-component);
|
|
95
|
+
transition-timing-function: ease;
|
|
96
|
+
}
|
|
97
|
+
@media (prefers-reduced-motion: reduce) {
|
|
98
|
+
.kit-avatar {
|
|
99
|
+
transition: none;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.kit-avatar[data-type=label] {
|
|
103
|
+
font-size: var(--kit-avatar-font);
|
|
104
|
+
text-transform: uppercase;
|
|
105
|
+
}
|
|
106
|
+
.kit-avatar__label {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
padding-inline: 0.25rem;
|
|
112
|
+
}
|
|
113
|
+
.kit-avatar > :global(img) {
|
|
114
|
+
display: block;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
object-fit: cover;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* size
|
|
122
|
+
* @link https://lapikit.dev/docs/components/avatar#size
|
|
123
|
+
*/
|
|
124
|
+
:where(.kit-avatar[data-size=xs]) {
|
|
125
|
+
--kit-avatar-h: 2rem;
|
|
126
|
+
--kit-avatar-font: var(--kit-font-xs);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:where(.kit-avatar[data-size=sm]) {
|
|
130
|
+
--kit-avatar-h: 2.5rem;
|
|
131
|
+
--kit-avatar-font: var(--kit-font-sm);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:where(.kit-avatar[data-size=md]) {
|
|
135
|
+
--kit-avatar-h: 3rem;
|
|
136
|
+
--kit-avatar-font: var(--kit-font-md);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:where(.kit-avatar[data-size=lg]) {
|
|
140
|
+
--kit-avatar-h: 3.5rem;
|
|
141
|
+
--kit-avatar-font: var(--kit-font-lg);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where(.kit-avatar[data-size=xl]) {
|
|
145
|
+
--kit-avatar-h: 4rem;
|
|
146
|
+
--kit-avatar-font: var(--kit-font-xl);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* rounded
|
|
151
|
+
* @link https://lapikit.dev/docs/customize
|
|
152
|
+
*/
|
|
153
|
+
:where(.kit-avatar[data-rounded="0"]) {
|
|
154
|
+
--kit-avatar-radius: var(--kit-shape-none);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:where(.kit-avatar[data-rounded=xs]) {
|
|
158
|
+
--kit-avatar-radius: var(--kit-shape-xs);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:where(.kit-avatar[data-rounded=sm]) {
|
|
162
|
+
--kit-avatar-radius: var(--kit-shape-sm);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:where(.kit-avatar[data-rounded=md]) {
|
|
166
|
+
--kit-avatar-radius: var(--kit-shape-md);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:where(.kit-avatar[data-rounded=lg]) {
|
|
170
|
+
--kit-avatar-radius: var(--kit-shape-lg);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:where(.kit-avatar[data-rounded=xl]) {
|
|
174
|
+
--kit-avatar-radius: var(--kit-shape-xl);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:where(.kit-avatar[data-rounded=full]) {
|
|
178
|
+
--kit-avatar-radius: var(--kit-shape-full);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* density
|
|
183
|
+
* @link https://lapikit.dev/docs/components/avatar#density
|
|
184
|
+
*/
|
|
185
|
+
:where(.kit-avatar[data-density=dense]) {
|
|
186
|
+
--kit-avatar-density-offset: var(--kit-density-dense);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:where(.kit-avatar[data-density=compact]) {
|
|
190
|
+
--kit-avatar-density-offset: var(--kit-density-compact);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:where(.kit-avatar[data-density=default]) {
|
|
194
|
+
--kit-avatar-density-offset: var(--kit-density-default);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:where(.kit-avatar[data-density=comfortable]) {
|
|
198
|
+
--kit-avatar-density-offset: var(--kit-density-comfortable);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
:where(.kit-avatar[data-density=spacious]) {
|
|
202
|
+
--kit-avatar-density-offset: var(--kit-density-spacious);
|
|
203
|
+
}</style>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColorProps, Component, ElevationProps, RoundedType, SizeType } from '../../@types';
|
|
2
2
|
export interface AvatarProps extends Component {
|
|
3
3
|
ref?: HTMLElement | null;
|
|
4
4
|
label?: string;
|
|
5
5
|
size?: SizeType;
|
|
6
|
-
density?:
|
|
6
|
+
density?: 'dense' | 'compact' | 'default' | 'comfortable' | 'spacious';
|
|
7
7
|
rounded?: RoundedType | 'full';
|
|
8
8
|
elevation?: ElevationProps;
|
|
9
|
-
color?:
|
|
10
|
-
background?: string;
|
|
9
|
+
color?: ColorProps;
|
|
11
10
|
}
|