lapikit 0.0.0-insiders.fd1a829 → 0.0.0-insiders.fd9617d

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -1
  3. package/bin/configuration.js +303 -0
  4. package/bin/helper.js +59 -0
  5. package/bin/index.js +33 -0
  6. package/bin/presets.js +26 -0
  7. package/bin/prompts.js +67 -0
  8. package/dist/actions/accordion.svelte.d.ts +9 -0
  9. package/dist/actions/accordion.svelte.js +24 -0
  10. package/dist/actions/index.d.ts +2 -0
  11. package/dist/actions/index.js +2 -0
  12. package/dist/actions/use-theme.d.ts +1 -0
  13. package/dist/actions/use-theme.js +18 -0
  14. package/dist/assets/icons/arrow-down.svelte +12 -0
  15. package/dist/assets/icons/arrow-down.svelte.d.ts +18 -0
  16. package/dist/assets/icons/arrow-up.svelte +12 -0
  17. package/dist/assets/icons/arrow-up.svelte.d.ts +18 -0
  18. package/dist/assets/icons/close-fill.svelte +12 -0
  19. package/dist/assets/icons/close-fill.svelte.d.ts +18 -0
  20. package/dist/assets/icons/loading-fill.svelte +31 -0
  21. package/dist/assets/icons/loading-fill.svelte.d.ts +18 -0
  22. package/dist/components/accordion/accordion.css +36 -0
  23. package/dist/components/accordion/accordion.svelte +39 -0
  24. package/dist/components/accordion/accordion.svelte.d.ts +4 -0
  25. package/dist/components/accordion/modules/accordion-item.css +68 -0
  26. package/dist/components/accordion/modules/accordion-item.svelte +94 -0
  27. package/dist/components/accordion/modules/accordion-item.svelte.d.ts +4 -0
  28. package/dist/components/accordion/types.d.ts +33 -0
  29. package/dist/components/accordion/types.js +1 -0
  30. package/dist/components/alert/alert.css +130 -0
  31. package/dist/components/alert/alert.svelte +89 -0
  32. package/dist/components/alert/alert.svelte.d.ts +4 -0
  33. package/dist/components/alert/types.d.ts +28 -0
  34. package/dist/components/alert/types.js +1 -0
  35. package/dist/components/app/app.css +26 -0
  36. package/dist/components/app/app.svelte +79 -0
  37. package/dist/components/app/app.svelte.d.ts +4 -0
  38. package/dist/components/app/types.d.ts +10 -0
  39. package/dist/components/app/types.js +1 -0
  40. package/dist/components/appbar/appbar.css +38 -0
  41. package/dist/components/appbar/appbar.svelte +40 -0
  42. package/dist/components/appbar/appbar.svelte.d.ts +4 -0
  43. package/dist/components/appbar/types.d.ts +15 -0
  44. package/dist/components/appbar/types.js +1 -0
  45. package/dist/components/aspect-ratio/aspect-ratio.css +19 -0
  46. package/dist/components/aspect-ratio/aspect-ratio.svelte +25 -0
  47. package/dist/components/aspect-ratio/aspect-ratio.svelte.d.ts +4 -0
  48. package/dist/components/aspect-ratio/types.d.ts +5 -0
  49. package/dist/components/aspect-ratio/types.js +1 -0
  50. package/dist/components/avatar/avatar.css +102 -0
  51. package/dist/components/avatar/avatar.svelte +46 -0
  52. package/dist/components/avatar/avatar.svelte.d.ts +4 -0
  53. package/dist/components/avatar/types.d.ts +22 -0
  54. package/dist/components/avatar/types.js +1 -0
  55. package/dist/components/button/button.css +240 -0
  56. package/dist/components/button/button.svelte +102 -0
  57. package/dist/components/button/button.svelte.d.ts +4 -0
  58. package/dist/components/button/types.d.ts +29 -0
  59. package/dist/components/button/types.js +1 -0
  60. package/dist/components/card/card.css +105 -0
  61. package/dist/components/card/card.svelte +67 -0
  62. package/dist/components/card/card.svelte.d.ts +4 -0
  63. package/dist/components/card/types.d.ts +20 -0
  64. package/dist/components/card/types.js +1 -0
  65. package/dist/components/chip/chip.css +224 -0
  66. package/dist/components/chip/chip.svelte +131 -0
  67. package/dist/components/chip/chip.svelte.d.ts +4 -0
  68. package/dist/components/chip/types.d.ts +32 -0
  69. package/dist/components/chip/types.js +1 -0
  70. package/dist/components/dialog/dialog.css +129 -0
  71. package/dist/components/dialog/dialog.svelte +67 -0
  72. package/dist/components/dialog/dialog.svelte.d.ts +4 -0
  73. package/dist/components/dialog/types.d.ts +24 -0
  74. package/dist/components/dialog/types.js +1 -0
  75. package/dist/components/dropdown/dropdown.css +13 -0
  76. package/dist/components/dropdown/dropdown.svelte +115 -0
  77. package/dist/components/dropdown/dropdown.svelte.d.ts +4 -0
  78. package/dist/components/dropdown/types.d.ts +26 -0
  79. package/dist/components/dropdown/types.js +1 -0
  80. package/dist/components/icon/icon.css +78 -0
  81. package/dist/components/icon/icon.svelte +49 -0
  82. package/dist/components/icon/icon.svelte.d.ts +4 -0
  83. package/dist/components/icon/types.d.ts +16 -0
  84. package/dist/components/icon/types.js +1 -0
  85. package/dist/components/index.d.ts +22 -0
  86. package/dist/components/index.js +23 -0
  87. package/dist/components/list/list.css +149 -0
  88. package/dist/components/list/list.svelte +44 -0
  89. package/dist/components/list/list.svelte.d.ts +4 -0
  90. package/dist/components/list/modules/list-item.css +67 -0
  91. package/dist/components/list/modules/list-item.svelte +76 -0
  92. package/dist/components/list/modules/list-item.svelte.d.ts +4 -0
  93. package/dist/components/list/types.d.ts +33 -0
  94. package/dist/components/list/types.js +1 -0
  95. package/dist/components/modal/modal.css +137 -0
  96. package/dist/components/modal/modal.svelte +112 -0
  97. package/dist/components/modal/modal.svelte.d.ts +4 -0
  98. package/dist/components/modal/types.d.ts +26 -0
  99. package/dist/components/modal/types.js +1 -0
  100. package/dist/components/popover/popover.css +13 -0
  101. package/dist/components/popover/popover.svelte +73 -0
  102. package/dist/components/popover/popover.svelte.d.ts +4 -0
  103. package/dist/components/popover/types.d.ts +20 -0
  104. package/dist/components/popover/types.js +1 -0
  105. package/dist/components/separator/separator.css +42 -0
  106. package/dist/components/separator/separator.svelte +37 -0
  107. package/dist/components/separator/separator.svelte.d.ts +4 -0
  108. package/dist/components/separator/types.d.ts +15 -0
  109. package/dist/components/separator/types.js +1 -0
  110. package/dist/components/spacer/spacer.css +3 -0
  111. package/dist/components/spacer/spacer.svelte +7 -0
  112. package/dist/components/spacer/spacer.svelte.d.ts +4 -0
  113. package/dist/components/spacer/types.d.ts +4 -0
  114. package/dist/components/spacer/types.js +1 -0
  115. package/dist/components/textfield/textfield.css +298 -0
  116. package/dist/components/textfield/textfield.svelte +193 -0
  117. package/dist/components/textfield/textfield.svelte.d.ts +4 -0
  118. package/dist/components/textfield/types.d.ts +37 -0
  119. package/dist/components/textfield/types.js +1 -0
  120. package/dist/components/toolbar/toolbar.css +106 -0
  121. package/dist/components/toolbar/toolbar.svelte +47 -0
  122. package/dist/components/toolbar/toolbar.svelte.d.ts +4 -0
  123. package/dist/components/toolbar/types.d.ts +27 -0
  124. package/dist/components/toolbar/types.js +1 -0
  125. package/dist/components/tooltip/tooltip.css +116 -0
  126. package/dist/components/tooltip/tooltip.svelte +113 -0
  127. package/dist/components/tooltip/tooltip.svelte.d.ts +4 -0
  128. package/dist/components/tooltip/types.d.ts +23 -0
  129. package/dist/components/tooltip/types.js +1 -0
  130. package/dist/entry-bundler.d.ts +12 -0
  131. package/dist/entry-bundler.js +107 -0
  132. package/dist/index.d.ts +3 -1
  133. package/dist/index.js +23 -3
  134. package/dist/internal/config/presets.d.ts +149 -0
  135. package/dist/internal/config/presets.js +169 -0
  136. package/dist/internal/config/variables.d.ts +3 -0
  137. package/dist/internal/config/variables.js +3 -0
  138. package/dist/internal/core/actions/assets.svelte.d.ts +8 -0
  139. package/dist/internal/core/actions/assets.svelte.js +54 -0
  140. package/dist/internal/core/actions/dropdown.svelte.d.ts +7 -0
  141. package/dist/internal/core/actions/dropdown.svelte.js +148 -0
  142. package/dist/internal/core/actions/popover.svelte.d.ts +7 -0
  143. package/dist/internal/core/actions/popover.svelte.js +134 -0
  144. package/dist/internal/core/actions/tooltip.svelte.d.ts +7 -0
  145. package/dist/internal/core/actions/tooltip.svelte.js +131 -0
  146. package/dist/internal/core/animations/ripple.d.ts +12 -0
  147. package/dist/internal/core/animations/ripple.js +93 -0
  148. package/dist/{server/modules → internal/core/bin}/ansi.d.ts +0 -1
  149. package/dist/{server/modules → internal/core/bin}/ansi.js +0 -11
  150. package/dist/internal/core/bin/terminal.d.ts +1 -0
  151. package/dist/internal/core/bin/terminal.js +12 -0
  152. package/dist/internal/core/css.d.ts +1 -0
  153. package/dist/internal/core/css.js +16 -0
  154. package/dist/internal/core/formatter/component.d.ts +5 -0
  155. package/dist/internal/core/formatter/component.js +60 -0
  156. package/dist/internal/core/formatter/device.d.ts +5 -0
  157. package/dist/internal/core/formatter/device.js +66 -0
  158. package/dist/internal/core/formatter/index.d.ts +7 -0
  159. package/dist/internal/core/formatter/index.js +35 -0
  160. package/dist/internal/core/formatter/style.d.ts +4 -0
  161. package/dist/internal/core/formatter/style.js +15 -0
  162. package/dist/internal/core/formatter/theme.d.ts +5 -0
  163. package/dist/internal/core/formatter/theme.js +44 -0
  164. package/dist/internal/core/formatter/typography.d.ts +5 -0
  165. package/dist/internal/core/formatter/typography.js +12 -0
  166. package/dist/internal/core/standard-colors.d.ts +75 -0
  167. package/dist/internal/core/standard-colors.js +75 -0
  168. package/dist/{server/modules/x11.d.ts → internal/core/x11-colors.d.ts} +1 -1
  169. package/dist/internal/helpers/colors.d.ts +1 -0
  170. package/dist/{server/modules → internal/helpers}/colors.js +2 -2
  171. package/dist/internal/helpers/convert.d.ts +1 -0
  172. package/dist/internal/helpers/convert.js +17 -0
  173. package/dist/internal/helpers/deep-merge.d.ts +44 -0
  174. package/dist/internal/helpers/deep-merge.js +80 -0
  175. package/dist/internal/helpers/outside.d.ts +9 -0
  176. package/dist/internal/helpers/outside.js +34 -0
  177. package/dist/internal/helpers/parser.d.ts +10 -0
  178. package/dist/internal/helpers/parser.js +93 -0
  179. package/dist/internal/helpers/scroll.d.ts +1 -0
  180. package/dist/internal/helpers/scroll.js +5 -0
  181. package/dist/internal/plugins/vite.d.ts +8 -0
  182. package/dist/internal/plugins/vite.js +33 -0
  183. package/dist/internal/types/components.d.ts +14 -0
  184. package/dist/internal/types/components.js +1 -0
  185. package/dist/internal/types/configuration.d.ts +63 -0
  186. package/dist/internal/types/configuration.js +1 -0
  187. package/dist/internal/types/index.d.ts +2 -0
  188. package/dist/internal/types/index.js +2 -0
  189. package/dist/labs/components/btn/btn.svelte +13 -0
  190. package/dist/labs/components/btn/btn.svelte.d.ts +5 -0
  191. package/dist/labs/components/index.d.ts +1 -0
  192. package/dist/labs/components/index.js +2 -0
  193. package/dist/stores/breakpoints.d.ts +6 -0
  194. package/dist/stores/breakpoints.js +14 -0
  195. package/dist/stores/components.d.ts +8 -0
  196. package/dist/stores/components.js +26 -0
  197. package/dist/stores/devices.d.ts +6 -0
  198. package/dist/stores/devices.js +9 -0
  199. package/dist/stores/index.d.ts +5 -0
  200. package/dist/stores/index.js +5 -0
  201. package/dist/stores/themes.d.ts +2 -0
  202. package/dist/stores/themes.js +4 -0
  203. package/dist/stores/viewport.d.ts +7 -0
  204. package/dist/stores/viewport.js +7 -0
  205. package/dist/styles/animation.css +33 -0
  206. package/dist/styles/keyframes.css +30 -0
  207. package/dist/styles/{normalize.css → reset.css} +15 -5
  208. package/dist/styles.css.d.ts +4 -0
  209. package/dist/themes.css +0 -0
  210. package/dist/themes.css.d.ts +4 -0
  211. package/package.json +135 -74
  212. package/dist/app.d.ts +0 -13
  213. package/dist/app.html +0 -12
  214. package/dist/server/modules/colors.d.ts +0 -1
  215. package/dist/server/modules/css.d.ts +0 -1
  216. package/dist/server/modules/css.js +0 -144
  217. package/dist/server/modules/devices.d.ts +0 -1
  218. package/dist/server/modules/devices.js +0 -43
  219. package/dist/server/modules/importer.d.ts +0 -1
  220. package/dist/server/modules/importer.js +0 -13
  221. package/dist/server/modules/themes.d.ts +0 -4
  222. package/dist/server/modules/themes.js +0 -94
  223. package/dist/server/vite.d.ts +0 -11
  224. package/dist/server/vite.js +0 -17
  225. package/dist/styles/variables.css +0 -7
  226. /package/dist/{server/modules → internal/core}/minify.d.ts +0 -0
  227. /package/dist/{server/modules → internal/core}/minify.js +0 -0
  228. /package/dist/{server/modules/x11.js → internal/core/x11-colors.js} +0 -0
@@ -0,0 +1,240 @@
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
+ }
@@ -0,0 +1,102 @@
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>
@@ -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/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
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,105 @@
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
+ }
@@ -0,0 +1,67 @@
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>
@@ -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,20 @@
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 {};
@@ -0,0 +1 @@
1
+ export {};