lapikit 0.0.0-insiders.e877f7f → 0.0.0-insiders.eb9b51b

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 (218) hide show
  1. package/bin/configuration.js +303 -0
  2. package/bin/helper.js +0 -15
  3. package/bin/index.js +33 -0
  4. package/bin/presets.js +26 -0
  5. package/bin/prompts.js +67 -0
  6. package/dist/actions/accordion.svelte.d.ts +9 -0
  7. package/dist/actions/accordion.svelte.js +24 -0
  8. package/dist/actions/index.d.ts +2 -0
  9. package/dist/actions/index.js +2 -0
  10. package/dist/actions/use-theme.d.ts +1 -0
  11. package/dist/actions/use-theme.js +18 -0
  12. package/dist/assets/icons/arrow-down.svelte +12 -0
  13. package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
  14. package/dist/assets/icons/arrow-up.svelte +12 -0
  15. package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
  16. package/dist/assets/icons/close-fill.svelte +12 -0
  17. package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
  18. package/dist/assets/icons/loading-fill.svelte +2 -0
  19. package/dist/assets/icons/loading-fill.svelte.d.ts +6 -14
  20. package/dist/components/accordion/accordion.css +36 -0
  21. package/dist/components/accordion/accordion.svelte +39 -0
  22. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  23. package/dist/components/accordion/modules/accordion-item.css +68 -0
  24. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  25. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  26. package/dist/components/accordion/types.d.ts +33 -0
  27. package/dist/components/alert/alert.css +130 -0
  28. package/dist/components/alert/alert.svelte +89 -0
  29. package/dist/components/alert/alert.svelte.d.ts +4 -0
  30. package/dist/components/alert/types.d.ts +28 -0
  31. package/dist/components/alert/types.js +1 -0
  32. package/dist/components/app/app.css +15 -0
  33. package/dist/components/app/app.svelte +34 -4
  34. package/dist/components/app/app.svelte.d.ts +2 -0
  35. package/dist/components/appbar/appbar.css +38 -0
  36. package/dist/components/appbar/appbar.svelte +40 -0
  37. package/dist/components/appbar/appbar.svelte.d.ts +4 -0
  38. package/dist/components/appbar/types.d.ts +15 -0
  39. package/dist/components/appbar/types.js +1 -0
  40. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  41. package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -0
  42. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  43. package/dist/components/aspect-ratio/types.d.ts +5 -0
  44. package/dist/components/aspect-ratio/types.js +1 -0
  45. package/dist/components/avatar/avatar.css +102 -0
  46. package/dist/components/avatar/avatar.svelte +46 -0
  47. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  48. package/dist/components/avatar/types.d.ts +22 -0
  49. package/dist/components/avatar/types.js +1 -0
  50. package/dist/components/button/button.css +167 -203
  51. package/dist/components/button/button.svelte +43 -35
  52. package/dist/components/button/button.svelte.d.ts +2 -2
  53. package/dist/components/button/types.d.ts +8 -6
  54. package/dist/components/card/card.css +105 -0
  55. package/dist/components/card/card.svelte +63 -0
  56. package/dist/components/card/card.svelte.d.ts +4 -0
  57. package/dist/components/card/types.d.ts +18 -0
  58. package/dist/components/card/types.js +1 -0
  59. package/dist/components/chip/chip.css +224 -0
  60. package/dist/components/chip/chip.svelte +131 -0
  61. package/dist/components/chip/chip.svelte.d.ts +4 -0
  62. package/dist/components/chip/types.d.ts +32 -0
  63. package/dist/components/chip/types.js +1 -0
  64. package/dist/components/dialog/dialog.css +129 -0
  65. package/dist/components/dialog/dialog.svelte +67 -0
  66. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  67. package/dist/components/dialog/types.d.ts +24 -0
  68. package/dist/components/dialog/types.js +1 -0
  69. package/dist/components/dropdown/dropdown.css +3 -12
  70. package/dist/components/dropdown/dropdown.svelte +6 -7
  71. package/dist/components/dropdown/types.d.ts +1 -1
  72. package/dist/components/icon/icon.css +20 -18
  73. package/dist/components/icon/icon.svelte +2 -2
  74. package/dist/components/icon/types.d.ts +1 -1
  75. package/dist/components/index.d.ts +17 -1
  76. package/dist/components/index.js +17 -1
  77. package/dist/components/list/list.css +149 -0
  78. package/dist/components/list/list.svelte +44 -0
  79. package/dist/components/list/list.svelte.d.ts +4 -0
  80. package/dist/components/list/modules/list-item.css +67 -0
  81. package/dist/components/list/modules/list-item.svelte +76 -0
  82. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  83. package/dist/components/list/types.d.ts +33 -0
  84. package/dist/components/list/types.js +1 -0
  85. package/dist/components/modal/modal.css +137 -0
  86. package/dist/components/modal/modal.svelte +112 -0
  87. package/dist/components/modal/modal.svelte.d.ts +4 -0
  88. package/dist/components/modal/types.d.ts +26 -0
  89. package/dist/components/modal/types.js +1 -0
  90. package/dist/components/popover/popover.css +3 -12
  91. package/dist/components/popover/popover.svelte +6 -6
  92. package/dist/components/popover/types.d.ts +1 -1
  93. package/dist/components/separator/separator.css +42 -0
  94. package/dist/components/separator/separator.svelte +37 -0
  95. package/dist/components/separator/separator.svelte.d.ts +4 -0
  96. package/dist/components/separator/types.d.ts +11 -0
  97. package/dist/components/separator/types.js +1 -0
  98. package/dist/components/spacer/spacer.css +3 -0
  99. package/dist/components/spacer/spacer.svelte +7 -0
  100. package/dist/components/spacer/spacer.svelte.d.ts +4 -0
  101. package/dist/components/spacer/types.d.ts +4 -0
  102. package/dist/components/spacer/types.js +1 -0
  103. package/dist/components/textfield/textfield.css +298 -0
  104. package/dist/components/textfield/textfield.svelte +193 -0
  105. package/dist/components/textfield/textfield.svelte.d.ts +4 -0
  106. package/dist/components/textfield/types.d.ts +37 -0
  107. package/dist/components/textfield/types.js +1 -0
  108. package/dist/components/toolbar/toolbar.css +117 -0
  109. package/dist/components/toolbar/toolbar.svelte +47 -0
  110. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  111. package/dist/components/toolbar/types.d.ts +27 -0
  112. package/dist/components/toolbar/types.js +1 -0
  113. package/dist/components/tooltip/tooltip.css +5 -13
  114. package/dist/components/tooltip/tooltip.svelte +5 -5
  115. package/dist/components/tooltip/types.d.ts +1 -1
  116. package/dist/index.d.ts +3 -1
  117. package/dist/index.js +23 -3
  118. package/dist/internal/config/presets.d.ts +149 -0
  119. package/dist/internal/config/presets.js +169 -0
  120. package/dist/internal/config/variables.d.ts +3 -0
  121. package/dist/internal/config/variables.js +3 -0
  122. package/dist/internal/{assets.svelte.d.ts → core/actions/assets.svelte.d.ts} +1 -0
  123. package/dist/internal/{assets.svelte.js → core/actions/assets.svelte.js} +17 -4
  124. package/dist/internal/core/actions/dropdown.svelte.d.ts +7 -0
  125. package/dist/internal/core/actions/popover.svelte.d.ts +7 -0
  126. package/dist/internal/core/actions/tooltip.svelte.d.ts +7 -0
  127. package/dist/internal/core/animations/ripple.d.ts +12 -0
  128. package/dist/internal/core/animations/ripple.js +93 -0
  129. package/dist/internal/core/css.d.ts +1 -0
  130. package/dist/internal/core/css.js +16 -0
  131. package/dist/internal/core/formatter/component.d.ts +5 -0
  132. package/dist/internal/core/formatter/component.js +60 -0
  133. package/dist/internal/core/formatter/device.d.ts +5 -0
  134. package/dist/internal/core/formatter/device.js +66 -0
  135. package/dist/internal/core/formatter/index.d.ts +7 -0
  136. package/dist/internal/core/formatter/index.js +35 -0
  137. package/dist/internal/core/formatter/style.d.ts +4 -0
  138. package/dist/internal/core/formatter/style.js +15 -0
  139. package/dist/internal/core/formatter/theme.d.ts +5 -0
  140. package/dist/internal/core/formatter/theme.js +44 -0
  141. package/dist/internal/core/formatter/typography.d.ts +5 -0
  142. package/dist/internal/core/formatter/typography.js +12 -0
  143. package/dist/internal/core/standard-colors.d.ts +75 -0
  144. package/dist/internal/core/standard-colors.js +75 -0
  145. package/dist/internal/helpers/colors.d.ts +1 -0
  146. package/dist/internal/{colors.js → helpers/colors.js} +2 -2
  147. package/dist/internal/helpers/convert.d.ts +1 -0
  148. package/dist/internal/helpers/convert.js +17 -0
  149. package/dist/internal/helpers/deep-merge.d.ts +44 -0
  150. package/dist/internal/helpers/deep-merge.js +80 -0
  151. package/dist/internal/helpers/parser.d.ts +10 -0
  152. package/dist/internal/helpers/parser.js +93 -0
  153. package/dist/internal/helpers/scroll.d.ts +1 -0
  154. package/dist/internal/helpers/scroll.js +6 -0
  155. package/dist/internal/plugins/vite.d.ts +8 -0
  156. package/dist/internal/plugins/vite.js +33 -0
  157. package/dist/internal/types/components.d.ts +14 -0
  158. package/dist/internal/types/components.js +1 -0
  159. package/dist/internal/types/configuration.d.ts +63 -0
  160. package/dist/internal/types/configuration.js +1 -0
  161. package/dist/internal/types/index.d.ts +2 -0
  162. package/dist/internal/types/index.js +2 -0
  163. package/dist/stores/breakpoints.d.ts +6 -0
  164. package/dist/stores/breakpoints.js +14 -0
  165. package/dist/stores/components.d.ts +8 -0
  166. package/dist/stores/components.js +26 -0
  167. package/dist/stores/devices.d.ts +6 -0
  168. package/dist/stores/devices.js +9 -0
  169. package/dist/stores/index.d.ts +4 -4
  170. package/dist/stores/index.js +4 -23
  171. package/dist/stores/themes.d.ts +2 -0
  172. package/dist/stores/themes.js +4 -0
  173. package/dist/styles/animation.css +33 -0
  174. package/dist/{style/animation.css → styles/keyframes.css} +10 -0
  175. package/dist/{style/normalize.css → styles/reset.css} +15 -5
  176. package/dist/themes.css +0 -0
  177. package/package.json +18 -6
  178. package/bin/lapikit.js +0 -54
  179. package/bin/modules/adapter.js +0 -52
  180. package/bin/modules/preset.js +0 -11
  181. package/dist/internal/colors.d.ts +0 -1
  182. package/dist/internal/index.d.ts +0 -3
  183. package/dist/internal/index.js +0 -3
  184. package/dist/internal/types.d.ts +0 -57
  185. package/dist/plugin/modules/config.d.ts +0 -2
  186. package/dist/plugin/modules/config.js +0 -54
  187. package/dist/plugin/modules/importer.d.ts +0 -1
  188. package/dist/plugin/modules/importer.js +0 -15
  189. package/dist/plugin/vitejs.d.ts +0 -6
  190. package/dist/plugin/vitejs.js +0 -26
  191. package/dist/preset.d.ts +0 -2
  192. package/dist/preset.js +0 -92
  193. package/dist/style/css.d.ts +0 -2
  194. package/dist/style/css.js +0 -31
  195. package/dist/style/parser/color.d.ts +0 -5
  196. package/dist/style/parser/color.js +0 -88
  197. package/dist/style/parser/component.d.ts +0 -2
  198. package/dist/style/parser/component.js +0 -115
  199. package/dist/style/parser/device.d.ts +0 -2
  200. package/dist/style/parser/device.js +0 -28
  201. package/dist/style/parser/index.d.ts +0 -4
  202. package/dist/style/parser/index.js +0 -4
  203. package/dist/style/parser/variable.d.ts +0 -2
  204. package/dist/style/parser/variable.js +0 -25
  205. /package/dist/{internal → components/accordion}/types.js +0 -0
  206. /package/dist/{components/dropdown → internal/core/actions}/dropdown.svelte.js +0 -0
  207. /package/dist/{components/popover → internal/core/actions}/popover.svelte.js +0 -0
  208. /package/dist/{components/tooltip → internal/core/actions}/tooltip.svelte.js +0 -0
  209. /package/dist/internal/{ansi.d.ts → core/bin/ansi.d.ts} +0 -0
  210. /package/dist/internal/{ansi.js → core/bin/ansi.js} +0 -0
  211. /package/dist/internal/{terminal.d.ts → core/bin/terminal.d.ts} +0 -0
  212. /package/dist/internal/{terminal.js → core/bin/terminal.js} +0 -0
  213. /package/dist/internal/{minify.d.ts → core/minify.d.ts} +0 -0
  214. /package/dist/internal/{minify.js → core/minify.js} +0 -0
  215. /package/dist/{utils/x11.d.ts → internal/core/x11-colors.d.ts} +0 -0
  216. /package/dist/{utils/x11.js → internal/core/x11-colors.js} +0 -0
  217. /package/dist/internal/{clickOutside.d.ts → helpers/outside.d.ts} +0 -0
  218. /package/dist/internal/{clickOutside.js → helpers/outside.js} +0 -0
@@ -0,0 +1,67 @@
1
+ .kit-list-item {
2
+ position: relative;
3
+ border: none;
4
+ outline: none;
5
+ padding-top: var(--list-spacing-x);
6
+ padding-bottom: var(--list-spacing-x);
7
+ padding-right: var(--list-spacing-y);
8
+ padding-left: var(--list-spacing-y);
9
+ color: var(--list-item-color, var(--kit-label-primary));
10
+ border-radius: var(--list-item-shape, var(--system-shape-sm));
11
+ font-weight: 500;
12
+ text-decoration: none;
13
+ }
14
+
15
+ .kit-list-item {
16
+ height: var(--list-height);
17
+ }
18
+
19
+ .kit-list-item:not(div) {
20
+ cursor: pointer;
21
+ }
22
+
23
+ .kit-list-item,
24
+ .kit-list-item .kit-list-item-content--content,
25
+ .kit-list-item .kit-list-item-content--append,
26
+ .kit-list-item .kit-list-item-content--prepend {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ white-space: nowrap;
30
+ gap: calc(var(--system-spacing) * var(--list-multiplier-gap));
31
+ font-size: calc(var(--system-spacing) * var(--list-multiplier-font-size));
32
+ }
33
+
34
+ .kit-list-item.kit-list-item--append:not(.kit-list-item--prepend) {
35
+ display: grid;
36
+ grid-template-columns: auto 1fr;
37
+ }
38
+
39
+ .kit-list-item.kit-list-item--prepend:not(.kit-list-item--append) {
40
+ display: grid;
41
+ grid-template-columns: 1fr auto;
42
+ }
43
+
44
+ .kit-list-item.kit-list-item--prepend.kit-list-item--append {
45
+ display: grid;
46
+ grid-template-columns: auto 1fr auto;
47
+ }
48
+
49
+ .kit-list-item::after {
50
+ content: '';
51
+ position: absolute;
52
+ inset: 0;
53
+ background-color: currentColor;
54
+ opacity: 0;
55
+ transition: opacity 150ms ease;
56
+ pointer-events: none;
57
+ border-radius: inherit;
58
+ }
59
+ .kit-list-item:not(div):hover::after {
60
+ opacity: 0.08;
61
+ }
62
+ .kit-list-item:not(div):active::after {
63
+ opacity: 0.12;
64
+ }
65
+ .kit-list-item:not(div):focus-visible::after {
66
+ opacity: 0.12;
67
+ }
@@ -0,0 +1,76 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../../internal/core/actions/assets.svelte.js';
3
+ import type { ListItemProps } from '../types.js';
4
+
5
+ // external
6
+ import { ripple } from '../../../internal/core/animations/ripple.js';
7
+
8
+ let {
9
+ children,
10
+ append,
11
+ prepend,
12
+ ref = $bindable(),
13
+ is = 'div',
14
+ dark,
15
+ light,
16
+ background,
17
+ color,
18
+ rounded,
19
+ disabled,
20
+ active,
21
+ href,
22
+ noRipple,
23
+ ...rest
24
+ }: ListItemProps = $props();
25
+
26
+ const assets = getAssets();
27
+
28
+ $effect(() => {
29
+ const refProps = { ...rest };
30
+ if (refProps?.onclick) is = 'button';
31
+ });
32
+ </script>
33
+
34
+ <svelte:element
35
+ this={href ? 'a' : is}
36
+ bind:this={ref}
37
+ {...rest}
38
+ href={href && !disabled ? href : undefined}
39
+ class={[
40
+ 'kit-list-item',
41
+ light && 'light',
42
+ dark && 'dark',
43
+ append && 'kit-list-item--append',
44
+ prepend && 'kit-list-item--prepend',
45
+ active && 'kit-list-item--active',
46
+ disabled && 'kit-list-item--disabled',
47
+ rest.class
48
+ ]}
49
+ use:ripple={{
50
+ component: 'list-item',
51
+ disabled: noRipple || disabled || is === 'div'
52
+ }}
53
+ role={is === 'button' ? 'listitem' : undefined}
54
+ tabindex={href && disabled ? -2 : 0}
55
+ aria-disabled={href ? disabled : undefined}
56
+ disabled={href ? undefined : disabled}
57
+ style:--list-item-background={assets.color(background)}
58
+ style:--list-item-color={assets.color(color)}
59
+ style:--list-item-shape={assets.shape(rounded)}
60
+ >
61
+ {#if append}
62
+ <div class="kit-list-item-content--append">
63
+ {@render append?.()}
64
+ </div>
65
+ {/if}
66
+
67
+ <div class="kit-list-item-content--content">
68
+ {@render children?.()}
69
+ </div>
70
+
71
+ {#if prepend}
72
+ <div class="kit-list-item-content--prepend">
73
+ {@render prepend?.()}
74
+ </div>
75
+ {/if}
76
+ </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { ListItemProps } from '../types.js';
2
+ declare const ListItem: import("svelte").Component<ListItemProps, {}, "ref">;
3
+ type ListItem = ReturnType<typeof ListItem>;
4
+ export default ListItem;
@@ -0,0 +1,33 @@
1
+ import type { Component } from '../../internal/types/index.js';
2
+ import type { Snippet } from 'svelte';
3
+ type ListSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
4
+ type ListDensity = 'compact' | 'comfortable' | 'default';
5
+ export interface ListProps extends Component {
6
+ ref?: HTMLElement | null;
7
+ is?: 'div' | 'nav';
8
+ dark?: boolean;
9
+ light?: boolean;
10
+ size?: ListSize | {
11
+ [key: string]: ListSize;
12
+ };
13
+ variant?: 'outline' | 'text' | 'filled';
14
+ density?: ListDensity | {
15
+ [key: string]: ListDensity;
16
+ };
17
+ nav?: boolean;
18
+ }
19
+ export interface ListItemProps extends Component {
20
+ ref?: HTMLElement | null;
21
+ is?: 'div' | 'a' | 'button';
22
+ href?: string;
23
+ dark?: boolean;
24
+ light?: boolean;
25
+ append?: Snippet;
26
+ prepend?: Snippet;
27
+ color?: string;
28
+ background?: string;
29
+ active?: boolean;
30
+ disabled?: boolean;
31
+ noRipple?: boolean;
32
+ }
33
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,137 @@
1
+ .kit-modal {
2
+ --modal-translate-x: -50%;
3
+ --modal-translate-y: -50%;
4
+ width: 100%;
5
+ height: 100%;
6
+ position: absolute;
7
+ }
8
+
9
+ .kit-modal-container {
10
+ position: fixed;
11
+ overflow-y: auto;
12
+ z-index: 9100;
13
+ width: 100%;
14
+ height: 100%;
15
+ padding-top: var(--modal-spacing-x);
16
+ padding-bottom: var(--modal-spacing-x);
17
+ padding-right: var(--modal-spacing-y);
18
+ padding-left: var(--modal-spacing-y);
19
+ color: var(--modal-color, var(--kit-label-primary));
20
+ background-color: var(--modal-background, var(--kit-background-grouped-primary));
21
+ border-color: var(--modal-background, var(--kit-background-grouped-primary));
22
+ }
23
+
24
+ .kit-modal.kit-modal--contain {
25
+ position: absolute;
26
+ top: 0;
27
+ }
28
+
29
+ .kit-modal.kit-modal--contain .kit-overlay {
30
+ position: absolute;
31
+ }
32
+
33
+ .kit-modal.kit-modal--contain .kit-modal-container {
34
+ position: absolute;
35
+ }
36
+
37
+ /* size */
38
+ .kit-modal [breakpoint]kit-modal-container--size-xs {
39
+ max-width: var(--system-dialog-xs);
40
+ max-height: calc(100% - 3rem);
41
+ height: fit-content;
42
+ margin: 0 auto;
43
+ left: 50%;
44
+ bottom: initial;
45
+ translate: var(--modal-translate-x) var(--modal-translate-y);
46
+ border-radius: var(--modal-shape, var(--system-shape-md));
47
+ }
48
+ .kit-modal [breakpoint]kit-modal-container--size-sm {
49
+ max-width: var(--system-dialog-sm);
50
+ max-height: calc(100% - 3rem);
51
+ height: fit-content;
52
+ margin: 0 auto;
53
+ left: 50%;
54
+ bottom: initial;
55
+ translate: var(--modal-translate-x) var(--modal-translate-y);
56
+ border-radius: var(--modal-shape, var(--system-shape-md));
57
+ }
58
+ .kit-modal [breakpoint]kit-modal-container--size-md {
59
+ max-width: var(--system-dialog-md);
60
+ max-height: calc(100% - 3rem);
61
+ height: fit-content;
62
+ margin: 0 auto;
63
+ left: 50%;
64
+ bottom: initial;
65
+ translate: var(--modal-translate-x) var(--modal-translate-y);
66
+ border-radius: var(--modal-shape, var(--system-shape-md));
67
+ }
68
+ .kit-modal [breakpoint]kit-modal-container--size-lg {
69
+ max-width: var(--system-dialog-lg);
70
+ max-height: calc(100% - 3rem);
71
+ height: fit-content;
72
+ margin: 0 auto;
73
+ left: 50%;
74
+ bottom: initial;
75
+ translate: var(--modal-translate-x) var(--modal-translate-y);
76
+ border-radius: var(--modal-shape, var(--system-shape-md));
77
+ }
78
+ .kit-modal [breakpoint]kit-modal-container--size-xl {
79
+ max-width: var(--system-dialog-xl);
80
+ max-height: calc(100% - 3rem);
81
+ height: fit-content;
82
+ margin: 0 auto;
83
+ left: 50%;
84
+ bottom: initial;
85
+ translate: var(--modal-translate-x) var(--modal-translate-y);
86
+ border-radius: var(--modal-shape, var(--system-shape-md));
87
+ }
88
+ .kit-modal [breakpoint]kit-modal-container--size-full {
89
+ max-width: 100%;
90
+ max-height: calc(100% - 3rem);
91
+ margin: 0 auto;
92
+ bottom: 0;
93
+ translate: 0 0;
94
+ left: 0;
95
+ top: initial;
96
+ height: 100%;
97
+ border-radius: var(--modal-shape, var(--system-shape-md))
98
+ var(--modal-shape, var(--system-shape-md)) 0 0;
99
+ }
100
+
101
+ /* density */
102
+ .kit-modal [breakpoint]kit-modal-container--density-default {
103
+ --modal-spacing-x: 0.5rem;
104
+ --modal-spacing-y: 0.5rem;
105
+ }
106
+
107
+ .kit-modal [breakpoint]kit-modal-container--density-compact {
108
+ --modal-spacing-x: 0.25rem;
109
+ --modal-spacing-y: 0.25rem;
110
+ }
111
+
112
+ .kit-modal [breakpoint]kit-modal-container--density-comfortable {
113
+ --modal-spacing-x: 0.75rem;
114
+ --modal-spacing-y: 0.75rem;
115
+ }
116
+
117
+ /* position */
118
+ .kit-modal [breakpoint]kit-modal-container--position-bottom {
119
+ --modal-translate-y: 0;
120
+ margin: auto;
121
+ top: initial;
122
+ bottom: 0;
123
+ }
124
+
125
+ .kit-modal [breakpoint]kit-modal-container--position-top {
126
+ --modal-translate-y: 0;
127
+ margin: auto;
128
+ top: 0;
129
+ bottom: initial;
130
+ }
131
+
132
+ .kit-modal [breakpoint]kit-modal-container--position-center {
133
+ --modal-translate-y: -50%;
134
+ margin: auto;
135
+ top: 50%;
136
+ bottom: initial;
137
+ }
@@ -0,0 +1,112 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/core/actions/assets.svelte.js';
3
+ import { modalOpen, modalStack, popModal, pushModal, setOpenModal } from '../../stores/index.js';
4
+ import { onDestroy } from 'svelte';
5
+ import type { ModalProps } from './types.js';
6
+ import { get } from 'svelte/store';
7
+
8
+ const modalId = crypto.randomUUID();
9
+ let wasPushed = $state(false);
10
+
11
+ let {
12
+ children,
13
+ ref = $bindable(),
14
+ open = $bindable(),
15
+ contain,
16
+ size = 'md',
17
+ persistent,
18
+ dark,
19
+ light,
20
+ classContent,
21
+ color,
22
+ background,
23
+ position = 'center',
24
+ rounded,
25
+ density = 'default',
26
+ closeWithEsc,
27
+ ...rest
28
+ }: ModalProps = $props();
29
+
30
+ const assets = getAssets();
31
+
32
+ $effect(() => {
33
+ if (open && !wasPushed) {
34
+ pushModal(modalId);
35
+ wasPushed = true;
36
+ } else if (!open && wasPushed) {
37
+ popModal(modalId);
38
+ wasPushed = false;
39
+ }
40
+ });
41
+
42
+ onDestroy(() => {
43
+ if (wasPushed) popModal(modalId);
44
+ });
45
+
46
+ $effect(() => {
47
+ if (open !== undefined && !contain)
48
+ setOpenModal(open ? (persistent ? 'persistent' : open) : open);
49
+ });
50
+
51
+ $effect(() => {
52
+ if ($modalOpen === false && !contain) open = false;
53
+ });
54
+
55
+ $effect(() => {
56
+ if (!closeWithEsc || persistent || !open) return;
57
+
58
+ const onKeyDown = (event: KeyboardEvent) => {
59
+ const stack = get(modalStack);
60
+ const isTop = stack[stack.length - 1] === modalId;
61
+
62
+ if (event.key === 'Escape' && isTop) {
63
+ event.preventDefault();
64
+ open = false;
65
+ }
66
+ };
67
+
68
+ document.addEventListener('keydown', onKeyDown);
69
+ return () => {
70
+ document.removeEventListener('keydown', onKeyDown);
71
+ };
72
+ });
73
+
74
+ const handleClose = () => {
75
+ if (!persistent) open = false;
76
+ };
77
+ </script>
78
+
79
+ {#if open}
80
+ <div
81
+ bind:this={ref}
82
+ {...rest}
83
+ class={['kit-modal', contain && 'kit-modal--contain', rest.class]}
84
+ role="dialog"
85
+ >
86
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
87
+ {#if contain}
88
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
89
+ <div
90
+ class={['kit-overlay', persistent && 'kit-overlay--persistent']}
91
+ onclick={() => handleClose()}
92
+ ></div>
93
+ {/if}
94
+
95
+ <div
96
+ class={[
97
+ 'kit-modal-container',
98
+ classContent,
99
+ light && 'light',
100
+ dark && 'dark',
101
+ size && assets.className('modal-container', 'size', size),
102
+ density && assets.className('modal-container', 'density', density),
103
+ position && assets.className('modal-container', 'position', position)
104
+ ]}
105
+ style:--modal-background={assets.color(background)}
106
+ style:--modal-color={assets.color(color)}
107
+ style:--modal-shape={assets.shape(rounded)}
108
+ >
109
+ {@render children?.()}
110
+ </div>
111
+ </div>
112
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { ModalProps } from './types.js';
2
+ declare const Modal: import("svelte").Component<ModalProps, {}, "ref" | "open">;
3
+ type Modal = ReturnType<typeof Modal>;
4
+ export default Modal;
@@ -0,0 +1,26 @@
1
+ import type { Component } from '../../internal/types/index.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 {};
@@ -1,8 +1,4 @@
1
1
  .kit-popover-content {
2
- --popover-color: var(--on, var(--kit-on-neutral));
3
- --popover-background: var(--base, var(--kit-neutral));
4
- --popover-radius: var(--shape, var(--kit-radius-md));
5
-
6
2
  inset: 0px auto auto 0px;
7
3
  margin: 0px;
8
4
  position: fixed;
@@ -11,12 +7,7 @@
11
7
  width: auto;
12
8
  opacity: 1;
13
9
  transition-property: opacity, transform;
14
- transition:
15
- color 0.5s,
16
- background-color 0.5s;
17
-
18
- /* theme */
19
- background-color: var(--popover-background);
20
- color: var(--popover-color);
21
- border-radius: var(--popover-radius);
10
+ background-color: var(--popover-background, var(--kit-background-grouped-primary));
11
+ color: var(--popover-color, var(--kit-label-primary));
12
+ border-radius: var(--popover-shape, var(--system-shape-md));
22
13
  }
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
- import { getAssets } from '../../internal/assets.svelte.js';
3
- import { clickOutside } from '../../internal/clickOutside.js';
4
- import { getPositions } from './popover.svelte.js';
2
+ import { getAssets } from '../../internal/core/actions/assets.svelte.js';
3
+ import { clickOutside } from '../../internal/helpers/outside.js';
4
+ import { getPositions } from '../../internal/core/actions/popover.svelte.js';
5
5
  import type { PopoverProps, ModelPopoverProps } from './types.js';
6
6
 
7
7
  let {
@@ -63,9 +63,9 @@
63
63
  role="menu"
64
64
  class={['kit-popover-content', light && 'light', dark && 'dark', rest.class]}
65
65
  style={`transform: translate(${axis.x}px, ${axis.y}px);`}
66
- style:--base={assets.color(background)}
67
- style:--on={assets.color(color)}
68
- style:--shape={assets.shape(rounded)}
66
+ style:--popover-background={assets.color(background)}
67
+ style:--popover-color={assets.color(color)}
68
+ style:--popover-shape={assets.shape(rounded)}
69
69
  use:clickOutside={{ exclude: [ref, refActivator], onClose: () => (open = false) }}
70
70
  >
71
71
  {@render children?.()}
@@ -1,4 +1,4 @@
1
- import type { Component } from '../../internal/types.js';
1
+ import type { Component } from '../../internal/types/index.js';
2
2
  import type { Snippet } from 'svelte';
3
3
  export type PositionElement = {
4
4
  x: number;
@@ -0,0 +1,42 @@
1
+ .kit-separator {
2
+ display: block;
3
+ flex: 1 1 100%;
4
+ height: 0px;
5
+ max-height: 0px;
6
+ opacity: var(--separator-opacity, 0.12);
7
+ transition: inherit;
8
+ border-color: var(--separator-color, var(--kit-state-shadow));
9
+ border-style: solid;
10
+ }
11
+
12
+ .kit-separator:not(.kit-separator--orientation-vertical) {
13
+ border-width: var(--separator-top-width, thin) 0 0 0;
14
+ }
15
+
16
+ .kit-separator--orientation-vertical {
17
+ align-self: stretch;
18
+ border-width: 0 thin 0 0;
19
+ display: inline-flex;
20
+ height: auto;
21
+ margin-left: 0px;
22
+ max-height: 100%;
23
+ max-width: 0px;
24
+ vertical-align: text-bottom;
25
+ width: 0px;
26
+ border-width: 0 var(--separator-right-width, thin) 0 0;
27
+ }
28
+
29
+ .kit-separator--inset:not(.kit-separator--orientation-vertical) {
30
+ max-width: calc(100% - 4.5rem);
31
+ margin-inline-start: 4.5rem;
32
+ }
33
+
34
+ .kit-separator--inset.kit-separator--orientation-vertical {
35
+ margin-bottom: 0.5rem;
36
+ margin-top: 0.5rem;
37
+ max-height: calc(100% - 1rem);
38
+ }
39
+
40
+ .kit-separator:not(.kit-separator--orientation-vertical) {
41
+ width: 100%;
42
+ }
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import { getAssets } from '../../internal/core/actions/assets.svelte.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:--separator-color={assets.color(color)}
34
+ style:--separator-opacity={opacity}
35
+ style:--separator-top-width={orientation === 'horizontal' ? assets.unit(thickness) : undefined}
36
+ style:--separator-right-width={orientation === 'vertical' ? assets.unit(thickness) : undefined}
37
+ />
@@ -0,0 +1,4 @@
1
+ import type { SeparatorProps } from './types.js';
2
+ declare const Separator: import("svelte").Component<SeparatorProps, {}, "">;
3
+ type Separator = ReturnType<typeof Separator>;
4
+ export default Separator;
@@ -0,0 +1,11 @@
1
+ import type { Base } from '../../internal/types/index.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,3 @@
1
+ .kit-spacer {
2
+ flex-grow: 1;
3
+ }
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { SpacerProps } from './types.js';
3
+
4
+ let { is = 'div', ...rest }: SpacerProps = $props();
5
+ </script>
6
+
7
+ <svelte:element this={is} {...rest} class={['kit-spacer', rest.class]}> </svelte:element>
@@ -0,0 +1,4 @@
1
+ import type { SpacerProps } from './types.js';
2
+ declare const Spacer: import("svelte").Component<SpacerProps, {}, "">;
3
+ type Spacer = ReturnType<typeof Spacer>;
4
+ export default Spacer;
@@ -0,0 +1,4 @@
1
+ import type { Base } from '../../internal/types/index.js';
2
+ export interface SpacerProps extends Base {
3
+ is?: 'div';
4
+ }
@@ -0,0 +1 @@
1
+ export {};