lapikit 0.0.0-insiders.e877f7f → 0.0.0-insiders.fb2e87e
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/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/assets/icons/arrow-down.svelte +10 -0
- package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
- package/dist/assets/icons/arrow-up.svelte +10 -0
- package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
- package/dist/assets/icons/close-fill.svelte +10 -0
- package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
- package/dist/components/accordion/accordion.css +113 -0
- package/dist/components/accordion/accordion.svelte +37 -0
- package/dist/components/accordion/accordion.svelte.d.ts +4 -0
- package/dist/components/accordion/accordion.svelte.js +24 -0
- package/dist/components/accordion/modules/accordion-item.svelte +94 -0
- package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/alert/alert.css +127 -0
- package/dist/components/alert/alert.svelte +89 -0
- package/dist/components/alert/alert.svelte.d.ts +4 -0
- package/dist/components/alert/types.d.ts +28 -0
- package/dist/components/alert/types.js +1 -0
- package/dist/components/app/app.css +16 -0
- package/dist/components/app/app.svelte +31 -2
- package/dist/components/appbar/appbar.css +48 -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.css +19 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +48 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
- package/dist/components/aspect-ratio/types.d.ts +5 -0
- package/dist/components/aspect-ratio/types.js +1 -0
- package/dist/components/avatar/avatar.css +109 -0
- package/dist/components/avatar/avatar.svelte +46 -0
- package/dist/components/avatar/avatar.svelte.d.ts +4 -0
- package/dist/components/avatar/types.d.ts +22 -0
- package/dist/components/avatar/types.js +1 -0
- package/dist/components/button/button.css +4 -4
- package/dist/components/button/button.svelte +1 -1
- package/dist/components/card/card.css +109 -0
- package/dist/components/card/card.svelte +50 -0
- package/dist/components/card/card.svelte.d.ts +4 -0
- package/dist/components/card/types.d.ts +18 -0
- package/dist/components/card/types.js +1 -0
- package/dist/components/chip/chip.css +199 -0
- package/dist/components/chip/chip.svelte +118 -0
- package/dist/components/chip/chip.svelte.d.ts +4 -0
- package/dist/components/chip/types.d.ts +30 -0
- package/dist/components/chip/types.js +1 -0
- package/dist/components/dialog/dialog.css +134 -0
- package/dist/components/dialog/dialog.svelte +67 -0
- package/dist/components/dialog/dialog.svelte.d.ts +4 -0
- package/dist/components/dialog/types.d.ts +24 -0
- package/dist/components/dialog/types.js +1 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/index.js +15 -0
- package/dist/components/list/list.css +195 -0
- package/dist/components/list/list.svelte +46 -0
- package/dist/components/list/list.svelte.d.ts +4 -0
- package/dist/components/list/modules/list-item.svelte +68 -0
- package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
- package/dist/components/list/types.d.ts +36 -0
- package/dist/components/list/types.js +1 -0
- package/dist/components/modal/modal.css +140 -0
- package/dist/components/modal/modal.svelte +112 -0
- package/dist/components/modal/modal.svelte.d.ts +4 -0
- package/dist/components/modal/types.d.ts +26 -0
- package/dist/components/modal/types.js +1 -0
- package/dist/components/separator/separator.css +46 -0
- package/dist/components/separator/separator.svelte +37 -0
- package/dist/components/separator/separator.svelte.d.ts +4 -0
- package/dist/components/separator/types.d.ts +11 -0
- package/dist/components/separator/types.js +1 -0
- 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 +129 -0
- package/dist/components/toolbar/toolbar.svelte +47 -0
- package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +27 -0
- package/dist/components/toolbar/types.js +1 -0
- package/dist/internal/assets.svelte.d.ts +1 -0
- package/dist/internal/assets.svelte.js +11 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/internal/scroll.d.ts +1 -0
- package/dist/internal/scroll.js +6 -0
- package/dist/internal/unit.d.ts +1 -0
- package/dist/internal/unit.js +11 -0
- package/dist/preset.js +1 -1
- package/dist/stores/index.d.ts +9 -3
- package/dist/stores/index.js +27 -3
- package/dist/style/css.js +3 -0
- package/dist/style/parser/device.js +31 -19
- package/dist/style/variable.css +12 -0
- package/package.json +6 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { SeparatorProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
is = 'hr',
|
|
7
|
+
light,
|
|
8
|
+
dark,
|
|
9
|
+
inset,
|
|
10
|
+
thickness,
|
|
11
|
+
orientation = 'horizontal',
|
|
12
|
+
opacity,
|
|
13
|
+
color,
|
|
14
|
+
...rest
|
|
15
|
+
}: SeparatorProps = $props();
|
|
16
|
+
|
|
17
|
+
const assets = getAssets();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<svelte:element
|
|
21
|
+
this={is}
|
|
22
|
+
{...rest}
|
|
23
|
+
class={[
|
|
24
|
+
'kit-separator',
|
|
25
|
+
light && 'light',
|
|
26
|
+
dark && 'dark',
|
|
27
|
+
inset && 'kit-separator--inset',
|
|
28
|
+
orientation && assets.className('separator', 'orientation', orientation),
|
|
29
|
+
rest.class
|
|
30
|
+
]}
|
|
31
|
+
aria-orientation={orientation}
|
|
32
|
+
role="separator"
|
|
33
|
+
style:--base={assets.color(color)}
|
|
34
|
+
style:--opacity={opacity}
|
|
35
|
+
style:--border-top-width={orientation === 'horizontal' ? assets.unit(thickness) : undefined}
|
|
36
|
+
style:--border-right-width={orientation === 'vertical' ? assets.unit(thickness) : undefined}
|
|
37
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Base } from '../../internal/types.js';
|
|
2
|
+
export interface SeparatorProps extends Base {
|
|
3
|
+
is?: 'div' | 'hr';
|
|
4
|
+
light?: boolean;
|
|
5
|
+
dark?: boolean;
|
|
6
|
+
inset?: boolean;
|
|
7
|
+
thickness?: string;
|
|
8
|
+
opacity?: string | number;
|
|
9
|
+
color?: string;
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
.kit-toolbar {
|
|
2
|
+
--toolbar-color: var(--on, var(--kit-on-neutral));
|
|
3
|
+
--toolbar-background: var(--base, var(--kit-neutral));
|
|
4
|
+
--toolbar-radius: var(--shape, var(--kit-radius-md));
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
min-width: max-content;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
transition:
|
|
11
|
+
color 0.5s,
|
|
12
|
+
border-color 0.5s,
|
|
13
|
+
background-color 0.5s;
|
|
14
|
+
|
|
15
|
+
border-width: 1px;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
border-radius: var(--toolbar-radius);
|
|
18
|
+
|
|
19
|
+
/* theme */
|
|
20
|
+
color: var(--toolbar-color);
|
|
21
|
+
background-color: var(--toolbar-background);
|
|
22
|
+
border-color: var(--toolbar-background);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* density */
|
|
26
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default {
|
|
27
|
+
border-radius: calc(var(--kit-spacing) * 2.25);
|
|
28
|
+
}
|
|
29
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default:not([class*='toolbar--orientation-vertical']) {
|
|
30
|
+
height: 3rem;
|
|
31
|
+
padding-inline: calc(var(--kit-spacing) * 1.5);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-default[class*='toolbar--orientation-vertical'] {
|
|
35
|
+
width: 3rem;
|
|
36
|
+
padding: calc(var(--kit-spacing) * 1.5) 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact {
|
|
40
|
+
border-radius: calc(var(--kit-spacing) * 1.75);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact:not([class*='toolbar--orientation-vertical']) {
|
|
44
|
+
height: 2.625rem;
|
|
45
|
+
padding-inline: calc(var(--kit-spacing) * 0.75);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-compact[class*='toolbar--orientation-vertical'] {
|
|
49
|
+
width: 2.625rem;
|
|
50
|
+
padding: calc(var(--kit-spacing) * 0.75) 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable {
|
|
54
|
+
border-radius: calc(var(--kit-spacing) * 3.5);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable:not(
|
|
58
|
+
[class*='toolbar--orientation-vertical']
|
|
59
|
+
) {
|
|
60
|
+
height: 3.5rem;
|
|
61
|
+
padding-inline: calc(var(--kit-spacing) * 2.25);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.kit-toolbar[breakpoint]kit-toolbar--density-comfortable[class*='toolbar--orientation-vertical'] {
|
|
65
|
+
width: 3.5rem;
|
|
66
|
+
padding: calc(var(--kit-spacing) * 2.25) 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-text,
|
|
70
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-outline,
|
|
71
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-dash {
|
|
72
|
+
--toolbar-color: var(--base, var(--kit-neutral));
|
|
73
|
+
background-color: transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-outline {
|
|
77
|
+
border-color: currentColor;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.kit-toolbar[breakpoint]kit-toolbar--variant-dash {
|
|
81
|
+
border-style: dashed;
|
|
82
|
+
border-color: currentColor;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-horizontal {
|
|
86
|
+
flex-direction: row;
|
|
87
|
+
width: 100%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical {
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
min-height: fit-content;
|
|
93
|
+
width: fit-content;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* wrapper */
|
|
97
|
+
.kit-toolbar .kit-toolbar--wrapper {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
/* margin-left: auto;
|
|
101
|
+
margin-right: auto; */
|
|
102
|
+
flex-direction: row;
|
|
103
|
+
height: auto;
|
|
104
|
+
width: 100%;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.kit-toolbar[breakpoint]kit-toolbar--orientation-vertical .kit-toolbar--wrapper {
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
height: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* location */
|
|
113
|
+
.kit-toolbar[breakpoint]kit-toolbar--location-top {
|
|
114
|
+
top: 0px;
|
|
115
|
+
z-index: 1004;
|
|
116
|
+
transform: translateY(0px);
|
|
117
|
+
position: fixed;
|
|
118
|
+
left: 0px;
|
|
119
|
+
width: calc(100% + 0px);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.kit-toolbar[breakpoint]kit-toolbar--location-bottom {
|
|
123
|
+
z-index: 1004;
|
|
124
|
+
transform: translateY(0px);
|
|
125
|
+
position: fixed;
|
|
126
|
+
left: 0px;
|
|
127
|
+
width: calc(100% + 0px);
|
|
128
|
+
bottom: 0px;
|
|
129
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getAssets } from '../../internal/index.js';
|
|
3
|
+
import type { ToolbarProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
children,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
is = 'div',
|
|
9
|
+
classContent,
|
|
10
|
+
light,
|
|
11
|
+
dark,
|
|
12
|
+
variant,
|
|
13
|
+
rounded,
|
|
14
|
+
background,
|
|
15
|
+
color,
|
|
16
|
+
density = 'default',
|
|
17
|
+
orientation = 'horizontal',
|
|
18
|
+
location,
|
|
19
|
+
...rest
|
|
20
|
+
}: ToolbarProps = $props();
|
|
21
|
+
|
|
22
|
+
const assets = getAssets();
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<svelte:element
|
|
26
|
+
this={is}
|
|
27
|
+
bind:this={ref}
|
|
28
|
+
{...rest}
|
|
29
|
+
role="toolbar"
|
|
30
|
+
class={[
|
|
31
|
+
'kit-toolbar',
|
|
32
|
+
light && 'light',
|
|
33
|
+
dark && 'dark',
|
|
34
|
+
variant && assets.className('toolbar', 'variant', variant),
|
|
35
|
+
density && assets.className('toolbar', 'density', density),
|
|
36
|
+
orientation && assets.className('toolbar', 'orientation', orientation),
|
|
37
|
+
location && assets.className('toolbar', 'location', location),
|
|
38
|
+
rest.class
|
|
39
|
+
]}
|
|
40
|
+
style:--base={assets.color(background)}
|
|
41
|
+
style:--on={assets.color(color)}
|
|
42
|
+
style:--shape={assets.shape(rounded)}
|
|
43
|
+
>
|
|
44
|
+
<div class={['kit-toolbar--wrapper', classContent]}>
|
|
45
|
+
{@render children?.()}
|
|
46
|
+
</div>
|
|
47
|
+
</svelte:element>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type Variant = 'outline' | 'text' | 'dash';
|
|
3
|
+
type Density = 'compact' | 'comfortable' | 'default';
|
|
4
|
+
type Orientation = 'horizontal' | 'vertical';
|
|
5
|
+
type Location = 'top' | 'bottom';
|
|
6
|
+
export interface ToolbarProps extends Component {
|
|
7
|
+
is?: 'div' | 'header' | 'nav';
|
|
8
|
+
variant?: Variant | {
|
|
9
|
+
[key: string]: Variant;
|
|
10
|
+
};
|
|
11
|
+
rounded?: string;
|
|
12
|
+
density?: Density | {
|
|
13
|
+
[key: string]: Density;
|
|
14
|
+
};
|
|
15
|
+
dark?: boolean;
|
|
16
|
+
light?: boolean;
|
|
17
|
+
color?: string;
|
|
18
|
+
orientation?: Orientation | {
|
|
19
|
+
[key: string]: Orientation;
|
|
20
|
+
};
|
|
21
|
+
background?: string;
|
|
22
|
+
location?: Location | {
|
|
23
|
+
[key: string]: Location;
|
|
24
|
+
};
|
|
25
|
+
classContent?: string | string[] | undefined;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -36,6 +36,17 @@ export function getAssets() {
|
|
|
36
36
|
return color;
|
|
37
37
|
return `var(--kit-${color})`;
|
|
38
38
|
}
|
|
39
|
+
},
|
|
40
|
+
unit(value) {
|
|
41
|
+
if (typeof value === 'number')
|
|
42
|
+
return `${value}px`;
|
|
43
|
+
if (typeof value === 'string') {
|
|
44
|
+
const cleaned = value.trim();
|
|
45
|
+
const isOnlyNumericLike = /^[\d.,]+$/.test(cleaned);
|
|
46
|
+
if (isOnlyNumericLike)
|
|
47
|
+
return `${value}px`;
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
39
50
|
}
|
|
40
51
|
};
|
|
41
52
|
}
|
package/dist/internal/index.d.ts
CHANGED
package/dist/internal/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function disabledScroll(state: boolean): void;
|
|
@@ -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/preset.js
CHANGED
package/dist/stores/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
-
export declare const colorScheme: Writable<'
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
2
|
+
export declare const colorScheme: Writable<'system' | 'dark' | 'light'>;
|
|
3
|
+
export declare const colorSchemeSystem: Writable<'dark' | 'light'>;
|
|
4
|
+
export declare const modalOpen: Writable<boolean | 'persistent'>;
|
|
5
|
+
export declare const modalStack: Writable<string[]>;
|
|
6
|
+
export declare function updateThemeStore(update: 'system' | 'dark' | 'light'): void;
|
|
7
|
+
export declare function setColorScheme(scheme: 'system' | 'dark' | 'light'): void;
|
|
8
|
+
export declare function setOpenModal(state: boolean | 'persistent'): void;
|
|
9
|
+
export declare const pushModal: (id: string) => void;
|
|
10
|
+
export declare const popModal: (id: string) => void;
|
package/dist/stores/index.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { disabledScroll } from '../internal/scroll.js';
|
|
1
2
|
import { writable } from 'svelte/store';
|
|
2
3
|
// states
|
|
3
|
-
const
|
|
4
|
+
const colorScheme_default = 'system';
|
|
5
|
+
const modalOpen_default = false;
|
|
4
6
|
const isBrowser = typeof window !== 'undefined';
|
|
5
|
-
export const colorScheme = writable(
|
|
7
|
+
export const colorScheme = writable(colorScheme_default);
|
|
8
|
+
export const colorSchemeSystem = writable('light');
|
|
9
|
+
export const modalOpen = writable(modalOpen_default);
|
|
10
|
+
export const modalStack = writable([]);
|
|
6
11
|
export function updateThemeStore(update) {
|
|
7
12
|
colorScheme.update(() => {
|
|
8
13
|
if (isBrowser) {
|
|
9
14
|
const ref = document.documentElement.classList;
|
|
10
|
-
if (update === '
|
|
15
|
+
if (update === 'system')
|
|
11
16
|
ref.remove('light', 'dark');
|
|
12
17
|
else {
|
|
13
18
|
ref.remove(update === 'dark' ? 'light' : 'dark');
|
|
@@ -21,3 +26,22 @@ export function updateThemeStore(update) {
|
|
|
21
26
|
export function setColorScheme(scheme) {
|
|
22
27
|
updateThemeStore(scheme);
|
|
23
28
|
}
|
|
29
|
+
export function setOpenModal(state) {
|
|
30
|
+
modalOpen.set(state);
|
|
31
|
+
}
|
|
32
|
+
export const pushModal = (id) => {
|
|
33
|
+
modalStack.update((stack) => {
|
|
34
|
+
let values = stack;
|
|
35
|
+
if (!stack.includes(id))
|
|
36
|
+
values = [...stack, id];
|
|
37
|
+
disabledScroll(values.length !== 0 ? true : false);
|
|
38
|
+
return values;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export const popModal = (id) => {
|
|
42
|
+
modalStack.update((stack) => {
|
|
43
|
+
const newStack = stack.filter((m) => m !== id);
|
|
44
|
+
disabledScroll(newStack.length !== 0 ? true : false);
|
|
45
|
+
return newStack.length === 0 ? [] : newStack;
|
|
46
|
+
});
|
|
47
|
+
};
|
package/dist/style/css.js
CHANGED
|
@@ -11,6 +11,7 @@ const __dirname = dirname(__filename);
|
|
|
11
11
|
export const processCSS = async (config) => {
|
|
12
12
|
const _normalize = fs.readFileSync(path.resolve(__dirname, './normalize.css'), 'utf-8');
|
|
13
13
|
const _animation = fs.readFileSync(path.resolve(__dirname, './animation.css'), 'utf-8');
|
|
14
|
+
const _variables = fs.readFileSync(path.resolve(__dirname, './variable.css'), 'utf-8');
|
|
14
15
|
let styles = ``;
|
|
15
16
|
if (config.options.normalize)
|
|
16
17
|
styles += `${_normalize}\n`;
|
|
@@ -19,6 +20,8 @@ export const processCSS = async (config) => {
|
|
|
19
20
|
const variablesStyles = variables(config);
|
|
20
21
|
styles += `${colorScheme.root}\n`;
|
|
21
22
|
styles += `${variablesStyles}\n`;
|
|
23
|
+
styles += `${variablesStyles}\n`;
|
|
24
|
+
styles += `${_variables}\n`;
|
|
22
25
|
styles += `${colorScheme.className}\n`;
|
|
23
26
|
styles += `${deviceDisplay}\n`;
|
|
24
27
|
styles += component(config);
|
|
@@ -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.mobile])}) {\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.mobile])}) {\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
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--kit-dialog-size-xs: 18.75rem;
|
|
3
|
+
--kit-dialog-size-sm: 25rem;
|
|
4
|
+
--kit-dialog-size-md: 37.5rem;
|
|
5
|
+
--kit-dialog-size-lg: 53.125rem;
|
|
6
|
+
--kit-dialog-size-xl: 75rem;
|
|
7
|
+
--kit-modal-size-xs: 18.75rem;
|
|
8
|
+
--kit-modal-size-sm: 25rem;
|
|
9
|
+
--kit-modal-size-md: 37.5rem;
|
|
10
|
+
--kit-modal-size-lg: 53.125rem;
|
|
11
|
+
--kit-modal-size-xl: 75rem;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lapikit",
|
|
3
|
-
"version": "0.0.0-insiders.
|
|
3
|
+
"version": "0.0.0-insiders.fb2e87e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"type": "module",
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
|
-
"types": "./dist/index.d.ts"
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"svelte": "./dist/index.js"
|
|
46
47
|
},
|
|
47
48
|
"./components": {
|
|
48
49
|
"svelte": "./dist/components/index.js",
|
|
@@ -54,6 +55,9 @@
|
|
|
54
55
|
"./stores": {
|
|
55
56
|
"default": "./dist/stores/index.js"
|
|
56
57
|
},
|
|
58
|
+
"./actions": {
|
|
59
|
+
"default": "./dist/actions/index.js"
|
|
60
|
+
},
|
|
57
61
|
"./css": "./dist/styles.css"
|
|
58
62
|
},
|
|
59
63
|
"peerDependencies": {
|