@baklavue/mcp 1.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.
- package/README.md +72 -0
- package/dist/data/component-categories.d.ts +7 -0
- package/dist/data/component-categories.js +48 -0
- package/dist/data/loaders.d.ts +22 -0
- package/dist/data/loaders.js +346 -0
- package/dist/docs/components/accordion.md +601 -0
- package/dist/docs/components/alert.md +233 -0
- package/dist/docs/components/badge.md +100 -0
- package/dist/docs/components/banner.md +231 -0
- package/dist/docs/components/button.md +324 -0
- package/dist/docs/components/checkbox.md +343 -0
- package/dist/docs/components/chip.md +199 -0
- package/dist/docs/components/datepicker.md +243 -0
- package/dist/docs/components/dialog.md +224 -0
- package/dist/docs/components/drawer.md +188 -0
- package/dist/docs/components/dropdown.md +291 -0
- package/dist/docs/components/file-upload.md +248 -0
- package/dist/docs/components/icon.md +142 -0
- package/dist/docs/components/image.md +161 -0
- package/dist/docs/components/index.md +151 -0
- package/dist/docs/components/input.md +407 -0
- package/dist/docs/components/link.md +249 -0
- package/dist/docs/components/notification.md +179 -0
- package/dist/docs/components/pagination.md +168 -0
- package/dist/docs/components/radio.md +221 -0
- package/dist/docs/components/scroll-to-top.md +90 -0
- package/dist/docs/components/select.md +239 -0
- package/dist/docs/components/skeleton.md +79 -0
- package/dist/docs/components/spinner.md +93 -0
- package/dist/docs/components/split-button.md +165 -0
- package/dist/docs/components/stepper.md +337 -0
- package/dist/docs/components/switch.md +144 -0
- package/dist/docs/components/tab.md +140 -0
- package/dist/docs/components/table.md +362 -0
- package/dist/docs/components/tag.md +243 -0
- package/dist/docs/components/textarea.md +190 -0
- package/dist/docs/components/tooltip.md +155 -0
- package/dist/docs/composables/alert.md +87 -0
- package/dist/docs/composables/asyncState.md +74 -0
- package/dist/docs/composables/base64.md +72 -0
- package/dist/docs/composables/breakpoints.md +129 -0
- package/dist/docs/composables/clipboard.md +108 -0
- package/dist/docs/composables/colorScheme.md +110 -0
- package/dist/docs/composables/confirmDialog.md +105 -0
- package/dist/docs/composables/containerScroll.md +89 -0
- package/dist/docs/composables/cookie.md +137 -0
- package/dist/docs/composables/debounce.md +69 -0
- package/dist/docs/composables/disclosure.md +69 -0
- package/dist/docs/composables/elementSize.md +84 -0
- package/dist/docs/composables/fetch.md +257 -0
- package/dist/docs/composables/fieldArray.md +104 -0
- package/dist/docs/composables/file.md +343 -0
- package/dist/docs/composables/focusTrap.md +87 -0
- package/dist/docs/composables/formPersistence.md +69 -0
- package/dist/docs/composables/formState.md +71 -0
- package/dist/docs/composables/formValidation.md +355 -0
- package/dist/docs/composables/format.md +107 -0
- package/dist/docs/composables/id.md +54 -0
- package/dist/docs/composables/index.md +112 -0
- package/dist/docs/composables/infiniteQuery.md +104 -0
- package/dist/docs/composables/intersectionObserver.md +64 -0
- package/dist/docs/composables/lazyQuery.md +68 -0
- package/dist/docs/composables/loading.md +91 -0
- package/dist/docs/composables/mutation.md +83 -0
- package/dist/docs/composables/notification.md +169 -0
- package/dist/docs/composables/pagination.md +109 -0
- package/dist/docs/composables/polling.md +76 -0
- package/dist/docs/composables/previous.md +58 -0
- package/dist/docs/composables/query.md +248 -0
- package/dist/docs/composables/raf.md +78 -0
- package/dist/docs/composables/scrollLock.md +46 -0
- package/dist/docs/composables/scrollToError.md +291 -0
- package/dist/docs/composables/scrollVisibility.md +60 -0
- package/dist/docs/composables/share.md +78 -0
- package/dist/docs/composables/slug.md +58 -0
- package/dist/docs/composables/stepper.md +117 -0
- package/dist/docs/composables/stepperForm.md +74 -0
- package/dist/docs/composables/sticky.md +91 -0
- package/dist/docs/composables/storage.md +193 -0
- package/dist/docs/composables/theme.md +252 -0
- package/dist/docs/composables/themePreset.md +62 -0
- package/dist/docs/composables/throttle.md +76 -0
- package/dist/docs/composables/timer.md +78 -0
- package/dist/docs/composables/toggle.md +55 -0
- package/dist/docs/guide/contributing.md +364 -0
- package/dist/docs/guide/design-tokens.md +29 -0
- package/dist/docs/guide/getting-started.md +181 -0
- package/dist/docs/guide/installation.md +287 -0
- package/dist/docs/guide/localization.md +132 -0
- package/dist/docs/guide/mcp.md +141 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +177 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @baklavue/mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for Baklavue. Exposes Baklavue component APIs, composables, and documentation to AI assistants like Cursor, Claude, and Windsurf.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### From the Baklavue Repo
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# From repo root
|
|
11
|
+
bun run mcp
|
|
12
|
+
|
|
13
|
+
# Or from this package
|
|
14
|
+
cd packages/mcp && bun run start
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### From Another Project (when published)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @baklavue/mcp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Cursor Configuration
|
|
24
|
+
|
|
25
|
+
Add to `.cursor/mcp.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"Baklavue": {
|
|
31
|
+
"command": "bun",
|
|
32
|
+
"args": ["run", "--cwd", "/path/to/baklavue", "mcp"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or with npx (when published):
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"Baklavue": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["@baklavue/mcp"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Tools
|
|
52
|
+
|
|
53
|
+
| Tool | Description |
|
|
54
|
+
|------|-------------|
|
|
55
|
+
| `list_components` | List all Bv* components with categories |
|
|
56
|
+
| `get_component` | Full component documentation |
|
|
57
|
+
| `get_component_metadata` | Props, events, slots only |
|
|
58
|
+
| `list_composables` | List composables |
|
|
59
|
+
| `get_composable` | Composable documentation |
|
|
60
|
+
| `search_components_by_category` | Filter by category |
|
|
61
|
+
| `get_documentation_page` | Get guide pages |
|
|
62
|
+
| `list_documentation_pages` | List guide pages |
|
|
63
|
+
|
|
64
|
+
## Build
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
bun run build
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Documentation
|
|
71
|
+
|
|
72
|
+
See the [MCP Guide](https://erbilnas.github.io/baklavue/guide/mcp) for full setup instructions and usage examples.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component to category mapping for Baklavue components.
|
|
3
|
+
* Based on docs/components/index.md structure.
|
|
4
|
+
*/
|
|
5
|
+
export declare const COMPONENT_CATEGORIES: Record<string, string>;
|
|
6
|
+
export declare const CATEGORY_LABELS: Record<string, string>;
|
|
7
|
+
export declare const COMPONENT_LIST: string[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component to category mapping for Baklavue components.
|
|
3
|
+
* Based on docs/components/index.md structure.
|
|
4
|
+
*/
|
|
5
|
+
export const COMPONENT_CATEGORIES = {
|
|
6
|
+
// Form Components
|
|
7
|
+
Button: "form",
|
|
8
|
+
Input: "form",
|
|
9
|
+
Checkbox: "form",
|
|
10
|
+
Radio: "form",
|
|
11
|
+
Switch: "form",
|
|
12
|
+
Select: "form",
|
|
13
|
+
Textarea: "form",
|
|
14
|
+
FileUpload: "form",
|
|
15
|
+
Datepicker: "form",
|
|
16
|
+
// Feedback Components
|
|
17
|
+
Alert: "feedback",
|
|
18
|
+
Badge: "feedback",
|
|
19
|
+
Banner: "feedback",
|
|
20
|
+
Chip: "feedback",
|
|
21
|
+
Tag: "feedback",
|
|
22
|
+
Notification: "feedback",
|
|
23
|
+
Spinner: "feedback",
|
|
24
|
+
// Layout Components
|
|
25
|
+
Dialog: "layout",
|
|
26
|
+
Drawer: "layout",
|
|
27
|
+
Dropdown: "layout",
|
|
28
|
+
Tooltip: "layout",
|
|
29
|
+
Accordion: "layout",
|
|
30
|
+
Tab: "layout",
|
|
31
|
+
Stepper: "layout",
|
|
32
|
+
// Navigation Components
|
|
33
|
+
Link: "navigation",
|
|
34
|
+
Pagination: "navigation",
|
|
35
|
+
SplitButton: "navigation",
|
|
36
|
+
// Data Display
|
|
37
|
+
Table: "data",
|
|
38
|
+
Icon: "data",
|
|
39
|
+
Image: "data",
|
|
40
|
+
};
|
|
41
|
+
export const CATEGORY_LABELS = {
|
|
42
|
+
form: "Form",
|
|
43
|
+
feedback: "Feedback",
|
|
44
|
+
layout: "Layout",
|
|
45
|
+
navigation: "Navigation",
|
|
46
|
+
data: "Data",
|
|
47
|
+
};
|
|
48
|
+
export const COMPONENT_LIST = Object.keys(COMPONENT_CATEGORIES);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ComponentInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
bvName: string;
|
|
4
|
+
category: string;
|
|
5
|
+
categoryLabel: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ComposableInfo {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function listComponents(): ComponentInfo[];
|
|
13
|
+
export declare function getComponentDoc(componentName: string): string | null;
|
|
14
|
+
export declare function getComponentMetadata(componentName: string): {
|
|
15
|
+
props?: string;
|
|
16
|
+
events?: string;
|
|
17
|
+
slots?: string;
|
|
18
|
+
} | null;
|
|
19
|
+
export declare function listComposables(): ComposableInfo[];
|
|
20
|
+
export declare function getComposableDoc(composableName: string): string | null;
|
|
21
|
+
export declare function getDocumentationPage(path: string): string | null;
|
|
22
|
+
export declare function listDocumentationPages(): string[];
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { CATEGORY_LABELS, COMPONENT_CATEGORIES, COMPONENT_LIST, } from "./component-categories.js";
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
/**
|
|
7
|
+
* Resolve docs path for MCP server.
|
|
8
|
+
* - When published (npx @baklavue/mcp): docs are bundled at dist/docs/
|
|
9
|
+
* - When running from monorepo: docs are at repo root docs/
|
|
10
|
+
*/
|
|
11
|
+
function getDocsPath() {
|
|
12
|
+
// Published package: loaders are in dist/data/, docs are in dist/docs/
|
|
13
|
+
const packageDocs = join(__dirname, "..", "docs");
|
|
14
|
+
if (existsSync(join(packageDocs, "components"))) {
|
|
15
|
+
return packageDocs;
|
|
16
|
+
}
|
|
17
|
+
// Monorepo: repo root has docs/
|
|
18
|
+
const cwd = process.cwd();
|
|
19
|
+
if (existsSync(join(cwd, "docs")) && existsSync(join(cwd, "packages"))) {
|
|
20
|
+
return join(cwd, "docs");
|
|
21
|
+
}
|
|
22
|
+
const mcpParent = join(cwd, "..", "..");
|
|
23
|
+
if (existsSync(join(mcpParent, "docs"))) {
|
|
24
|
+
return join(mcpParent, "docs");
|
|
25
|
+
}
|
|
26
|
+
return packageDocs;
|
|
27
|
+
}
|
|
28
|
+
const docsPath = getDocsPath();
|
|
29
|
+
export function listComponents() {
|
|
30
|
+
return COMPONENT_LIST.map((name) => {
|
|
31
|
+
const category = COMPONENT_CATEGORIES[name] ?? "other";
|
|
32
|
+
return {
|
|
33
|
+
name,
|
|
34
|
+
bvName: `Bv${name}`,
|
|
35
|
+
category,
|
|
36
|
+
categoryLabel: CATEGORY_LABELS[category] ?? category,
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export function getComponentDoc(componentName) {
|
|
41
|
+
const normalized = componentName.replace(/^Bv/, "");
|
|
42
|
+
const path = join(docsPath, "components", `${normalized.toLowerCase()}.md`);
|
|
43
|
+
if (!existsSync(path))
|
|
44
|
+
return null;
|
|
45
|
+
return readFileSync(path, "utf-8");
|
|
46
|
+
}
|
|
47
|
+
export function getComponentMetadata(componentName) {
|
|
48
|
+
const doc = getComponentDoc(componentName);
|
|
49
|
+
if (!doc)
|
|
50
|
+
return null;
|
|
51
|
+
const result = {};
|
|
52
|
+
// Extract Props table (between ## Props and next ## or end)
|
|
53
|
+
const propsMatch = doc.match(/## Props\s*\n\n([\s\S]*?)(?=\n## |$)/);
|
|
54
|
+
if (propsMatch)
|
|
55
|
+
result.props = propsMatch[1].trim();
|
|
56
|
+
// Extract Events table
|
|
57
|
+
const eventsMatch = doc.match(/## Events\s*\n\n([\s\S]*?)(?=\n## |$)/);
|
|
58
|
+
if (eventsMatch)
|
|
59
|
+
result.events = eventsMatch[1].trim();
|
|
60
|
+
// Extract Slots table
|
|
61
|
+
const slotsMatch = doc.match(/## Slots\s*\n\n([\s\S]*?)(?=\n## |$)/);
|
|
62
|
+
if (slotsMatch)
|
|
63
|
+
result.slots = slotsMatch[1].trim();
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
export function listComposables() {
|
|
67
|
+
const indexPath = join(docsPath, "composables", "index.md");
|
|
68
|
+
if (!existsSync(indexPath))
|
|
69
|
+
return [];
|
|
70
|
+
const composables = [
|
|
71
|
+
{ name: "useFile", description: "Parse, create, and download CSV, TSV, and JSON files" },
|
|
72
|
+
{
|
|
73
|
+
name: "useNotification",
|
|
74
|
+
description: "Programmatically manage notifications",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "useScrollToError",
|
|
78
|
+
description: "Scroll to element with validation error",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "useZodForm",
|
|
82
|
+
description: "Form validation with Zod schemas",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "useBaklavaTheme",
|
|
86
|
+
description: "Overwrite Baklava colors (Vue preset or custom)",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "useDisclosure",
|
|
90
|
+
description: "Open/close state for Dialog, Drawer, Dropdown",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "usePagination",
|
|
94
|
+
description: "Pagination state for tables and lists",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "useConfirmDialog",
|
|
98
|
+
description: "Confirm/cancel dialog flow",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "useClipboard",
|
|
102
|
+
description: "Copy text to clipboard. Supports source, copiedDuring, legacy fallback, isSupported",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: "useShare",
|
|
106
|
+
description: "Share text, URLs, or files via Web Share API",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "useBase64",
|
|
110
|
+
description: "Convert Blob/File/ArrayBuffer/canvas to Base64 data URLs",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "usePrevious",
|
|
114
|
+
description: "Track previous value of a ref for diffing or undo logic",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "useToggle",
|
|
118
|
+
description: "Simple boolean toggle",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "useDateFormat",
|
|
122
|
+
description: "Reactive locale-aware date formatting (Intl)",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "useNumberFormat",
|
|
126
|
+
description: "Reactive locale-aware number/currency formatting (Intl)",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "useSlug",
|
|
130
|
+
description: "Convert string to URL-friendly slug",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "useAsyncState",
|
|
134
|
+
description: "Generic async state (loading, error, data) without fetch",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "useBreakpoints",
|
|
138
|
+
description: "Responsive breakpoints (isMobile, isTablet, isDesktop)",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "useMediaQuery",
|
|
142
|
+
description: "Single media query matcher",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "useCookie",
|
|
146
|
+
description: "Reactive sync with document.cookie",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "useLocalStorage",
|
|
150
|
+
description: "Reactive sync with localStorage",
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "useSessionStorage",
|
|
154
|
+
description: "Reactive sync with sessionStorage",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "useDebounceFn",
|
|
158
|
+
description: "Debounce function execution",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "useDebouncedRef",
|
|
162
|
+
description: "Debounced ref value",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "useThrottleFn",
|
|
166
|
+
description: "Throttle function execution",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "useThrottledRef",
|
|
170
|
+
description: "Throttled ref value",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "useIntervalFn",
|
|
174
|
+
description: "Pausable interval",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "useTimeoutFn",
|
|
178
|
+
description: "Cancellable timeout",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "createFetch",
|
|
182
|
+
description: "Create preconfigured useFetch instance (axios.create-like)",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "useFetch",
|
|
186
|
+
description: "Reactive fetch with loading/error/data (axios-like API)",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "useQuery",
|
|
190
|
+
description: "Data fetching with caching, retries, and invalidation",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "useQueryClient",
|
|
194
|
+
description: "Cache invalidation and manual cache access for useQuery",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "useMutation",
|
|
198
|
+
description: "Mutations (POST/PUT/DELETE) with cache invalidation",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "useInfiniteQuery",
|
|
202
|
+
description: "Infinite scroll / cursor-based pagination",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "useLazyQuery",
|
|
206
|
+
description: "On-demand queries that fetch when execute() is called",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "usePolling",
|
|
210
|
+
description: "Polling with fetch state for non-query scenarios",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "useIntersectionObserver",
|
|
214
|
+
description: "Detect element visibility in viewport",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "useRafFn",
|
|
218
|
+
description: "Animation frame loop",
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "useStepper",
|
|
222
|
+
description: "Multi-step wizard state for BvStepper",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "useScrollVisibility",
|
|
226
|
+
description: "Scroll-based visibility for scroll-to-top and sticky UI",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "useScrollLock",
|
|
230
|
+
description: "Lock body scroll when modals/drawers are open",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "useAlert",
|
|
234
|
+
description: "Programmatic show/hide for inline BvAlert",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "useLoading",
|
|
238
|
+
description: "Generic loading state with optional delay",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "useFocusTrap",
|
|
242
|
+
description: "Trap focus within modals/dialogs",
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: "useId",
|
|
246
|
+
description: "Stable unique IDs for accessibility attributes",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "useFormState",
|
|
250
|
+
description: "Form dirty and touched state without validation",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: "useFieldArray",
|
|
254
|
+
description: "Dynamic array fields for forms",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "useFormPersistence",
|
|
258
|
+
description: "Auto-save form data to localStorage/sessionStorage",
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "useStepperForm",
|
|
262
|
+
description: "Multi-step form validation with useStepper",
|
|
263
|
+
},
|
|
264
|
+
];
|
|
265
|
+
return composables;
|
|
266
|
+
}
|
|
267
|
+
const COMPOSABLE_TO_FILE = {
|
|
268
|
+
useFile: "file",
|
|
269
|
+
useNotification: "notification",
|
|
270
|
+
useScrollToError: "scrollToError",
|
|
271
|
+
useZodForm: "formValidation",
|
|
272
|
+
useBaklavaTheme: "theme",
|
|
273
|
+
useDisclosure: "disclosure",
|
|
274
|
+
usePagination: "pagination",
|
|
275
|
+
useConfirmDialog: "confirmDialog",
|
|
276
|
+
useClipboard: "clipboard",
|
|
277
|
+
useShare: "share",
|
|
278
|
+
useBase64: "base64",
|
|
279
|
+
usePrevious: "previous",
|
|
280
|
+
useToggle: "toggle",
|
|
281
|
+
useDateFormat: "format",
|
|
282
|
+
useNumberFormat: "format",
|
|
283
|
+
useSlug: "slug",
|
|
284
|
+
useAsyncState: "asyncState",
|
|
285
|
+
useBreakpoints: "breakpoints",
|
|
286
|
+
useMediaQuery: "breakpoints",
|
|
287
|
+
useCookie: "cookie",
|
|
288
|
+
useLocalStorage: "storage",
|
|
289
|
+
useSessionStorage: "storage",
|
|
290
|
+
useDebounceFn: "debounce",
|
|
291
|
+
useDebouncedRef: "debounce",
|
|
292
|
+
useThrottleFn: "throttle",
|
|
293
|
+
useThrottledRef: "throttle",
|
|
294
|
+
useIntervalFn: "timer",
|
|
295
|
+
useTimeoutFn: "timer",
|
|
296
|
+
createFetch: "fetch",
|
|
297
|
+
useFetch: "fetch",
|
|
298
|
+
useQuery: "query",
|
|
299
|
+
useQueryClient: "query",
|
|
300
|
+
useMutation: "mutation",
|
|
301
|
+
useInfiniteQuery: "infiniteQuery",
|
|
302
|
+
useLazyQuery: "lazyQuery",
|
|
303
|
+
usePolling: "polling",
|
|
304
|
+
useIntersectionObserver: "intersectionObserver",
|
|
305
|
+
useRafFn: "raf",
|
|
306
|
+
useStepper: "stepper",
|
|
307
|
+
useScrollVisibility: "scrollVisibility",
|
|
308
|
+
useScrollLock: "scrollLock",
|
|
309
|
+
useAlert: "alert",
|
|
310
|
+
useLoading: "loading",
|
|
311
|
+
useFocusTrap: "focusTrap",
|
|
312
|
+
useId: "id",
|
|
313
|
+
useFormState: "formState",
|
|
314
|
+
useFieldArray: "fieldArray",
|
|
315
|
+
useFormPersistence: "formPersistence",
|
|
316
|
+
useStepperForm: "stepperForm",
|
|
317
|
+
};
|
|
318
|
+
export function getComposableDoc(composableName) {
|
|
319
|
+
const file = COMPOSABLE_TO_FILE[composableName] ??
|
|
320
|
+
composableName.replace(/^use/, "").toLowerCase();
|
|
321
|
+
const path = join(docsPath, "composables", `${file}.md`);
|
|
322
|
+
if (!existsSync(path))
|
|
323
|
+
return null;
|
|
324
|
+
return readFileSync(path, "utf-8");
|
|
325
|
+
}
|
|
326
|
+
export function getDocumentationPage(path) {
|
|
327
|
+
// path could be "installation", "getting-started", "design-tokens", etc.
|
|
328
|
+
const normalized = path.replace(/^\//, "").replace(/\.md$/, "");
|
|
329
|
+
const fullPath = join(docsPath, "guide", `${normalized}.md`);
|
|
330
|
+
if (!existsSync(fullPath))
|
|
331
|
+
return null;
|
|
332
|
+
return readFileSync(fullPath, "utf-8");
|
|
333
|
+
}
|
|
334
|
+
export function listDocumentationPages() {
|
|
335
|
+
const guidePath = join(docsPath, "guide");
|
|
336
|
+
if (!existsSync(guidePath))
|
|
337
|
+
return [];
|
|
338
|
+
try {
|
|
339
|
+
return readdirSync(guidePath)
|
|
340
|
+
.filter((f) => f.endsWith(".md"))
|
|
341
|
+
.map((f) => f.replace(".md", ""));
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
return ["installation", "getting-started", "design-tokens", "contributing"];
|
|
345
|
+
}
|
|
346
|
+
}
|