lapikit 0.0.0-insiders.c501032 → 0.0.0-insiders.d715369

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