@swell/swell-ui 0.0.0-stage → 0.1.1

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 (225) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +165 -2
  3. package/custom-elements.json +8274 -0
  4. package/dist/chunks/badge-Dt6q8Cqa.js +11 -0
  5. package/dist/chunks/button-C7nCiu-t.js +123 -0
  6. package/dist/chunks/card-CvSQEug8.js +10 -0
  7. package/dist/chunks/checkbox-BRI_A1TP.js +99 -0
  8. package/dist/chunks/chip-BtnufSMG.js +48 -0
  9. package/dist/chunks/config-C-FYxOaJ.js +588 -0
  10. package/dist/chunks/define-BlQTa1g4.js +19 -0
  11. package/dist/chunks/description-BHfQ8meK.js +19 -0
  12. package/dist/chunks/disclosure-CET8-H6f.js +56 -0
  13. package/dist/chunks/divider-BfkO0c1j.js +27 -0
  14. package/dist/chunks/element-B4-_7TLZ.js +138 -0
  15. package/dist/chunks/input-Uun-ls2_.js +53 -0
  16. package/dist/chunks/link-8qHFEKQE.js +53 -0
  17. package/dist/chunks/link-D4NC86oc.js +24 -0
  18. package/dist/chunks/lookup-5icr_T6o.js +205 -0
  19. package/dist/chunks/lookup-list-Bw6OJoDS.js +19 -0
  20. package/dist/chunks/lookup-option-Mn3k8W2M.js +26 -0
  21. package/dist/chunks/popover-D3Ob6slA.js +92 -0
  22. package/dist/chunks/popup-Dbh2fchP.js +21 -0
  23. package/dist/chunks/quantity-h3wqn8tC.js +140 -0
  24. package/dist/chunks/radio-BhFDL3pO.js +192 -0
  25. package/dist/chunks/radio-option-hT29S8Zl.js +88 -0
  26. package/dist/chunks/select-DS1n_htj.js +331 -0
  27. package/dist/chunks/select-option-DoM9GAe0.js +66 -0
  28. package/dist/chunks/skeleton-DfPjhls9.js +13 -0
  29. package/dist/chunks/status-B23JZ5RQ.js +71 -0
  30. package/dist/chunks/tab-BpjFUbFO.js +107 -0
  31. package/dist/chunks/tabs-aWKq1Iaz.js +122 -0
  32. package/dist/chunks/text-ZWPy-iB3.js +26 -0
  33. package/dist/chunks/text-field-BB_MRt5h.js +158 -0
  34. package/dist/chunks/textarea-L6_OJ2IN.js +18 -0
  35. package/dist/chunks/thumbnail-CLe9AsFg.js +21 -0
  36. package/dist/chunks/toggle-C7-oPgWR.js +22 -0
  37. package/dist/chunks/ui-HcyMKwzs.js +11 -0
  38. package/dist/editors/vscode.css-custom-data.json +824 -0
  39. package/dist/editors/vscode.html-custom-data.json +1156 -0
  40. package/dist/editors/web-types.json +1706 -0
  41. package/dist/elements/badge.d.ts +1 -0
  42. package/dist/elements/badge.js +1 -0
  43. package/dist/elements/button.d.ts +1 -0
  44. package/dist/elements/button.js +1 -0
  45. package/dist/elements/card.d.ts +1 -0
  46. package/dist/elements/card.js +1 -0
  47. package/dist/elements/checkbox.d.ts +1 -0
  48. package/dist/elements/checkbox.js +1 -0
  49. package/dist/elements/chip.d.ts +1 -0
  50. package/dist/elements/chip.js +1 -0
  51. package/dist/elements/disclosure.d.ts +1 -0
  52. package/dist/elements/disclosure.js +1 -0
  53. package/dist/elements/divider.d.ts +1 -0
  54. package/dist/elements/divider.js +1 -0
  55. package/dist/elements/input.d.ts +1 -0
  56. package/dist/elements/input.js +1 -0
  57. package/dist/elements/link.d.ts +1 -0
  58. package/dist/elements/link.js +1 -0
  59. package/dist/elements/lookup-list.d.ts +1 -0
  60. package/dist/elements/lookup-list.js +1 -0
  61. package/dist/elements/lookup-option.d.ts +1 -0
  62. package/dist/elements/lookup-option.js +1 -0
  63. package/dist/elements/lookup.d.ts +1 -0
  64. package/dist/elements/lookup.js +1 -0
  65. package/dist/elements/popover.d.ts +1 -0
  66. package/dist/elements/popover.js +1 -0
  67. package/dist/elements/quantity.d.ts +1 -0
  68. package/dist/elements/quantity.js +1 -0
  69. package/dist/elements/radio-option.d.ts +1 -0
  70. package/dist/elements/radio-option.js +1 -0
  71. package/dist/elements/radio.d.ts +1 -0
  72. package/dist/elements/radio.js +1 -0
  73. package/dist/elements/select-option.d.ts +1 -0
  74. package/dist/elements/select-option.js +1 -0
  75. package/dist/elements/select.d.ts +1 -0
  76. package/dist/elements/select.js +1 -0
  77. package/dist/elements/skeleton.d.ts +1 -0
  78. package/dist/elements/skeleton.js +1 -0
  79. package/dist/elements/status.d.ts +1 -0
  80. package/dist/elements/status.js +1 -0
  81. package/dist/elements/tab.d.ts +1 -0
  82. package/dist/elements/tab.js +1 -0
  83. package/dist/elements/tabs.d.ts +1 -0
  84. package/dist/elements/tabs.js +1 -0
  85. package/dist/elements/text.d.ts +1 -0
  86. package/dist/elements/text.js +1 -0
  87. package/dist/elements/textarea.d.ts +1 -0
  88. package/dist/elements/textarea.js +1 -0
  89. package/dist/elements/thumbnail.d.ts +1 -0
  90. package/dist/elements/thumbnail.js +1 -0
  91. package/dist/elements/ui.d.ts +1 -0
  92. package/dist/elements/ui.js +1 -0
  93. package/dist/frameworks/jsx.d.ts +3589 -0
  94. package/dist/frameworks/preact.d.ts +9 -0
  95. package/dist/frameworks/solid.d.ts +7 -0
  96. package/dist/frameworks/svelte.d.ts +1676 -0
  97. package/dist/frameworks/vue.d.ts +827 -0
  98. package/dist/index.js +80 -0
  99. package/dist/react/badge.d.ts +12 -0
  100. package/dist/react/badge.js +4 -0
  101. package/dist/react/button.d.ts +16 -0
  102. package/dist/react/button.js +4 -0
  103. package/dist/react/card.d.ts +11 -0
  104. package/dist/react/card.js +4 -0
  105. package/dist/react/checkbox.d.ts +14 -0
  106. package/dist/react/checkbox.js +4 -0
  107. package/dist/react/chip.d.ts +12 -0
  108. package/dist/react/chip.js +4 -0
  109. package/dist/react/create.js +49 -0
  110. package/dist/react/disclosure.d.ts +11 -0
  111. package/dist/react/disclosure.js +4 -0
  112. package/dist/react/divider.d.ts +9 -0
  113. package/dist/react/divider.js +4 -0
  114. package/dist/react/index.d.ts +26 -0
  115. package/dist/react/index.js +26 -0
  116. package/dist/react/input.d.ts +28 -0
  117. package/dist/react/input.js +4 -0
  118. package/dist/react/link.d.ts +15 -0
  119. package/dist/react/link.js +4 -0
  120. package/dist/react/lookup-list.d.ts +9 -0
  121. package/dist/react/lookup-list.js +4 -0
  122. package/dist/react/lookup-option.d.ts +11 -0
  123. package/dist/react/lookup-option.js +4 -0
  124. package/dist/react/lookup.d.ts +28 -0
  125. package/dist/react/lookup.js +4 -0
  126. package/dist/react/popover.d.ts +11 -0
  127. package/dist/react/popover.js +4 -0
  128. package/dist/react/quantity.d.ts +15 -0
  129. package/dist/react/quantity.js +4 -0
  130. package/dist/react/radio-option.d.ts +11 -0
  131. package/dist/react/radio-option.js +4 -0
  132. package/dist/react/radio.d.ts +18 -0
  133. package/dist/react/radio.js +4 -0
  134. package/dist/react/select-option.d.ts +11 -0
  135. package/dist/react/select-option.js +4 -0
  136. package/dist/react/select.d.ts +20 -0
  137. package/dist/react/select.js +4 -0
  138. package/dist/react/skeleton.d.ts +11 -0
  139. package/dist/react/skeleton.js +4 -0
  140. package/dist/react/status.d.ts +12 -0
  141. package/dist/react/status.js +4 -0
  142. package/dist/react/tab.d.ts +10 -0
  143. package/dist/react/tab.js +4 -0
  144. package/dist/react/tabs.d.ts +17 -0
  145. package/dist/react/tabs.js +4 -0
  146. package/dist/react/text.d.ts +12 -0
  147. package/dist/react/text.js +4 -0
  148. package/dist/react/textarea.d.ts +23 -0
  149. package/dist/react/textarea.js +4 -0
  150. package/dist/react/thumbnail.d.ts +13 -0
  151. package/dist/react/thumbnail.js +4 -0
  152. package/dist/react/ui.d.ts +10 -0
  153. package/dist/react/ui.js +4 -0
  154. package/dist/types/components/core/badge/badge.d.ts +25 -0
  155. package/dist/types/components/core/button/button.d.ts +60 -0
  156. package/dist/types/components/core/card/card.d.ts +21 -0
  157. package/dist/types/components/core/checkbox/checkbox.d.ts +46 -0
  158. package/dist/types/components/core/chip/chip.d.ts +36 -0
  159. package/dist/types/components/core/disclosure/disclosure.d.ts +37 -0
  160. package/dist/types/components/core/divider/divider.d.ts +21 -0
  161. package/dist/types/components/core/index.d.ts +21 -0
  162. package/dist/types/components/core/input/input.d.ts +57 -0
  163. package/dist/types/components/core/link/link.d.ts +42 -0
  164. package/dist/types/components/core/lookup/lookup-list.d.ts +21 -0
  165. package/dist/types/components/core/lookup/lookup-option.d.ts +27 -0
  166. package/dist/types/components/core/lookup/lookup.d.ts +32 -0
  167. package/dist/types/components/core/popover/popover.d.ts +33 -0
  168. package/dist/types/components/core/quantity/quantity.d.ts +47 -0
  169. package/dist/types/components/core/radio/radio-option.d.ts +82 -0
  170. package/dist/types/components/core/radio/radio.d.ts +65 -0
  171. package/dist/types/components/core/select/select-option.d.ts +69 -0
  172. package/dist/types/components/core/select/select.d.ts +70 -0
  173. package/dist/types/components/core/skeleton/skeleton.d.ts +23 -0
  174. package/dist/types/components/core/status/status.d.ts +38 -0
  175. package/dist/types/components/core/tabs/tab.d.ts +76 -0
  176. package/dist/types/components/core/tabs/tabs.d.ts +46 -0
  177. package/dist/types/components/core/text/text.d.ts +23 -0
  178. package/dist/types/components/core/textarea/textarea.d.ts +45 -0
  179. package/dist/types/components/core/thumbnail/thumbnail.d.ts +27 -0
  180. package/dist/types/components/core/ui/ui.d.ts +16 -0
  181. package/dist/types/components/elements.d.ts +1 -0
  182. package/dist/types/react/create.d.ts +8 -0
  183. package/dist/types/runtime/config.d.ts +25 -0
  184. package/dist/types/runtime/css.d.ts +12 -0
  185. package/dist/types/runtime/define.d.ts +4 -0
  186. package/dist/types/runtime/description.d.ts +12 -0
  187. package/dist/types/runtime/element.d.ts +61 -0
  188. package/dist/types/runtime/focus.d.ts +5 -0
  189. package/dist/types/runtime/form.d.ts +5 -0
  190. package/dist/types/runtime/index.d.ts +2 -0
  191. package/dist/types/runtime/link.d.ts +17 -0
  192. package/dist/types/runtime/loader.d.ts +21 -0
  193. package/dist/types/runtime/popup.d.ts +8 -0
  194. package/dist/types/runtime/sheet.d.ts +31 -0
  195. package/dist/types/runtime/text-field.d.ts +47 -0
  196. package/dist/types/runtime/toggle.d.ts +8 -0
  197. package/dist/types/runtime/tokens.generated.d.ts +492 -0
  198. package/dist/types/runtime/values.d.ts +6 -0
  199. package/dist/types/runtime/variants.d.ts +4 -0
  200. package/package.json +136 -4
  201. package/resolver.json +111 -0
  202. package/src/components/core/badge/tokens.json +152 -0
  203. package/src/components/core/button/tokens.dark.json +16 -0
  204. package/src/components/core/button/tokens.json +232 -0
  205. package/src/components/core/card/tokens.json +35 -0
  206. package/src/components/core/checkbox/tokens.json +15 -0
  207. package/src/components/core/chip/tokens.json +144 -0
  208. package/src/components/core/link/tokens.json +24 -0
  209. package/src/components/core/radio/tokens.dark.json +17 -0
  210. package/src/components/core/radio/tokens.json +114 -0
  211. package/src/components/core/status/tokens.dark.json +71 -0
  212. package/src/components/core/status/tokens.json +135 -0
  213. package/src/components/core/tabs/tokens.json +80 -0
  214. package/src/components/core/text/tokens.json +222 -0
  215. package/src/components/core/thumbnail/tokens.json +46 -0
  216. package/tokens/border.json +38 -0
  217. package/tokens/color.dark.json +88 -0
  218. package/tokens/color.json +115 -0
  219. package/tokens/control.json +115 -0
  220. package/tokens/field.dark.json +65 -0
  221. package/tokens/field.json +158 -0
  222. package/tokens/focus.json +26 -0
  223. package/tokens/font.json +117 -0
  224. package/tokens/motion.json +49 -0
  225. package/tokens/overlay.json +81 -0
@@ -0,0 +1,492 @@
1
+ export type Theme = "light" | "dark" | "system";
2
+ export type Color = string | {
3
+ light: string;
4
+ dark: string;
5
+ };
6
+ /** The palette of a variant: the kit's `secondary`, or a host's own in `color`. */
7
+ export interface Variant {
8
+ background?: Color;
9
+ foreground?: Color;
10
+ border?: Color;
11
+ accent?: Color;
12
+ shadow?: Color;
13
+ }
14
+ export type TokenType = "color" | "dimension" | "fontFamily" | "fontWeight" | "number" | "duration" | "cubicBezier" | "shadow";
15
+ export type Attribute = "variant" | "size" | "type";
16
+ export interface Config {
17
+ theme?: Theme;
18
+ color?: {
19
+ [variant: string]: Color | Variant | undefined;
20
+ background?: Color;
21
+ foreground?: Color;
22
+ border?: Color;
23
+ accent?: Color;
24
+ danger?: Color;
25
+ success?: Color;
26
+ warning?: Color;
27
+ secondary?: {
28
+ background?: Color;
29
+ foreground?: Color;
30
+ border?: Color;
31
+ accent?: Color;
32
+ shadow?: Color;
33
+ };
34
+ };
35
+ font?: {
36
+ family?: string | readonly string[];
37
+ size?: string;
38
+ weight?: number | string;
39
+ tracking?: number;
40
+ leading?: number;
41
+ caption?: {
42
+ size?: string;
43
+ };
44
+ footnote?: {
45
+ size?: string;
46
+ };
47
+ heading?: {
48
+ family?: string | readonly string[];
49
+ weight?: number | string;
50
+ tracking?: number;
51
+ };
52
+ medium?: {
53
+ weight?: number | string;
54
+ };
55
+ strong?: {
56
+ weight?: number | string;
57
+ };
58
+ bold?: {
59
+ weight?: number | string;
60
+ };
61
+ };
62
+ border?: {
63
+ radius?: string;
64
+ width?: string;
65
+ strong?: {
66
+ width?: string;
67
+ };
68
+ };
69
+ focus?: {
70
+ color?: Color;
71
+ width?: string;
72
+ offset?: string;
73
+ };
74
+ motion?: {
75
+ duration?: {
76
+ fast?: string;
77
+ base?: string;
78
+ slow?: string;
79
+ loop?: string;
80
+ };
81
+ easing?: string;
82
+ spring?: string;
83
+ };
84
+ control?: {
85
+ height?: string;
86
+ font?: {
87
+ size?: string;
88
+ };
89
+ xsmall?: {
90
+ height?: string;
91
+ font?: {
92
+ size?: string;
93
+ };
94
+ };
95
+ small?: {
96
+ height?: string;
97
+ font?: {
98
+ size?: string;
99
+ };
100
+ };
101
+ large?: {
102
+ height?: string;
103
+ font?: {
104
+ size?: string;
105
+ };
106
+ };
107
+ xlarge?: {
108
+ height?: string;
109
+ font?: {
110
+ size?: string;
111
+ };
112
+ };
113
+ disabled?: {
114
+ opacity?: number;
115
+ };
116
+ };
117
+ field?: {
118
+ color?: {
119
+ background?: Color;
120
+ foreground?: Color;
121
+ border?: Color;
122
+ };
123
+ hover?: {
124
+ color?: {
125
+ border?: Color;
126
+ };
127
+ };
128
+ focus?: {
129
+ color?: {
130
+ ring?: Color;
131
+ };
132
+ };
133
+ invalid?: {
134
+ color?: {
135
+ ring?: Color;
136
+ };
137
+ };
138
+ label?: {
139
+ font?: {
140
+ family?: string | readonly string[];
141
+ weight?: number | string;
142
+ tracking?: number;
143
+ };
144
+ color?: {
145
+ foreground?: Color;
146
+ };
147
+ position?: "above" | "floating";
148
+ };
149
+ ring?: {
150
+ width?: string;
151
+ };
152
+ gap?: string;
153
+ outline?: {
154
+ color?: {
155
+ background?: Color;
156
+ };
157
+ };
158
+ appearance?: "outline" | "filled" | "underline";
159
+ };
160
+ overlay?: {
161
+ border?: {
162
+ radius?: string;
163
+ };
164
+ color?: {
165
+ background?: Color;
166
+ border?: Color;
167
+ shadow?: Color;
168
+ };
169
+ shadow?: string;
170
+ padding?: string;
171
+ offset?: string;
172
+ height?: string;
173
+ };
174
+ components?: {
175
+ text?: {
176
+ font?: {
177
+ family?: string | readonly string[];
178
+ size?: string;
179
+ weight?: number | string;
180
+ tracking?: number;
181
+ leading?: number;
182
+ };
183
+ color?: {
184
+ accent?: Color;
185
+ };
186
+ title?: {
187
+ font?: {
188
+ family?: string | readonly string[];
189
+ size?: string;
190
+ weight?: number | string;
191
+ tracking?: number;
192
+ leading?: number;
193
+ };
194
+ };
195
+ heading?: {
196
+ font?: {
197
+ family?: string | readonly string[];
198
+ size?: string;
199
+ weight?: number | string;
200
+ tracking?: number;
201
+ leading?: number;
202
+ };
203
+ };
204
+ subheading?: {
205
+ font?: {
206
+ family?: string | readonly string[];
207
+ size?: string;
208
+ weight?: number | string;
209
+ tracking?: number;
210
+ leading?: number;
211
+ };
212
+ };
213
+ strong?: {
214
+ font?: {
215
+ weight?: number | string;
216
+ };
217
+ };
218
+ caption?: {
219
+ font?: {
220
+ size?: string;
221
+ };
222
+ };
223
+ footnote?: {
224
+ font?: {
225
+ size?: string;
226
+ };
227
+ };
228
+ eyebrow?: {
229
+ font?: {
230
+ size?: string;
231
+ weight?: number | string;
232
+ tracking?: number;
233
+ };
234
+ };
235
+ };
236
+ link?: {
237
+ font?: {
238
+ weight?: number | string;
239
+ };
240
+ color?: {
241
+ accent?: Color;
242
+ };
243
+ };
244
+ button?: {
245
+ height?: string;
246
+ font?: {
247
+ size?: string;
248
+ tracking?: number;
249
+ weight?: number | string;
250
+ };
251
+ xsmall?: {
252
+ height?: string;
253
+ font?: {
254
+ size?: string;
255
+ };
256
+ };
257
+ small?: {
258
+ height?: string;
259
+ font?: {
260
+ size?: string;
261
+ };
262
+ };
263
+ large?: {
264
+ height?: string;
265
+ font?: {
266
+ size?: string;
267
+ tracking?: number;
268
+ };
269
+ };
270
+ xlarge?: {
271
+ height?: string;
272
+ font?: {
273
+ size?: string;
274
+ tracking?: number;
275
+ };
276
+ };
277
+ border?: {
278
+ radius?: string;
279
+ };
280
+ color?: {
281
+ accent?: Color;
282
+ background?: Color;
283
+ foreground?: Color;
284
+ border?: Color;
285
+ shadow?: Color;
286
+ };
287
+ shadow?: string;
288
+ hover?: {
289
+ shadow?: string;
290
+ offset?: string;
291
+ };
292
+ appearance?: "filled" | "outline" | "plain";
293
+ secondary?: {
294
+ appearance?: "filled" | "outline" | "plain";
295
+ };
296
+ };
297
+ checkbox?: {
298
+ border?: {
299
+ radius?: string;
300
+ };
301
+ };
302
+ radio?: {
303
+ border?: {
304
+ radius?: string;
305
+ };
306
+ color?: {
307
+ background?: Color;
308
+ border?: Color;
309
+ shadow?: Color;
310
+ };
311
+ checked?: {
312
+ color?: {
313
+ background?: Color;
314
+ };
315
+ };
316
+ shadow?: string;
317
+ gap?: string;
318
+ button?: {
319
+ gap?: string;
320
+ };
321
+ appearance?: "plain" | "outline";
322
+ indicator?: {
323
+ position?: "start" | "end";
324
+ };
325
+ };
326
+ status?: {
327
+ border?: {
328
+ radius?: string;
329
+ };
330
+ color?: {
331
+ background?: Color;
332
+ foreground?: Color;
333
+ accent?: Color;
334
+ border?: Color;
335
+ };
336
+ danger?: {
337
+ color?: {
338
+ accent?: Color;
339
+ background?: Color;
340
+ border?: Color;
341
+ };
342
+ };
343
+ success?: {
344
+ color?: {
345
+ accent?: Color;
346
+ background?: Color;
347
+ border?: Color;
348
+ };
349
+ };
350
+ warning?: {
351
+ color?: {
352
+ accent?: Color;
353
+ background?: Color;
354
+ border?: Color;
355
+ };
356
+ };
357
+ appearance?: "filled" | "outline" | "plain";
358
+ };
359
+ badge?: {
360
+ height?: string;
361
+ font?: {
362
+ size?: string;
363
+ weight?: number | string;
364
+ };
365
+ xsmall?: {
366
+ height?: string;
367
+ font?: {
368
+ size?: string;
369
+ weight?: number | string;
370
+ };
371
+ };
372
+ small?: {
373
+ height?: string;
374
+ font?: {
375
+ size?: string;
376
+ weight?: number | string;
377
+ };
378
+ };
379
+ large?: {
380
+ height?: string;
381
+ font?: {
382
+ size?: string;
383
+ };
384
+ };
385
+ xlarge?: {
386
+ height?: string;
387
+ font?: {
388
+ size?: string;
389
+ };
390
+ };
391
+ color?: {
392
+ background?: Color;
393
+ foreground?: Color;
394
+ border?: Color;
395
+ accent?: Color;
396
+ };
397
+ appearance?: "filled" | "outline";
398
+ };
399
+ chip?: {
400
+ height?: string;
401
+ font?: {
402
+ size?: string;
403
+ weight?: number | string;
404
+ tracking?: number;
405
+ };
406
+ xsmall?: {
407
+ height?: string;
408
+ font?: {
409
+ size?: string;
410
+ };
411
+ };
412
+ small?: {
413
+ height?: string;
414
+ font?: {
415
+ size?: string;
416
+ };
417
+ };
418
+ large?: {
419
+ height?: string;
420
+ font?: {
421
+ size?: string;
422
+ };
423
+ };
424
+ xlarge?: {
425
+ height?: string;
426
+ font?: {
427
+ size?: string;
428
+ };
429
+ };
430
+ color?: {
431
+ background?: Color;
432
+ foreground?: Color;
433
+ border?: Color;
434
+ accent?: Color;
435
+ };
436
+ };
437
+ thumbnail?: {
438
+ border?: {
439
+ radius?: string;
440
+ };
441
+ color?: {
442
+ background?: Color;
443
+ foreground?: Color;
444
+ border?: Color;
445
+ };
446
+ font?: {
447
+ weight?: number | string;
448
+ };
449
+ };
450
+ card?: {
451
+ border?: {
452
+ radius?: string;
453
+ };
454
+ color?: {
455
+ background?: Color;
456
+ border?: Color;
457
+ };
458
+ appearance?: "outline" | "filled";
459
+ };
460
+ tabs?: {
461
+ border?: {
462
+ radius?: string;
463
+ };
464
+ indicator?: {
465
+ width?: string;
466
+ };
467
+ color?: {
468
+ background?: Color;
469
+ shadow?: Color;
470
+ };
471
+ font?: {
472
+ weight?: number | string;
473
+ };
474
+ shadow?: string;
475
+ appearance?: "underline" | "segmented";
476
+ };
477
+ };
478
+ }
479
+ export declare const DEFAULTS_CSS: string;
480
+ export declare const GROUPS: Readonly<Record<string, "global" | "components">>;
481
+ export declare const TOKENS: Readonly<Record<string, {
482
+ readonly type: TokenType;
483
+ readonly unit?: string;
484
+ }>>;
485
+ export declare const SETTINGS: Readonly<Record<string, {
486
+ readonly values: readonly string[];
487
+ readonly default: string;
488
+ }>>;
489
+ export declare const ATTRIBUTES: Readonly<Record<string, Partial<Record<Attribute, readonly string[]>>>>;
490
+ export declare const STATES: Readonly<Record<string, readonly string[]>>;
491
+ /** The components that take the variants of `color`: each role they draw, with the chain of their own token, which an element takes where its variant's palette is missing. */
492
+ export declare const VARIANT_COLORS: Readonly<Record<string, Readonly<Record<string, string>>>>;
@@ -0,0 +1,6 @@
1
+ /** Whether `value` fits a token of `name` and stays inside its own declaration. */
2
+ export declare function isTokenValue(name: string, value: unknown): boolean;
3
+ /** A copy of an accepted value with its data only: a color pair keeps `light` and `dark`. */
4
+ export declare function plain(value: unknown): unknown;
5
+ /** The CSS text of a configured value of token `name`. */
6
+ export declare function toCss(name: string, value: unknown): string;
@@ -0,0 +1,4 @@
1
+ /** The stylesheet of the variants of a component's elements, or `undefined` for a component that takes none. */
2
+ export declare function variantSheet(group: string | null): CSSStyleSheet | undefined;
3
+ /** Whether an element of `group` takes `variant`. */
4
+ export declare function takesVariant(group: string | null, variant: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,138 @@
1
1
  {
2
2
  "name": "@swell/swell-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Web components for Swell checkout, dashboard, apps and storefronts, styled by the host through design tokens.",
5
+ "license": "UNLICENSED",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/components/core/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./react": {
16
+ "types": "./dist/react/index.d.ts",
17
+ "default": "./dist/react/index.js"
18
+ },
19
+ "./preact": {
20
+ "types": "./dist/frameworks/preact.d.ts"
21
+ },
22
+ "./solid": {
23
+ "types": "./dist/frameworks/solid.d.ts"
24
+ },
25
+ "./vue": {
26
+ "types": "./dist/frameworks/vue.d.ts"
27
+ },
28
+ "./svelte": {
29
+ "types": "./dist/frameworks/svelte.d.ts"
30
+ },
31
+ "./custom-elements.json": "./custom-elements.json",
32
+ "./resolver.json": "./resolver.json",
33
+ "./tokens/*": "./tokens/*",
34
+ "./components/*": "./src/components/*",
35
+ "./web-types.json": "./dist/editors/web-types.json",
36
+ "./vscode.html-custom-data.json": "./dist/editors/vscode.html-custom-data.json",
37
+ "./vscode.css-custom-data.json": "./dist/editors/vscode.css-custom-data.json",
38
+ "./elements/*": {
39
+ "types": "./dist/elements/*.d.ts",
40
+ "default": "./dist/elements/*.js"
41
+ },
42
+ "./*": {
43
+ "types": "./dist/types/components/*/index.d.ts",
44
+ "default": "./dist/*.js"
45
+ },
46
+ "./package.json": "./package.json"
47
+ },
48
+ "sideEffects": [
49
+ "./dist/*.js",
50
+ "./dist/elements/*.js",
51
+ "./dist/chunks/*.js"
52
+ ],
53
+ "types": "./dist/types/components/core/index.d.ts",
54
+ "web-types": "./dist/editors/web-types.json",
55
+ "files": [
56
+ "CHANGELOG.md",
57
+ "dist",
58
+ "custom-elements.json",
59
+ "resolver.json",
60
+ "tokens",
61
+ "src/components/**/tokens*.json"
62
+ ],
63
+ "engines": {
64
+ "node": ">=22.18"
65
+ },
66
+ "scripts": {
67
+ "typecheck": "tsc --noEmit",
68
+ "lint": "eslint . && stylelint \"src/**/*.css\" --allow-empty-input && prettier --check .",
69
+ "format": "prettier --write . && eslint --fix . && stylelint \"src/**/*.css\" --fix --allow-empty-input",
70
+ "test": "vitest run",
71
+ "tokens": "node scripts/tokens/cli.ts",
72
+ "build": "vite build && tsc -p tsconfig.build.json && node scripts/package/types.ts && npm run analyze && node scripts/package/editors.ts && node scripts/package/react.ts",
73
+ "analyze": "cem analyze --config custom-elements-manifest.config.js",
74
+ "storybook": "npm run analyze && storybook dev -p 6006",
75
+ "build-storybook": "npm run analyze && storybook build",
76
+ "check": "npm run tokens -- --check && npm run typecheck && npm run lint && npm test && npm run build && node scripts/package/check.ts",
77
+ "release": "npm run check && npm pack",
78
+ "prepublishOnly": "npm run check",
79
+ "pretypecheck": "npm run analyze",
80
+ "pretest": "npm run analyze"
81
+ },
82
+ "peerDependencies": {
83
+ "preact": ">=10",
84
+ "react": ">=16.8",
85
+ "solid-js": ">=1",
86
+ "vue": ">=3.5"
87
+ },
88
+ "peerDependenciesMeta": {
89
+ "preact": {
90
+ "optional": true
91
+ },
92
+ "react": {
93
+ "optional": true
94
+ },
95
+ "solid-js": {
96
+ "optional": true
97
+ },
98
+ "vue": {
99
+ "optional": true
100
+ }
101
+ },
102
+ "devDependencies": {
103
+ "@custom-elements-manifest/analyzer": "0.11.0",
104
+ "@eslint/js": "10.0.1",
105
+ "@storybook/addon-a11y": "10.6.6",
106
+ "@storybook/addon-docs": "10.6.6",
107
+ "@storybook/addon-vitest": "10.6.6",
108
+ "@storybook/web-components-vite": "10.6.6",
109
+ "@types/node": "22.20.5",
110
+ "@types/react": "19.3.0",
111
+ "@types/react-dom": "19.3.0",
112
+ "@vitest/browser": "5.1.0",
113
+ "@vitest/browser-playwright": "5.1.0",
114
+ "@wc-toolkit/jsx-types": "1.8.2",
115
+ "@wc-toolkit/svelte-types": "1.0.3",
116
+ "@wc-toolkit/vuejs-types": "1.0.3",
117
+ "custom-element-jet-brains-integration": "1.8.0",
118
+ "custom-element-vs-code-integration": "1.5.0",
119
+ "eslint": "10.14.0",
120
+ "eslint-config-prettier": "10.1.8",
121
+ "eslint-plugin-storybook": "10.6.6",
122
+ "eslint-plugin-wc": "3.1.0",
123
+ "globals": "17.14.0",
124
+ "lit": "3.3.3",
125
+ "playwright": "1.65.0",
126
+ "prettier": "3.9.10",
127
+ "react": "19.3.1",
128
+ "react-dom": "19.3.1",
129
+ "storybook": "10.6.6",
130
+ "stylelint": "18.0.0",
131
+ "stylelint-config-standard": "41.0.0",
132
+ "typescript": "6.0.3",
133
+ "typescript-eslint": "8.72.1",
134
+ "vite": "8.3.6",
135
+ "vitest": "5.1.0"
136
+ },
137
+ "customElements": "custom-elements.json"
138
+ }