lapikit 0.1.10 → 0.1.12
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.css +4 -4
- package/dist/components/alert/alert.css +3 -3
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -1
- package/dist/components/avatar/avatar.css +5 -5
- package/dist/components/button/button.css +8 -11
- package/dist/components/button/button.svelte +6 -6
- package/dist/components/card/card.css +62 -56
- package/dist/components/card/card.svelte +13 -1
- package/dist/components/card/types.d.ts +1 -1
- package/dist/components/chip/chip.css +111 -81
- package/dist/components/chip/chip.svelte +17 -7
- package/dist/components/chip/types.d.ts +2 -1
- package/dist/components/dialog/dialog.css +2 -2
- package/dist/components/dropdown/dropdown.css +2 -2
- package/dist/components/list/list.css +144 -119
- package/dist/components/list/list.svelte +1 -3
- package/dist/components/list/modules/list-item.svelte +8 -1
- package/dist/components/list/types.d.ts +2 -5
- package/dist/components/modal/modal.css +9 -6
- package/dist/components/popover/popover.css +2 -2
- package/dist/components/toolbar/toolbar.css +3 -3
- package/dist/components/tooltip/tooltip.css +2 -2
- package/dist/internal/assets.svelte.js +2 -0
- package/dist/style/normalize.css +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.kit-accordion {
|
|
2
|
-
--accordion-color: var(--on, var(--kit-on-
|
|
3
|
-
--accordion-background: var(--base, var(--kit-
|
|
2
|
+
--accordion-color: var(--on, var(--kit-on-container));
|
|
3
|
+
--accordion-background: var(--base, var(--kit-container));
|
|
4
4
|
--accordion-radius: var(--shape, var(--kit-radius-md));
|
|
5
5
|
|
|
6
6
|
display: flex;
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
transition: 0.3s all cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
48
|
transition-property: margin-top, border-radius, border, max-width;
|
|
49
49
|
border-radius: var(--shape, var(--accordion-radius, var(--kit-radius-md)));
|
|
50
|
-
color: var(--on, var(--accordion-color, var(--kit-on-
|
|
51
|
-
background-color: var(--base, var(--accordion-background, var(--kit-
|
|
50
|
+
color: var(--on, var(--accordion-color, var(--kit-on-container)));
|
|
51
|
+
background-color: var(--base, var(--accordion-background, var(--kit-container)));
|
|
52
52
|
transition:
|
|
53
53
|
color 0.5s,
|
|
54
54
|
background-color 0.5s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.kit-alert {
|
|
2
|
-
--alert-color: var(--on, var(--kit-on-
|
|
3
|
-
--alert-background: var(--base, var(--kit-
|
|
2
|
+
--alert-color: var(--on, var(--kit-on-container));
|
|
3
|
+
--alert-background: var(--base, var(--kit-container));
|
|
4
4
|
--alert-radius: var(--shape, var(--kit-radius-md));
|
|
5
5
|
|
|
6
6
|
display: grid;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
grid-template-areas:
|
|
9
9
|
'prepend content append close'
|
|
10
10
|
'. content . .';
|
|
11
|
-
grid-template-columns: max-content auto max-content max-content;
|
|
11
|
+
/* grid-template-columns: max-content auto max-content max-content; */ /* bug */
|
|
12
12
|
position: relative;
|
|
13
13
|
padding: 1rem;
|
|
14
14
|
overflow: hidden;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.kit-avatar {
|
|
2
|
-
--avatar-color: var(--on, var(--kit-on-
|
|
3
|
-
--avatar-background: var(--base, var(--kit-
|
|
2
|
+
--avatar-color: var(--on, var(--kit-on-container));
|
|
3
|
+
--avatar-background: var(--base, var(--kit-container));
|
|
4
4
|
--avatar-radius: var(--shape, var(--kit-radius-full));
|
|
5
5
|
|
|
6
6
|
display: flex;
|
|
@@ -91,19 +91,19 @@
|
|
|
91
91
|
|
|
92
92
|
/* variant */
|
|
93
93
|
.kit-avatar[breakpoint]kit-avatar--variant-outline {
|
|
94
|
-
--avatar-color: var(--base, var(--kit-
|
|
94
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
95
95
|
background-color: transparent;
|
|
96
96
|
border: 1px solid currentColor;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.kit-avatar[breakpoint]kit-avatar--variant-text {
|
|
100
|
-
--avatar-color: var(--base, var(--kit-
|
|
100
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
101
101
|
background-color: transparent;
|
|
102
102
|
border-color: transparent;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.kit-avatar[breakpoint]kit-avatar--variant-dash {
|
|
106
|
-
--avatar-color: var(--base, var(--kit-
|
|
106
|
+
--avatar-color: var(--base, var(--kit-container));
|
|
107
107
|
background-color: transparent;
|
|
108
108
|
border: 1px dashed currentColor;
|
|
109
109
|
}
|
|
@@ -165,32 +165,32 @@
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/* state */
|
|
168
|
-
.kit-button.kit-button--info
|
|
168
|
+
.kit-button.kit-button--info[class*='button--variant-filled'] {
|
|
169
169
|
--on: var(--kit-on-info);
|
|
170
170
|
--base: var(--kit-info);
|
|
171
171
|
}
|
|
172
|
-
.kit-button.kit-button--info[class*='button--variant-'] {
|
|
172
|
+
.kit-button.kit-button--info[class*='button--variant-']:not([class*='variant-filled']) {
|
|
173
173
|
--base: var(--kit-info);
|
|
174
174
|
}
|
|
175
|
-
.kit-button.kit-button--success
|
|
175
|
+
.kit-button.kit-button--success[class*='button--variant-filled'] {
|
|
176
176
|
--on: var(--kit-on-success);
|
|
177
177
|
--base: var(--kit-success);
|
|
178
178
|
}
|
|
179
|
-
.kit-button.kit-button--success[class*='button--variant-'] {
|
|
179
|
+
.kit-button.kit-button--success[class*='button--variant-']:not([class*='variant-filled']) {
|
|
180
180
|
--base: var(--kit-success);
|
|
181
181
|
}
|
|
182
|
-
.kit-button.kit-button--warning
|
|
182
|
+
.kit-button.kit-button--warning[class*='button--variant-filled'] {
|
|
183
183
|
--on: var(--kit-on-warning);
|
|
184
184
|
--base: var(--kit-warning);
|
|
185
185
|
}
|
|
186
|
-
.kit-button.kit-button--warning[class*='button--variant-'] {
|
|
186
|
+
.kit-button.kit-button--warning[class*='button--variant-']:not([class*='variant-filled']) {
|
|
187
187
|
--base: var(--kit-warning);
|
|
188
188
|
}
|
|
189
|
-
.kit-button.kit-button--error
|
|
189
|
+
.kit-button.kit-button--error[class*='button--variant-filled'] {
|
|
190
190
|
--on: var(--kit-on-error);
|
|
191
191
|
--base: var(--kit-error);
|
|
192
192
|
}
|
|
193
|
-
.kit-button.kit-button--error[class*='button--variant-'] {
|
|
193
|
+
.kit-button.kit-button--error[class*='button--variant-']:not([class*='variant-filled']) {
|
|
194
194
|
--base: var(--kit-error);
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -198,12 +198,10 @@
|
|
|
198
198
|
.kit-button[class*='button--variant-filled']:active,
|
|
199
199
|
.kit-button.kit-button--active[class*='button--variant-filled'] {
|
|
200
200
|
background-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-scrim));
|
|
201
|
-
border-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-scrim));
|
|
202
201
|
}
|
|
203
202
|
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']):active,
|
|
204
203
|
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']) {
|
|
205
204
|
background-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
206
|
-
border-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
207
205
|
}
|
|
208
206
|
|
|
209
207
|
/* icon */
|
|
@@ -223,7 +221,6 @@
|
|
|
223
221
|
.kit-button[class*='button--variant-filled'].kit-button--disabled {
|
|
224
222
|
color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
|
|
225
223
|
background-color: color-mix(in oklab, var(--button-background) 70%, transparent) !important;
|
|
226
|
-
border-color: color-mix(in oklab, var(--button-background) 70%, transparent) !important;
|
|
227
224
|
}
|
|
228
225
|
.kit-button[class*='button--variant-filled'].kit-button--disabled i:before {
|
|
229
226
|
color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
|
|
@@ -84,18 +84,18 @@
|
|
|
84
84
|
{/if}
|
|
85
85
|
|
|
86
86
|
{#if prepend}
|
|
87
|
-
<
|
|
87
|
+
<div class="kit-button-prepend">
|
|
88
88
|
{@render prepend?.()}
|
|
89
|
-
</
|
|
89
|
+
</div>
|
|
90
90
|
{/if}
|
|
91
91
|
|
|
92
|
-
<
|
|
92
|
+
<div class="kit-button-content">
|
|
93
93
|
{@render children?.()}
|
|
94
|
-
</
|
|
94
|
+
</div>
|
|
95
95
|
|
|
96
96
|
{#if append}
|
|
97
|
-
<
|
|
97
|
+
<div class="kit-button-append">
|
|
98
98
|
{@render append?.()}
|
|
99
|
-
</
|
|
99
|
+
</div>
|
|
100
100
|
{/if}
|
|
101
101
|
</svelte:element>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/* root */
|
|
1
2
|
.kit-card {
|
|
2
|
-
--card-color: var(--on, var(--kit-on-
|
|
3
|
-
--card-background: var(--base, var(--kit-
|
|
3
|
+
--card-color: var(--on, var(--kit-on-surface));
|
|
4
|
+
--card-background: var(--base, var(--kit-surface));
|
|
4
5
|
--card-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
+
}
|
|
5
7
|
|
|
8
|
+
.kit-card {
|
|
6
9
|
position: relative;
|
|
7
10
|
display: flex;
|
|
8
11
|
flex-direction: column;
|
|
@@ -11,90 +14,93 @@
|
|
|
11
14
|
transition:
|
|
12
15
|
color 0.5s,
|
|
13
16
|
background-color 0.5s;
|
|
14
|
-
|
|
15
17
|
padding-top: var(--card-spacing-x);
|
|
16
18
|
padding-bottom: var(--card-spacing-x);
|
|
17
19
|
padding-right: var(--card-spacing-y);
|
|
18
20
|
padding-left: var(--card-spacing-y);
|
|
19
|
-
|
|
20
|
-
border-width: 1px;
|
|
21
|
-
border-style: solid;
|
|
22
21
|
border-radius: var(--card-radius);
|
|
23
|
-
|
|
24
|
-
/* theme */
|
|
22
|
+
font-weight: 500;
|
|
25
23
|
color: var(--card-color);
|
|
26
|
-
|
|
27
|
-
border-color: var(--card-background);
|
|
24
|
+
text-decoration: none;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--card-spacing-x: 0.25rem;
|
|
33
|
-
--card-spacing-y: 0.25rem;
|
|
27
|
+
.kit-card.kit-card--clickable {
|
|
28
|
+
cursor: pointer;
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
.kit-card
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
.kit-card.kit-card--clickable::after {
|
|
32
|
+
content: '';
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset: 0;
|
|
35
|
+
background-color: currentColor;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transition: opacity 150ms ease;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
border-radius: inherit;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
.
|
|
42
|
-
--card-spacing-x: 0.5rem;
|
|
43
|
-
--card-spacing-y: 0.5rem;
|
|
41
|
+
.kit-card.kit-card--clickable:hover::after {
|
|
42
|
+
opacity: 0.08;
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
text-decoration: none;
|
|
44
|
+
.kit-card.kit-card--clickable:active::after {
|
|
45
|
+
opacity: 0.12;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
background-color: color-mix(in oklab, var(--card-background) 90%, black);
|
|
47
|
+
.kit-card.kit-card--clickable:focus-visible::after {
|
|
48
|
+
opacity: 0.12;
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
/* density */
|
|
52
|
+
.kit-card[breakpoint]kit-card--density-default {
|
|
53
|
+
--card-spacing-x: calc(var(--kit-spacing) * 2);
|
|
54
|
+
--card-spacing-y: calc(var(--kit-spacing) * 2);
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
background-color: color-mix(in oklab, var(--card-background) 95%, black);
|
|
56
|
+
.kit-card[breakpoint]kit-card--density-compact {
|
|
57
|
+
--card-spacing-x: 0;
|
|
58
|
+
--card-spacing-y: 0;
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
.kit-card[breakpoint]kit-card--density-comfortable {
|
|
61
|
+
--card-spacing-x: calc(var(--kit-spacing) * 4);
|
|
62
|
+
--card-spacing-y: calc(var(--kit-spacing) * 4);
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
/* variant */
|
|
66
|
+
.kit-card[breakpoint]kit-card--variant-filled {
|
|
67
|
+
background-color: var(--card-background);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
.kit-card
|
|
72
|
-
|
|
70
|
+
.kit-card[breakpoint]kit-card--variant-outline {
|
|
71
|
+
--card-color: var(--base, var(--kit-on-surface));
|
|
72
|
+
background-color: transparent;
|
|
73
|
+
}
|
|
74
|
+
.kit-card[breakpoint]kit-card--variant-outline::before {
|
|
75
|
+
content: '';
|
|
76
|
+
position: absolute;
|
|
77
|
+
inset: 0;
|
|
78
|
+
border: 1px solid currentColor;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
border-radius: inherit;
|
|
73
81
|
}
|
|
74
82
|
|
|
75
|
-
.kit-card
|
|
76
|
-
|
|
77
|
-
--card-color: var(--base, var(--kit-neutral));
|
|
83
|
+
.kit-card[breakpoint]kit-card--variant-text {
|
|
84
|
+
--card-color: var(--base, var(--kit-on-surface));
|
|
78
85
|
background-color: transparent;
|
|
86
|
+
border: none;
|
|
79
87
|
}
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
.kit-card.kit-card--
|
|
83
|
-
|
|
89
|
+
/* events */
|
|
90
|
+
.kit-card[class*='card--variant-filled'].kit-card--clickable:active,
|
|
91
|
+
.kit-card.kit-card--active[class*='card--variant-filled'].kit-card--clickable {
|
|
92
|
+
background-color: color-mix(in oklab, var(--card-background) 90%, var(--kit-scrim));
|
|
84
93
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.kit-card
|
|
94
|
+
.kit-card.kit-card--active[class*='card--variant-']:not(
|
|
95
|
+
[class*='variant-filled']
|
|
96
|
+
).kit-card--clickable:active,
|
|
97
|
+
.kit-card.kit-card--active[class*='card--variant-']:not(
|
|
98
|
+
[class*='variant-filled']
|
|
99
|
+
).kit-card--clickable {
|
|
88
100
|
background-color: color-mix(in oklab, currentColor 15%, transparent);
|
|
89
101
|
}
|
|
90
102
|
|
|
91
|
-
|
|
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
|
-
|
|
103
|
+
/* disabled */
|
|
98
104
|
.kit-card.kit-card--disabled,
|
|
99
105
|
.kit-card[disabled],
|
|
100
106
|
.kit-card:disabled {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { getAssets } from '../../internal/index.js';
|
|
3
3
|
import type { CardProps } from './types.js';
|
|
4
4
|
|
|
5
|
+
// external
|
|
6
|
+
import { ripple } from '../../internal/ripple.js';
|
|
7
|
+
|
|
5
8
|
let {
|
|
6
9
|
children,
|
|
7
10
|
ref = $bindable(),
|
|
@@ -11,18 +14,23 @@
|
|
|
11
14
|
light,
|
|
12
15
|
active,
|
|
13
16
|
density = 'default',
|
|
14
|
-
variant,
|
|
17
|
+
variant = 'filled',
|
|
15
18
|
disabled,
|
|
16
19
|
rounded,
|
|
17
20
|
color,
|
|
18
21
|
background,
|
|
22
|
+
noRipple,
|
|
19
23
|
...rest
|
|
20
24
|
}: CardProps = $props();
|
|
21
25
|
|
|
22
26
|
const assets = getAssets();
|
|
27
|
+
let isClickable: boolean = $state(false);
|
|
23
28
|
|
|
24
29
|
$effect(() => {
|
|
30
|
+
const refProps = { ...rest };
|
|
25
31
|
if (href) is = 'a';
|
|
32
|
+
if (refProps?.onclick || href || is === 'a') isClickable = true;
|
|
33
|
+
else isClickable = false;
|
|
26
34
|
});
|
|
27
35
|
</script>
|
|
28
36
|
|
|
@@ -37,11 +45,15 @@
|
|
|
37
45
|
dark && 'dark',
|
|
38
46
|
variant && assets.className('card', 'variant', variant),
|
|
39
47
|
density && assets.className('card', 'density', density),
|
|
48
|
+
isClickable && 'kit-card--clickable',
|
|
40
49
|
active && 'kit-card--active',
|
|
41
50
|
disabled && 'kit-card--disabled',
|
|
42
51
|
rest.class
|
|
43
52
|
]}
|
|
44
53
|
disabled={href ? undefined : disabled}
|
|
54
|
+
use:ripple={{
|
|
55
|
+
disabled: noRipple || disabled || !isClickable
|
|
56
|
+
}}
|
|
45
57
|
style:--base={assets.color(background)}
|
|
46
58
|
style:--on={assets.color(color)}
|
|
47
59
|
style:--shape={assets.shape(rounded)}
|