lapikit 0.5.9 → 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 (214) 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/{@legacy/stores/components.d.ts → components/modal/modal.d.ts} +1 -2
  8. package/dist/{@legacy/stores/components.js → components/modal/modal.js} +1 -1
  9. package/dist/components/modal/modal.svelte +1 -1
  10. package/dist/components/textfield/textfield.svelte.d.ts +1 -1
  11. package/dist/constants.d.ts +2 -2
  12. package/dist/constants.js +2 -2
  13. package/dist/utils/outside.d.ts +1 -0
  14. package/dist/utils/outside.js +5 -0
  15. package/dist/{@legacy/stores → utils}/themes.d.ts +1 -0
  16. package/dist/{@legacy/actions/use-theme.js → utils/themes.js} +4 -1
  17. package/package.json +11 -32
  18. package/dist/@legacy/actions/accordion.svelte.d.ts +0 -9
  19. package/dist/@legacy/actions/index.d.ts +0 -2
  20. package/dist/@legacy/actions/index.js +0 -2
  21. package/dist/@legacy/actions/use-theme.d.ts +0 -1
  22. package/dist/@legacy/assets/icons/arrow-down.svelte +0 -12
  23. package/dist/@legacy/assets/icons/arrow-down.svelte.d.ts +0 -18
  24. package/dist/@legacy/assets/icons/arrow-up.svelte +0 -12
  25. package/dist/@legacy/assets/icons/arrow-up.svelte.d.ts +0 -18
  26. package/dist/@legacy/assets/icons/close-fill.svelte +0 -12
  27. package/dist/@legacy/assets/icons/close-fill.svelte.d.ts +0 -18
  28. package/dist/@legacy/assets/icons/loading-fill.svelte +0 -31
  29. package/dist/@legacy/assets/icons/loading-fill.svelte.d.ts +0 -18
  30. package/dist/@legacy/components/accordion/accordion.css +0 -36
  31. package/dist/@legacy/components/accordion/accordion.svelte +0 -39
  32. package/dist/@legacy/components/accordion/accordion.svelte.d.ts +0 -4
  33. package/dist/@legacy/components/accordion/modules/accordion-item.css +0 -68
  34. package/dist/@legacy/components/accordion/modules/accordion-item.svelte +0 -94
  35. package/dist/@legacy/components/accordion/modules/accordion-item.svelte.d.ts +0 -4
  36. package/dist/@legacy/components/accordion/types.d.ts +0 -33
  37. package/dist/@legacy/components/alert/alert.css +0 -130
  38. package/dist/@legacy/components/alert/alert.svelte +0 -89
  39. package/dist/@legacy/components/alert/alert.svelte.d.ts +0 -4
  40. package/dist/@legacy/components/alert/types.d.ts +0 -28
  41. package/dist/@legacy/components/alert/types.js +0 -1
  42. package/dist/@legacy/components/app/app.css +0 -26
  43. package/dist/@legacy/components/app/app.svelte +0 -79
  44. package/dist/@legacy/components/app/app.svelte.d.ts +0 -4
  45. package/dist/@legacy/components/app/types.d.ts +0 -10
  46. package/dist/@legacy/components/app/types.js +0 -1
  47. package/dist/@legacy/components/appbar/appbar.css +0 -38
  48. package/dist/@legacy/components/appbar/appbar.svelte +0 -40
  49. package/dist/@legacy/components/appbar/appbar.svelte.d.ts +0 -4
  50. package/dist/@legacy/components/appbar/types.d.ts +0 -15
  51. package/dist/@legacy/components/appbar/types.js +0 -1
  52. package/dist/@legacy/components/aspect-ratio/aspect-ratio.css +0 -19
  53. package/dist/@legacy/components/aspect-ratio/aspect-ratio.svelte +0 -25
  54. package/dist/@legacy/components/aspect-ratio/aspect-ratio.svelte.d.ts +0 -4
  55. package/dist/@legacy/components/aspect-ratio/types.d.ts +0 -5
  56. package/dist/@legacy/components/aspect-ratio/types.js +0 -1
  57. package/dist/@legacy/components/avatar/avatar.css +0 -102
  58. package/dist/@legacy/components/avatar/avatar.svelte +0 -46
  59. package/dist/@legacy/components/avatar/avatar.svelte.d.ts +0 -4
  60. package/dist/@legacy/components/avatar/types.d.ts +0 -22
  61. package/dist/@legacy/components/avatar/types.js +0 -1
  62. package/dist/@legacy/components/button/button.css +0 -240
  63. package/dist/@legacy/components/button/button.svelte +0 -102
  64. package/dist/@legacy/components/button/button.svelte.d.ts +0 -4
  65. package/dist/@legacy/components/button/types.d.ts +0 -29
  66. package/dist/@legacy/components/button/types.js +0 -1
  67. package/dist/@legacy/components/card/card.css +0 -105
  68. package/dist/@legacy/components/card/card.svelte +0 -67
  69. package/dist/@legacy/components/card/card.svelte.d.ts +0 -4
  70. package/dist/@legacy/components/card/types.d.ts +0 -20
  71. package/dist/@legacy/components/card/types.js +0 -1
  72. package/dist/@legacy/components/chip/chip.css +0 -224
  73. package/dist/@legacy/components/chip/chip.svelte +0 -131
  74. package/dist/@legacy/components/chip/chip.svelte.d.ts +0 -4
  75. package/dist/@legacy/components/chip/types.d.ts +0 -32
  76. package/dist/@legacy/components/chip/types.js +0 -1
  77. package/dist/@legacy/components/dialog/dialog.css +0 -129
  78. package/dist/@legacy/components/dialog/dialog.svelte +0 -67
  79. package/dist/@legacy/components/dialog/dialog.svelte.d.ts +0 -4
  80. package/dist/@legacy/components/dialog/types.d.ts +0 -24
  81. package/dist/@legacy/components/dialog/types.js +0 -1
  82. package/dist/@legacy/components/dropdown/dropdown.css +0 -13
  83. package/dist/@legacy/components/dropdown/dropdown.svelte +0 -115
  84. package/dist/@legacy/components/dropdown/dropdown.svelte.d.ts +0 -4
  85. package/dist/@legacy/components/dropdown/types.d.ts +0 -26
  86. package/dist/@legacy/components/dropdown/types.js +0 -1
  87. package/dist/@legacy/components/icon/icon.css +0 -78
  88. package/dist/@legacy/components/icon/icon.svelte +0 -49
  89. package/dist/@legacy/components/icon/icon.svelte.d.ts +0 -4
  90. package/dist/@legacy/components/icon/types.d.ts +0 -16
  91. package/dist/@legacy/components/icon/types.js +0 -1
  92. package/dist/@legacy/components/index.d.ts +0 -22
  93. package/dist/@legacy/components/index.js +0 -23
  94. package/dist/@legacy/components/list/list.css +0 -149
  95. package/dist/@legacy/components/list/list.svelte +0 -44
  96. package/dist/@legacy/components/list/list.svelte.d.ts +0 -4
  97. package/dist/@legacy/components/list/modules/list-item.css +0 -67
  98. package/dist/@legacy/components/list/modules/list-item.svelte +0 -76
  99. package/dist/@legacy/components/list/modules/list-item.svelte.d.ts +0 -4
  100. package/dist/@legacy/components/list/types.d.ts +0 -33
  101. package/dist/@legacy/components/list/types.js +0 -1
  102. package/dist/@legacy/components/modal/modal.css +0 -137
  103. package/dist/@legacy/components/modal/modal.svelte +0 -118
  104. package/dist/@legacy/components/modal/modal.svelte.d.ts +0 -4
  105. package/dist/@legacy/components/modal/types.d.ts +0 -26
  106. package/dist/@legacy/components/modal/types.js +0 -1
  107. package/dist/@legacy/components/popover/popover.css +0 -13
  108. package/dist/@legacy/components/popover/popover.svelte +0 -73
  109. package/dist/@legacy/components/popover/popover.svelte.d.ts +0 -4
  110. package/dist/@legacy/components/popover/types.d.ts +0 -20
  111. package/dist/@legacy/components/popover/types.js +0 -1
  112. package/dist/@legacy/components/separator/separator.css +0 -42
  113. package/dist/@legacy/components/separator/separator.svelte +0 -37
  114. package/dist/@legacy/components/separator/separator.svelte.d.ts +0 -4
  115. package/dist/@legacy/components/separator/types.d.ts +0 -15
  116. package/dist/@legacy/components/separator/types.js +0 -1
  117. package/dist/@legacy/components/spacer/spacer.css +0 -3
  118. package/dist/@legacy/components/spacer/spacer.svelte +0 -7
  119. package/dist/@legacy/components/spacer/spacer.svelte.d.ts +0 -4
  120. package/dist/@legacy/components/spacer/types.d.ts +0 -4
  121. package/dist/@legacy/components/spacer/types.js +0 -1
  122. package/dist/@legacy/components/textfield/textfield.css +0 -298
  123. package/dist/@legacy/components/textfield/textfield.svelte +0 -193
  124. package/dist/@legacy/components/textfield/textfield.svelte.d.ts +0 -4
  125. package/dist/@legacy/components/textfield/types.d.ts +0 -37
  126. package/dist/@legacy/components/textfield/types.js +0 -1
  127. package/dist/@legacy/components/toolbar/toolbar.css +0 -106
  128. package/dist/@legacy/components/toolbar/toolbar.svelte +0 -47
  129. package/dist/@legacy/components/toolbar/toolbar.svelte.d.ts +0 -4
  130. package/dist/@legacy/components/toolbar/types.d.ts +0 -27
  131. package/dist/@legacy/components/toolbar/types.js +0 -1
  132. package/dist/@legacy/components/tooltip/tooltip.css +0 -116
  133. package/dist/@legacy/components/tooltip/tooltip.svelte +0 -113
  134. package/dist/@legacy/components/tooltip/tooltip.svelte.d.ts +0 -4
  135. package/dist/@legacy/components/tooltip/types.d.ts +0 -23
  136. package/dist/@legacy/components/tooltip/types.js +0 -1
  137. package/dist/@legacy/index.d.ts +0 -3
  138. package/dist/@legacy/index.js +0 -24
  139. package/dist/@legacy/internal/config/presets.d.ts +0 -149
  140. package/dist/@legacy/internal/config/presets.js +0 -169
  141. package/dist/@legacy/internal/config/variables.d.ts +0 -3
  142. package/dist/@legacy/internal/config/variables.js +0 -3
  143. package/dist/@legacy/internal/core/actions/assets.svelte.d.ts +0 -8
  144. package/dist/@legacy/internal/core/actions/assets.svelte.js +0 -54
  145. package/dist/@legacy/internal/core/actions/dropdown.svelte.d.ts +0 -7
  146. package/dist/@legacy/internal/core/actions/dropdown.svelte.js +0 -148
  147. package/dist/@legacy/internal/core/actions/popover.svelte.d.ts +0 -7
  148. package/dist/@legacy/internal/core/actions/popover.svelte.js +0 -134
  149. package/dist/@legacy/internal/core/actions/tooltip.svelte.d.ts +0 -7
  150. package/dist/@legacy/internal/core/actions/tooltip.svelte.js +0 -131
  151. package/dist/@legacy/internal/core/animations/ripple.d.ts +0 -12
  152. package/dist/@legacy/internal/core/animations/ripple.js +0 -96
  153. package/dist/@legacy/internal/core/bin/ansi.d.ts +0 -40
  154. package/dist/@legacy/internal/core/bin/ansi.js +0 -44
  155. package/dist/@legacy/internal/core/bin/terminal.d.ts +0 -1
  156. package/dist/@legacy/internal/core/bin/terminal.js +0 -12
  157. package/dist/@legacy/internal/core/css.d.ts +0 -1
  158. package/dist/@legacy/internal/core/css.js +0 -16
  159. package/dist/@legacy/internal/core/formatter/component.d.ts +0 -5
  160. package/dist/@legacy/internal/core/formatter/component.js +0 -60
  161. package/dist/@legacy/internal/core/formatter/device.d.ts +0 -5
  162. package/dist/@legacy/internal/core/formatter/device.js +0 -66
  163. package/dist/@legacy/internal/core/formatter/index.d.ts +0 -7
  164. package/dist/@legacy/internal/core/formatter/index.js +0 -35
  165. package/dist/@legacy/internal/core/formatter/style.d.ts +0 -4
  166. package/dist/@legacy/internal/core/formatter/style.js +0 -15
  167. package/dist/@legacy/internal/core/formatter/theme.d.ts +0 -5
  168. package/dist/@legacy/internal/core/formatter/theme.js +0 -44
  169. package/dist/@legacy/internal/core/formatter/typography.d.ts +0 -5
  170. package/dist/@legacy/internal/core/formatter/typography.js +0 -12
  171. package/dist/@legacy/internal/core/minify.d.ts +0 -1
  172. package/dist/@legacy/internal/core/minify.js +0 -10
  173. package/dist/@legacy/internal/core/standard-colors.d.ts +0 -75
  174. package/dist/@legacy/internal/core/standard-colors.js +0 -75
  175. package/dist/@legacy/internal/core/x11-colors.d.ts +0 -4
  176. package/dist/@legacy/internal/core/x11-colors.js +0 -151
  177. package/dist/@legacy/internal/helpers/colors.d.ts +0 -1
  178. package/dist/@legacy/internal/helpers/colors.js +0 -50
  179. package/dist/@legacy/internal/helpers/convert.d.ts +0 -1
  180. package/dist/@legacy/internal/helpers/convert.js +0 -17
  181. package/dist/@legacy/internal/helpers/deep-merge.d.ts +0 -44
  182. package/dist/@legacy/internal/helpers/deep-merge.js +0 -80
  183. package/dist/@legacy/internal/helpers/outside.d.ts +0 -9
  184. package/dist/@legacy/internal/helpers/outside.js +0 -34
  185. package/dist/@legacy/internal/helpers/parser.d.ts +0 -10
  186. package/dist/@legacy/internal/helpers/parser.js +0 -93
  187. package/dist/@legacy/internal/helpers/scroll.d.ts +0 -1
  188. package/dist/@legacy/internal/helpers/scroll.js +0 -5
  189. package/dist/@legacy/internal/plugins/vite.d.ts +0 -8
  190. package/dist/@legacy/internal/plugins/vite.js +0 -33
  191. package/dist/@legacy/internal/types/components.d.ts +0 -14
  192. package/dist/@legacy/internal/types/components.js +0 -1
  193. package/dist/@legacy/internal/types/configuration.d.ts +0 -63
  194. package/dist/@legacy/internal/types/configuration.js +0 -1
  195. package/dist/@legacy/internal/types/index.d.ts +0 -2
  196. package/dist/@legacy/internal/types/index.js +0 -2
  197. package/dist/@legacy/stores/breakpoints.d.ts +0 -6
  198. package/dist/@legacy/stores/breakpoints.js +0 -14
  199. package/dist/@legacy/stores/devices.d.ts +0 -6
  200. package/dist/@legacy/stores/devices.js +0 -9
  201. package/dist/@legacy/stores/index.d.ts +0 -5
  202. package/dist/@legacy/stores/index.js +0 -5
  203. package/dist/@legacy/stores/themes.js +0 -4
  204. package/dist/@legacy/stores/viewport.d.ts +0 -7
  205. package/dist/@legacy/stores/viewport.js +0 -7
  206. package/dist/@legacy/styles/animation.css +0 -33
  207. package/dist/@legacy/styles/keyframes.css +0 -30
  208. package/dist/@legacy/styles/reset.css +0 -133
  209. package/dist/@legacy/styles.css +0 -0
  210. package/dist/@legacy/styles.css.d.ts +0 -4
  211. package/dist/@legacy/themes.css +0 -0
  212. package/dist/@legacy/themes.css.d.ts +0 -4
  213. /package/dist/{@legacy/components/accordion/types.js → @types/actions.js} +0 -0
  214. /package/dist/{@legacy/actions → components/accordion}/accordion.svelte.js +0 -0
@@ -1,46 +0,0 @@
1
- <script lang="ts">
2
- import { getAssets } from '../../internal/core/actions/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:--avatar-background={assets.color(background)}
38
- style:--avatar-color={assets.color(color)}
39
- style:--avatar-shape={assets.shape(rounded)}
40
- >
41
- {#if src}
42
- <img {src} {alt} />
43
- {:else}
44
- {@render children?.()}
45
- {/if}
46
- </svelte:element>
@@ -1,4 +0,0 @@
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;
@@ -1,22 +0,0 @@
1
- import type { Component } from '../../internal/types/index.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 {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,240 +0,0 @@
1
- .kit-button {
2
- position: relative;
3
- cursor: pointer;
4
- border: none;
5
- outline: none;
6
- padding-top: var(--button-spacing-x);
7
- padding-bottom: var(--button-spacing-x);
8
- padding-right: var(--button-spacing-y);
9
- padding-left: var(--button-spacing-y);
10
- border-radius: var(--button-shape, var(--system-shape-md));
11
- color: var(--button-color, var(--kit-label-primary));
12
- font-weight: 500;
13
- text-decoration: none;
14
- }
15
-
16
- .kit-button,
17
- .kit-button .kit-button-content,
18
- .kit-button .kit-button-append,
19
- .kit-button .kit-button-prepend,
20
- .kit-button .kit-button-loading {
21
- display: inline-flex;
22
- align-items: center;
23
- justify-content: center;
24
- white-space: nowrap;
25
- gap: calc(var(--system-spacing) * var(--button-multiplier-gap));
26
- font-size: calc(var(--system-spacing) * var(--button-multiplier-font-size));
27
- }
28
-
29
- .kit-button::after {
30
- content: '';
31
- position: absolute;
32
- inset: 0;
33
- background-color: currentColor;
34
- opacity: 0;
35
- transition: opacity 150ms ease;
36
- pointer-events: none;
37
- border-radius: inherit;
38
- }
39
- .kit-button:hover::after {
40
- opacity: 0.08;
41
- }
42
- .kit-button:active::after {
43
- opacity: 0.12;
44
- }
45
- .kit-button:focus-visible::after {
46
- opacity: 0.12;
47
- }
48
-
49
- /* size */
50
- .kit-button[breakpoint]kit-button--size-xs {
51
- --button-multiplier-x: 12;
52
- --button-multiplier-y: 2;
53
- --button-multiplier-gap: 2;
54
- --button-multiplier-font-size: 6;
55
- }
56
- .kit-button[breakpoint]kit-button--size-xs .kit-icon[class*='kit-icon--size-md'] {
57
- --icon-multiplier-parent-size: 7;
58
- }
59
-
60
- .kit-button[breakpoint]kit-button--size-sm {
61
- --button-multiplier-x: 16;
62
- --button-multiplier-y: 3;
63
- --button-multiplier-gap: 4;
64
- --button-multiplier-font-size: 7;
65
- }
66
- .kit-button[breakpoint]kit-button--size-sm .kit-icon[class*='kit-icon--size-md'] {
67
- --icon-multiplier-parent-size: 8;
68
- }
69
-
70
- .kit-button[breakpoint]kit-button--size-md {
71
- --button-multiplier-x: 20;
72
- --button-multiplier-y: 4;
73
- --button-multiplier-gap: 4;
74
- --button-multiplier-font-size: 8;
75
- }
76
- .kit-button[breakpoint]kit-button--size-md .kit-icon[class*='kit-icon--size-md'] {
77
- --icon-multiplier-parent-size: 9;
78
- }
79
-
80
- .kit-button[breakpoint]kit-button--size-lg {
81
- --button-multiplier-x: 24;
82
- --button-multiplier-y: 5;
83
- --button-multiplier-gap: 4;
84
- --button-multiplier-font-size: 9;
85
- }
86
- .kit-button[breakpoint]kit-button--size-lg .kit-icon[class*='kit-icon--size-md'] {
87
- --icon-multiplier-parent-size: 10;
88
- }
89
-
90
- .kit-button[breakpoint]kit-button--size-xl {
91
- --button-multiplier-x: 28;
92
- --button-multiplier-y: 6;
93
- --button-multiplier-gap: 5;
94
- --button-multiplier-font-size: 10;
95
- }
96
- .kit-button[breakpoint]kit-button--size-xl .kit-icon[class*='kit-icon--size-md'] {
97
- --icon-multiplier-parent-size: 11;
98
- }
99
-
100
- /* density */
101
- .kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-default {
102
- height: calc(var(--system-spacing) * var(--button-multiplier-x));
103
- --button-spacing-x: 0;
104
- --button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y));
105
- }
106
- .kit-button.kit-button--icon[breakpoint]kit-button--density-default {
107
- height: calc(var(--system-spacing) * var(--button-multiplier-x));
108
- width: calc(var(--system-spacing) * var(--button-multiplier-x));
109
- --button-spacing-x: 0;
110
- --button-spacing-y: 0;
111
- }
112
-
113
- .kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-compact {
114
- height: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
115
- --button-spacing-x: 0;
116
- --button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y) - 0.25rem);
117
- }
118
- .kit-button.kit-button--icon[breakpoint]kit-button--density-compact {
119
- height: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
120
- width: calc(var(--system-spacing) * var(--button-multiplier-x) - 0.25rem);
121
- --button-spacing-x: 0;
122
- --button-spacing-y: 0;
123
- }
124
-
125
- .kit-button:not(.kit-button--icon)[breakpoint]kit-button--density-comfortable {
126
- height: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
127
- --button-spacing-x: 0;
128
- --button-spacing-y: calc(var(--system-spacing) * var(--button-multiplier-y) + 0.25rem);
129
- }
130
- .kit-button.kit-button--icon[breakpoint]kit-button--density-comfortable {
131
- height: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
132
- width: calc(var(--system-spacing) * var(--button-multiplier-x) + 0.25rem);
133
- --button-spacing-x: 0;
134
- --button-spacing-y: 0;
135
- }
136
-
137
- /* variant */
138
- .kit-button[breakpoint]kit-button--variant-filled {
139
- background-color: var(--button-background, var(--kit-background-grouped-primary));
140
- }
141
-
142
- .kit-button[breakpoint]kit-button--variant-outline {
143
- --button-color: var(--on, var(--kit-label-primary));
144
- background-color: var(--button-background, var(--kit-background-grouped-primary));
145
- }
146
- .kit-button[breakpoint]kit-button--variant-outline::before {
147
- content: '';
148
- position: absolute;
149
- inset: 0;
150
- border: 1px solid currentColor;
151
- pointer-events: none;
152
- border-radius: inherit;
153
- }
154
-
155
- .kit-button[breakpoint]kit-button--variant-text {
156
- --button-color: var(--base, var(--kit-label-primary));
157
- background-color: transparent;
158
- border: none;
159
- }
160
-
161
- /* state */
162
- .kit-button.kit-button--info[class*='button--variant-filled'] {
163
- --on: var(--kit-on-info);
164
- --base: var(--kit-accent-info);
165
- }
166
- .kit-button.kit-button--info[class*='button--variant-']:not([class*='variant-filled']) {
167
- --base: var(--kit-accent-info);
168
- }
169
- .kit-button.kit-button--success[class*='button--variant-filled'] {
170
- --on: var(--kit-on-success);
171
- --base: var(--kit-accent-successs);
172
- }
173
- .kit-button.kit-button--success[class*='button--variant-']:not([class*='variant-filled']) {
174
- --base: var(--kit-accent-successs);
175
- }
176
- .kit-button.kit-button--warning[class*='button--variant-filled'] {
177
- --on: var(--kit-on-warning);
178
- --base: var(--kit-accent-warning);
179
- }
180
- .kit-button.kit-button--warning[class*='button--variant-']:not([class*='variant-filled']) {
181
- --base: var(--kit-accent-warning);
182
- }
183
- .kit-button.kit-button--error[class*='button--variant-filled'] {
184
- --on: var(--kit-on-error);
185
- --base: var(--kit-accent-destructive);
186
- }
187
- .kit-button.kit-button--error[class*='button--variant-']:not([class*='variant-filled']) {
188
- --base: var(--kit-accent-destructive);
189
- }
190
-
191
- /* events */
192
- .kit-button[class*='button--variant-filled']:active,
193
- .kit-button.kit-button--active[class*='button--variant-filled'] {
194
- background-color: color-mix(in oklab, var(--button-background) 90%, var(--kit-state-shadow));
195
- }
196
- .kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']):active,
197
- .kit-button.kit-button--active[class*='button--variant-']:not([class*='variant-filled']) {
198
- background-color: color-mix(in oklab, currentColor 15%, transparent);
199
- }
200
-
201
- /* icon */
202
- .kit-button i::before,
203
- .kit-button .kit-icon {
204
- --base-parent: var(--button-color);
205
- }
206
-
207
- /* disabled */
208
- .kit-button.kit-button--disabled,
209
- .kit-button[disabled],
210
- .kit-button.kit-button--loading {
211
- pointer-events: none;
212
- user-select: none;
213
- cursor: default;
214
- }
215
- .kit-button[class*='button--variant-filled'].kit-button--disabled {
216
- color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
217
- background-color: color-mix(in oklab, var(--button-background) 70%, transparent) !important;
218
- }
219
- .kit-button[class*='button--variant-filled'].kit-button--disabled i:before {
220
- color: color-mix(in oklab, var(--button-color) 40%, transparent) !important;
221
- }
222
- .kit-button[class*='button--variant-']:not([class*='variant-filled']).kit-button--disabled,
223
- .kit-button[class*='button--variant-']:not([class*='variant-filled']).kit-button--disabled
224
- i::before {
225
- color: color-mix(in oklab, var(--button-background) 40%, transparent) !important;
226
- }
227
-
228
- /* loading */
229
- .kit-button.kit-button--loading > .kit-button-content,
230
- .kit-button.kit-button--loading > .kit-button-append,
231
- .kit-button.kit-button--loading > .kit-button-prepend {
232
- visibility: hidden;
233
- }
234
- .kit-button.kit-button--loading > .kit-button-loading {
235
- position: absolute;
236
- min-width: fit-content;
237
- }
238
- .kit-button.kit-button--loading > .kit-button-loading .kit-icon-load {
239
- animation: icon-rotate 1s ease-out infinite;
240
- }
@@ -1,102 +0,0 @@
1
- <script lang="ts">
2
- import { getAssets } from '../../internal/core/actions/assets.svelte.js';
3
- import type { ButtonProps } from './types.js';
4
-
5
- // external
6
- import { Icon } from '../index.js';
7
- import LoadingFill from '../../assets/icons/loading-fill.svelte';
8
- import { ripple } from '../../internal/core/animations/ripple.js';
9
-
10
- let {
11
- children,
12
- prepend,
13
- append,
14
- ref = $bindable(),
15
- is = 'button',
16
- href,
17
- dark,
18
- light,
19
- active,
20
- variant = 'filled',
21
- error,
22
- info,
23
- success,
24
- warning,
25
- density = 'default',
26
- disabled,
27
- size = 'md',
28
- type = 'button',
29
- background,
30
- color,
31
- loading,
32
- rounded,
33
- icon,
34
- load,
35
- noRipple,
36
- ...rest
37
- }: ButtonProps = $props();
38
-
39
- const assets = getAssets();
40
- </script>
41
-
42
- <svelte:element
43
- this={href ? 'a' : is}
44
- bind:this={ref}
45
- {...rest}
46
- href={href && !disabled ? href : undefined}
47
- class={[
48
- 'kit-button',
49
- light && 'light',
50
- dark && 'dark',
51
- size && assets.className('button', 'size', size),
52
- variant && assets.className('button', 'variant', variant),
53
- density && assets.className('button', 'density', density),
54
- error && 'kit-button--error',
55
- info && 'kit-button--info',
56
- success && 'kit-button--success',
57
- warning && 'kit-button--warning',
58
- disabled && 'kit-button--disabled',
59
- active && 'kit-button--active',
60
- loading && 'kit-button--loading',
61
- icon && 'kit-button--icon',
62
- rest.class
63
- ]}
64
- tabindex={href && disabled ? -1 : 0}
65
- disabled={href ? undefined : disabled}
66
- type={href ? undefined : type}
67
- use:ripple={{
68
- component: 'button',
69
- disabled: noRipple || disabled
70
- }}
71
- style:--button-background={assets.color(background)}
72
- style:--button-color={assets.color(color)}
73
- style:--button-shape={assets.shape(rounded)}
74
- >
75
- {#if loading}
76
- <div class="kit-button-loading">
77
- {#if load}
78
- {@render load?.()}
79
- {:else}
80
- <Icon class="kit-icon-load">
81
- <LoadingFill />
82
- </Icon>
83
- {/if}
84
- </div>
85
- {/if}
86
-
87
- {#if prepend}
88
- <div class="kit-button-prepend">
89
- {@render prepend?.()}
90
- </div>
91
- {/if}
92
-
93
- <div class="kit-button-content">
94
- {@render children?.()}
95
- </div>
96
-
97
- {#if append}
98
- <div class="kit-button-append">
99
- {@render append?.()}
100
- </div>
101
- {/if}
102
- </svelte:element>
@@ -1,4 +0,0 @@
1
- import type { ButtonProps } from './types.js';
2
- declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
3
- type Button = ReturnType<typeof Button>;
4
- export default Button;
@@ -1,29 +0,0 @@
1
- import type { Component } from '../../internal/types/index.js';
2
- import type { Snippet } from 'svelte';
3
- export interface ButtonProps extends Component {
4
- ref?: HTMLElement | null;
5
- is?: 'button' | 'a';
6
- dark?: boolean;
7
- light?: boolean;
8
- href?: string;
9
- variant?: 'outline' | 'text' | 'filled';
10
- density?: 'compact' | 'comfortable' | 'default';
11
- active?: boolean;
12
- loading?: boolean;
13
- error?: boolean;
14
- info?: boolean;
15
- warning?: boolean;
16
- success?: boolean;
17
- disabled?: boolean;
18
- color?: string;
19
- background?: string;
20
- size?: string | {
21
- [key: string]: string;
22
- };
23
- type?: 'button' | 'submit' | 'reset';
24
- icon?: boolean;
25
- load?: Snippet;
26
- append?: Snippet;
27
- prepend?: Snippet;
28
- noRipple?: boolean;
29
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,105 +0,0 @@
1
- .kit-card {
2
- position: relative;
3
- display: flex;
4
- flex-direction: column;
5
- text-align: start;
6
- overflow: hidden;
7
- padding-top: var(--card-spacing-x);
8
- padding-bottom: var(--card-spacing-x);
9
- padding-right: var(--card-spacing-y);
10
- padding-left: var(--card-spacing-y);
11
- border-radius: var(--card-shape, var(--system-shape-md));
12
- font-weight: 500;
13
- color: var(--card-color, var(--kit-label-primary));
14
- text-decoration: none;
15
- }
16
-
17
- .kit-card.kit-card--clickable {
18
- cursor: pointer;
19
- }
20
-
21
- .kit-card.kit-card--clickable::after {
22
- content: '';
23
- position: absolute;
24
- inset: 0;
25
- background-color: currentColor;
26
- opacity: 0;
27
- transition: opacity 150ms ease;
28
- pointer-events: none;
29
- border-radius: inherit;
30
- }
31
- .kit-card.kit-card--clickable:hover::after {
32
- opacity: 0.08;
33
- }
34
- .kit-card.kit-card--clickable:active::after {
35
- opacity: 0.12;
36
- }
37
- .kit-card.kit-card--clickable:focus-visible::after {
38
- opacity: 0.12;
39
- }
40
-
41
- /* density */
42
- .kit-card[breakpoint]kit-card--density-default {
43
- --card-spacing-x: calc(var(--system-spacing) * 2);
44
- --card-spacing-y: calc(var(--system-spacing) * 2);
45
- }
46
- .kit-card[breakpoint]kit-card--density-compact {
47
- --card-spacing-x: 0;
48
- --card-spacing-y: 0;
49
- }
50
- .kit-card[breakpoint]kit-card--density-comfortable {
51
- --card-spacing-x: calc(var(--system-spacing) * 4);
52
- --card-spacing-y: calc(var(--system-spacing) * 4);
53
- }
54
-
55
- /* variant */
56
- .kit-card[breakpoint]kit-card--variant-filled {
57
- background-color: var(--card-background, var(--kit-background-grouped-secondary));
58
- }
59
-
60
- .kit-card[breakpoint]kit-card--variant-outline {
61
- --card-color: var(--card-background, var(--kit-label-primary));
62
- background-color: transparent;
63
- }
64
- .kit-card[breakpoint]kit-card--variant-outline::before {
65
- content: '';
66
- position: absolute;
67
- inset: 0;
68
- border: 1px solid currentColor;
69
- pointer-events: none;
70
- border-radius: inherit;
71
- }
72
-
73
- .kit-card[breakpoint]kit-card--variant-text {
74
- --card-color: var(--card-background, var(--kit-label-primary));
75
- background-color: transparent;
76
- border: none;
77
- }
78
-
79
- /* events */
80
- .kit-card[class*='card--variant-filled'].kit-card--clickable:active,
81
- .kit-card.kit-card--active[class*='card--variant-filled'].kit-card--clickable {
82
- background-color: color-mix(in oklab, var(--card-background) 90%, var(--kit-state-shadow));
83
- }
84
- .kit-card.kit-card--active[class*='card--variant-']:not(
85
- [class*='variant-filled']
86
- ).kit-card--clickable:active,
87
- .kit-card.kit-card--active[class*='card--variant-']:not(
88
- [class*='variant-filled']
89
- ).kit-card--clickable {
90
- background-color: color-mix(in oklab, currentColor 15%, transparent);
91
- }
92
-
93
- /* disabled */
94
- .kit-card.kit-card--disabled,
95
- .kit-card[disabled],
96
- .kit-card:disabled {
97
- pointer-events: none;
98
- user-select: none;
99
- opacity: 0.6;
100
- }
101
- .kit-card.kit-card--disabled > *,
102
- .kit-card[disabled] > *,
103
- .kit-card:disabled > * {
104
- opacity: 0.6;
105
- }
@@ -1,67 +0,0 @@
1
- <script lang="ts">
2
- import { getAssets } from '../../internal/core/actions/assets.svelte.js';
3
- import type { CardProps } from './types.js';
4
-
5
- // external
6
- import { ripple } from '../../internal/core/animations/ripple.js';
7
-
8
- let {
9
- children,
10
- ref = $bindable(),
11
- is = 'div',
12
- href,
13
- dark,
14
- light,
15
- active,
16
- density = 'default',
17
- variant = 'filled',
18
- disabled,
19
- rounded,
20
- color,
21
- background,
22
- noRipple,
23
- width,
24
- height,
25
- ...rest
26
- }: CardProps = $props();
27
-
28
- const assets = getAssets();
29
- let isClickable: boolean = $state(false);
30
-
31
- $effect(() => {
32
- const refProps = { ...rest };
33
- if (href) is = 'a';
34
- if (refProps?.onclick || href || is === 'a') isClickable = true;
35
- else isClickable = false;
36
- });
37
- </script>
38
-
39
- <svelte:element
40
- this={is}
41
- bind:this={ref}
42
- {...rest}
43
- href={href && !disabled ? href : undefined}
44
- class={[
45
- 'kit-card',
46
- light && 'light',
47
- dark && 'dark',
48
- variant && assets.className('card', 'variant', variant),
49
- density && assets.className('card', 'density', density),
50
- isClickable && 'kit-card--clickable',
51
- active && 'kit-card--active',
52
- disabled && 'kit-card--disabled',
53
- rest.class
54
- ]}
55
- disabled={href ? undefined : disabled}
56
- use:ripple={{
57
- component: 'card',
58
- disabled: noRipple || disabled || !isClickable
59
- }}
60
- style:--card-background={assets.color(background)}
61
- style:--card-color={assets.color(color)}
62
- style:--card-shape={assets.shape(rounded)}
63
- style:width
64
- style:height
65
- >
66
- {@render children?.()}
67
- </svelte:element>
@@ -1,4 +0,0 @@
1
- import type { CardProps } from './types.js';
2
- declare const Card: import("svelte").Component<CardProps, {}, "ref">;
3
- type Card = ReturnType<typeof Card>;
4
- export default Card;
@@ -1,20 +0,0 @@
1
- import type { Component } from '../../internal/types/index.js';
2
- type Density = 'compact' | 'comfortable' | 'default';
3
- export interface CardProps extends Component {
4
- is?: 'a' | 'button' | 'div';
5
- dark?: boolean;
6
- light?: boolean;
7
- href?: string;
8
- variant?: 'outline' | 'text' | 'filled';
9
- density?: Density | {
10
- [key: string]: Density;
11
- };
12
- active?: boolean;
13
- disabled?: boolean;
14
- rounded?: string;
15
- color?: string;
16
- background?: string;
17
- width?: string | number;
18
- height?: string | number;
19
- }
20
- export {};
@@ -1 +0,0 @@
1
- export {};