svelora 2.2.0 → 3.0.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.
@@ -0,0 +1,490 @@
1
+ export const docsMeta = {
2
+ name: 'Svelora',
3
+ version: 'v2.2.0',
4
+ npmCommand: 'npm install svelora',
5
+ githubHref: 'https://github.com/asphum/svelora'
6
+ };
7
+ export const docsIntroItems = [
8
+ {
9
+ title: 'Introduction',
10
+ href: '/docs',
11
+ legacyHref: '/getting-started',
12
+ icon: 'lucide:book-open',
13
+ description: 'Overview, quick start, and ecosystem highlights.'
14
+ },
15
+ {
16
+ title: 'Installation',
17
+ href: '/docs/installation',
18
+ legacyHref: '/getting-started/installation',
19
+ icon: 'lucide:download',
20
+ description: 'Install the package and set up the required styles.'
21
+ },
22
+ {
23
+ title: 'Theming',
24
+ href: '/docs/theming',
25
+ legacyHref: '/getting-started/theming',
26
+ icon: 'lucide:palette',
27
+ description: 'Customize OKLCH tokens and component appearance.'
28
+ },
29
+ {
30
+ title: 'Dark Mode',
31
+ href: '/docs/dark-mode',
32
+ legacyHref: '/getting-started/dark-mode',
33
+ icon: 'lucide:moon-star',
34
+ description: 'Enable light, dark, and system theme support.'
35
+ },
36
+ {
37
+ title: 'MCP',
38
+ href: '/docs/mcp',
39
+ legacyHref: '/mcp',
40
+ icon: 'lucide:plug',
41
+ description: 'Connect Svelora docs helpers to Cursor IDE via MCP.'
42
+ }
43
+ ];
44
+ export const docsThemeItems = [
45
+ {
46
+ title: 'Customization',
47
+ href: '/docs/customization',
48
+ legacyHref: '/customization',
49
+ icon: 'lucide:sliders-horizontal',
50
+ description: 'Configure global defaults, icons, and component slots.'
51
+ },
52
+ {
53
+ title: 'Colors',
54
+ href: '/docs/colors',
55
+ legacyHref: '/colors',
56
+ icon: 'lucide:swatch-book',
57
+ description: 'Explore semantic color tokens and the surface system.'
58
+ }
59
+ ];
60
+ export const docsComponentGroups = [
61
+ {
62
+ title: 'General',
63
+ items: [
64
+ {
65
+ title: 'Button',
66
+ href: '/docs/components/button',
67
+ legacyHref: '/button',
68
+ icon: 'lucide:mouse-pointer-click'
69
+ },
70
+ {
71
+ title: 'CodeBlock',
72
+ href: '/docs/components/code-block',
73
+ legacyHref: '/code-block',
74
+ icon: 'lucide:code'
75
+ },
76
+ {
77
+ title: 'FieldGroup',
78
+ href: '/docs/components/field-group',
79
+ legacyHref: '/field-group',
80
+ icon: 'lucide:group'
81
+ },
82
+ {
83
+ title: 'Fonts',
84
+ href: '/docs/components/fonts',
85
+ legacyHref: '/google-fonts',
86
+ icon: 'lucide:font'
87
+ },
88
+ {
89
+ title: 'Icon',
90
+ href: '/docs/components/icon',
91
+ legacyHref: '/icon',
92
+ icon: 'lucide:shapes'
93
+ },
94
+ {
95
+ title: 'Link',
96
+ href: '/docs/components/link',
97
+ legacyHref: '/link',
98
+ icon: 'lucide:link'
99
+ },
100
+ {
101
+ title: 'Kbd',
102
+ href: '/docs/components/kbd',
103
+ legacyHref: '/kbd',
104
+ icon: 'lucide:keyboard'
105
+ },
106
+ {
107
+ title: 'ThemeModeButton',
108
+ href: '/docs/components/theme-mode-button',
109
+ legacyHref: '/theme-mode-button',
110
+ icon: 'lucide:sun-moon'
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ title: 'Layout',
116
+ items: [
117
+ {
118
+ title: 'Card',
119
+ href: '/docs/components/card',
120
+ legacyHref: '/card',
121
+ icon: 'lucide:square'
122
+ },
123
+ {
124
+ title: 'Container',
125
+ href: '/docs/components/container',
126
+ legacyHref: '/container',
127
+ icon: 'lucide:box'
128
+ },
129
+ {
130
+ title: 'Separator',
131
+ href: '/docs/components/separator',
132
+ legacyHref: '/separator',
133
+ icon: 'lucide:minus'
134
+ }
135
+ ]
136
+ },
137
+ {
138
+ title: 'Data Display',
139
+ items: [
140
+ {
141
+ title: 'Accordion',
142
+ href: '/docs/components/accordion',
143
+ legacyHref: '/accordion',
144
+ icon: 'lucide:chevrons-down-up'
145
+ },
146
+ {
147
+ title: 'Avatar',
148
+ href: '/docs/components/avatar',
149
+ legacyHref: '/avatar',
150
+ icon: 'lucide:circle-user'
151
+ },
152
+ {
153
+ title: 'AvatarGroup',
154
+ href: '/docs/components/avatar-group',
155
+ legacyHref: '/avatar-group',
156
+ icon: 'lucide:users'
157
+ },
158
+ {
159
+ title: 'Badge',
160
+ href: '/docs/components/badge',
161
+ legacyHref: '/badge',
162
+ icon: 'lucide:tag'
163
+ },
164
+ {
165
+ title: 'Carousel',
166
+ href: '/docs/components/carousel',
167
+ legacyHref: '/carousel',
168
+ icon: 'lucide:gallery-horizontal'
169
+ },
170
+ {
171
+ title: 'Chip',
172
+ href: '/docs/components/chip',
173
+ legacyHref: '/chip',
174
+ icon: 'lucide:circle-dot'
175
+ },
176
+ {
177
+ title: 'Empty',
178
+ href: '/docs/components/empty',
179
+ legacyHref: '/empty',
180
+ icon: 'lucide:inbox'
181
+ },
182
+ {
183
+ title: 'Skeleton',
184
+ href: '/docs/components/skeleton',
185
+ legacyHref: '/skeleton',
186
+ icon: 'lucide:loader-circle'
187
+ },
188
+ {
189
+ title: 'Timeline',
190
+ href: '/docs/components/timeline',
191
+ legacyHref: '/timeline',
192
+ icon: 'lucide:git-commit-horizontal'
193
+ },
194
+ {
195
+ title: 'User',
196
+ href: '/docs/components/user',
197
+ legacyHref: '/user',
198
+ icon: 'lucide:user'
199
+ },
200
+ {
201
+ title: 'Table',
202
+ href: '/docs/components/table',
203
+ legacyHref: '/table',
204
+ icon: 'lucide:table'
205
+ }
206
+ ]
207
+ },
208
+ {
209
+ title: 'Forms',
210
+ items: [
211
+ {
212
+ title: 'Checkbox',
213
+ href: '/docs/components/checkbox',
214
+ legacyHref: '/checkbox',
215
+ icon: 'lucide:square-check'
216
+ },
217
+ {
218
+ title: 'CheckboxGroup',
219
+ href: '/docs/components/checkbox-group',
220
+ legacyHref: '/checkbox-group',
221
+ icon: 'lucide:list-checks'
222
+ },
223
+ {
224
+ title: 'Editor',
225
+ href: '/docs/components/editor',
226
+ legacyHref: '/editor',
227
+ icon: 'lucide:pen-line'
228
+ },
229
+ {
230
+ title: 'Input',
231
+ href: '/docs/components/input',
232
+ legacyHref: '/input',
233
+ icon: 'lucide:text-cursor-input'
234
+ },
235
+ {
236
+ title: 'RadioGroup',
237
+ href: '/docs/components/radio-group',
238
+ legacyHref: '/radio-group',
239
+ icon: 'lucide:circle-dot'
240
+ },
241
+ {
242
+ title: 'Select',
243
+ href: '/docs/components/select',
244
+ legacyHref: '/select',
245
+ icon: 'lucide:chevrons-up-down'
246
+ },
247
+ {
248
+ title: 'SelectMenu',
249
+ href: '/docs/components/select-menu',
250
+ legacyHref: '/select-menu',
251
+ icon: 'lucide:list-filter'
252
+ },
253
+ {
254
+ title: 'Slider',
255
+ href: '/docs/components/slider',
256
+ legacyHref: '/slider',
257
+ icon: 'lucide:sliders-horizontal'
258
+ },
259
+ {
260
+ title: 'Switch',
261
+ href: '/docs/components/switch',
262
+ legacyHref: '/switch',
263
+ icon: 'lucide:toggle-left'
264
+ },
265
+ {
266
+ title: 'Textarea',
267
+ href: '/docs/components/textarea',
268
+ legacyHref: '/textarea',
269
+ icon: 'lucide:text'
270
+ },
271
+ {
272
+ title: 'FileUpload',
273
+ href: '/docs/components/file-upload',
274
+ legacyHref: '/file-upload',
275
+ icon: 'lucide:upload'
276
+ },
277
+ {
278
+ title: 'PinInput',
279
+ href: '/docs/components/pin-input',
280
+ legacyHref: '/pin-input',
281
+ icon: 'lucide:square-asterisk'
282
+ },
283
+ {
284
+ title: 'FormField',
285
+ href: '/docs/components/form-field',
286
+ legacyHref: '/form-field',
287
+ icon: 'lucide:text-cursor-input'
288
+ },
289
+ {
290
+ title: 'Form',
291
+ href: '/docs/components/form',
292
+ legacyHref: '/form',
293
+ icon: 'lucide:clipboard-list'
294
+ }
295
+ ]
296
+ },
297
+ {
298
+ title: 'Feedback',
299
+ items: [
300
+ {
301
+ title: 'Alert',
302
+ href: '/docs/components/alert',
303
+ legacyHref: '/alert',
304
+ icon: 'lucide:bell'
305
+ },
306
+ {
307
+ title: 'Banner',
308
+ href: '/docs/components/banner',
309
+ legacyHref: '/banner',
310
+ icon: 'lucide:megaphone'
311
+ },
312
+ {
313
+ title: 'Progress',
314
+ href: '/docs/components/progress',
315
+ legacyHref: '/progress',
316
+ icon: 'lucide:loader'
317
+ },
318
+ {
319
+ title: 'Toast',
320
+ href: '/docs/components/toast',
321
+ legacyHref: '/toast',
322
+ icon: 'lucide:message-square-warning'
323
+ }
324
+ ]
325
+ },
326
+ {
327
+ title: 'Navigation',
328
+ items: [
329
+ {
330
+ title: 'Breadcrumb',
331
+ href: '/docs/components/breadcrumb',
332
+ legacyHref: '/breadcrumb',
333
+ icon: 'lucide:chevron-right'
334
+ },
335
+ {
336
+ title: 'Pagination',
337
+ href: '/docs/components/pagination',
338
+ legacyHref: '/pagination',
339
+ icon: 'lucide:ellipsis'
340
+ },
341
+ {
342
+ title: 'Stepper',
343
+ href: '/docs/components/stepper',
344
+ legacyHref: '/stepper',
345
+ icon: 'lucide:list-ordered'
346
+ },
347
+ {
348
+ title: 'Tabs',
349
+ href: '/docs/components/tabs',
350
+ legacyHref: '/tabs',
351
+ icon: 'lucide:panel-top'
352
+ }
353
+ ]
354
+ },
355
+ {
356
+ title: 'Overlay',
357
+ items: [
358
+ {
359
+ title: 'Collapsible',
360
+ href: '/docs/components/collapsible',
361
+ legacyHref: '/collapsible',
362
+ icon: 'lucide:chevrons-up-down'
363
+ },
364
+ {
365
+ title: 'Command',
366
+ href: '/docs/components/command',
367
+ legacyHref: '/command',
368
+ icon: 'lucide:square-terminal'
369
+ },
370
+ {
371
+ title: 'ContextMenu',
372
+ href: '/docs/components/context-menu',
373
+ legacyHref: '/context-menu',
374
+ icon: 'lucide:mouse-pointer-square'
375
+ },
376
+ {
377
+ title: 'Modal',
378
+ href: '/docs/components/modal',
379
+ legacyHref: '/modal',
380
+ icon: 'lucide:square-stack'
381
+ },
382
+ {
383
+ title: 'Drawer',
384
+ href: '/docs/components/drawer',
385
+ legacyHref: '/drawer',
386
+ icon: 'lucide:panel-bottom'
387
+ },
388
+ {
389
+ title: 'DropdownMenu',
390
+ href: '/docs/components/dropdown-menu',
391
+ legacyHref: '/dropdown-menu',
392
+ icon: 'lucide:menu'
393
+ },
394
+ {
395
+ title: 'Popover',
396
+ href: '/docs/components/popover',
397
+ legacyHref: '/popover',
398
+ icon: 'lucide:messages-square'
399
+ },
400
+ {
401
+ title: 'Slideover',
402
+ href: '/docs/components/slideover',
403
+ legacyHref: '/slideover',
404
+ icon: 'lucide:panel-right'
405
+ },
406
+ {
407
+ title: 'Tooltip',
408
+ href: '/docs/components/tooltip',
409
+ legacyHref: '/tooltip',
410
+ icon: 'lucide:message-square'
411
+ }
412
+ ]
413
+ },
414
+ {
415
+ title: 'Date & Time',
416
+ items: [
417
+ {
418
+ title: 'Calendar',
419
+ href: '/docs/components/calendar',
420
+ legacyHref: '/calendar',
421
+ icon: 'lucide:calendar'
422
+ },
423
+ {
424
+ title: 'RangeCalendar',
425
+ href: '/docs/components/range-calendar',
426
+ legacyHref: '/range-calendar',
427
+ icon: 'lucide:calendar-range'
428
+ }
429
+ ]
430
+ }
431
+ ];
432
+ export const docsHookItems = [
433
+ {
434
+ title: 'useMediaQuery',
435
+ href: '/docs/hooks/use-media-query',
436
+ legacyHref: '/use-media-query',
437
+ icon: 'lucide:monitor-smartphone'
438
+ },
439
+ {
440
+ title: 'useClipboard',
441
+ href: '/docs/hooks/use-clipboard',
442
+ legacyHref: '/use-clipboard',
443
+ icon: 'lucide:clipboard'
444
+ },
445
+ {
446
+ title: 'useFormField',
447
+ href: '/docs/hooks/use-form-field',
448
+ legacyHref: '/use-form-field',
449
+ icon: 'lucide:text-cursor-input'
450
+ },
451
+ {
452
+ title: 'useClickOutside',
453
+ href: '/docs/hooks/use-click-outside',
454
+ legacyHref: '/use-click-outside',
455
+ icon: 'lucide:pointer'
456
+ },
457
+ {
458
+ title: 'useInfiniteScroll',
459
+ href: '/docs/hooks/use-infinite-scroll',
460
+ legacyHref: '/use-infinite-scroll',
461
+ icon: 'lucide:arrow-down-to-line'
462
+ },
463
+ {
464
+ title: 'useEscapeKeydown',
465
+ href: '/docs/hooks/use-escape-keydown',
466
+ legacyHref: '/use-escape-keydown',
467
+ icon: 'lucide:keyboard'
468
+ },
469
+ {
470
+ title: 'useDebounce',
471
+ href: '/docs/hooks/use-debounce',
472
+ legacyHref: '/use-debounce',
473
+ icon: 'lucide:timer'
474
+ }
475
+ ];
476
+ export const docsTopNav = [
477
+ { title: 'Docs', href: '/docs', icon: 'lucide:book-open' },
478
+ { title: 'Components', href: '/docs/components/button', icon: 'lucide:blocks' },
479
+ { title: 'Hooks', href: '/docs/hooks/use-debounce', icon: 'lucide:hook' }
480
+ ];
481
+ export const allComponentItems = docsComponentGroups.flatMap((group) => group.items);
482
+ export const allDocsItems = [
483
+ ...docsIntroItems,
484
+ ...docsThemeItems,
485
+ ...allComponentItems,
486
+ ...docsHookItems
487
+ ];
488
+ export const totalComponents = allComponentItems.length;
489
+ export const totalHooks = docsHookItems.length;
490
+ export const docsPathAliases = new Map(allDocsItems.flatMap((item) => (item.legacyHref ? [[item.legacyHref, item.href]] : [])));
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './Checkbox/index.js';
15
15
  export * from './CheckboxGroup/index.js';
16
16
  export * from './Chip/index.js';
17
17
  export * from './Collapsible/index.js';
18
+ export * from './CodeBlock/index.js';
18
19
  export * from './Command/index.js';
19
20
  export * from './Container/index.js';
20
21
  export * from './ContextMenu/index.js';
@@ -27,6 +28,7 @@ export * from './FieldGroup/index.js';
27
28
  export * from './FileUpload/index.js';
28
29
  export * from './Form/index.js';
29
30
  export * from './FormField/index.js';
31
+ export * from './Fonts/index.js';
30
32
  export * from './hooks/index.js';
31
33
  export * from './Icon/index.js';
32
34
  export * from './Input/index.js';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ export * from './Checkbox/index.js';
15
15
  export * from './CheckboxGroup/index.js';
16
16
  export * from './Chip/index.js';
17
17
  export * from './Collapsible/index.js';
18
+ export * from './CodeBlock/index.js';
18
19
  export * from './Command/index.js';
19
20
  export * from './Container/index.js';
20
21
  export * from './ContextMenu/index.js';
@@ -27,6 +28,7 @@ export * from './FieldGroup/index.js';
27
28
  export * from './FileUpload/index.js';
28
29
  export * from './Form/index.js';
29
30
  export * from './FormField/index.js';
31
+ export * from './Fonts/index.js';
30
32
  // Composables
31
33
  export * from './hooks/index.js';
32
34
  export * from './Icon/index.js';
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "svelora-docs": {
4
+ "type": "stdio",
5
+ "command": "node",
6
+ "args": [
7
+ "./node_modules/svelora/dist/mcp/server.mjs"
8
+ ],
9
+ "cwd": "${workspaceFolder}"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { access, copyFile, mkdir } from 'node:fs/promises'
4
+ import path from 'node:path'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const __filename = fileURLToPath(import.meta.url)
8
+ const __dirname = path.dirname(__filename)
9
+
10
+ const args = new Set(process.argv.slice(2))
11
+ const force = args.has('--force')
12
+ const cwd = process.cwd()
13
+ const targetDir = path.join(cwd, '.cursor')
14
+ const targetPath = path.join(targetDir, 'mcp.json')
15
+
16
+ async function resolveTemplatePath() {
17
+ const candidates = [
18
+ path.join(__dirname, 'cursor.mcp.json'),
19
+ path.resolve(__dirname, '../../dist/mcp/cursor.mcp.json')
20
+ ]
21
+
22
+ for (const candidate of candidates) {
23
+ try {
24
+ await access(candidate)
25
+ return candidate
26
+ } catch {
27
+ // Try next candidate.
28
+ }
29
+ }
30
+
31
+ throw new Error('Could not find cursor.mcp.json template for Svelora MCP.')
32
+ }
33
+
34
+ async function main() {
35
+ const templatePath = await resolveTemplatePath()
36
+
37
+ try {
38
+ await access(targetPath)
39
+ if (!force) {
40
+ console.error(`Refusing to overwrite existing file: ${targetPath}`)
41
+ console.error('Run again with --force if you want to replace it.')
42
+ process.exitCode = 1
43
+ return
44
+ }
45
+ } catch {
46
+ // Continue and attempt to create the file.
47
+ }
48
+
49
+ await mkdir(targetDir, { recursive: true })
50
+ await copyFile(templatePath, targetPath)
51
+
52
+ console.log(`Installed Svelora MCP template at ${targetPath}`)
53
+ }
54
+
55
+ await main()