lapikit 0.0.0-insiders.e877f7f → 0.0.0-insiders.efb49b7
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 +12 -1
- package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
- package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -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.svelte +1 -1
- package/dist/components/chip/chip.css +17 -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 +10 -0
- package/dist/components/index.js +10 -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/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/stores/index.d.ts +5 -0
- package/dist/stores/index.js +21 -2
- package/dist/style/css.js +3 -0
- package/dist/style/variable.css +12 -0
- package/package.json +6 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Component } from '../../internal/types.js';
|
|
2
|
+
type ModalSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
3
|
+
type ModalPosition = 'bottom' | 'center' | 'top';
|
|
4
|
+
type ModalDensity = 'compact' | 'comfortable' | 'default';
|
|
5
|
+
export interface ModalProps extends Component {
|
|
6
|
+
ref?: HTMLDivElement;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
classContent?: string | string[] | undefined;
|
|
9
|
+
size?: ModalSize | {
|
|
10
|
+
[key: string]: ModalSize;
|
|
11
|
+
};
|
|
12
|
+
persistent?: boolean;
|
|
13
|
+
position?: ModalPosition | {
|
|
14
|
+
[key: string]: ModalPosition;
|
|
15
|
+
};
|
|
16
|
+
dark?: boolean;
|
|
17
|
+
light?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
background?: string;
|
|
20
|
+
density?: ModalDensity | {
|
|
21
|
+
[key: string]: ModalDensity;
|
|
22
|
+
};
|
|
23
|
+
contain?: boolean;
|
|
24
|
+
closeWithEsc?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
.kit-separator {
|
|
2
|
+
--separator-opacity: var(--opacity, 0.12);
|
|
3
|
+
--separator-color: var(--base, var(--kit-scrim));
|
|
4
|
+
|
|
5
|
+
display: block;
|
|
6
|
+
flex: 1 1 100%;
|
|
7
|
+
height: 0px;
|
|
8
|
+
max-height: 0px;
|
|
9
|
+
opacity: var(--separator-opacity);
|
|
10
|
+
transition: inherit;
|
|
11
|
+
border-color: var(--separator-color);
|
|
12
|
+
transition: border-color 0.5s;
|
|
13
|
+
border-style: solid;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.kit-separator:not(.kit-separator--orientation-vertical) {
|
|
17
|
+
border-width: var(--border-top-width, thin) 0 0 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.kit-separator--orientation-vertical {
|
|
21
|
+
align-self: stretch;
|
|
22
|
+
border-width: 0 thin 0 0;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
height: auto;
|
|
25
|
+
margin-left: 0px;
|
|
26
|
+
max-height: 100%;
|
|
27
|
+
max-width: 0px;
|
|
28
|
+
vertical-align: text-bottom;
|
|
29
|
+
width: 0px;
|
|
30
|
+
border-width: 0 var(--border-right-width, thin) 0 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.kit-separator--inset:not(.kit-separator--orientation-vertical) {
|
|
34
|
+
max-width: calc(100% - 4.5rem);
|
|
35
|
+
margin-inline-start: 4.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.kit-separator--inset.kit-separator--orientation-vertical {
|
|
39
|
+
margin-bottom: 0.5rem;
|
|
40
|
+
margin-top: 0.5rem;
|
|
41
|
+
max-height: calc(100% - 1rem);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.kit-separator:not(.kit-separator--orientation-vertical) {
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
@@ -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 {};
|
|
@@ -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;
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type Writable } from 'svelte/store';
|
|
2
2
|
export declare const colorScheme: Writable<'auto' | 'dark' | 'light'>;
|
|
3
|
+
export declare const modalOpen: Writable<boolean | 'persistent'>;
|
|
4
|
+
export declare const modalStack: Writable<string[]>;
|
|
3
5
|
export declare function updateThemeStore(update: 'auto' | 'dark' | 'light'): void;
|
|
4
6
|
export declare function setColorScheme(scheme: 'auto' | 'dark' | 'light'): void;
|
|
7
|
+
export declare function setOpenModal(state: boolean | 'persistent'): void;
|
|
8
|
+
export declare const pushModal: (id: string) => void;
|
|
9
|
+
export declare const popModal: (id: string) => void;
|
package/dist/stores/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
2
|
// states
|
|
3
|
-
const
|
|
3
|
+
const colorScheme_default = 'light';
|
|
4
|
+
const modalOpen_default = false;
|
|
4
5
|
const isBrowser = typeof window !== 'undefined';
|
|
5
|
-
export const colorScheme = writable(
|
|
6
|
+
export const colorScheme = writable(colorScheme_default);
|
|
7
|
+
export const modalOpen = writable(modalOpen_default);
|
|
8
|
+
export const modalStack = writable([]);
|
|
6
9
|
export function updateThemeStore(update) {
|
|
7
10
|
colorScheme.update(() => {
|
|
8
11
|
if (isBrowser) {
|
|
@@ -21,3 +24,19 @@ export function updateThemeStore(update) {
|
|
|
21
24
|
export function setColorScheme(scheme) {
|
|
22
25
|
updateThemeStore(scheme);
|
|
23
26
|
}
|
|
27
|
+
export function setOpenModal(state) {
|
|
28
|
+
modalOpen.set(state);
|
|
29
|
+
}
|
|
30
|
+
export const pushModal = (id) => {
|
|
31
|
+
modalStack.update((stack) => {
|
|
32
|
+
if (!stack.includes(id))
|
|
33
|
+
return [...stack, id];
|
|
34
|
+
return stack;
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export const popModal = (id) => {
|
|
38
|
+
modalStack.update((stack) => {
|
|
39
|
+
const newStack = stack.filter((m) => m !== id);
|
|
40
|
+
return newStack.length === 0 ? [] : newStack;
|
|
41
|
+
});
|
|
42
|
+
};
|
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);
|
|
@@ -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.efb49b7",
|
|
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": {
|