lapikit 0.0.0-insiders.fb2e87e → 0.0.0-insiders.fbd9b54
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/configuration.js +22 -0
- package/bin/helper.js +23 -0
- package/bin/index.js +41 -0
- package/bin/lapikit.js +37 -5
- package/bin/legacy.js +34 -0
- package/bin/modules/adapter.js +3 -3
- package/bin/modules/plugin.js +223 -0
- package/bin/prompts.js +101 -0
- package/dist/assets/icons/arrow-down.svelte +2 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +6 -14
- package/dist/assets/icons/arrow-up.svelte +2 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +6 -14
- package/dist/assets/icons/close-fill.svelte +2 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +6 -14
- package/dist/assets/icons/loading-fill.svelte +2 -0
- package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
- package/dist/components/accordion/accordion.css +6 -6
- package/dist/components/alert/alert.css +19 -9
- package/dist/components/app/app.css +1 -1
- package/dist/components/appbar/appbar.css +2 -2
- package/dist/components/appbar/appbar.svelte +0 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -1
- package/dist/components/avatar/avatar.css +5 -5
- package/dist/components/button/button.css +165 -194
- package/dist/components/button/button.svelte +39 -31
- package/dist/components/button/button.svelte.d.ts +2 -2
- package/dist/components/button/types.d.ts +7 -5
- package/dist/components/card/card.css +64 -58
- package/dist/components/card/card.svelte +14 -1
- package/dist/components/card/types.d.ts +1 -1
- package/dist/components/chip/chip.css +114 -82
- package/dist/components/chip/chip.svelte +18 -7
- package/dist/components/chip/types.d.ts +2 -1
- package/dist/components/dialog/dialog.css +2 -2
- package/dist/components/dropdown/dropdown.css +4 -4
- package/dist/components/icon/icon.css +14 -11
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/components/list/list.css +145 -119
- package/dist/components/list/list.svelte +1 -3
- package/dist/components/list/modules/list-item.svelte +9 -1
- package/dist/components/list/types.d.ts +2 -5
- package/dist/components/modal/modal.css +10 -6
- package/dist/components/modal/modal.svelte +1 -0
- package/dist/components/popover/popover.css +4 -4
- package/dist/components/separator/separator.css +1 -1
- package/dist/components/textfield/textfield.css +305 -0
- package/dist/components/textfield/textfield.svelte +193 -0
- package/dist/components/textfield/textfield.svelte.d.ts +4 -0
- package/dist/components/textfield/types.d.ts +37 -0
- package/dist/components/textfield/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +6 -6
- package/dist/components/tooltip/tooltip.css +4 -4
- package/dist/internal/assets.svelte.js +2 -0
- package/dist/internal/ripple.d.ts +12 -0
- package/dist/internal/ripple.js +93 -0
- package/dist/preset.js +1 -1
- package/dist/style/animation.css +42 -0
- package/dist/style/normalize.css +2 -0
- package/dist/style/parser/color.js +2 -2
- package/package.json +7 -3
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { getAssets } from '../../internal/index.js';
|
|
3
|
-
import {
|
|
4
|
-
import type { BtnProps } from './types.js';
|
|
3
|
+
import type { ButtonProps } from './types.js';
|
|
5
4
|
|
|
6
5
|
// external
|
|
6
|
+
import { Icon } from '../index.js';
|
|
7
7
|
import LoadingFill from '../../assets/icons/loading-fill.svelte';
|
|
8
|
+
import { ripple } from '../../internal/ripple.js';
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
11
|
children,
|
|
12
|
+
prepend,
|
|
13
|
+
append,
|
|
11
14
|
ref = $bindable(),
|
|
12
15
|
is = 'button',
|
|
13
16
|
href,
|
|
14
17
|
dark,
|
|
15
18
|
light,
|
|
16
19
|
active,
|
|
17
|
-
variant,
|
|
20
|
+
variant = 'filled',
|
|
18
21
|
error,
|
|
19
22
|
info,
|
|
20
23
|
success,
|
|
@@ -25,22 +28,15 @@
|
|
|
25
28
|
type = 'button',
|
|
26
29
|
background,
|
|
27
30
|
color,
|
|
28
|
-
label,
|
|
29
31
|
loading,
|
|
30
32
|
rounded,
|
|
31
33
|
icon,
|
|
32
34
|
load,
|
|
35
|
+
noRipple,
|
|
33
36
|
...rest
|
|
34
|
-
}:
|
|
37
|
+
}: ButtonProps = $props();
|
|
35
38
|
|
|
36
39
|
const assets = getAssets();
|
|
37
|
-
|
|
38
|
-
$effect(() => {
|
|
39
|
-
if (type === 'radio') is = 'input';
|
|
40
|
-
if (type === 'checkbox') is = 'input';
|
|
41
|
-
if (type === 'submit') is = 'input';
|
|
42
|
-
if (type === 'reset') is = 'input';
|
|
43
|
-
});
|
|
44
40
|
</script>
|
|
45
41
|
|
|
46
42
|
<svelte:element
|
|
@@ -49,33 +45,35 @@
|
|
|
49
45
|
{...rest}
|
|
50
46
|
href={href && !disabled ? href : undefined}
|
|
51
47
|
class={[
|
|
52
|
-
'kit-
|
|
48
|
+
'kit-button',
|
|
53
49
|
light && 'light',
|
|
54
50
|
dark && 'dark',
|
|
55
|
-
size && assets.className('
|
|
56
|
-
variant && assets.className('
|
|
57
|
-
density && assets.className('
|
|
58
|
-
error && 'kit-
|
|
59
|
-
info && 'kit-
|
|
60
|
-
success && 'kit-
|
|
61
|
-
warning && 'kit-
|
|
62
|
-
disabled && 'kit-
|
|
63
|
-
active && 'kit-
|
|
64
|
-
loading && 'kit-
|
|
65
|
-
icon && 'kit-
|
|
51
|
+
size && assets.className('button', 'size', size),
|
|
52
|
+
variant && assets.className('button', 'variant', variant),
|
|
53
|
+
density && assets.className('button', 'density', density),
|
|
54
|
+
error && 'kit-button--error',
|
|
55
|
+
info && 'kit-button--info',
|
|
56
|
+
success && 'kit-button--success',
|
|
57
|
+
warning && 'kit-button--warning',
|
|
58
|
+
disabled && 'kit-button--disabled',
|
|
59
|
+
active && 'kit-button--active',
|
|
60
|
+
loading && 'kit-button--loading',
|
|
61
|
+
icon && 'kit-button--icon',
|
|
66
62
|
rest.class
|
|
67
63
|
]}
|
|
68
64
|
tabindex={href && disabled ? -1 : 0}
|
|
69
|
-
aria-disabled={href ? disabled : undefined}
|
|
70
|
-
aria-label={type !== 'button' ? label : undefined}
|
|
71
65
|
disabled={href ? undefined : disabled}
|
|
72
66
|
type={href ? undefined : type}
|
|
67
|
+
use:ripple={{
|
|
68
|
+
component: 'button',
|
|
69
|
+
disabled: noRipple || disabled
|
|
70
|
+
}}
|
|
73
71
|
style:--base={assets.color(background)}
|
|
74
72
|
style:--on={assets.color(color)}
|
|
75
73
|
style:--shape={assets.shape(rounded)}
|
|
76
74
|
>
|
|
77
75
|
{#if loading}
|
|
78
|
-
<div class="kit-
|
|
76
|
+
<div class="kit-button-loading">
|
|
79
77
|
{#if load}
|
|
80
78
|
{@render load?.()}
|
|
81
79
|
{:else}
|
|
@@ -86,9 +84,19 @@
|
|
|
86
84
|
</div>
|
|
87
85
|
{/if}
|
|
88
86
|
|
|
89
|
-
{#if
|
|
90
|
-
<
|
|
91
|
-
{@render
|
|
92
|
-
</
|
|
87
|
+
{#if prepend}
|
|
88
|
+
<div class="kit-button-prepend">
|
|
89
|
+
{@render prepend?.()}
|
|
90
|
+
</div>
|
|
91
|
+
{/if}
|
|
92
|
+
|
|
93
|
+
<div class="kit-button-content">
|
|
94
|
+
{@render children?.()}
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
{#if append}
|
|
98
|
+
<div class="kit-button-append">
|
|
99
|
+
{@render append?.()}
|
|
100
|
+
</div>
|
|
93
101
|
{/if}
|
|
94
102
|
</svelte:element>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const Button: import("svelte").Component<
|
|
1
|
+
import type { ButtonProps } from './types.js';
|
|
2
|
+
declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
|
|
3
3
|
type Button = ReturnType<typeof Button>;
|
|
4
4
|
export default Button;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Component } from '../../internal/types.js';
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ButtonProps extends Component {
|
|
4
4
|
ref?: HTMLElement | null;
|
|
5
|
-
is?: 'button' | 'a'
|
|
5
|
+
is?: 'button' | 'a';
|
|
6
6
|
dark?: boolean;
|
|
7
7
|
light?: boolean;
|
|
8
8
|
href?: string;
|
|
9
|
-
variant?: 'outline' | 'text' | '
|
|
9
|
+
variant?: 'outline' | 'text' | 'filled';
|
|
10
10
|
density?: 'compact' | 'comfortable' | 'default';
|
|
11
11
|
active?: boolean;
|
|
12
12
|
loading?: boolean;
|
|
@@ -20,8 +20,10 @@ export interface BtnProps extends Component {
|
|
|
20
20
|
size?: string | {
|
|
21
21
|
[key: string]: string;
|
|
22
22
|
};
|
|
23
|
-
type?: 'button' | 'submit' | 'reset'
|
|
24
|
-
label?: string;
|
|
23
|
+
type?: 'button' | 'submit' | 'reset';
|
|
25
24
|
icon?: boolean;
|
|
26
25
|
load?: Snippet;
|
|
26
|
+
append?: Snippet;
|
|
27
|
+
prepend?: Snippet;
|
|
28
|
+
noRipple?: boolean;
|
|
27
29
|
}
|
|
@@ -1,100 +1,106 @@
|
|
|
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;
|
|
9
12
|
text-align: start;
|
|
10
13
|
overflow: hidden;
|
|
11
|
-
transition:
|
|
14
|
+
/* transition:
|
|
12
15
|
color 0.5s,
|
|
13
|
-
background-color 0.5s;
|
|
14
|
-
|
|
16
|
+
background-color 0.5s; */
|
|
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,16 @@
|
|
|
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
|
+
component: 'card',
|
|
56
|
+
disabled: noRipple || disabled || !isClickable
|
|
57
|
+
}}
|
|
45
58
|
style:--base={assets.color(background)}
|
|
46
59
|
style:--on={assets.color(color)}
|
|
47
60
|
style:--shape={assets.shape(rounded)}
|