@ghostvue/nuxt 0.0.0-stage → 0.2.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.
- package/LICENSE +22 -0
- package/README.md +43 -2
- package/dist/.registries/auto-imports.generated.d.ts +7 -0
- package/dist/.registries/auto-imports.generated.js +438 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +84 -0
- package/dist/plan.d.ts +70 -0
- package/dist/plan.js +69 -0
- package/package.json +51 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GhostVue contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ghostvue/nuxt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nuxt module for GhostVue. By default it auto-imports every headless `Ghost*`
|
|
4
|
+
component and public `useGhost*` composable from
|
|
5
|
+
[`@ghostvue/vue`](https://www.npmjs.com/package/@ghostvue/vue) and adds no CSS.
|
|
6
|
+
Themed wrappers and theme stylesheets from
|
|
7
|
+
[`@ghostvue/themes`](https://www.npmjs.com/package/@ghostvue/themes) are an
|
|
8
|
+
explicit opt-in.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add @ghostvue/vue @ghostvue/nuxt
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Nuxt `^4.6.0` is a peer dependency. Add `@ghostvue/themes` only if you opt in
|
|
17
|
+
to themed components or CSS.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// nuxt.config.ts
|
|
23
|
+
export default defineNuxtConfig({
|
|
24
|
+
modules: ['@ghostvue/nuxt'],
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To use themed wrappers and a flagship stylesheet:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// nuxt.config.ts
|
|
32
|
+
export default defineNuxtConfig({
|
|
33
|
+
modules: ['@ghostvue/nuxt'],
|
|
34
|
+
ghostvue: {
|
|
35
|
+
components: 'themed',
|
|
36
|
+
css: ['calm'],
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Documentation
|
|
42
|
+
|
|
43
|
+
[ghostvue.dev](https://ghostvue.dev): see
|
|
44
|
+
[Nuxt and auto-imports](https://ghostvue.dev/auto-imports) for every option.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @generated by pnpm registries:write — do not edit. */
|
|
2
|
+
/** Headless `Ghost*` components exported by `@ghostvue/vue`. */
|
|
3
|
+
export declare const headlessComponentNames: readonly string[];
|
|
4
|
+
/** Public `useGhost*` composables exported by `@ghostvue/vue`. */
|
|
5
|
+
export declare const headlessComposableNames: readonly string[];
|
|
6
|
+
/** Themed `Ghost*` wrappers exported by `@ghostvue/themes`. */
|
|
7
|
+
export declare const themedComponentNames: readonly string[];
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
/** @generated by pnpm registries:write — do not edit. */
|
|
2
|
+
/** Headless `Ghost*` components exported by `@ghostvue/vue`. */
|
|
3
|
+
export const headlessComponentNames = [
|
|
4
|
+
'GhostAccordion',
|
|
5
|
+
'GhostAccordionContent',
|
|
6
|
+
'GhostAccordionItem',
|
|
7
|
+
'GhostAccordionTrigger',
|
|
8
|
+
'GhostAvatar',
|
|
9
|
+
'GhostBadge',
|
|
10
|
+
'GhostBreadcrumb',
|
|
11
|
+
'GhostBreadcrumbEllipsis',
|
|
12
|
+
'GhostBreadcrumbItem',
|
|
13
|
+
'GhostBreadcrumbLink',
|
|
14
|
+
'GhostBreadcrumbList',
|
|
15
|
+
'GhostBreadcrumbPage',
|
|
16
|
+
'GhostBreadcrumbSeparator',
|
|
17
|
+
'GhostButton',
|
|
18
|
+
'GhostCalendar',
|
|
19
|
+
'GhostCalendarCell',
|
|
20
|
+
'GhostCalendarGrid',
|
|
21
|
+
'GhostCalendarHeader',
|
|
22
|
+
'GhostCalendarHeading',
|
|
23
|
+
'GhostCalendarNextButton',
|
|
24
|
+
'GhostCalendarPrevButton',
|
|
25
|
+
'GhostCard',
|
|
26
|
+
'GhostCheckbox',
|
|
27
|
+
'GhostCheckboxGroup',
|
|
28
|
+
'GhostCollapsible',
|
|
29
|
+
'GhostCollapsibleContent',
|
|
30
|
+
'GhostCollapsibleTrigger',
|
|
31
|
+
'GhostCombobox',
|
|
32
|
+
'GhostComboboxContent',
|
|
33
|
+
'GhostComboboxEmpty',
|
|
34
|
+
'GhostComboboxGroup',
|
|
35
|
+
'GhostComboboxInput',
|
|
36
|
+
'GhostComboboxLabel',
|
|
37
|
+
'GhostComboboxOption',
|
|
38
|
+
'GhostComboboxTrigger',
|
|
39
|
+
'GhostCommandPalette',
|
|
40
|
+
'GhostCommandPaletteContent',
|
|
41
|
+
'GhostCommandPaletteEmpty',
|
|
42
|
+
'GhostCommandPaletteGroup',
|
|
43
|
+
'GhostCommandPaletteInput',
|
|
44
|
+
'GhostCommandPaletteItem',
|
|
45
|
+
'GhostCommandPaletteLabel',
|
|
46
|
+
'GhostCommandPaletteList',
|
|
47
|
+
'GhostCommandPaletteOverlay',
|
|
48
|
+
'GhostCommandPaletteSeparator',
|
|
49
|
+
'GhostCommandPaletteTitle',
|
|
50
|
+
'GhostCommandPaletteTrigger',
|
|
51
|
+
'GhostContextMenu',
|
|
52
|
+
'GhostContextMenuCheckboxItem',
|
|
53
|
+
'GhostContextMenuContent',
|
|
54
|
+
'GhostContextMenuGroup',
|
|
55
|
+
'GhostContextMenuItem',
|
|
56
|
+
'GhostContextMenuLabel',
|
|
57
|
+
'GhostContextMenuRadioGroup',
|
|
58
|
+
'GhostContextMenuRadioItem',
|
|
59
|
+
'GhostContextMenuSeparator',
|
|
60
|
+
'GhostContextMenuTrigger',
|
|
61
|
+
'GhostDataTable',
|
|
62
|
+
'GhostDataTablePreset',
|
|
63
|
+
'GhostDataTableTable',
|
|
64
|
+
'GhostDatePicker',
|
|
65
|
+
'GhostDatePickerCalendar',
|
|
66
|
+
'GhostDatePickerContent',
|
|
67
|
+
'GhostDatePickerInput',
|
|
68
|
+
'GhostDatePickerTrigger',
|
|
69
|
+
'GhostDialog',
|
|
70
|
+
'GhostDialogClose',
|
|
71
|
+
'GhostDialogContent',
|
|
72
|
+
'GhostDialogDescription',
|
|
73
|
+
'GhostDialogOverlay',
|
|
74
|
+
'GhostDialogTitle',
|
|
75
|
+
'GhostDialogTrigger',
|
|
76
|
+
'GhostDrawer',
|
|
77
|
+
'GhostDrawerClose',
|
|
78
|
+
'GhostDrawerContent',
|
|
79
|
+
'GhostDrawerDescription',
|
|
80
|
+
'GhostDrawerOverlay',
|
|
81
|
+
'GhostDrawerTitle',
|
|
82
|
+
'GhostDrawerTrigger',
|
|
83
|
+
'GhostDropdownMenu',
|
|
84
|
+
'GhostDropdownMenuCheckboxItem',
|
|
85
|
+
'GhostDropdownMenuContent',
|
|
86
|
+
'GhostDropdownMenuGroup',
|
|
87
|
+
'GhostDropdownMenuItem',
|
|
88
|
+
'GhostDropdownMenuLabel',
|
|
89
|
+
'GhostDropdownMenuRadioGroup',
|
|
90
|
+
'GhostDropdownMenuRadioItem',
|
|
91
|
+
'GhostDropdownMenuSeparator',
|
|
92
|
+
'GhostDropdownMenuTrigger',
|
|
93
|
+
'GhostEmptyState',
|
|
94
|
+
'GhostField',
|
|
95
|
+
'GhostFieldControl',
|
|
96
|
+
'GhostFieldDescription',
|
|
97
|
+
'GhostFieldError',
|
|
98
|
+
'GhostFieldLabel',
|
|
99
|
+
'GhostFileUpload',
|
|
100
|
+
'GhostFileUploadDropzone',
|
|
101
|
+
'GhostFileUploadItem',
|
|
102
|
+
'GhostFileUploadItemRemove',
|
|
103
|
+
'GhostFileUploadList',
|
|
104
|
+
'GhostFileUploadTrigger',
|
|
105
|
+
'GhostForm',
|
|
106
|
+
'GhostHoverCard',
|
|
107
|
+
'GhostHoverCardContent',
|
|
108
|
+
'GhostHoverCardTrigger',
|
|
109
|
+
'GhostInlineAlert',
|
|
110
|
+
'GhostInput',
|
|
111
|
+
'GhostInteractiveSurface',
|
|
112
|
+
'GhostKbd',
|
|
113
|
+
'GhostLink',
|
|
114
|
+
'GhostMenubar',
|
|
115
|
+
'GhostMenubarCheckboxItem',
|
|
116
|
+
'GhostMenubarContent',
|
|
117
|
+
'GhostMenubarGroup',
|
|
118
|
+
'GhostMenubarItem',
|
|
119
|
+
'GhostMenubarLabel',
|
|
120
|
+
'GhostMenubarMenu',
|
|
121
|
+
'GhostMenubarRadioGroup',
|
|
122
|
+
'GhostMenubarRadioItem',
|
|
123
|
+
'GhostMenubarSeparator',
|
|
124
|
+
'GhostMenubarTrigger',
|
|
125
|
+
'GhostNumberInput',
|
|
126
|
+
'GhostPagination',
|
|
127
|
+
'GhostPopover',
|
|
128
|
+
'GhostPopoverClose',
|
|
129
|
+
'GhostPopoverContent',
|
|
130
|
+
'GhostPopoverTrigger',
|
|
131
|
+
'GhostPortal',
|
|
132
|
+
'GhostPresence',
|
|
133
|
+
'GhostProgress',
|
|
134
|
+
'GhostRadioGroup',
|
|
135
|
+
'GhostRadioGroupItem',
|
|
136
|
+
'GhostScrollArea',
|
|
137
|
+
'GhostScrollSpy',
|
|
138
|
+
'GhostScrollSpyItem',
|
|
139
|
+
'GhostScrollSpyLink',
|
|
140
|
+
'GhostScrollSpyList',
|
|
141
|
+
'GhostSegmentedControl',
|
|
142
|
+
'GhostSegmentedControlItem',
|
|
143
|
+
'GhostSelect',
|
|
144
|
+
'GhostSelectContent',
|
|
145
|
+
'GhostSelectGroup',
|
|
146
|
+
'GhostSelectLabel',
|
|
147
|
+
'GhostSelectOption',
|
|
148
|
+
'GhostSelectTrigger',
|
|
149
|
+
'GhostSelectValue',
|
|
150
|
+
'GhostSeparator',
|
|
151
|
+
'GhostSkeleton',
|
|
152
|
+
'GhostSlider',
|
|
153
|
+
'GhostSpinner',
|
|
154
|
+
'GhostSubmenu',
|
|
155
|
+
'GhostSubmenuContent',
|
|
156
|
+
'GhostSubmenuTrigger',
|
|
157
|
+
'GhostSwitch',
|
|
158
|
+
'GhostTable',
|
|
159
|
+
'GhostTableBody',
|
|
160
|
+
'GhostTableCaption',
|
|
161
|
+
'GhostTableCell',
|
|
162
|
+
'GhostTableFoot',
|
|
163
|
+
'GhostTableHead',
|
|
164
|
+
'GhostTableHeaderCell',
|
|
165
|
+
'GhostTableRow',
|
|
166
|
+
'GhostTabs',
|
|
167
|
+
'GhostTabsContent',
|
|
168
|
+
'GhostTabsList',
|
|
169
|
+
'GhostTabsTrigger',
|
|
170
|
+
'GhostTagsInput',
|
|
171
|
+
'GhostTextarea',
|
|
172
|
+
'GhostToast',
|
|
173
|
+
'GhostToastAction',
|
|
174
|
+
'GhostToastClose',
|
|
175
|
+
'GhostToastDescription',
|
|
176
|
+
'GhostToastProvider',
|
|
177
|
+
'GhostToastTitle',
|
|
178
|
+
'GhostToastViewport',
|
|
179
|
+
'GhostToggleGroup',
|
|
180
|
+
'GhostToggleGroupItem',
|
|
181
|
+
'GhostToolbar',
|
|
182
|
+
'GhostTooltip',
|
|
183
|
+
'GhostTooltipContent',
|
|
184
|
+
'GhostTooltipProvider',
|
|
185
|
+
'GhostTooltipTrigger',
|
|
186
|
+
'GhostTree',
|
|
187
|
+
'GhostTreeGroup',
|
|
188
|
+
'GhostTreeItem',
|
|
189
|
+
'GhostTreeTrigger',
|
|
190
|
+
'GhostVisuallyHidden',
|
|
191
|
+
];
|
|
192
|
+
/** Public `useGhost*` composables exported by `@ghostvue/vue`. */
|
|
193
|
+
export const headlessComposableNames = [
|
|
194
|
+
'useGhostAccordion',
|
|
195
|
+
'useGhostAvatar',
|
|
196
|
+
'useGhostBadge',
|
|
197
|
+
'useGhostBreadcrumb',
|
|
198
|
+
'useGhostButton',
|
|
199
|
+
'useGhostCalendar',
|
|
200
|
+
'useGhostCard',
|
|
201
|
+
'useGhostCheckbox',
|
|
202
|
+
'useGhostCheckboxGroup',
|
|
203
|
+
'useGhostCollapsible',
|
|
204
|
+
'useGhostCombobox',
|
|
205
|
+
'useGhostComboboxAsyncSearch',
|
|
206
|
+
'useGhostCommandPalette',
|
|
207
|
+
'useGhostCommandPaletteAsyncSearch',
|
|
208
|
+
'useGhostContextMenu',
|
|
209
|
+
'useGhostDataTable',
|
|
210
|
+
'useGhostDataTableServerRequest',
|
|
211
|
+
'useGhostDatePicker',
|
|
212
|
+
'useGhostDialog',
|
|
213
|
+
'useGhostDrawer',
|
|
214
|
+
'useGhostDropdownMenu',
|
|
215
|
+
'useGhostEmptyState',
|
|
216
|
+
'useGhostField',
|
|
217
|
+
'useGhostFileUpload',
|
|
218
|
+
'useGhostForm',
|
|
219
|
+
'useGhostHoverCard',
|
|
220
|
+
'useGhostId',
|
|
221
|
+
'useGhostInlineAlert',
|
|
222
|
+
'useGhostInput',
|
|
223
|
+
'useGhostInteractiveSurface',
|
|
224
|
+
'useGhostKbd',
|
|
225
|
+
'useGhostLink',
|
|
226
|
+
'useGhostMenubar',
|
|
227
|
+
'useGhostMenubarMenu',
|
|
228
|
+
'useGhostMenuCollection',
|
|
229
|
+
'useGhostNumberInput',
|
|
230
|
+
'useGhostPagination',
|
|
231
|
+
'useGhostPopover',
|
|
232
|
+
'useGhostPresence',
|
|
233
|
+
'useGhostProgress',
|
|
234
|
+
'useGhostRadioGroup',
|
|
235
|
+
'useGhostScrollArea',
|
|
236
|
+
'useGhostScrollSpy',
|
|
237
|
+
'useGhostSegmentedControl',
|
|
238
|
+
'useGhostSelect',
|
|
239
|
+
'useGhostSeparator',
|
|
240
|
+
'useGhostSkeleton',
|
|
241
|
+
'useGhostSlider',
|
|
242
|
+
'useGhostSpinner',
|
|
243
|
+
'useGhostSwitch',
|
|
244
|
+
'useGhostTable',
|
|
245
|
+
'useGhostTableBody',
|
|
246
|
+
'useGhostTableCaption',
|
|
247
|
+
'useGhostTableCell',
|
|
248
|
+
'useGhostTableFoot',
|
|
249
|
+
'useGhostTableHead',
|
|
250
|
+
'useGhostTableHeaderCell',
|
|
251
|
+
'useGhostTableRow',
|
|
252
|
+
'useGhostTabs',
|
|
253
|
+
'useGhostTextarea',
|
|
254
|
+
'useGhostToast',
|
|
255
|
+
'useGhostToggleGroup',
|
|
256
|
+
'useGhostToolbar',
|
|
257
|
+
'useGhostTooltip',
|
|
258
|
+
'useGhostTree',
|
|
259
|
+
'useGhostVisuallyHidden',
|
|
260
|
+
];
|
|
261
|
+
/** Themed `Ghost*` wrappers exported by `@ghostvue/themes`. */
|
|
262
|
+
export const themedComponentNames = [
|
|
263
|
+
'GhostAccordion',
|
|
264
|
+
'GhostAccordionContent',
|
|
265
|
+
'GhostAccordionItem',
|
|
266
|
+
'GhostAccordionTrigger',
|
|
267
|
+
'GhostAvatar',
|
|
268
|
+
'GhostBadge',
|
|
269
|
+
'GhostBreadcrumb',
|
|
270
|
+
'GhostBreadcrumbEllipsis',
|
|
271
|
+
'GhostBreadcrumbItem',
|
|
272
|
+
'GhostBreadcrumbLink',
|
|
273
|
+
'GhostBreadcrumbList',
|
|
274
|
+
'GhostBreadcrumbPage',
|
|
275
|
+
'GhostBreadcrumbSeparator',
|
|
276
|
+
'GhostButton',
|
|
277
|
+
'GhostCalendar',
|
|
278
|
+
'GhostCalendarCell',
|
|
279
|
+
'GhostCalendarGrid',
|
|
280
|
+
'GhostCalendarHeader',
|
|
281
|
+
'GhostCalendarHeading',
|
|
282
|
+
'GhostCalendarNextButton',
|
|
283
|
+
'GhostCalendarPrevButton',
|
|
284
|
+
'GhostCard',
|
|
285
|
+
'GhostCheckbox',
|
|
286
|
+
'GhostCheckboxGroup',
|
|
287
|
+
'GhostCollapsible',
|
|
288
|
+
'GhostCollapsibleContent',
|
|
289
|
+
'GhostCollapsibleTrigger',
|
|
290
|
+
'GhostCombobox',
|
|
291
|
+
'GhostComboboxContent',
|
|
292
|
+
'GhostComboboxEmpty',
|
|
293
|
+
'GhostComboboxGroup',
|
|
294
|
+
'GhostComboboxInput',
|
|
295
|
+
'GhostComboboxLabel',
|
|
296
|
+
'GhostComboboxOption',
|
|
297
|
+
'GhostComboboxTrigger',
|
|
298
|
+
'GhostCommandPalette',
|
|
299
|
+
'GhostCommandPaletteContent',
|
|
300
|
+
'GhostCommandPaletteEmpty',
|
|
301
|
+
'GhostCommandPaletteGroup',
|
|
302
|
+
'GhostCommandPaletteInput',
|
|
303
|
+
'GhostCommandPaletteItem',
|
|
304
|
+
'GhostCommandPaletteLabel',
|
|
305
|
+
'GhostCommandPaletteList',
|
|
306
|
+
'GhostCommandPaletteOverlay',
|
|
307
|
+
'GhostCommandPaletteSeparator',
|
|
308
|
+
'GhostCommandPaletteTitle',
|
|
309
|
+
'GhostCommandPaletteTrigger',
|
|
310
|
+
'GhostContextMenu',
|
|
311
|
+
'GhostContextMenuCheckboxItem',
|
|
312
|
+
'GhostContextMenuContent',
|
|
313
|
+
'GhostContextMenuGroup',
|
|
314
|
+
'GhostContextMenuItem',
|
|
315
|
+
'GhostContextMenuLabel',
|
|
316
|
+
'GhostContextMenuRadioGroup',
|
|
317
|
+
'GhostContextMenuRadioItem',
|
|
318
|
+
'GhostContextMenuSeparator',
|
|
319
|
+
'GhostContextMenuTrigger',
|
|
320
|
+
'GhostDataTable',
|
|
321
|
+
'GhostDataTablePreset',
|
|
322
|
+
'GhostDataTableTable',
|
|
323
|
+
'GhostDatePicker',
|
|
324
|
+
'GhostDatePickerCalendar',
|
|
325
|
+
'GhostDatePickerContent',
|
|
326
|
+
'GhostDatePickerInput',
|
|
327
|
+
'GhostDatePickerTrigger',
|
|
328
|
+
'GhostDialog',
|
|
329
|
+
'GhostDialogClose',
|
|
330
|
+
'GhostDialogContent',
|
|
331
|
+
'GhostDialogDescription',
|
|
332
|
+
'GhostDialogOverlay',
|
|
333
|
+
'GhostDialogTitle',
|
|
334
|
+
'GhostDialogTrigger',
|
|
335
|
+
'GhostDrawer',
|
|
336
|
+
'GhostDrawerClose',
|
|
337
|
+
'GhostDrawerContent',
|
|
338
|
+
'GhostDrawerDescription',
|
|
339
|
+
'GhostDrawerOverlay',
|
|
340
|
+
'GhostDrawerTitle',
|
|
341
|
+
'GhostDrawerTrigger',
|
|
342
|
+
'GhostDropdownMenu',
|
|
343
|
+
'GhostDropdownMenuCheckboxItem',
|
|
344
|
+
'GhostDropdownMenuContent',
|
|
345
|
+
'GhostDropdownMenuGroup',
|
|
346
|
+
'GhostDropdownMenuItem',
|
|
347
|
+
'GhostDropdownMenuLabel',
|
|
348
|
+
'GhostDropdownMenuRadioGroup',
|
|
349
|
+
'GhostDropdownMenuRadioItem',
|
|
350
|
+
'GhostDropdownMenuSeparator',
|
|
351
|
+
'GhostDropdownMenuTrigger',
|
|
352
|
+
'GhostEmptyState',
|
|
353
|
+
'GhostField',
|
|
354
|
+
'GhostFieldControl',
|
|
355
|
+
'GhostFieldDescription',
|
|
356
|
+
'GhostFieldError',
|
|
357
|
+
'GhostFieldLabel',
|
|
358
|
+
'GhostFileUpload',
|
|
359
|
+
'GhostFileUploadDropzone',
|
|
360
|
+
'GhostFileUploadItem',
|
|
361
|
+
'GhostFileUploadItemRemove',
|
|
362
|
+
'GhostFileUploadList',
|
|
363
|
+
'GhostFileUploadTrigger',
|
|
364
|
+
'GhostHoverCard',
|
|
365
|
+
'GhostHoverCardContent',
|
|
366
|
+
'GhostHoverCardTrigger',
|
|
367
|
+
'GhostInlineAlert',
|
|
368
|
+
'GhostInput',
|
|
369
|
+
'GhostInteractiveSurface',
|
|
370
|
+
'GhostKbd',
|
|
371
|
+
'GhostLink',
|
|
372
|
+
'GhostMenubar',
|
|
373
|
+
'GhostMenubarCheckboxItem',
|
|
374
|
+
'GhostMenubarContent',
|
|
375
|
+
'GhostMenubarGroup',
|
|
376
|
+
'GhostMenubarItem',
|
|
377
|
+
'GhostMenubarLabel',
|
|
378
|
+
'GhostMenubarMenu',
|
|
379
|
+
'GhostMenubarRadioGroup',
|
|
380
|
+
'GhostMenubarRadioItem',
|
|
381
|
+
'GhostMenubarSeparator',
|
|
382
|
+
'GhostMenubarTrigger',
|
|
383
|
+
'GhostNumberInput',
|
|
384
|
+
'GhostPagination',
|
|
385
|
+
'GhostPopover',
|
|
386
|
+
'GhostPopoverClose',
|
|
387
|
+
'GhostPopoverContent',
|
|
388
|
+
'GhostPopoverTrigger',
|
|
389
|
+
'GhostProgress',
|
|
390
|
+
'GhostRadioGroup',
|
|
391
|
+
'GhostRadioGroupItem',
|
|
392
|
+
'GhostScrollArea',
|
|
393
|
+
'GhostScrollSpy',
|
|
394
|
+
'GhostScrollSpyItem',
|
|
395
|
+
'GhostScrollSpyLink',
|
|
396
|
+
'GhostScrollSpyList',
|
|
397
|
+
'GhostSegmentedControl',
|
|
398
|
+
'GhostSegmentedControlItem',
|
|
399
|
+
'GhostSelect',
|
|
400
|
+
'GhostSelectContent',
|
|
401
|
+
'GhostSelectGroup',
|
|
402
|
+
'GhostSelectLabel',
|
|
403
|
+
'GhostSelectOption',
|
|
404
|
+
'GhostSelectTrigger',
|
|
405
|
+
'GhostSelectValue',
|
|
406
|
+
'GhostSeparator',
|
|
407
|
+
'GhostSkeleton',
|
|
408
|
+
'GhostSlider',
|
|
409
|
+
'GhostSpinner',
|
|
410
|
+
'GhostSubmenu',
|
|
411
|
+
'GhostSubmenuContent',
|
|
412
|
+
'GhostSubmenuTrigger',
|
|
413
|
+
'GhostSwitch',
|
|
414
|
+
'GhostTable',
|
|
415
|
+
'GhostTabs',
|
|
416
|
+
'GhostTabsContent',
|
|
417
|
+
'GhostTabsList',
|
|
418
|
+
'GhostTabsTrigger',
|
|
419
|
+
'GhostTagsInput',
|
|
420
|
+
'GhostTextarea',
|
|
421
|
+
'GhostToast',
|
|
422
|
+
'GhostToastAction',
|
|
423
|
+
'GhostToastClose',
|
|
424
|
+
'GhostToastDescription',
|
|
425
|
+
'GhostToastProvider',
|
|
426
|
+
'GhostToastTitle',
|
|
427
|
+
'GhostToastViewport',
|
|
428
|
+
'GhostToggleGroup',
|
|
429
|
+
'GhostToggleGroupItem',
|
|
430
|
+
'GhostToolbar',
|
|
431
|
+
'GhostTooltip',
|
|
432
|
+
'GhostTooltipContent',
|
|
433
|
+
'GhostTooltipTrigger',
|
|
434
|
+
'GhostTree',
|
|
435
|
+
'GhostTreeGroup',
|
|
436
|
+
'GhostTreeItem',
|
|
437
|
+
'GhostTreeTrigger',
|
|
438
|
+
];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema';
|
|
2
|
+
import { type GhostVueNuxtOptions } from './plan.js';
|
|
3
|
+
export { ghostVueNuxtStylesheets, type GhostVueNuxtComponents, type GhostVueNuxtOptions, type GhostVueNuxtStylesheet, } from './plan.js';
|
|
4
|
+
/**
|
|
5
|
+
* Nuxt module. Add `'@ghostvue/nuxt'` to `modules` and configure it under the
|
|
6
|
+
* `ghostvue` key. Defaults auto-import headless components and `useGhost*`
|
|
7
|
+
* composables from `@ghostvue/vue` and inject no CSS.
|
|
8
|
+
*/
|
|
9
|
+
declare const ghostVueNuxtModule: NuxtModule<GhostVueNuxtOptions>;
|
|
10
|
+
export default ghostVueNuxtModule;
|
|
11
|
+
declare module '@nuxt/schema' {
|
|
12
|
+
interface NuxtConfig {
|
|
13
|
+
/** GhostVue auto-import options for `@ghostvue/nuxt`. */
|
|
14
|
+
ghostvue?: GhostVueNuxtOptions;
|
|
15
|
+
}
|
|
16
|
+
interface NuxtOptions {
|
|
17
|
+
ghostvue?: GhostVueNuxtOptions;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@ghostvue/nuxt`: Nuxt module that registers GhostVue auto-imports.
|
|
3
|
+
*
|
|
4
|
+
* Dependency direction: this package points toward `@ghostvue/vue` (required
|
|
5
|
+
* peer) and, only when a consumer opts in, `@ghostvue/themes` (optional peer).
|
|
6
|
+
* Neither of those packages knows about Nuxt. The module references both by
|
|
7
|
+
* package name only, so the consumer's own installation (and its single Vue
|
|
8
|
+
* runtime) is what Nuxt bundles.
|
|
9
|
+
*
|
|
10
|
+
* Named imports from `@ghostvue/vue` / `@ghostvue/themes` stay the primary
|
|
11
|
+
* library API; this module only spares Nuxt apps from writing them.
|
|
12
|
+
*/
|
|
13
|
+
import { pathToFileURL } from 'node:url';
|
|
14
|
+
import { addComponent, addImports, defineNuxtModule, tryResolveModule, useLogger, } from '@nuxt/kit';
|
|
15
|
+
import { planGhostVueNuxt, THEMES_PACKAGE, } from './plan.js';
|
|
16
|
+
export { ghostVueNuxtStylesheets, } from './plan.js';
|
|
17
|
+
/** `nuxt.config` key that holds {@link GhostVueNuxtOptions}. */
|
|
18
|
+
const CONFIG_KEY = 'ghostvue';
|
|
19
|
+
/**
|
|
20
|
+
* Nuxt module. Add `'@ghostvue/nuxt'` to `modules` and configure it under the
|
|
21
|
+
* `ghostvue` key. Defaults auto-import headless components and `useGhost*`
|
|
22
|
+
* composables from `@ghostvue/vue` and inject no CSS.
|
|
23
|
+
*/
|
|
24
|
+
const ghostVueNuxtModule = defineNuxtModule({
|
|
25
|
+
meta: {
|
|
26
|
+
name: '@ghostvue/nuxt',
|
|
27
|
+
configKey: CONFIG_KEY,
|
|
28
|
+
compatibility: { nuxt: '>=4.6.0' },
|
|
29
|
+
},
|
|
30
|
+
defaults: {
|
|
31
|
+
components: 'headless',
|
|
32
|
+
composables: true,
|
|
33
|
+
css: [],
|
|
34
|
+
},
|
|
35
|
+
async setup(options, nuxt) {
|
|
36
|
+
const logger = useLogger('@ghostvue/nuxt');
|
|
37
|
+
const plan = planGhostVueNuxt(options);
|
|
38
|
+
if (plan.requiresThemes) {
|
|
39
|
+
// Fail at build time with the fix instead of emitting imports that only
|
|
40
|
+
// break once Vite tries to resolve them.
|
|
41
|
+
const searchFrom = [
|
|
42
|
+
nuxt.options.rootDir,
|
|
43
|
+
...nuxt.options.modulesDir,
|
|
44
|
+
].map((directory) => pathToFileURL(`${directory}/`));
|
|
45
|
+
if (!(await tryResolveModule(THEMES_PACKAGE, searchFrom))) {
|
|
46
|
+
throw new Error(`[@ghostvue/nuxt] ghostvue.components: 'themed' and ghostvue.css need ${THEMES_PACKAGE}. Install it, or keep the headless default.`);
|
|
47
|
+
}
|
|
48
|
+
// The themes entry imports its stylesheet. Transpiling keeps that CSS
|
|
49
|
+
// import inside Vite during SSR instead of handing a `.css` import to
|
|
50
|
+
// Node, which cannot load it.
|
|
51
|
+
if (!nuxt.options.build.transpile.includes(THEMES_PACKAGE)) {
|
|
52
|
+
nuxt.options.build.transpile.push(THEMES_PACKAGE);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (const specifier of plan.css) {
|
|
56
|
+
if (!nuxt.options.css.includes(specifier)) {
|
|
57
|
+
nuxt.options.css.push(specifier);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const { name, from } of plan.components) {
|
|
61
|
+
addComponent({ name, export: name, filePath: from });
|
|
62
|
+
}
|
|
63
|
+
if (plan.components.length > 0) {
|
|
64
|
+
// App and layer component directories register with a higher priority
|
|
65
|
+
// than module components, so Nuxt would otherwise drop ours silently
|
|
66
|
+
// when an app also defines e.g. `components/GhostButton.vue`. This hook
|
|
67
|
+
// runs after the registrations above and reports each tag that now
|
|
68
|
+
// resolves somewhere else.
|
|
69
|
+
const ours = new Map(plan.components.map((entry) => [entry.name, entry]));
|
|
70
|
+
nuxt.hook('components:extend', (components) => {
|
|
71
|
+
for (const component of components) {
|
|
72
|
+
const expected = ours.get(component.pascalName);
|
|
73
|
+
if (expected && component.filePath !== expected.from) {
|
|
74
|
+
logger.warn(`<${expected.name}> resolves to ${component.filePath}, not ${expected.from}. Rename one of them, or import the GhostVue component explicitly.`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (plan.composables.length > 0) {
|
|
80
|
+
addImports(plan.composables.map(({ name, from }) => ({ name, as: name, from })));
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
export default ghostVueNuxtModule;
|
package/dist/plan.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Package that headless components and composables import from. */
|
|
2
|
+
export declare const HEADLESS_PACKAGE = "@ghostvue/vue";
|
|
3
|
+
/** Optional package that themed wrappers and theme stylesheets come from. */
|
|
4
|
+
export declare const THEMES_PACKAGE = "@ghostvue/themes";
|
|
5
|
+
/**
|
|
6
|
+
* Which layer auto-imported `Ghost*` component tags resolve to.
|
|
7
|
+
*
|
|
8
|
+
* - `'headless'` (default): every tag resolves to `@ghostvue/vue`. No CSS.
|
|
9
|
+
* - `'themed'`: tags with a themed wrapper resolve to `@ghostvue/themes`
|
|
10
|
+
* (which loads its base stylesheet); the few headless-only utilities
|
|
11
|
+
* (`GhostPortal`, `GhostVisuallyHidden`, ...) keep resolving to
|
|
12
|
+
* `@ghostvue/vue`. Requires `@ghostvue/themes` to be installed.
|
|
13
|
+
* - `false`: register no components; use named imports instead.
|
|
14
|
+
*/
|
|
15
|
+
export type GhostVueNuxtComponents = 'headless' | 'themed' | false;
|
|
16
|
+
/**
|
|
17
|
+
* Stylesheet exported by `@ghostvue/themes` as `@ghostvue/themes/<name>.css`.
|
|
18
|
+
* `default`, `calm`, `vibrant`, and `mono` are full themes; `tokens` is the
|
|
19
|
+
* token custom properties alone.
|
|
20
|
+
*/
|
|
21
|
+
export type GhostVueNuxtStylesheet = 'default' | 'calm' | 'vibrant' | 'mono' | 'tokens';
|
|
22
|
+
/** Every accepted stylesheet name, in documentation order. */
|
|
23
|
+
export declare const ghostVueNuxtStylesheets: readonly GhostVueNuxtStylesheet[];
|
|
24
|
+
/** Options for the `ghostvue` key in `nuxt.config`. */
|
|
25
|
+
export interface GhostVueNuxtOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Layer that auto-imported `Ghost*` components resolve to.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue `'headless'`
|
|
30
|
+
*/
|
|
31
|
+
components?: GhostVueNuxtComponents;
|
|
32
|
+
/**
|
|
33
|
+
* Auto-import the public `useGhost*` composables from `@ghostvue/vue`.
|
|
34
|
+
* Lower-level helpers such as `useFocusScope` remain named imports.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue `true`
|
|
37
|
+
*/
|
|
38
|
+
composables?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Theme stylesheets to add to `nuxt.options.css`. Nothing is injected by
|
|
41
|
+
* default, so headless apps ship no GhostVue CSS. Requires
|
|
42
|
+
* `@ghostvue/themes` when non-empty.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue `[]`
|
|
45
|
+
*/
|
|
46
|
+
css?: readonly GhostVueNuxtStylesheet[];
|
|
47
|
+
}
|
|
48
|
+
/** One name the module registers, with the package it imports from. */
|
|
49
|
+
export interface GhostVueNuxtImport {
|
|
50
|
+
readonly name: string;
|
|
51
|
+
readonly from: typeof HEADLESS_PACKAGE | typeof THEMES_PACKAGE;
|
|
52
|
+
}
|
|
53
|
+
/** What the module registers for a given set of options. */
|
|
54
|
+
export interface GhostVueNuxtPlan {
|
|
55
|
+
readonly components: readonly GhostVueNuxtImport[];
|
|
56
|
+
readonly composables: readonly GhostVueNuxtImport[];
|
|
57
|
+
/** Module specifiers appended to `nuxt.options.css`. */
|
|
58
|
+
readonly css: readonly string[];
|
|
59
|
+
/** True when the plan imports anything from `@ghostvue/themes`. */
|
|
60
|
+
readonly requiresThemes: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolves options to the exact components, composables, and stylesheets to
|
|
64
|
+
* register. Each component name appears once, so the headless and themed
|
|
65
|
+
* layers never register competing definitions for the same tag.
|
|
66
|
+
*
|
|
67
|
+
* @throws TypeError for an unknown `components` mode or stylesheet name, so a
|
|
68
|
+
* typo fails the build instead of silently shipping a different layer.
|
|
69
|
+
*/
|
|
70
|
+
export declare function planGhostVueNuxt(options?: GhostVueNuxtOptions): GhostVueNuxtPlan;
|
package/dist/plan.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure resolution plan for the Nuxt module. Kept free of `@nuxt/kit` so the
|
|
3
|
+
* headless-versus-themed rules are unit-testable without booting Nuxt.
|
|
4
|
+
*/
|
|
5
|
+
import { headlessComponentNames, headlessComposableNames, themedComponentNames, } from './.registries/auto-imports.generated.js';
|
|
6
|
+
/** Package that headless components and composables import from. */
|
|
7
|
+
export const HEADLESS_PACKAGE = '@ghostvue/vue';
|
|
8
|
+
/** Optional package that themed wrappers and theme stylesheets come from. */
|
|
9
|
+
export const THEMES_PACKAGE = '@ghostvue/themes';
|
|
10
|
+
/** Every accepted stylesheet name, in documentation order. */
|
|
11
|
+
export const ghostVueNuxtStylesheets = [
|
|
12
|
+
'default',
|
|
13
|
+
'calm',
|
|
14
|
+
'vibrant',
|
|
15
|
+
'mono',
|
|
16
|
+
'tokens',
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Resolves options to the exact components, composables, and stylesheets to
|
|
20
|
+
* register. Each component name appears once, so the headless and themed
|
|
21
|
+
* layers never register competing definitions for the same tag.
|
|
22
|
+
*
|
|
23
|
+
* @throws TypeError for an unknown `components` mode or stylesheet name, so a
|
|
24
|
+
* typo fails the build instead of silently shipping a different layer.
|
|
25
|
+
*/
|
|
26
|
+
export function planGhostVueNuxt(options = {}) {
|
|
27
|
+
const mode = options.components ?? 'headless';
|
|
28
|
+
// Runtime guard for untyped (JavaScript) nuxt.config files.
|
|
29
|
+
const modes = ['headless', 'themed', false];
|
|
30
|
+
if (!modes.includes(mode)) {
|
|
31
|
+
throw new TypeError(`[@ghostvue/nuxt] Unknown components mode ${JSON.stringify(mode)}. Use 'headless', 'themed', or false.`);
|
|
32
|
+
}
|
|
33
|
+
const themed = new Set(themedComponentNames);
|
|
34
|
+
// Themed mode covers the union so a future themed-only wrapper still
|
|
35
|
+
// registers; today every themed name also exists headless.
|
|
36
|
+
const names = mode === 'themed'
|
|
37
|
+
? [...new Set([...headlessComponentNames, ...themedComponentNames])]
|
|
38
|
+
: headlessComponentNames;
|
|
39
|
+
const components = mode === false
|
|
40
|
+
? []
|
|
41
|
+
: names.map((name) => ({
|
|
42
|
+
name,
|
|
43
|
+
from: mode === 'themed' && themed.has(name)
|
|
44
|
+
? THEMES_PACKAGE
|
|
45
|
+
: HEADLESS_PACKAGE,
|
|
46
|
+
}));
|
|
47
|
+
const composables = options.composables === false
|
|
48
|
+
? []
|
|
49
|
+
: headlessComposableNames.map((name) => ({
|
|
50
|
+
name,
|
|
51
|
+
from: HEADLESS_PACKAGE,
|
|
52
|
+
}));
|
|
53
|
+
const known = new Set(ghostVueNuxtStylesheets);
|
|
54
|
+
const css = [];
|
|
55
|
+
for (const sheet of options.css ?? []) {
|
|
56
|
+
if (!known.has(sheet)) {
|
|
57
|
+
throw new TypeError(`[@ghostvue/nuxt] Unknown stylesheet ${JSON.stringify(sheet)}. Use one of: ${ghostVueNuxtStylesheets.join(', ')}.`);
|
|
58
|
+
}
|
|
59
|
+
const specifier = `${THEMES_PACKAGE}/${sheet}.css`;
|
|
60
|
+
if (!css.includes(specifier))
|
|
61
|
+
css.push(specifier);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
components,
|
|
65
|
+
composables,
|
|
66
|
+
css,
|
|
67
|
+
requiresThemes: css.length > 0 || components.some(({ from }) => from === THEMES_PACKAGE),
|
|
68
|
+
};
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghostvue/nuxt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Nuxt module for GhostVue: headless auto-imports by default, opt-in themed wrappers and theme CSS.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/zprue743/ghostvue.git",
|
|
9
|
+
"directory": "packages/nuxt"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@nuxt/kit": "4.6.4",
|
|
29
|
+
"@nuxt/schema": "4.6.4"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"nuxt": "^4.6.0",
|
|
33
|
+
"@ghostvue/themes": "^0.2.0",
|
|
34
|
+
"@ghostvue/vue": "^0.2.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"@ghostvue/themes": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"nuxt": "4.6.4",
|
|
43
|
+
"vite": "8.3.5",
|
|
44
|
+
"@ghostvue/themes": "0.2.0",
|
|
45
|
+
"@ghostvue/vue": "0.2.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"prebuild": "pnpm -w registries:write",
|
|
49
|
+
"build": "tsc -p tsconfig.build.json",
|
|
50
|
+
"pretypecheck": "pnpm -w registries:write",
|
|
51
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
52
|
+
}
|
|
53
|
+
}
|