lapikit 0.2.2 → 0.2.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/bin/configuration.js +17 -12
- package/bin/helper.js +0 -38
- package/bin/index.js +1 -9
- package/bin/presets.js +2 -1
- package/bin/prompts.js +46 -79
- package/dist/actions/accordion.svelte.d.ts +9 -0
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.js +2 -1
- package/dist/actions/use-theme.d.ts +1 -0
- package/dist/actions/use-theme.js +18 -0
- package/dist/components/accordion/accordion.css +0 -77
- package/dist/components/accordion/accordion.svelte +5 -3
- package/dist/components/accordion/modules/accordion-item.css +68 -0
- package/dist/components/accordion/modules/accordion-item.svelte +4 -4
- package/dist/components/accordion/types.d.ts +1 -1
- package/dist/components/alert/alert.css +11 -18
- package/dist/components/alert/alert.svelte +4 -4
- package/dist/components/alert/types.d.ts +1 -1
- package/dist/components/app/app.css +1 -2
- package/dist/components/app/app.svelte +24 -23
- package/dist/components/app/app.svelte.d.ts +2 -0
- package/dist/components/appbar/appbar.css +8 -18
- package/dist/components/appbar/appbar.svelte +4 -4
- package/dist/components/appbar/types.d.ts +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.svelte +0 -22
- package/dist/components/aspect-ratio/types.d.ts +1 -1
- package/dist/components/avatar/avatar.css +7 -14
- package/dist/components/avatar/avatar.svelte +4 -4
- package/dist/components/avatar/types.d.ts +1 -1
- package/dist/components/button/button.css +29 -36
- package/dist/components/button/button.svelte +5 -5
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/card/card.css +10 -20
- package/dist/components/card/card.svelte +5 -5
- package/dist/components/card/types.d.ts +1 -1
- package/dist/components/chip/chip.css +26 -33
- package/dist/components/chip/chip.svelte +5 -5
- package/dist/components/chip/types.d.ts +1 -1
- package/dist/components/dialog/dialog.css +13 -20
- package/dist/components/dialog/dialog.svelte +5 -5
- package/dist/components/dialog/types.d.ts +1 -1
- package/dist/components/dropdown/dropdown.css +3 -12
- package/dist/components/dropdown/dropdown.svelte +6 -7
- package/dist/components/dropdown/types.d.ts +1 -1
- package/dist/components/icon/icon.css +11 -12
- package/dist/components/icon/icon.svelte +2 -2
- package/dist/components/icon/types.d.ts +1 -1
- package/dist/components/list/list.css +19 -91
- package/dist/components/list/list.svelte +4 -4
- package/dist/components/list/modules/list-item.css +67 -0
- package/dist/components/list/modules/list-item.svelte +5 -5
- package/dist/components/list/types.d.ts +1 -1
- package/dist/components/modal/modal.css +15 -23
- package/dist/components/modal/modal.svelte +4 -5
- package/dist/components/modal/types.d.ts +1 -1
- package/dist/components/popover/popover.css +3 -12
- package/dist/components/popover/popover.svelte +6 -6
- package/dist/components/popover/types.d.ts +1 -1
- package/dist/components/separator/separator.css +4 -8
- package/dist/components/separator/separator.svelte +5 -5
- package/dist/components/separator/types.d.ts +1 -1
- package/dist/components/spacer/types.d.ts +1 -1
- package/dist/components/textfield/textfield.css +16 -23
- package/dist/components/textfield/textfield.svelte +4 -4
- package/dist/components/textfield/types.d.ts +1 -1
- package/dist/components/toolbar/toolbar.css +14 -26
- package/dist/components/toolbar/toolbar.svelte +4 -4
- package/dist/components/toolbar/types.d.ts +1 -1
- package/dist/components/tooltip/tooltip.css +5 -13
- package/dist/components/tooltip/tooltip.svelte +5 -5
- package/dist/components/tooltip/types.d.ts +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +21 -2
- package/dist/internal/config/presets.d.ts +149 -0
- package/dist/internal/config/presets.js +169 -0
- package/dist/internal/config/variables.d.ts +3 -0
- package/dist/internal/config/variables.js +3 -0
- package/dist/internal/{assets.svelte.js → core/actions/assets.svelte.js} +4 -4
- package/dist/internal/core/actions/dropdown.svelte.d.ts +7 -0
- package/dist/internal/core/actions/popover.svelte.d.ts +7 -0
- package/dist/internal/core/actions/tooltip.svelte.d.ts +7 -0
- package/dist/internal/{ripple.js → core/animations/ripple.js} +3 -3
- package/dist/internal/core/css.d.ts +1 -0
- package/dist/internal/core/css.js +16 -0
- package/dist/internal/core/formatter/component.d.ts +5 -0
- package/dist/internal/core/formatter/component.js +60 -0
- package/dist/internal/core/formatter/device.d.ts +5 -0
- package/dist/internal/core/formatter/device.js +66 -0
- package/dist/internal/core/formatter/index.d.ts +7 -0
- package/dist/internal/core/formatter/index.js +35 -0
- package/dist/internal/core/formatter/style.d.ts +4 -0
- package/dist/internal/core/formatter/style.js +15 -0
- package/dist/internal/core/formatter/theme.d.ts +5 -0
- package/dist/internal/core/formatter/theme.js +44 -0
- package/dist/internal/core/formatter/typography.d.ts +5 -0
- package/dist/internal/core/formatter/typography.js +12 -0
- package/dist/internal/core/standard-colors.d.ts +75 -0
- package/dist/internal/core/standard-colors.js +75 -0
- package/dist/internal/helpers/colors.d.ts +1 -0
- package/dist/internal/{colors.js → helpers/colors.js} +2 -2
- package/dist/internal/helpers/convert.d.ts +1 -0
- package/dist/internal/helpers/convert.js +17 -0
- package/dist/internal/helpers/deep-merge.d.ts +44 -0
- package/dist/internal/helpers/deep-merge.js +80 -0
- package/dist/internal/helpers/parser.d.ts +10 -0
- package/dist/internal/helpers/parser.js +93 -0
- package/dist/internal/plugins/vite.d.ts +8 -0
- package/dist/internal/plugins/vite.js +33 -0
- package/dist/internal/types/components.d.ts +14 -0
- package/dist/internal/types/configuration.d.ts +63 -0
- package/dist/internal/types/configuration.js +1 -0
- package/dist/internal/types/index.d.ts +2 -0
- package/dist/internal/types/index.js +2 -0
- package/dist/stores/breakpoints.d.ts +6 -0
- package/dist/stores/breakpoints.js +14 -0
- package/dist/stores/components.d.ts +8 -0
- package/dist/stores/components.js +26 -0
- package/dist/stores/devices.d.ts +6 -0
- package/dist/stores/devices.js +9 -0
- package/dist/stores/index.d.ts +4 -10
- package/dist/stores/index.js +4 -47
- package/dist/stores/themes.d.ts +2 -0
- package/dist/stores/themes.js +4 -0
- package/dist/styles/animation.css +33 -0
- package/dist/styles/keyframes.css +30 -0
- package/dist/{style/normalize.css → styles/reset.css} +15 -7
- package/dist/themes.css +0 -0
- package/package.json +7 -3
- package/bin/lapikit.js +0 -86
- package/bin/legacy.js +0 -34
- package/bin/modules/adapter.js +0 -52
- package/bin/modules/plugin.js +0 -223
- package/bin/modules/preset.js +0 -11
- package/dist/internal/colors.d.ts +0 -1
- package/dist/internal/index.d.ts +0 -4
- package/dist/internal/index.js +0 -4
- package/dist/internal/types.d.ts +0 -57
- package/dist/internal/unit.d.ts +0 -1
- package/dist/internal/unit.js +0 -11
- package/dist/plugin/modules/config.d.ts +0 -2
- package/dist/plugin/modules/config.js +0 -54
- package/dist/plugin/modules/importer.d.ts +0 -1
- package/dist/plugin/modules/importer.js +0 -15
- package/dist/plugin/vitejs.d.ts +0 -6
- package/dist/plugin/vitejs.js +0 -26
- package/dist/preset.d.ts +0 -2
- package/dist/preset.js +0 -92
- package/dist/style/animation.css +0 -62
- package/dist/style/css.d.ts +0 -2
- package/dist/style/css.js +0 -34
- package/dist/style/parser/color.d.ts +0 -5
- package/dist/style/parser/color.js +0 -88
- package/dist/style/parser/component.d.ts +0 -2
- package/dist/style/parser/component.js +0 -115
- package/dist/style/parser/device.d.ts +0 -2
- package/dist/style/parser/device.js +0 -40
- package/dist/style/parser/index.d.ts +0 -4
- package/dist/style/parser/index.js +0 -4
- package/dist/style/parser/variable.d.ts +0 -2
- package/dist/style/parser/variable.js +0 -25
- package/dist/style/variable.css +0 -12
- /package/dist/{components/accordion → actions}/accordion.svelte.js +0 -0
- /package/dist/internal/{assets.svelte.d.ts → core/actions/assets.svelte.d.ts} +0 -0
- /package/dist/{components/dropdown → internal/core/actions}/dropdown.svelte.js +0 -0
- /package/dist/{components/popover → internal/core/actions}/popover.svelte.js +0 -0
- /package/dist/{components/tooltip → internal/core/actions}/tooltip.svelte.js +0 -0
- /package/dist/internal/{ripple.d.ts → core/animations/ripple.d.ts} +0 -0
- /package/dist/internal/{ansi.d.ts → core/bin/ansi.d.ts} +0 -0
- /package/dist/internal/{ansi.js → core/bin/ansi.js} +0 -0
- /package/dist/internal/{terminal.d.ts → core/bin/terminal.d.ts} +0 -0
- /package/dist/internal/{terminal.js → core/bin/terminal.js} +0 -0
- /package/dist/internal/{minify.d.ts → core/minify.d.ts} +0 -0
- /package/dist/internal/{minify.js → core/minify.js} +0 -0
- /package/dist/{utils/x11.d.ts → internal/core/x11-colors.d.ts} +0 -0
- /package/dist/{utils/x11.js → internal/core/x11-colors.js} +0 -0
- /package/dist/internal/{clickOutside.d.ts → helpers/outside.d.ts} +0 -0
- /package/dist/internal/{clickOutside.js → helpers/outside.js} +0 -0
- /package/dist/internal/{scroll.d.ts → helpers/scroll.d.ts} +0 -0
- /package/dist/internal/{scroll.js → helpers/scroll.js} +0 -0
- /package/dist/internal/{types.js → types/components.js} +0 -0
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { BROWSER } from 'esm-env';
|
|
3
|
-
import {
|
|
4
|
-
colorSchemeSystem,
|
|
5
|
-
modalOpen,
|
|
6
|
-
setOpenModal,
|
|
7
|
-
updateThemeStore
|
|
8
|
-
} from '../../stores/index.js';
|
|
9
3
|
import type { Snippet } from 'svelte';
|
|
10
|
-
|
|
4
|
+
import { useTheme } from '../../actions/use-theme.js';
|
|
5
|
+
import { modalOpen, setOpenModal } from '../../stores/components.js';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
children,
|
|
9
|
+
themes,
|
|
10
|
+
storageKey = '@lapikit/theme'
|
|
11
|
+
}: { children: Snippet; themes?: string | string[]; storageKey?: string } = $props();
|
|
11
12
|
|
|
12
13
|
$effect.pre(() => {
|
|
13
14
|
if (!BROWSER) return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
}
|
|
15
|
+
const colorScheme = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
16
|
+
? 'dark'
|
|
17
|
+
: 'light';
|
|
18
|
+
const localTheme = localStorage.getItem(storageKey);
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
if (localTheme) {
|
|
21
|
+
useTheme(localTheme);
|
|
22
|
+
} else if (colorScheme) {
|
|
23
|
+
if (typeof themes === 'string') {
|
|
24
|
+
useTheme(themes);
|
|
25
|
+
} else if (typeof themes === 'object' && Array.isArray(themes)) {
|
|
26
|
+
if (colorScheme === 'dark') useTheme(themes[1] ?? themes[0]);
|
|
27
|
+
else useTheme(themes[0]);
|
|
28
|
+
} else {
|
|
29
|
+
useTheme(colorScheme);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
31
32
|
});
|
|
32
33
|
</script>
|
|
33
34
|
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
/* root default*/
|
|
2
1
|
.kit-appbar {
|
|
3
|
-
--appbar-
|
|
4
|
-
--appbar-background: var(--base, var(--kit-surface));
|
|
5
|
-
--appbar-radius: var(--shape, 0);
|
|
6
|
-
--appbar-padding-wrapper: var(--kit-spacing) * 4;
|
|
7
|
-
}
|
|
2
|
+
--appbar-padding-wrapper: var(--system-spacing) * 4;
|
|
8
3
|
|
|
9
|
-
.kit-appbar {
|
|
10
4
|
display: flex;
|
|
11
5
|
align-items: center;
|
|
12
6
|
border-style: solid;
|
|
13
7
|
border-width: 1px;
|
|
14
|
-
border-radius: var(--appbar-
|
|
15
|
-
color: var(--appbar-color);
|
|
16
|
-
background-color: var(--appbar-background);
|
|
17
|
-
border-color: var(--appbar-background);
|
|
18
|
-
/* transition:
|
|
19
|
-
color 0.5s,
|
|
20
|
-
border-color 0.5s,
|
|
21
|
-
background-color 0.5s; */
|
|
8
|
+
border-radius: var(--appbar-shape);
|
|
9
|
+
color: var(--appbar-color, var(--kit-label-primary));
|
|
10
|
+
background-color: var(--appbar-background, var(--kit-background-grouped-tertiary));
|
|
11
|
+
border-color: var(--appbar-background, var(--kit-background-grouped-tertiary));
|
|
22
12
|
}
|
|
23
13
|
|
|
24
14
|
/* wrapper */
|
|
@@ -34,15 +24,15 @@
|
|
|
34
24
|
/* density */
|
|
35
25
|
.kit-appbar[breakpoint]kit-appbar--density-default {
|
|
36
26
|
height: 4rem;
|
|
37
|
-
padding-inline: calc(var(--
|
|
27
|
+
padding-inline: calc(var(--system-spacing) * 1.5);
|
|
38
28
|
}
|
|
39
29
|
|
|
40
30
|
.kit-appbar[breakpoint]kit-appbar--density-compact {
|
|
41
31
|
height: 3.5rem;
|
|
42
|
-
padding-inline: calc(var(--
|
|
32
|
+
padding-inline: calc(var(--system-spacing) * 0.75);
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
.kit-appbar[breakpoint]kit-appbar--density-comfortable {
|
|
46
36
|
height: 4.5rem;
|
|
47
|
-
padding-inline: calc(var(--
|
|
37
|
+
padding-inline: calc(var(--system-spacing) * 2.25);
|
|
48
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { AppbarProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
let {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
density && assets.className('appbar', 'density', density),
|
|
31
31
|
rest.class
|
|
32
32
|
]}
|
|
33
|
-
style:--
|
|
34
|
-
style:--
|
|
35
|
-
style:--shape={assets.shape(rounded)}
|
|
33
|
+
style:--appbar-background={assets.color(background)}
|
|
34
|
+
style:--appbar-color={assets.color(color)}
|
|
35
|
+
style:--appbar-shape={assets.shape(rounded)}
|
|
36
36
|
>
|
|
37
37
|
<div class={['kit-appbar--wrapper', classContent]}>
|
|
38
38
|
{@render children?.()}
|
|
@@ -23,25 +23,3 @@
|
|
|
23
23
|
<div class="kit-aspect-ratio--sizer" style={`padding-bottom: ${paddingBottom}%;`}></div>
|
|
24
24
|
{@render children?.()}
|
|
25
25
|
</div>
|
|
26
|
-
|
|
27
|
-
<style>
|
|
28
|
-
.kit-aspect-ratio {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex: 1 0 auto;
|
|
31
|
-
max-height: 100%;
|
|
32
|
-
max-width: 100%;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
position: relative;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.kit-aspect-ratio--inline {
|
|
38
|
-
display: inline-flex;
|
|
39
|
-
flex: 0 0 auto;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.kit-aspect-ratio--sizer {
|
|
43
|
-
flex: 1 0 0px;
|
|
44
|
-
transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
.kit-avatar {
|
|
2
|
-
--avatar-color: var(--on, var(--kit-on-container));
|
|
3
|
-
--avatar-background: var(--base, var(--kit-container));
|
|
4
|
-
--avatar-radius: var(--shape, var(--kit-radius-full));
|
|
5
|
-
|
|
6
2
|
display: flex;
|
|
7
3
|
align-items: center;
|
|
8
4
|
justify-content: center;
|
|
@@ -11,15 +7,12 @@
|
|
|
11
7
|
padding-bottom: var(--avatar-spacing-x);
|
|
12
8
|
padding-right: var(--avatar-spacing-y);
|
|
13
9
|
padding-left: var(--avatar-spacing-y);
|
|
14
|
-
|
|
15
10
|
border-width: 1px;
|
|
16
11
|
border-style: solid;
|
|
17
|
-
border-radius: var(--avatar-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: var(--avatar-
|
|
21
|
-
background-color: var(--avatar-background);
|
|
22
|
-
border-color: var(--avatar-background);
|
|
12
|
+
border-radius: var(--avatar-shape, var(--system-shape-full));
|
|
13
|
+
color: var(--avatar-color, var(--kit-label-primary));
|
|
14
|
+
background-color: var(--avatar-background, var(--kit-background-secondary));
|
|
15
|
+
border-color: var(--avatar-background, var(--kit-background-secondary));
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
.kit-avatar.kit-avatar--image {
|
|
@@ -91,19 +84,19 @@
|
|
|
91
84
|
|
|
92
85
|
/* variant */
|
|
93
86
|
.kit-avatar[breakpoint]kit-avatar--variant-outline {
|
|
94
|
-
--avatar-color: var(--base, var(--kit-
|
|
87
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
95
88
|
background-color: transparent;
|
|
96
89
|
border: 1px solid currentColor;
|
|
97
90
|
}
|
|
98
91
|
|
|
99
92
|
.kit-avatar[breakpoint]kit-avatar--variant-text {
|
|
100
|
-
--avatar-color: var(--base, var(--kit-
|
|
93
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
101
94
|
background-color: transparent;
|
|
102
95
|
border-color: transparent;
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
.kit-avatar[breakpoint]kit-avatar--variant-dash {
|
|
106
|
-
--avatar-color: var(--base, var(--kit-
|
|
99
|
+
--avatar-color: var(--base, var(--kit-background-grouped-tertiary));
|
|
107
100
|
background-color: transparent;
|
|
108
101
|
border: 1px dashed currentColor;
|
|
109
102
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/assets.svelte.js';
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { AvatarProps } from './types.js';
|
|
4
4
|
let {
|
|
5
5
|
children,
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
density && assets.className('avatar', 'density', density),
|
|
35
35
|
rest.class
|
|
36
36
|
]}
|
|
37
|
-
style:--
|
|
38
|
-
style:--
|
|
39
|
-
style:--shape={assets.shape(rounded)}
|
|
37
|
+
style:--avatar-background={assets.color(background)}
|
|
38
|
+
style:--avatar-color={assets.color(color)}
|
|
39
|
+
style:--avatar-shape={assets.shape(rounded)}
|
|
40
40
|
>
|
|
41
41
|
{#if src}
|
|
42
42
|
<img {src} {alt} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component } from '../../internal/types.js';
|
|
1
|
+
import type { Component } from '../../internal/types/index.js';
|
|
2
2
|
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
3
|
type AvatarDensity = 'compact' | 'comfortable' | 'default';
|
|
4
4
|
type AvatarVariant = 'outline' | 'text' | 'dash';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/* root */
|
|
2
|
-
.kit-button {
|
|
3
|
-
--button-color: var(--on, var(--kit-on-container));
|
|
4
|
-
--button-background: var(--base, var(--kit-container));
|
|
5
|
-
--button-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
.kit-button {
|
|
9
2
|
position: relative;
|
|
10
3
|
cursor: pointer;
|
|
@@ -14,8 +7,8 @@
|
|
|
14
7
|
padding-bottom: var(--button-spacing-x);
|
|
15
8
|
padding-right: var(--button-spacing-y);
|
|
16
9
|
padding-left: var(--button-spacing-y);
|
|
17
|
-
border-radius: var(--button-
|
|
18
|
-
color: var(--button-color);
|
|
10
|
+
border-radius: var(--button-shape, var(--system-shape-md));
|
|
11
|
+
color: var(--button-color, var(--kit-label-primary));
|
|
19
12
|
font-weight: 500;
|
|
20
13
|
text-decoration: none;
|
|
21
14
|
}
|
|
@@ -29,8 +22,8 @@
|
|
|
29
22
|
align-items: center;
|
|
30
23
|
justify-content: center;
|
|
31
24
|
white-space: nowrap;
|
|
32
|
-
gap: calc(var(--
|
|
33
|
-
font-size: calc(var(--
|
|
25
|
+
gap: calc(var(--system-spacing) * var(--button-multiplier-gap));
|
|
26
|
+
font-size: calc(var(--system-spacing) * var(--button-multiplier-font-size));
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
.kit-button::after {
|
|
@@ -106,49 +99,49 @@
|
|
|
106
99
|
|
|
107
100
|
/* density */
|
|
108
101
|
.kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-default {
|
|
109
|
-
height: calc(var(--
|
|
102
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x));
|
|
110
103
|
--button-spacing-x: 0;
|
|
111
|
-
--button-spacing-y: calc(var(--
|
|
104
|
+
--button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y));
|
|
112
105
|
}
|
|
113
106
|
.kit-button.kit-button--icon[breakpoint]kit-button--density-default {
|
|
114
|
-
height: calc(var(--
|
|
115
|
-
width: calc(var(--
|
|
107
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x));
|
|
108
|
+
width: calc(var(--system-spacing) * var(--button-multiplier-x));
|
|
116
109
|
--button-spacing-x: 0;
|
|
117
110
|
--button-spacing-y: 0;
|
|
118
111
|
}
|
|
119
112
|
|
|
120
113
|
.kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-compact {
|
|
121
|
-
height: calc(var(--
|
|
114
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
|
|
122
115
|
--button-spacing-x: 0;
|
|
123
|
-
--button-spacing-y: calc(var(--
|
|
116
|
+
--button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y) - 0.25rem);
|
|
124
117
|
}
|
|
125
118
|
.kit-button.kit-button--icon[breakpoint]kit-button--density-compact {
|
|
126
|
-
height: calc(var(--
|
|
127
|
-
width: calc(var(--
|
|
119
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
|
|
120
|
+
width: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
|
|
128
121
|
--button-spacing-x: 0;
|
|
129
122
|
--button-spacing-y: 0;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
.kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-comfortable {
|
|
133
|
-
height: calc(var(--
|
|
126
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
|
|
134
127
|
--button-spacing-x: 0;
|
|
135
|
-
--button-spacing-y: calc(var(--
|
|
128
|
+
--button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y) + 0.25rem);
|
|
136
129
|
}
|
|
137
130
|
.kit-button.kit-button--icon[breakpoint]kit-button--density-comfortable {
|
|
138
|
-
height: calc(var(--
|
|
139
|
-
width: calc(var(--
|
|
131
|
+
height: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
|
|
132
|
+
width: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
|
|
140
133
|
--button-spacing-x: 0;
|
|
141
134
|
--button-spacing-y: 0;
|
|
142
135
|
}
|
|
143
136
|
|
|
144
137
|
/* variant */
|
|
145
138
|
.kit-button[breakpoint]kit-button--variant-filled {
|
|
146
|
-
background-color: var(--button-background);
|
|
139
|
+
background-color: var(--button-background, var(--kit-background-grouped-primary));
|
|
147
140
|
}
|
|
148
141
|
|
|
149
142
|
.kit-button[breakpoint]kit-button--variant-outline {
|
|
150
|
-
--button-color: var(--on, var(--kit-
|
|
151
|
-
background-color: var(--button-background);
|
|
143
|
+
--button-color: var(--on, var(--kit-label-primary));
|
|
144
|
+
background-color: var(--button-background, var(--kit-background-grouped-primary));
|
|
152
145
|
}
|
|
153
146
|
.kit-button[breakpoint]kit-button--variant-outline::before {
|
|
154
147
|
content: '';
|
|
@@ -160,7 +153,7 @@
|
|
|
160
153
|
}
|
|
161
154
|
|
|
162
155
|
.kit-button[breakpoint]kit-button--variant-text {
|
|
163
|
-
--button-color: var(--base, var(--kit-
|
|
156
|
+
--button-color: var(--base, var(--kit-label-primary));
|
|
164
157
|
background-color: transparent;
|
|
165
158
|
border: none;
|
|
166
159
|
}
|
|
@@ -168,37 +161,37 @@
|
|
|
168
161
|
/* state */
|
|
169
162
|
.kit-button.kit-button--info[class*='button--variant-filled'] {
|
|
170
163
|
--on: var(--kit-on-info);
|
|
171
|
-
--base: var(--kit-info);
|
|
164
|
+
--base: var(--kit-accent-info);
|
|
172
165
|
}
|
|
173
166
|
.kit-button.kit-button--info[class*='button--variant-']:not([class*='variant-filled']) {
|
|
174
|
-
--base: var(--kit-info);
|
|
167
|
+
--base: var(--kit-accent-info);
|
|
175
168
|
}
|
|
176
169
|
.kit-button.kit-button--success[class*='button--variant-filled'] {
|
|
177
170
|
--on: var(--kit-on-success);
|
|
178
|
-
--base: var(--kit-
|
|
171
|
+
--base: var(--kit-accent-successs);
|
|
179
172
|
}
|
|
180
173
|
.kit-button.kit-button--success[class*='button--variant-']:not([class*='variant-filled']) {
|
|
181
|
-
--base: var(--kit-
|
|
174
|
+
--base: var(--kit-accent-successs);
|
|
182
175
|
}
|
|
183
176
|
.kit-button.kit-button--warning[class*='button--variant-filled'] {
|
|
184
177
|
--on: var(--kit-on-warning);
|
|
185
|
-
--base: var(--kit-warning);
|
|
178
|
+
--base: var(--kit-accent-warning);
|
|
186
179
|
}
|
|
187
180
|
.kit-button.kit-button--warning[class*='button--variant-']:not([class*='variant-filled']) {
|
|
188
|
-
--base: var(--kit-warning);
|
|
181
|
+
--base: var(--kit-accent-warning);
|
|
189
182
|
}
|
|
190
183
|
.kit-button.kit-button--error[class*='button--variant-filled'] {
|
|
191
184
|
--on: var(--kit-on-error);
|
|
192
|
-
--base: var(--kit-
|
|
185
|
+
--base: var(--kit-accent-destructive);
|
|
193
186
|
}
|
|
194
187
|
.kit-button.kit-button--error[class*='button--variant-']:not([class*='variant-filled']) {
|
|
195
|
-
--base: var(--kit-
|
|
188
|
+
--base: var(--kit-accent-destructive);
|
|
196
189
|
}
|
|
197
190
|
|
|
198
191
|
/* events */
|
|
199
192
|
.kit-button[class*='button--variant-filled']:active,
|
|
200
193
|
.kit-button.kit-button--active[class*='button--variant-filled'] {
|
|
201
|
-
background-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-
|
|
194
|
+
background-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-state-shadow));
|
|
202
195
|
}
|
|
203
196
|
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']):active,
|
|
204
197
|
.kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { ButtonProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
// external
|
|
6
6
|
import { Icon } from '../index.js';
|
|
7
7
|
import LoadingFill from '../../assets/icons/loading-fill.svelte';
|
|
8
|
-
import { ripple } from '../../internal/ripple.js';
|
|
8
|
+
import { ripple } from '../../internal/core/animations/ripple.js';
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
children,
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
component: 'button',
|
|
69
69
|
disabled: noRipple || disabled
|
|
70
70
|
}}
|
|
71
|
-
style:--
|
|
72
|
-
style:--
|
|
73
|
-
style:--shape={assets.shape(rounded)}
|
|
71
|
+
style:--button-background={assets.color(background)}
|
|
72
|
+
style:--button-color={assets.color(color)}
|
|
73
|
+
style:--button-shape={assets.shape(rounded)}
|
|
74
74
|
>
|
|
75
75
|
{#if loading}
|
|
76
76
|
<div class="kit-button-loading">
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
/* root */
|
|
2
|
-
.kit-card {
|
|
3
|
-
--card-color: var(--on, var(--kit-on-surface));
|
|
4
|
-
--card-background: var(--base, var(--kit-surface));
|
|
5
|
-
--card-radius: var(--shape, var(--kit-radius-md));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
.kit-card {
|
|
9
2
|
position: relative;
|
|
10
3
|
display: flex;
|
|
11
4
|
flex-direction: column;
|
|
12
5
|
text-align: start;
|
|
13
6
|
overflow: hidden;
|
|
14
|
-
/* transition:
|
|
15
|
-
color 0.5s,
|
|
16
|
-
background-color 0.5s; */
|
|
17
7
|
padding-top: var(--card-spacing-x);
|
|
18
8
|
padding-bottom: var(--card-spacing-x);
|
|
19
9
|
padding-right: var(--card-spacing-y);
|
|
20
10
|
padding-left: var(--card-spacing-y);
|
|
21
|
-
border-radius: var(--card-
|
|
11
|
+
border-radius: var(--card-shape, var(--system-shape-md));
|
|
22
12
|
font-weight: 500;
|
|
23
|
-
color: var(--card-color);
|
|
13
|
+
color: var(--card-color, var(--kit-label-primary));
|
|
24
14
|
text-decoration: none;
|
|
25
15
|
}
|
|
26
16
|
|
|
@@ -50,25 +40,25 @@
|
|
|
50
40
|
|
|
51
41
|
/* density */
|
|
52
42
|
.kit-card[breakpoint]kit-card--density-default {
|
|
53
|
-
--card-spacing-x: calc(var(--
|
|
54
|
-
--card-spacing-y: calc(var(--
|
|
43
|
+
--card-spacing-x: calc(var(--system-spacing) * 2);
|
|
44
|
+
--card-spacing-y: calc(var(--system-spacing) * 2);
|
|
55
45
|
}
|
|
56
46
|
.kit-card[breakpoint]kit-card--density-compact {
|
|
57
47
|
--card-spacing-x: 0;
|
|
58
48
|
--card-spacing-y: 0;
|
|
59
49
|
}
|
|
60
50
|
.kit-card[breakpoint]kit-card--density-comfortable {
|
|
61
|
-
--card-spacing-x: calc(var(--
|
|
62
|
-
--card-spacing-y: calc(var(--
|
|
51
|
+
--card-spacing-x: calc(var(--system-spacing) * 4);
|
|
52
|
+
--card-spacing-y: calc(var(--system-spacing) * 4);
|
|
63
53
|
}
|
|
64
54
|
|
|
65
55
|
/* variant */
|
|
66
56
|
.kit-card[breakpoint]kit-card--variant-filled {
|
|
67
|
-
background-color: var(--card-background);
|
|
57
|
+
background-color: var(--card-background, var(--kit-background-grouped-secondary));
|
|
68
58
|
}
|
|
69
59
|
|
|
70
60
|
.kit-card[breakpoint]kit-card--variant-outline {
|
|
71
|
-
--card-color: var(--base, var(--kit-
|
|
61
|
+
--card-color: var(--base, var(--kit-label-primary));
|
|
72
62
|
background-color: transparent;
|
|
73
63
|
}
|
|
74
64
|
.kit-card[breakpoint]kit-card--variant-outline::before {
|
|
@@ -81,7 +71,7 @@
|
|
|
81
71
|
}
|
|
82
72
|
|
|
83
73
|
.kit-card[breakpoint]kit-card--variant-text {
|
|
84
|
-
--card-color: var(--base, var(--kit-
|
|
74
|
+
--card-color: var(--base, var(--kit-label-primary));
|
|
85
75
|
background-color: transparent;
|
|
86
76
|
border: none;
|
|
87
77
|
}
|
|
@@ -89,7 +79,7 @@
|
|
|
89
79
|
/* events */
|
|
90
80
|
.kit-card[class*='card--variant-filled'].kit-card--clickable:active,
|
|
91
81
|
.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-
|
|
82
|
+
background-color: color-mix(in oklab, var(--card-background) 90%, var(--kit-state-shadow));
|
|
93
83
|
}
|
|
94
84
|
.kit-card.kit-card--active[class*='card--variant-']:not(
|
|
95
85
|
[class*='variant-filled']
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getAssets } from '../../internal/
|
|
2
|
+
import { getAssets } from '../../internal/core/actions/assets.svelte.js';
|
|
3
3
|
import type { CardProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
// external
|
|
6
|
-
import { ripple } from '../../internal/ripple.js';
|
|
6
|
+
import { ripple } from '../../internal/core/animations/ripple.js';
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
children,
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
component: 'card',
|
|
56
56
|
disabled: noRipple || disabled || !isClickable
|
|
57
57
|
}}
|
|
58
|
-
style:--
|
|
59
|
-
style:--
|
|
60
|
-
style:--shape={assets.shape(rounded)}
|
|
58
|
+
style:--card-background={assets.color(background)}
|
|
59
|
+
style:--card-color={assets.color(color)}
|
|
60
|
+
style:--card-shape={assets.shape(rounded)}
|
|
61
61
|
>
|
|
62
62
|
{@render children?.()}
|
|
63
63
|
</svelte:element>
|