lapikit 0.5.8 → 0.6.0

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