lapikit 0.0.0-insiders.e877f7f → 0.0.0-insiders.f502b02

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.
Files changed (105) hide show
  1. package/dist/actions/index.d.ts +1 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/assets/icons/arrow-down.svelte +10 -0
  4. package/dist/assets/icons/arrow-down.svelte.d.ts +26 -0
  5. package/dist/assets/icons/arrow-up.svelte +10 -0
  6. package/dist/assets/icons/arrow-up.svelte.d.ts +26 -0
  7. package/dist/assets/icons/close-fill.svelte +10 -0
  8. package/dist/assets/icons/close-fill.svelte.d.ts +26 -0
  9. package/dist/components/accordion/accordion.css +113 -0
  10. package/dist/components/accordion/accordion.svelte +37 -0
  11. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  12. package/dist/components/accordion/accordion.svelte.js +24 -0
  13. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  14. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  15. package/dist/components/accordion/types.d.ts +33 -0
  16. package/dist/components/accordion/types.js +1 -0
  17. package/dist/components/alert/alert.css +127 -0
  18. package/dist/components/alert/alert.svelte +89 -0
  19. package/dist/components/alert/alert.svelte.d.ts +4 -0
  20. package/dist/components/alert/types.d.ts +28 -0
  21. package/dist/components/alert/types.js +1 -0
  22. package/dist/components/app/app.css +16 -0
  23. package/dist/components/app/app.svelte +31 -2
  24. package/dist/components/appbar/appbar.css +48 -0
  25. package/dist/components/appbar/appbar.svelte +41 -0
  26. package/dist/components/appbar/appbar.svelte.d.ts +4 -0
  27. package/dist/components/appbar/types.d.ts +15 -0
  28. package/dist/components/appbar/types.js +1 -0
  29. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  30. package/dist/components/aspect-ratio/aspect-ratio.svelte +48 -0
  31. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  32. package/dist/components/aspect-ratio/types.d.ts +5 -0
  33. package/dist/components/aspect-ratio/types.js +1 -0
  34. package/dist/components/avatar/avatar.css +109 -0
  35. package/dist/components/avatar/avatar.svelte +46 -0
  36. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  37. package/dist/components/avatar/types.d.ts +22 -0
  38. package/dist/components/avatar/types.js +1 -0
  39. package/dist/components/button/button.css +162 -194
  40. package/dist/components/button/button.svelte +36 -24
  41. package/dist/components/button/button.svelte.d.ts +2 -2
  42. package/dist/components/button/types.d.ts +6 -4
  43. package/dist/components/card/card.css +109 -0
  44. package/dist/components/card/card.svelte +50 -0
  45. package/dist/components/card/card.svelte.d.ts +4 -0
  46. package/dist/components/card/types.d.ts +18 -0
  47. package/dist/components/card/types.js +1 -0
  48. package/dist/components/chip/chip.css +199 -0
  49. package/dist/components/chip/chip.svelte +118 -0
  50. package/dist/components/chip/chip.svelte.d.ts +4 -0
  51. package/dist/components/chip/types.d.ts +30 -0
  52. package/dist/components/chip/types.js +1 -0
  53. package/dist/components/dialog/dialog.css +134 -0
  54. package/dist/components/dialog/dialog.svelte +67 -0
  55. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  56. package/dist/components/dialog/types.d.ts +24 -0
  57. package/dist/components/dialog/types.js +1 -0
  58. package/dist/components/icon/icon.css +13 -10
  59. package/dist/components/index.d.ts +16 -1
  60. package/dist/components/index.js +16 -1
  61. package/dist/components/list/list.css +195 -0
  62. package/dist/components/list/list.svelte +46 -0
  63. package/dist/components/list/list.svelte.d.ts +4 -0
  64. package/dist/components/list/modules/list-item.svelte +68 -0
  65. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  66. package/dist/components/list/types.d.ts +36 -0
  67. package/dist/components/list/types.js +1 -0
  68. package/dist/components/modal/modal.css +140 -0
  69. package/dist/components/modal/modal.svelte +112 -0
  70. package/dist/components/modal/modal.svelte.d.ts +4 -0
  71. package/dist/components/modal/types.d.ts +26 -0
  72. package/dist/components/modal/types.js +1 -0
  73. package/dist/components/separator/separator.css +46 -0
  74. package/dist/components/separator/separator.svelte +37 -0
  75. package/dist/components/separator/separator.svelte.d.ts +4 -0
  76. package/dist/components/separator/types.d.ts +11 -0
  77. package/dist/components/separator/types.js +1 -0
  78. package/dist/components/spacer/spacer.css +3 -0
  79. package/dist/components/spacer/spacer.svelte +7 -0
  80. package/dist/components/spacer/spacer.svelte.d.ts +4 -0
  81. package/dist/components/spacer/types.d.ts +4 -0
  82. package/dist/components/spacer/types.js +1 -0
  83. package/dist/components/toolbar/toolbar.css +129 -0
  84. package/dist/components/toolbar/toolbar.svelte +47 -0
  85. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  86. package/dist/components/toolbar/types.d.ts +27 -0
  87. package/dist/components/toolbar/types.js +1 -0
  88. package/dist/internal/assets.svelte.d.ts +1 -0
  89. package/dist/internal/assets.svelte.js +11 -0
  90. package/dist/internal/index.d.ts +1 -0
  91. package/dist/internal/index.js +1 -0
  92. package/dist/internal/ripple.d.ts +11 -0
  93. package/dist/internal/ripple.js +90 -0
  94. package/dist/internal/scroll.d.ts +1 -0
  95. package/dist/internal/scroll.js +6 -0
  96. package/dist/internal/unit.d.ts +1 -0
  97. package/dist/internal/unit.js +11 -0
  98. package/dist/preset.js +2 -2
  99. package/dist/stores/index.d.ts +9 -3
  100. package/dist/stores/index.js +27 -3
  101. package/dist/style/animation.css +40 -0
  102. package/dist/style/css.js +3 -0
  103. package/dist/style/parser/device.js +31 -19
  104. package/dist/style/variable.css +12 -0
  105. package/package.json +6 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ .kit-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ height: 100%;
6
+ width: 100%;
7
+ background-color: color-mix(in oklab, var(--kit-shadow) 45%, transparent);
8
+ z-index: 9000;
9
+ cursor: default;
10
+ }
11
+
12
+ .kit-overlay.kit-overlay--persistent {
13
+ /* pointer-events: none; */
14
+ user-select: none;
15
+ cursor: default;
16
+ }
@@ -1,14 +1,43 @@
1
1
  <script lang="ts">
2
2
  import { BROWSER } from 'esm-env';
3
- import { updateThemeStore } from '../../stores/index.js';
3
+ import {
4
+ colorSchemeSystem,
5
+ modalOpen,
6
+ setOpenModal,
7
+ updateThemeStore
8
+ } from '../../stores/index.js';
4
9
  import type { Snippet } from 'svelte';
5
10
  let { children }: { children: Snippet } = $props();
6
11
 
7
12
  $effect.pre(() => {
8
13
  if (!BROWSER) return;
14
+ // system
15
+ if (window.matchMedia) {
16
+ colorSchemeSystem.set(
17
+ window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
18
+ );
19
+ }
20
+
21
+ // listener
22
+ window
23
+ .matchMedia('(prefers-color-scheme: dark)')
24
+ .addEventListener('change', (event: MediaQueryListEvent) => {
25
+ colorSchemeSystem.set(event.matches ? 'dark' : 'light');
26
+ });
27
+
28
+ // local
9
29
  const local = localStorage.getItem('@lapikit/theme');
10
- if (local !== null) updateThemeStore(local as 'dark' | 'light' | 'auto');
30
+ if (local !== null) updateThemeStore(local as 'dark' | 'light' | 'system');
11
31
  });
12
32
  </script>
13
33
 
14
34
  {@render children?.()}
35
+
36
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
37
+ {#if $modalOpen}
38
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
39
+ <div
40
+ class={['kit-overlay', $modalOpen === 'persistent' && 'kit-overlay--persistent']}
41
+ onclick={() => $modalOpen !== 'persistent' && setOpenModal(false)}
42
+ ></div>
43
+ {/if}
@@ -0,0 +1,48 @@
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
+ border-style: solid;
13
+ border-width: 1px;
14
+ border-radius: var(--appbar-radius);
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;
22
+ }
23
+
24
+ /* wrapper */
25
+ .kit-appbar .kit-appbar--wrapper {
26
+ display: flex;
27
+ align-items: center;
28
+ flex-direction: row;
29
+ height: calc(100% - (var(--appbar-padding-wrapper) * 2));
30
+ width: calc(100% - (var(--appbar-padding-wrapper) * 2));
31
+ margin: 0 auto;
32
+ }
33
+
34
+ /* density */
35
+ .kit-appbar[breakpoint]kit-appbar--density-default {
36
+ height: 4rem;
37
+ padding-inline: calc(var(--kit-spacing) * 1.5);
38
+ }
39
+
40
+ .kit-appbar[breakpoint]kit-appbar--density-compact {
41
+ height: 3.5rem;
42
+ padding-inline: calc(var(--kit-spacing) * 0.75);
43
+ }
44
+
45
+ .kit-appbar[breakpoint]kit-appbar--density-comfortable {
46
+ height: 4.5rem;
47
+ padding-inline: calc(var(--kit-spacing) * 2.25);
48
+ }
@@ -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,4 @@
1
+ import type { AppbarProps } from './types.js';
2
+ declare const Appbar: import("svelte").Component<AppbarProps, {}, "ref">;
3
+ type Appbar = ReturnType<typeof Appbar>;
4
+ export default Appbar;
@@ -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 {};
@@ -0,0 +1,19 @@
1
+ .kit-aspect-ratio {
2
+ display: flex;
3
+ flex: 1 0 auto;
4
+ max-height: 100%;
5
+ max-width: 100%;
6
+ overflow: hidden;
7
+ position: relative;
8
+ }
9
+
10
+ .kit-aspect-ratio--inline {
11
+ display: inline-flex;
12
+ flex: 0 0 auto;
13
+ }
14
+
15
+ .kit-aspect-ratio--sizer {
16
+ flex: 1 0 0px;
17
+ transition: padding-bottom 0.2s cubic-bezier(0.4, 0, 0.2, 1);
18
+ pointer-events: none;
19
+ }
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import type { AspectRationProps } from './types.js';
3
+ let { children, aspectRatio, inline, ...rest }: AspectRationProps = $props();
4
+
5
+ let paddingBottom = $state(0);
6
+
7
+ $effect.pre(() => {
8
+ if (aspectRatio) {
9
+ const [width, height] = aspectRatio.split('/').map(Number);
10
+ paddingBottom = (height / width) * 100;
11
+ }
12
+ });
13
+
14
+ $effect(() => {
15
+ if (aspectRatio) {
16
+ const [width, height] = aspectRatio.split('/').map(Number);
17
+ paddingBottom = (height / width) * 100;
18
+ }
19
+ });
20
+ </script>
21
+
22
+ <div {...rest} class={['kit-aspect-ratio', inline && 'kit-aspect-ratio--inline', rest.class]}>
23
+ <div class="kit-aspect-ratio--sizer" style={`padding-bottom: ${paddingBottom}%;`}></div>
24
+ {@render children?.()}
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>
@@ -0,0 +1,4 @@
1
+ import type { AspectRationProps } from './types.js';
2
+ declare const AspectRatio: import("svelte").Component<AspectRationProps, {}, "">;
3
+ type AspectRatio = ReturnType<typeof AspectRatio>;
4
+ export default AspectRatio;
@@ -0,0 +1,5 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ export interface AspectRationProps extends Component {
3
+ aspectRatio?: string;
4
+ inline?: boolean;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,109 @@
1
+ .kit-avatar {
2
+ --avatar-color: var(--on, var(--kit-on-neutral));
3
+ --avatar-background: var(--base, var(--kit-neutral));
4
+ --avatar-radius: var(--shape, var(--kit-radius-full));
5
+
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ white-space: nowrap;
10
+ padding-top: var(--avatar-spacing-x);
11
+ padding-bottom: var(--avatar-spacing-x);
12
+ padding-right: var(--avatar-spacing-y);
13
+ padding-left: var(--avatar-spacing-y);
14
+
15
+ border-width: 1px;
16
+ border-style: solid;
17
+ border-radius: var(--avatar-radius);
18
+
19
+ /* theme */
20
+ color: var(--avatar-color);
21
+ background-color: var(--avatar-background);
22
+ border-color: var(--avatar-background);
23
+ }
24
+
25
+ .kit-avatar.kit-avatar--image {
26
+ position: relative;
27
+ overflow: hidden;
28
+ }
29
+
30
+ .kit-avatar.kit-avatar--image img {
31
+ position: relative;
32
+ top: 0;
33
+ left: 0;
34
+ width: 100%;
35
+ height: 100%;
36
+ object-fit: cover;
37
+ }
38
+
39
+ /* size */
40
+ .kit-avatar[breakpoint]kit-avatar--size-xs {
41
+ --avatar-height: 1.75rem;
42
+ --avatar-multiplier-y: 2;
43
+ font-size: 0.75rem;
44
+ }
45
+
46
+ .kit-avatar[breakpoint]kit-avatar--size-sm {
47
+ --avatar-height: 2rem;
48
+ --avatar-multiplier-y: 3;
49
+ font-size: 0.875rem;
50
+ }
51
+
52
+ .kit-avatar[breakpoint]kit-avatar--size-md {
53
+ --avatar-height: 2.25rem;
54
+ --avatar-multiplier-y: 4;
55
+ font-size: 0.875rem;
56
+ }
57
+
58
+ .kit-avatar[breakpoint]kit-avatar--size-lg {
59
+ --avatar-height: 2.5rem;
60
+ --avatar-multiplier-y: 5;
61
+ font-size: 1rem;
62
+ }
63
+
64
+ .kit-avatar[breakpoint]kit-avatar--size-xl {
65
+ --avatar-height: 2.75rem;
66
+ --avatar-multiplier-y: 6;
67
+ font-size: 1.125rem;
68
+ }
69
+
70
+ /* density */
71
+ .kit-avatar[breakpoint]kit-avatar--density-default {
72
+ height: calc(var(--avatar-height));
73
+ width: calc(var(--avatar-height));
74
+ --avatar-spacing-x: 0;
75
+ --avatar-spacing-y: 0;
76
+ }
77
+
78
+ .kit-avatar[breakpoint]kit-avatar--density-compact {
79
+ height: calc(var(--avatar-height) - 0.25rem);
80
+ width: calc(var(--avatar-height) - 0.25rem);
81
+ --avatar-spacing-x: 0;
82
+ --avatar-spacing-y: 0;
83
+ }
84
+
85
+ .kit-avatar[breakpoint]kit-avatar--density-comfortable {
86
+ height: calc(var(--avatar-height) + 0.25rem);
87
+ width: calc(var(--avatar-height) + 0.25rem);
88
+ --avatar-spacing-x: 0;
89
+ --avatar-spacing-y: 0;
90
+ }
91
+
92
+ /* variant */
93
+ .kit-avatar[breakpoint]kit-avatar--variant-outline {
94
+ --avatar-color: var(--base, var(--kit-neutral));
95
+ background-color: transparent;
96
+ border: 1px solid currentColor;
97
+ }
98
+
99
+ .kit-avatar[breakpoint]kit-avatar--variant-text {
100
+ --avatar-color: var(--base, var(--kit-neutral));
101
+ background-color: transparent;
102
+ border-color: transparent;
103
+ }
104
+
105
+ .kit-avatar[breakpoint]kit-avatar--variant-dash {
106
+ --avatar-color: var(--base, var(--kit-neutral));
107
+ background-color: transparent;
108
+ border: 1px dashed currentColor;
109
+ }
@@ -0,0 +1,46 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/assets.svelte.js';
3
+ import type { AvatarProps } from './types.js';
4
+ let {
5
+ children,
6
+ ref = $bindable(),
7
+ light,
8
+ dark,
9
+ size = 'md',
10
+ rounded,
11
+ alt,
12
+ background,
13
+ color,
14
+ src,
15
+ variant,
16
+ density = 'default',
17
+ ...rest
18
+ }: AvatarProps = $props();
19
+
20
+ const assets = getAssets();
21
+ </script>
22
+
23
+ <svelte:element
24
+ this={'div'}
25
+ bind:this={ref}
26
+ {...rest}
27
+ class={[
28
+ 'kit-avatar',
29
+ light && 'light',
30
+ dark && 'dark',
31
+ src && 'kit-avatar--image',
32
+ size && assets.className('avatar', 'size', size),
33
+ variant && assets.className('avatar', 'variant', variant),
34
+ density && assets.className('avatar', 'density', density),
35
+ rest.class
36
+ ]}
37
+ style:--base={assets.color(background)}
38
+ style:--on={assets.color(color)}
39
+ style:--shape={assets.shape(rounded)}
40
+ >
41
+ {#if src}
42
+ <img {src} {alt} />
43
+ {:else}
44
+ {@render children?.()}
45
+ {/if}
46
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { AvatarProps } from './types.js';
2
+ declare const Avatar: import("svelte").Component<AvatarProps, {}, "ref">;
3
+ type Avatar = ReturnType<typeof Avatar>;
4
+ export default Avatar;
@@ -0,0 +1,22 @@
1
+ import type { Component } from '../../internal/types.js';
2
+ type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ type AvatarDensity = 'compact' | 'comfortable' | 'default';
4
+ type AvatarVariant = 'outline' | 'text' | 'dash';
5
+ export interface AvatarProps extends Component {
6
+ ref?: HTMLElement | null;
7
+ dark?: boolean;
8
+ light?: boolean;
9
+ color?: string;
10
+ background?: string;
11
+ src?: string;
12
+ size?: AvatarSize | {
13
+ [key: string]: AvatarSize;
14
+ };
15
+ variant?: AvatarVariant | {
16
+ [key: string]: AvatarVariant;
17
+ };
18
+ density?: AvatarDensity | {
19
+ [key: string]: AvatarDensity;
20
+ };
21
+ }
22
+ export {};
@@ -0,0 +1 @@
1
+ export {};