lapikit 0.1.7 → 0.1.8
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/appbar/appbar.css +49 -0
- package/dist/components/appbar/appbar.svelte +41 -0
- package/dist/components/appbar/appbar.svelte.d.ts +4 -0
- package/dist/components/appbar/types.d.ts +15 -0
- package/dist/components/appbar/types.js +1 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +23 -0
- package/dist/components/avatar/avatar.svelte +4 -4
- package/dist/components/avatar/types.d.ts +1 -1
- package/dist/components/button/button.css +4 -4
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/list/list.css +5 -5
- package/dist/components/modal/modal.css +1 -1
- package/dist/components/spacer/spacer.css +3 -0
- package/dist/components/spacer/spacer.svelte +7 -0
- package/dist/components/spacer/spacer.svelte.d.ts +4 -0
- package/dist/components/spacer/types.d.ts +4 -0
- package/dist/components/spacer/types.js +1 -0
- package/dist/components/toolbar/toolbar.css +5 -18
- package/dist/components/toolbar/toolbar.svelte +1 -1
- package/dist/internal/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/stores/index.js +6 -2
- package/dist/style/parser/device.js +31 -19
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* root default*/
|
|
2
|
+
.kit-appbar {
|
|
3
|
+
--appbar-color: var(--on, var(--kit-on-surface));
|
|
4
|
+
--appbar-background: var(--base, var(--kit-surface));
|
|
5
|
+
--appbar-radius: var(--shape, 0);
|
|
6
|
+
--appbar-padding-wrapper: var(--kit-spacing) * 4;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.kit-appbar {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
min-width: max-content;
|
|
13
|
+
border-style: solid;
|
|
14
|
+
border-width: 1px;
|
|
15
|
+
border-radius: var(--appbar-radius);
|
|
16
|
+
color: var(--appbar-color);
|
|
17
|
+
background-color: var(--appbar-background);
|
|
18
|
+
border-color: var(--appbar-background);
|
|
19
|
+
transition:
|
|
20
|
+
color 0.5s,
|
|
21
|
+
border-color 0.5s,
|
|
22
|
+
background-color 0.5s;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* wrapper */
|
|
26
|
+
.kit-appbar .kit-appbar--wrapper {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
height: calc(100% - (var(--appbar-padding-wrapper) * 2));
|
|
31
|
+
width: calc(100% - (var(--appbar-padding-wrapper) * 2));
|
|
32
|
+
margin: 0 auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* density */
|
|
36
|
+
.kit-appbar[breakpoint]kit-appbar--density-default {
|
|
37
|
+
height: 4rem;
|
|
38
|
+
padding-inline: calc(var(--kit-spacing) * 1.5);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.kit-appbar[breakpoint]kit-appbar--density-compact {
|
|
42
|
+
height: 3.5rem;
|
|
43
|
+
padding-inline: calc(var(--kit-spacing) * 0.75);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.kit-appbar[breakpoint]kit-appbar--density-comfortable {
|
|
47
|
+
height: 4.5rem;
|
|
48
|
+
padding-inline: calc(var(--kit-spacing) * 2.25);
|
|
49
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { AppbarProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
is = 'header',
|
|
9
|
+
classContent,
|
|
10
|
+
light,
|
|
11
|
+
dark,
|
|
12
|
+
rounded,
|
|
13
|
+
background,
|
|
14
|
+
color,
|
|
15
|
+
density = 'default',
|
|
16
|
+
...rest
|
|
17
|
+
}: AppbarProps = $props();
|
|
18
|
+
|
|
19
|
+
const assets = getAssets();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<svelte:element
|
|
23
|
+
this={is}
|
|
24
|
+
bind:this={ref}
|
|
25
|
+
{...rest}
|
|
26
|
+
role="heading"
|
|
27
|
+
class={[
|
|
28
|
+
'kit-appbar',
|
|
29
|
+
light && 'light',
|
|
30
|
+
dark && 'dark',
|
|
31
|
+
density && assets.className('appbar', 'density', density),
|
|
32
|
+
rest.class
|
|
33
|
+
]}
|
|
34
|
+
style:--base={assets.color(background)}
|
|
35
|
+
style:--on={assets.color(color)}
|
|
36
|
+
style:--shape={assets.shape(rounded)}
|
|
37
|
+
>
|
|
38
|
+
<div class={['kit-appbar--wrapper', classContent]}>
|
|
39
|
+
{@render children?.()}
|
|
40
|
+
</div>
|
|
41
|
+
</svelte:element>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type Density = 'compact' | 'comfortable' | 'default';
|
|
3
|
+
export interface AppbarProps extends Component {
|
|
4
|
+
is?: 'div' | 'header' | 'nav';
|
|
5
|
+
rounded?: string;
|
|
6
|
+
density?: Density | {
|
|
7
|
+
[key: string]: Density;
|
|
8
|
+
};
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
light?: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
background?: string;
|
|
13
|
+
classContent?: string | string[] | undefined;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,3 +23,26 @@
|
|
|
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
|
+
background-color: aqua;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex: 1 0 auto;
|
|
32
|
+
max-height: 100%;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.kit-aspect-ratio--inline {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
flex: 0 0 auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.kit-aspect-ratio--sizer {
|
|
44
|
+
flex: 1 0 0px;
|
|
45
|
+
transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
alt,
|
|
12
12
|
background,
|
|
13
13
|
color,
|
|
14
|
-
|
|
14
|
+
src,
|
|
15
15
|
variant,
|
|
16
16
|
density = 'default',
|
|
17
17
|
...rest
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
'kit-avatar',
|
|
29
29
|
light && 'light',
|
|
30
30
|
dark && 'dark',
|
|
31
|
-
|
|
31
|
+
src && 'kit-avatar--image',
|
|
32
32
|
size && assets.className('avatar', 'size', size),
|
|
33
33
|
variant && assets.className('avatar', 'variant', variant),
|
|
34
34
|
density && assets.className('avatar', 'density', density),
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
style:--on={assets.color(color)}
|
|
39
39
|
style:--shape={assets.shape(rounded)}
|
|
40
40
|
>
|
|
41
|
-
{#if
|
|
42
|
-
<img src
|
|
41
|
+
{#if src}
|
|
42
|
+
<img {src} {alt} />
|
|
43
43
|
{:else}
|
|
44
44
|
{@render children?.()}
|
|
45
45
|
{/if}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
padding-right: var(--btn-spacing-y);
|
|
13
13
|
padding-left: var(--btn-spacing-y);
|
|
14
14
|
cursor: pointer;
|
|
15
|
-
|
|
15
|
+
width: fit-content;
|
|
16
16
|
border-width: 1px;
|
|
17
17
|
border-style: solid;
|
|
18
18
|
border-radius: var(--btn-radius);
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
/* density */
|
|
83
83
|
.kit-btn:not(.kit-btn--icon)[breakpoint]kit-btn--density-default {
|
|
84
84
|
height: calc(var(--btn-height));
|
|
85
|
-
min-width: calc(var(--btn-height));
|
|
85
|
+
/* min-width: calc(var(--btn-height)); */
|
|
86
86
|
--btn-spacing-x: 0;
|
|
87
87
|
--btn-spacing-y: calc(var(--kit-spacing) * var(--btn-multiplier-y));
|
|
88
88
|
}
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
|
|
96
96
|
.kit-btn:not(.kit-btn--icon)[breakpoint]kit-btn--density-compact {
|
|
97
97
|
height: calc(var(--btn-height) - 0.25rem);
|
|
98
|
-
min-width: calc(var(--btn-height - 0.25rem)
|
|
98
|
+
/* min-width: calc(var(--btn-height) - 0.25rem); */
|
|
99
99
|
--btn-spacing-x: 0;
|
|
100
100
|
--btn-spacing-y: calc(var(--kit-spacing) * var(--btn-multiplier-y) - 0.25rem);
|
|
101
101
|
}
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
.kit-btn:not(.kit-btn--icon)[breakpoint]kit-btn--density-comfortable {
|
|
110
110
|
height: calc(var(--btn-height) + 0.25rem);
|
|
111
|
-
min-width: calc(var(--btn-height) + 0.25rem);
|
|
111
|
+
/* min-width: calc(var(--btn-height) + 0.25rem); */
|
|
112
112
|
--btn-spacing-x: 0;
|
|
113
113
|
--btn-spacing-y: calc(var(--kit-spacing) * var(--btn-multiplier-y) + 0.25rem);
|
|
114
114
|
}
|
|
@@ -17,3 +17,5 @@ export { default as Alert } from './alert/alert.svelte';
|
|
|
17
17
|
export { default as Chip } from './chip/chip.svelte';
|
|
18
18
|
export { default as Card } from './card/card.svelte';
|
|
19
19
|
export { default as Toolbar } from './toolbar/toolbar.svelte';
|
|
20
|
+
export { default as Appbar } from './appbar/appbar.svelte';
|
|
21
|
+
export { default as Spacer } from './spacer/spacer.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -18,3 +18,5 @@ export { default as Alert } from './alert/alert.svelte';
|
|
|
18
18
|
export { default as Chip } from './chip/chip.svelte';
|
|
19
19
|
export { default as Card } from './card/card.svelte';
|
|
20
20
|
export { default as Toolbar } from './toolbar/toolbar.svelte';
|
|
21
|
+
export { default as Appbar } from './appbar/appbar.svelte';
|
|
22
|
+
export { default as Spacer } from './spacer/spacer.svelte';
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
--list-color: var(--on, var(--kit-on-neutral));
|
|
3
3
|
--list-background: var(--base, var(--kit-neutral));
|
|
4
4
|
--list-radius: var(--shape, var(--kit-radius-md));
|
|
5
|
-
|
|
6
5
|
display: flex;
|
|
7
|
-
width: 100%;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
.kit-list.kit-list--nav {
|
|
@@ -16,9 +14,11 @@
|
|
|
16
14
|
/* orientation */
|
|
17
15
|
.kit-list[breakpoint]kit-list--orientation-vertical {
|
|
18
16
|
flex-direction: column;
|
|
17
|
+
width: 100%;
|
|
19
18
|
}
|
|
20
19
|
.kit-list[breakpoint]kit-list--orientation-horizontal {
|
|
21
20
|
flex-direction: row;
|
|
21
|
+
width: fit-content;
|
|
22
22
|
}
|
|
23
23
|
.kit-list[breakpoint]kit-list--orientation-horizontal .kit-list-item {
|
|
24
24
|
justify-content: center;
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
|
|
71
71
|
.kit-list[breakpoint]kit-list--density-compact .kit-list-item {
|
|
72
72
|
height: calc(var(--list-height) - 0.25rem);
|
|
73
|
-
min-width: calc(var(--list-height - 0.25rem)
|
|
73
|
+
min-width: calc(var(--list-height) - 0.25rem);
|
|
74
74
|
--list-spacing-x: 0;
|
|
75
|
-
--list-spacing-y: calc(var(--
|
|
75
|
+
--list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y) - 0.25rem);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.kit-list[breakpoint]kit-list--density-comfortable .kit-list-item {
|
|
79
79
|
height: calc(var(--list-height) + 0.25rem);
|
|
80
|
-
min-width: calc(var(--list-height + 0.25rem)
|
|
80
|
+
min-width: calc(var(--list-height) + 0.25rem);
|
|
81
81
|
--list-spacing-x: 0;
|
|
82
82
|
--list-spacing-y: calc(var(--kit-spacing) * var(--list-multiplier-y) + 0.25rem);
|
|
83
83
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,22 +22,6 @@
|
|
|
22
22
|
border-color: var(--toolbar-background);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/* density */
|
|
26
|
-
.kit-card[breakpoint]kit-card--density-default {
|
|
27
|
-
--card-spacing-x: 0.25rem;
|
|
28
|
-
--card-spacing-y: 0.25rem;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.kit-card[breakpoint]kit-card--density-compact {
|
|
32
|
-
--card-spacing-x: 0;
|
|
33
|
-
--card-spacing-y: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.kit-card[breakpoint]kit-card--density-comfortable {
|
|
37
|
-
--card-spacing-x: 0.5rem;
|
|
38
|
-
--card-spacing-y: 0.5rem;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
25
|
/* density */
|
|
42
26
|
.kit-toolbar[breakpoint]kit-toolbar--density-default {
|
|
43
27
|
border-radius: calc(var(--kit-spacing) * 2.25);
|
|
@@ -100,21 +84,24 @@
|
|
|
100
84
|
|
|
101
85
|
.kit-toolbar[breakpoint]kit-toolbar--orientation-horizontal {
|
|
102
86
|
flex-direction: row;
|
|
87
|
+
width: 100%;
|
|
103
88
|
}
|
|
104
89
|
|
|
105
90
|
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical {
|
|
106
91
|
flex-direction: column;
|
|
107
92
|
min-height: fit-content;
|
|
93
|
+
width: fit-content;
|
|
108
94
|
}
|
|
109
95
|
|
|
110
96
|
/* wrapper */
|
|
111
97
|
.kit-toolbar .kit-toolbar--wrapper {
|
|
112
98
|
display: flex;
|
|
113
99
|
align-items: center;
|
|
114
|
-
margin-left: auto;
|
|
115
|
-
margin-right: auto;
|
|
100
|
+
/* margin-left: auto;
|
|
101
|
+
margin-right: auto; */
|
|
116
102
|
flex-direction: row;
|
|
117
103
|
height: auto;
|
|
104
|
+
width: 100%;
|
|
118
105
|
}
|
|
119
106
|
|
|
120
107
|
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical .kit-toolbar--wrapper {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setUnit: (value: string | number) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const setUnit = (value) => {
|
|
2
|
+
if (typeof value === 'number')
|
|
3
|
+
return `${value}px`;
|
|
4
|
+
if (typeof value === 'string') {
|
|
5
|
+
const cleaned = value.trim();
|
|
6
|
+
const isOnlyNumericLike = /^[\d.,]+$/.test(cleaned);
|
|
7
|
+
if (isOnlyNumericLike)
|
|
8
|
+
return `${value}px`;
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
};
|
package/dist/stores/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { disabledScroll } from '../internal/scroll.js';
|
|
1
2
|
import { writable } from 'svelte/store';
|
|
2
3
|
// states
|
|
3
4
|
const colorScheme_default = 'light';
|
|
@@ -29,14 +30,17 @@ export function setOpenModal(state) {
|
|
|
29
30
|
}
|
|
30
31
|
export const pushModal = (id) => {
|
|
31
32
|
modalStack.update((stack) => {
|
|
33
|
+
let values = stack;
|
|
32
34
|
if (!stack.includes(id))
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
values = [...stack, id];
|
|
36
|
+
disabledScroll(values.length !== 0 ? true : false);
|
|
37
|
+
return values;
|
|
35
38
|
});
|
|
36
39
|
};
|
|
37
40
|
export const popModal = (id) => {
|
|
38
41
|
modalStack.update((stack) => {
|
|
39
42
|
const newStack = stack.filter((m) => m !== id);
|
|
43
|
+
disabledScroll(newStack.length !== 0 ? true : false);
|
|
40
44
|
return newStack.length === 0 ? [] : newStack;
|
|
41
45
|
});
|
|
42
46
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setUnit } from '../../internal/unit.js';
|
|
1
2
|
export const devices = (config) => {
|
|
2
3
|
let css = ``;
|
|
3
4
|
const list = {
|
|
@@ -5,24 +6,35 @@ export const devices = (config) => {
|
|
|
5
6
|
tablet: config.breakpoints.tabletBreakpoint,
|
|
6
7
|
laptop: config.breakpoints.laptopBreakpoint
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
9
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) {\n`;
|
|
10
|
+
css += `.hidden-mobile {\n`;
|
|
11
|
+
css += `display: none !important;\n`;
|
|
12
|
+
css += `}\n`;
|
|
13
|
+
css += `}\n`;
|
|
14
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) {\n`;
|
|
15
|
+
css += `.display-mobile {\n`;
|
|
16
|
+
css += `display: none !important;\n`;
|
|
17
|
+
css += `}\n`;
|
|
18
|
+
css += `}\n`;
|
|
19
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) and (max-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
20
|
+
css += `.hidden-tablet {\n`;
|
|
21
|
+
css += `display: none !important;\n`;
|
|
22
|
+
css += `}\n`;
|
|
23
|
+
css += `}\n`;
|
|
24
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.tablet])}) and (min-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}){\n`;
|
|
25
|
+
css += `.display-tablet {\n`;
|
|
26
|
+
css += `display: none !important;\n`;
|
|
27
|
+
css += `}\n`;
|
|
28
|
+
css += `}\n`;
|
|
29
|
+
css += `@media screen and (min-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
30
|
+
css += `.hidden-laptop {\n`;
|
|
31
|
+
css += `display: none !important;\n`;
|
|
32
|
+
css += `}\n`;
|
|
33
|
+
css += `}\n`;
|
|
34
|
+
css += `@media screen and (max-width: ${setUnit(config.breakpoints.thresholds[list.laptop])}) {\n`;
|
|
35
|
+
css += `.display-laptop {\n`;
|
|
36
|
+
css += `display: none !important;\n`;
|
|
37
|
+
css += `}\n`;
|
|
38
|
+
css += `}\n`;
|
|
27
39
|
return css;
|
|
28
40
|
};
|