lapikit 0.0.0-insiders.44c1154 → 0.0.0-insiders.51a5f0d

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 (46) hide show
  1. package/dist/assets/icons/arrow-down.svelte +2 -0
  2. package/dist/assets/icons/arrow-down.svelte.d.ts +6 -14
  3. package/dist/assets/icons/arrow-up.svelte +2 -0
  4. package/dist/assets/icons/arrow-up.svelte.d.ts +6 -14
  5. package/dist/assets/icons/close-fill.svelte +2 -0
  6. package/dist/assets/icons/close-fill.svelte.d.ts +6 -14
  7. package/dist/assets/icons/loading-fill.svelte +2 -0
  8. package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
  9. package/dist/components/app/app.svelte +22 -4
  10. package/dist/components/appbar/appbar.css +48 -0
  11. package/dist/components/{navbar/navbar.svelte → appbar/appbar.svelte} +7 -13
  12. package/dist/components/appbar/appbar.svelte.d.ts +4 -0
  13. package/dist/components/{navbar → appbar}/types.d.ts +1 -13
  14. package/dist/components/avatar/avatar.svelte +4 -4
  15. package/dist/components/avatar/types.d.ts +1 -1
  16. package/dist/components/button/button.css +163 -193
  17. package/dist/components/button/button.svelte +38 -31
  18. package/dist/components/button/button.svelte.d.ts +2 -2
  19. package/dist/components/button/types.d.ts +7 -5
  20. package/dist/components/card/card.css +62 -56
  21. package/dist/components/card/card.svelte +13 -1
  22. package/dist/components/card/types.d.ts +1 -1
  23. package/dist/components/chip/chip.css +111 -81
  24. package/dist/components/chip/chip.svelte +17 -7
  25. package/dist/components/chip/types.d.ts +2 -1
  26. package/dist/components/icon/icon.css +13 -10
  27. package/dist/components/index.d.ts +2 -2
  28. package/dist/components/index.js +2 -3
  29. package/dist/components/list/list.css +144 -119
  30. package/dist/components/list/list.svelte +1 -3
  31. package/dist/components/list/modules/list-item.svelte +7 -0
  32. package/dist/components/list/types.d.ts +2 -5
  33. package/dist/components/modal/modal.css +1 -1
  34. package/dist/internal/ripple.d.ts +11 -0
  35. package/dist/internal/ripple.js +90 -0
  36. package/dist/internal/unit.d.ts +1 -0
  37. package/dist/internal/unit.js +11 -0
  38. package/dist/preset.js +2 -2
  39. package/dist/stores/index.d.ts +4 -3
  40. package/dist/stores/index.js +9 -4
  41. package/dist/style/animation.css +40 -0
  42. package/dist/style/parser/device.js +31 -19
  43. package/package.json +1 -1
  44. package/dist/components/navbar/navbar.css +0 -117
  45. package/dist/components/navbar/navbar.svelte.d.ts +0 -4
  46. /package/dist/components/{navbar → appbar}/types.js +0 -0
@@ -1,3 +1,5 @@
1
+ <script lang="ts"></script>
2
+
1
3
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
2
4
  ><path
3
5
  fill="none"
@@ -1,18 +1,5 @@
1
- export default ArrowDown;
2
- type ArrowDown = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const ArrowDown: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
1
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
3
  $$bindings?: Bindings;
17
4
  } & Exports;
18
5
  (internal: unknown, props: {
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
11
  };
25
12
  z_$$bindings?: Bindings;
26
13
  }
14
+ declare const ArrowDown: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type ArrowDown = InstanceType<typeof ArrowDown>;
18
+ export default ArrowDown;
@@ -1,3 +1,5 @@
1
+ <script lang="ts"></script>
2
+
1
3
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
2
4
  ><path
3
5
  fill="none"
@@ -1,18 +1,5 @@
1
- export default ArrowUp;
2
- type ArrowUp = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const ArrowUp: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
1
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
3
  $$bindings?: Bindings;
17
4
  } & Exports;
18
5
  (internal: unknown, props: {
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
11
  };
25
12
  z_$$bindings?: Bindings;
26
13
  }
14
+ declare const ArrowUp: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type ArrowUp = InstanceType<typeof ArrowUp>;
18
+ export default ArrowUp;
@@ -1,3 +1,5 @@
1
+ <script lang="ts"></script>
2
+
1
3
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
2
4
  ><title>close_fill</title><g id="close_fill" fill="none" fill-rule="evenodd"
3
5
  ><path
@@ -1,18 +1,5 @@
1
- export default CloseFill;
2
- type CloseFill = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const CloseFill: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
1
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
3
  $$bindings?: Bindings;
17
4
  } & Exports;
18
5
  (internal: unknown, props: {
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
11
  };
25
12
  z_$$bindings?: Bindings;
26
13
  }
14
+ declare const CloseFill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type CloseFill = InstanceType<typeof CloseFill>;
18
+ export default CloseFill;
@@ -1,3 +1,5 @@
1
+ <script lang="ts"></script>
2
+
1
3
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
2
4
  ><defs
3
5
  ><linearGradient id="a" x1="50%" x2="50%" y1="5.271%" y2="91.793%"
@@ -1,18 +1,5 @@
1
- export default LoadingFill;
2
- type LoadingFill = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const LoadingFill: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
1
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
3
  $$bindings?: Bindings;
17
4
  } & Exports;
18
5
  (internal: unknown, props: {
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
11
  };
25
12
  z_$$bindings?: Bindings;
26
13
  }
14
+ declare const LoadingFill: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type LoadingFill = InstanceType<typeof LoadingFill>;
18
+ export default LoadingFill;
@@ -1,18 +1,36 @@
1
1
  <script lang="ts">
2
2
  import { BROWSER } from 'esm-env';
3
- import { modalOpen, setOpenModal, 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
- {$modalOpen ? ($modalOpen === 'persistent' ? 'persistent' : 'true') : 'false'}
15
-
16
34
  {@render children?.()}
17
35
 
18
36
  <!-- svelte-ignore a11y_no_static_element_interactions -->
@@ -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
+ }
@@ -1,23 +1,20 @@
1
1
  <script lang="ts">
2
2
  import { getAssets } from '../../internal/index.js';
3
- import type { NavbarProps } from './types.js';
3
+ import type { AppbarProps } from './types.js';
4
4
 
5
5
  let {
6
6
  children,
7
7
  ref = $bindable(),
8
- is = 'div',
8
+ is = 'header',
9
9
  classContent,
10
10
  light,
11
11
  dark,
12
- variant,
13
12
  rounded,
14
13
  background,
15
14
  color,
16
15
  density = 'default',
17
- orientation = 'horizontal',
18
- location,
19
16
  ...rest
20
- }: NavbarProps = $props();
17
+ }: AppbarProps = $props();
21
18
 
22
19
  const assets = getAssets();
23
20
  </script>
@@ -26,22 +23,19 @@
26
23
  this={is}
27
24
  bind:this={ref}
28
25
  {...rest}
29
- role="navigation"
26
+ role="heading"
30
27
  class={[
31
- 'kit-navbar',
28
+ 'kit-appbar',
32
29
  light && 'light',
33
30
  dark && 'dark',
34
- variant && assets.className('navbar', 'variant', variant),
35
- density && assets.className('navbar', 'density', density),
36
- orientation && assets.className('navbar', 'orientation', orientation),
37
- location && assets.className('navbar', 'location', location),
31
+ density && assets.className('appbar', 'density', density),
38
32
  rest.class
39
33
  ]}
40
34
  style:--base={assets.color(background)}
41
35
  style:--on={assets.color(color)}
42
36
  style:--shape={assets.shape(rounded)}
43
37
  >
44
- <div class={['kit-navbar--wrapper', classContent]}>
38
+ <div class={['kit-appbar--wrapper', classContent]}>
45
39
  {@render children?.()}
46
40
  </div>
47
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;
@@ -1,13 +1,7 @@
1
1
  import type { Component } from '../../internal/types.js';
2
- type Variant = 'outline' | 'text' | 'dash';
3
2
  type Density = 'compact' | 'comfortable' | 'default';
4
- type Orientation = 'horizontal' | 'vertical';
5
- type Location = 'top' | 'bottom';
6
- export interface NavbarProps extends Component {
3
+ export interface AppbarProps extends Component {
7
4
  is?: 'div' | 'header' | 'nav';
8
- variant?: Variant | {
9
- [key: string]: Variant;
10
- };
11
5
  rounded?: string;
12
6
  density?: Density | {
13
7
  [key: string]: Density;
@@ -15,13 +9,7 @@ export interface NavbarProps extends Component {
15
9
  dark?: boolean;
16
10
  light?: boolean;
17
11
  color?: string;
18
- orientation?: Orientation | {
19
- [key: string]: Orientation;
20
- };
21
12
  background?: string;
22
- location?: Location | {
23
- [key: string]: Location;
24
- };
25
13
  classContent?: string | string[] | undefined;
26
14
  }
27
15
  export {};
@@ -11,7 +11,7 @@
11
11
  alt,
12
12
  background,
13
13
  color,
14
- image,
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
- image && 'kit-avatar--image',
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 image}
42
- <img src={image} {alt} />
41
+ {#if src}
42
+ <img {src} {alt} />
43
43
  {:else}
44
44
  {@render children?.()}
45
45
  {/if}
@@ -8,7 +8,7 @@ export interface AvatarProps extends Component {
8
8
  light?: boolean;
9
9
  color?: string;
10
10
  background?: string;
11
- image?: string;
11
+ src?: string;
12
12
  size?: AvatarSize | {
13
13
  [key: string]: AvatarSize;
14
14
  };