@bridge-ui/vue 0.0.7 → 0.0.8
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/ai/AGENTS.md +31 -0
- package/ai/README.md +35 -0
- package/ai/guidelines/core.md +44 -0
- package/ai/llms.txt +38 -0
- package/ai/skills/bridge-ui-components/SKILL.md +37 -0
- package/ai/skills/bridge-ui-forms/SKILL.md +38 -0
- package/ai/skills/bridge-ui-overlays/SKILL.md +37 -0
- package/ai/skills/bridge-ui-setup/SKILL.md +38 -0
- package/bin/__tests__/ai.test.ts +319 -0
- package/bin/ai.mjs +469 -0
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +5 -5
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +6 -2
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/BaseField/BaseField.js +5 -0
- package/dist/Components/BaseField/BaseField.vue.d.ts +15 -0
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/Components/BaseField/BaseFieldLabel.js +5 -0
- package/dist/Components/{OtpField/OtpFieldLabel.vue.d.ts → BaseField/BaseFieldLabel.vue.d.ts} +2 -2
- package/dist/Components/{OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js → BaseField/BaseFieldLabel.vue_vue_type_script_setup_true_lang.js} +2 -2
- package/dist/Components/BaseField/baseField.types.d.ts +222 -0
- package/dist/Components/BaseField/composables/useBaseField.d.ts +55 -0
- package/dist/Components/BaseField/composables/useBaseField.js +131 -0
- package/dist/Components/BaseField/index.d.ts +4 -0
- package/dist/Components/BaseField/index.js +3 -0
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -1
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
- package/dist/Components/Chip/Chip.vue.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.vue.d.ts +2 -2
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +11 -2
- package/dist/Components/FormControl/composables/useFormControl.js +57 -53
- package/dist/Components/FormControl/index.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.d.ts +5 -1
- package/dist/Components/FormField/composables/useFormField.js +1 -1
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +3 -3
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -1
- package/dist/Components/Listbox/composables/useListbox.js +20 -20
- package/dist/Components/Listbox/index.d.ts +1 -0
- package/dist/Components/Listbox/listbox.types.d.ts +6 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Modal/Modal.vue.d.ts +2 -2
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/NumberField/NumberField.vue.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.js +4 -1
- package/dist/Components/OtpField/OtpField.vue.d.ts +3 -3
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +34 -52
- package/dist/Components/OtpField/composables/useOtpField.d.ts +40 -213
- package/dist/Components/OtpField/composables/useOtpField.js +92 -150
- package/dist/Components/OtpField/otpField.types.d.ts +10 -180
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/PasswordField/composables/usePasswordField.js +4 -1
- package/dist/Components/Radio/composables/useRadio.d.ts +1 -1
- package/dist/Components/Radio/composables/useRadio.js +1 -1
- package/dist/Components/Select/Select.vue.d.ts +4 -4
- package/dist/Components/Select/composables/useSelect.d.ts +3 -2
- package/dist/Components/Select/composables/useSelect.js +6 -2
- package/dist/Components/Slider/Slider.js +5 -0
- package/dist/Components/Slider/Slider.vue.d.ts +25 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +482 -0
- package/dist/Components/Slider/composables/useSlider.js +287 -0
- package/dist/Components/Slider/index.d.ts +4 -0
- package/dist/Components/Slider/index.js +3 -0
- package/dist/Components/Slider/slider.types.d.ts +169 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +1 -1
- package/dist/Components/Switch/composables/useSwitch.js +1 -1
- package/dist/Components/Tabs/Tabs.vue.d.ts +2 -2
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/TextField/composables/useTextField.js +1 -1
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.js +1 -0
- package/dist/Utils/index.d.ts +3 -3
- package/dist/Utils/index.js +5 -2
- package/dist/augments.d.ts +29 -17
- package/dist/index.d.ts +5 -1
- package/dist/index.js +59 -55
- package/docs/README.md +56 -0
- package/docs/components/Alert.md +96 -0
- package/docs/components/Autocomplete.md +198 -0
- package/docs/components/Avatar.md +60 -0
- package/docs/components/Badge.md +47 -0
- package/docs/components/BaseField.md +126 -0
- package/docs/components/BridgeUIProvider.md +151 -0
- package/docs/components/Button.md +93 -0
- package/docs/components/Card.md +287 -0
- package/docs/components/Checkbox.md +87 -0
- package/docs/components/Divider.md +56 -0
- package/docs/components/Drawer.md +137 -0
- package/docs/components/FormControl.md +66 -0
- package/docs/components/FormField.md +71 -0
- package/docs/components/I18n.md +125 -0
- package/docs/components/Icon.md +88 -0
- package/docs/components/Label.md +31 -0
- package/docs/components/Link.md +71 -0
- package/docs/components/List.md +167 -0
- package/docs/components/Menu.md +97 -0
- package/docs/components/Modal.md +154 -0
- package/docs/components/NumberField.md +80 -0
- package/docs/components/OtpField.md +133 -0
- package/docs/components/PasswordField.md +82 -0
- package/docs/components/Progress.md +68 -0
- package/docs/components/Radio.md +91 -0
- package/docs/components/Select.md +181 -0
- package/docs/components/Skeleton.md +38 -0
- package/docs/components/Slider.md +140 -0
- package/docs/components/Snackbar.md +99 -0
- package/docs/components/Spinner.md +61 -0
- package/docs/components/Switch.md +72 -0
- package/docs/components/Tabs.md +207 -0
- package/docs/components/TextField.md +72 -0
- package/docs/components/Textarea.md +80 -0
- package/docs/components/Tooltip.md +125 -0
- package/docs/components/useBreakpoint.md +100 -0
- package/docs/components/useDialogAction.md +97 -0
- package/docs/components/useDrawerAction.md +75 -0
- package/docs/components/useModalAction.md +75 -0
- package/docs/components/useSnackbarAction.md +85 -0
- package/docs/examples/i18n-dictionary.ts +48 -0
- package/docs/examples/i18n-vue-i18n.ts +34 -0
- package/docs/examples/icon-fontawesome.ts +112 -0
- package/docs/examples/icon-heroicons.ts +57 -0
- package/docs/examples/icon-lucide.ts +57 -0
- package/docs/examples/icon-phosphor.ts +57 -0
- package/docs/examples/icon-tabler.ts +57 -0
- package/package.json +12 -5
- package/dist/Components/OtpField/OtpFieldLabel.js +0 -5
package/bin/ai.mjs
ADDED
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Install Bridge UI agent guidelines, docs, and skills into a consumer app.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* npx bridge-ui-vue-ai install|remove [--copy] [--cwd <dir>]
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
cpSync,
|
|
11
|
+
existsSync,
|
|
12
|
+
lstatSync,
|
|
13
|
+
mkdirSync,
|
|
14
|
+
readdirSync,
|
|
15
|
+
readFileSync,
|
|
16
|
+
readlinkSync,
|
|
17
|
+
realpathSync,
|
|
18
|
+
rmdirSync,
|
|
19
|
+
rmSync,
|
|
20
|
+
symlinkSync,
|
|
21
|
+
writeFileSync,
|
|
22
|
+
} from "node:fs";
|
|
23
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Package context
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
31
|
+
const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
|
|
32
|
+
|
|
33
|
+
const packageName = pkg.name;
|
|
34
|
+
const aiRoot = join(packageRoot, "ai");
|
|
35
|
+
const docsRoot = join(packageRoot, "docs");
|
|
36
|
+
const binName = Object.keys(pkg.bin ?? {})[0] ?? "bridge-ui-ai";
|
|
37
|
+
|
|
38
|
+
const MARK_END = "<!-- bridge-ui-ai:end -->";
|
|
39
|
+
const MARK_START = "<!-- bridge-ui-ai:start -->";
|
|
40
|
+
const MARK_BLOCK = new RegExp(`${MARK_START}[\\s\\S]*?${MARK_END}`, "m");
|
|
41
|
+
const MARK_BLOCK_PADDED = new RegExp(
|
|
42
|
+
`\\n*${MARK_START}[\\s\\S]*?${MARK_END}\\n*`,
|
|
43
|
+
"m",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
/** Paths linked/copied into the consumer app (relative dest → absolute source). */
|
|
47
|
+
function installTargets() {
|
|
48
|
+
return [
|
|
49
|
+
{ dest: ".ai/docs", src: docsRoot },
|
|
50
|
+
{ dest: "llms.txt", src: join(aiRoot, "llms.txt") },
|
|
51
|
+
{ dest: ".ai/AGENTS.md", src: join(aiRoot, "AGENTS.md") },
|
|
52
|
+
{ dest: ".ai/guidelines", src: join(aiRoot, "guidelines") },
|
|
53
|
+
].filter(({ src }) => existsSync(src));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function skillTargets() {
|
|
57
|
+
const skillsDir = join(aiRoot, "skills");
|
|
58
|
+
|
|
59
|
+
if (!existsSync(skillsDir)) return [];
|
|
60
|
+
|
|
61
|
+
return readdirSync(skillsDir, { withFileTypes: true })
|
|
62
|
+
.filter((entry) => entry.isDirectory())
|
|
63
|
+
.map((entry) => entry.name)
|
|
64
|
+
.sort()
|
|
65
|
+
.map((name) => ({
|
|
66
|
+
dest: join(".cursor", "skills", name),
|
|
67
|
+
src: join(skillsDir, name),
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// CLI
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
|
|
75
|
+
function printHelp() {
|
|
76
|
+
console.log(`Usage: ${binName} <command> [options]
|
|
77
|
+
|
|
78
|
+
Commands:
|
|
79
|
+
install Link (or copy) AI guidelines, docs, and skills into the app
|
|
80
|
+
remove Remove links/copies created by install
|
|
81
|
+
help Show this help
|
|
82
|
+
|
|
83
|
+
Options:
|
|
84
|
+
--copy Copy files instead of symlinking (Windows / PnP fallback)
|
|
85
|
+
--cwd App root (default: process.cwd())
|
|
86
|
+
`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function parseArgs(argv) {
|
|
90
|
+
const args = { command: "help", copy: false, cwd: process.cwd() };
|
|
91
|
+
|
|
92
|
+
for (let i = 0; i < argv.length; i++) {
|
|
93
|
+
const arg = argv[i];
|
|
94
|
+
|
|
95
|
+
if (arg === "--copy") {
|
|
96
|
+
args.copy = true;
|
|
97
|
+
} else if (arg === "--cwd") {
|
|
98
|
+
args.cwd = resolve(argv[++i] ?? process.cwd());
|
|
99
|
+
} else if (arg === "-h" || arg === "--help") {
|
|
100
|
+
args.command = "help";
|
|
101
|
+
} else if (!arg.startsWith("-") && args.command === "help") {
|
|
102
|
+
args.command = arg;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return args;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
// Filesystem helpers
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
function pathExists(path) {
|
|
114
|
+
try {
|
|
115
|
+
lstatSync(path);
|
|
116
|
+
return true;
|
|
117
|
+
} catch {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function removePath(path) {
|
|
123
|
+
if (!pathExists(path)) return;
|
|
124
|
+
|
|
125
|
+
rmSync(path, { recursive: true, force: true });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function linkTypeFor(target) {
|
|
129
|
+
if (lstatSync(target).isDirectory()) {
|
|
130
|
+
return process.platform === "win32" ? "junction" : "dir";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return "file";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** @returns {"linked" | "copied"} */
|
|
137
|
+
function linkOrCopy(target, dest, { copy }) {
|
|
138
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
139
|
+
removePath(dest);
|
|
140
|
+
|
|
141
|
+
if (!copy) {
|
|
142
|
+
try {
|
|
143
|
+
symlinkSync(target, dest, linkTypeFor(target));
|
|
144
|
+
return "linked";
|
|
145
|
+
} catch (err) {
|
|
146
|
+
console.warn(`Symlink failed (${err.message}); falling back to copy.`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
cpSync(target, dest, { recursive: true });
|
|
151
|
+
|
|
152
|
+
return "copied";
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function isSymlink(path) {
|
|
156
|
+
try {
|
|
157
|
+
return lstatSync(path).isSymbolicLink();
|
|
158
|
+
} catch {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function resolvesUnder(path, root, fileName) {
|
|
164
|
+
if (!pathExists(path)) return false;
|
|
165
|
+
try {
|
|
166
|
+
const real = realpathSync(path);
|
|
167
|
+
|
|
168
|
+
return real === join(root, fileName) || real.startsWith(`${root}/`);
|
|
169
|
+
} catch {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** True when `path` is a real file whose contents match the package AGENTS.md. */
|
|
175
|
+
function isPackageAgentsCopy(path) {
|
|
176
|
+
const src = join(aiRoot, "AGENTS.md");
|
|
177
|
+
|
|
178
|
+
if (!existsSync(src) || !existsSync(path) || isSymlink(path)) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
try {
|
|
183
|
+
return readFileSync(path, "utf8") === readFileSync(src, "utf8");
|
|
184
|
+
} catch {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function removeEmptyDir(path) {
|
|
190
|
+
try {
|
|
191
|
+
rmdirSync(path);
|
|
192
|
+
return true;
|
|
193
|
+
} catch {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function cleanupEmptyDirs(appRoot) {
|
|
199
|
+
const cleaned = [];
|
|
200
|
+
|
|
201
|
+
for (const rel of [".ai", join(".cursor", "skills"), ".cursor"]) {
|
|
202
|
+
if (removeEmptyDir(join(appRoot, rel))) {
|
|
203
|
+
cleaned.push(rel.replaceAll("\\", "/"));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return cleaned;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function assertAiPresent() {
|
|
211
|
+
if (existsSync(aiRoot)) return;
|
|
212
|
+
console.error(`Missing AI resources in ${packageName}: expected ${aiRoot}`);
|
|
213
|
+
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function logResults(title, results) {
|
|
218
|
+
console.log(title);
|
|
219
|
+
|
|
220
|
+
for (const { mode, dest } of results) {
|
|
221
|
+
console.log(` ${String(mode).padEnd(7)} ${dest}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
// AGENTS.md / CLAUDE.md
|
|
227
|
+
// ---------------------------------------------------------------------------
|
|
228
|
+
|
|
229
|
+
function agentsSnippet(skills) {
|
|
230
|
+
const skillList = skills
|
|
231
|
+
.map(({ dest }) => `- \`${dest.replaceAll("\\", "/")}\``)
|
|
232
|
+
.join("\n");
|
|
233
|
+
|
|
234
|
+
return `${MARK_START}
|
|
235
|
+
## Bridge UI
|
|
236
|
+
|
|
237
|
+
This app uses **${packageName}**. Full agent guide: \`.ai/AGENTS.md\` (also see \`llms.txt\`).
|
|
238
|
+
|
|
239
|
+
- Docs: \`.ai/docs/\` (component API and examples)
|
|
240
|
+
- Guidelines: \`.ai/guidelines/core.md\`
|
|
241
|
+
- Skills (on demand):
|
|
242
|
+
${skillList}
|
|
243
|
+
|
|
244
|
+
Install/update: \`npx ${binName} install\`
|
|
245
|
+
${MARK_END}
|
|
246
|
+
`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function upsertAgentsMd(appRoot, skills) {
|
|
250
|
+
let next;
|
|
251
|
+
const snippet = agentsSnippet(skills);
|
|
252
|
+
const path = join(appRoot, "AGENTS.md");
|
|
253
|
+
|
|
254
|
+
// Never write through a symlink (would mutate package sources under file: installs).
|
|
255
|
+
if (isSymlink(path)) {
|
|
256
|
+
removePath(path);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!existsSync(path)) {
|
|
260
|
+
// Stub only — strip on remove deletes the file cleanly.
|
|
261
|
+
next = `${snippet.trimEnd()}\n`;
|
|
262
|
+
} else {
|
|
263
|
+
const prev = readFileSync(path, "utf8");
|
|
264
|
+
|
|
265
|
+
if (prev.includes(MARK_START) && prev.includes(MARK_END)) {
|
|
266
|
+
next = prev.replace(MARK_BLOCK, snippet.trimEnd());
|
|
267
|
+
} else {
|
|
268
|
+
next = `${prev.trimEnd()}\n\n${snippet}\n`;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
writeFileSync(path, next.endsWith("\n") ? next : `${next}\n`);
|
|
273
|
+
return path;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function stripAgentsMd(appRoot) {
|
|
277
|
+
const path = join(appRoot, "AGENTS.md");
|
|
278
|
+
|
|
279
|
+
if (!pathExists(path)) return null;
|
|
280
|
+
|
|
281
|
+
// Legacy installs that linked/copied the full package guide to the root.
|
|
282
|
+
if (isPackageAgentsCopy(path) || resolvesUnder(path, aiRoot, "AGENTS.md")) {
|
|
283
|
+
removePath(path);
|
|
284
|
+
return path;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (!existsSync(path)) return null;
|
|
288
|
+
|
|
289
|
+
const prev = readFileSync(path, "utf8");
|
|
290
|
+
|
|
291
|
+
if (!prev.includes(MARK_START)) return null;
|
|
292
|
+
|
|
293
|
+
const next = prev.replace(MARK_BLOCK_PADDED, "\n").trimEnd();
|
|
294
|
+
|
|
295
|
+
if (!next.trim()) {
|
|
296
|
+
rmSync(path, { force: true });
|
|
297
|
+
return path;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
writeFileSync(path, `${next}\n`);
|
|
301
|
+
|
|
302
|
+
return path;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Root AGENTS.md is always a short stub (or inject into the app's own file).
|
|
307
|
+
* Full guide lives at `.ai/AGENTS.md` only.
|
|
308
|
+
*/
|
|
309
|
+
function installRootAgents(appRoot, skills) {
|
|
310
|
+
const dest = join(appRoot, "AGENTS.md");
|
|
311
|
+
const rel = relative(appRoot, dest);
|
|
312
|
+
|
|
313
|
+
// Legacy full-guide link/copy or foreign Bridge symlink → replace with stub.
|
|
314
|
+
if (
|
|
315
|
+
isSymlink(dest) ||
|
|
316
|
+
isPackageAgentsCopy(dest) ||
|
|
317
|
+
resolvesUnder(dest, aiRoot, "AGENTS.md")
|
|
318
|
+
) {
|
|
319
|
+
removePath(dest);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
upsertAgentsMd(appRoot, skills);
|
|
323
|
+
|
|
324
|
+
return { dest: rel, mode: "updated" };
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/** True when CLAUDE.md is our symlink/copy of the root AGENTS.md stub. */
|
|
328
|
+
function isClaudeBridgeManaged(appRoot, claudePath) {
|
|
329
|
+
const agents = join(appRoot, "AGENTS.md");
|
|
330
|
+
|
|
331
|
+
if (!pathExists(claudePath) || !pathExists(agents)) return false;
|
|
332
|
+
|
|
333
|
+
if (isSymlink(claudePath)) {
|
|
334
|
+
try {
|
|
335
|
+
return realpathSync(claudePath) === realpathSync(agents);
|
|
336
|
+
} catch {
|
|
337
|
+
try {
|
|
338
|
+
const target = readlinkSync(claudePath);
|
|
339
|
+
|
|
340
|
+
return resolve(dirname(claudePath), target) === agents;
|
|
341
|
+
} catch {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
try {
|
|
348
|
+
return readFileSync(claudePath, "utf8") === readFileSync(agents, "utf8");
|
|
349
|
+
} catch {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function installClaudeMd(appRoot, { copy }) {
|
|
355
|
+
const dest = join(appRoot, "CLAUDE.md");
|
|
356
|
+
const agents = join(appRoot, "AGENTS.md");
|
|
357
|
+
|
|
358
|
+
if (!existsSync(agents)) return null;
|
|
359
|
+
|
|
360
|
+
// App already has its own CLAUDE.md → leave it alone.
|
|
361
|
+
if (pathExists(dest) && !isClaudeBridgeManaged(appRoot, dest)) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
return {
|
|
366
|
+
dest: "CLAUDE.md",
|
|
367
|
+
mode: linkOrCopy(agents, dest, { copy }),
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function stripClaudeMd(appRoot) {
|
|
372
|
+
const path = join(appRoot, "CLAUDE.md");
|
|
373
|
+
|
|
374
|
+
if (!isClaudeBridgeManaged(appRoot, path)) return null;
|
|
375
|
+
|
|
376
|
+
removePath(path);
|
|
377
|
+
return path;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// ---------------------------------------------------------------------------
|
|
381
|
+
// Commands
|
|
382
|
+
// ---------------------------------------------------------------------------
|
|
383
|
+
|
|
384
|
+
function install({ cwd: appRoot, copy }) {
|
|
385
|
+
assertAiPresent();
|
|
386
|
+
|
|
387
|
+
const results = [];
|
|
388
|
+
const skills = skillTargets();
|
|
389
|
+
|
|
390
|
+
for (const { src, dest } of [...installTargets(), ...skills]) {
|
|
391
|
+
results.push({
|
|
392
|
+
dest,
|
|
393
|
+
mode: linkOrCopy(src, join(appRoot, dest), { copy }),
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
results.push(installRootAgents(appRoot, skills));
|
|
398
|
+
|
|
399
|
+
const claude = installClaudeMd(appRoot, { copy });
|
|
400
|
+
|
|
401
|
+
if (claude) results.push(claude);
|
|
402
|
+
|
|
403
|
+
logResults(`Installed Bridge UI AI resources from ${packageName}`, results);
|
|
404
|
+
|
|
405
|
+
console.log(`\nPackage AI root: ${aiRoot}`);
|
|
406
|
+
|
|
407
|
+
try {
|
|
408
|
+
console.log(`Resolved: ${realpathSync(aiRoot)}`);
|
|
409
|
+
} catch {
|
|
410
|
+
/* ignore */
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
function remove({ cwd: appRoot }) {
|
|
415
|
+
const removed = [];
|
|
416
|
+
|
|
417
|
+
for (const { dest } of [...installTargets(), ...skillTargets()]) {
|
|
418
|
+
const absolute = join(appRoot, dest);
|
|
419
|
+
|
|
420
|
+
if (!pathExists(absolute)) continue;
|
|
421
|
+
|
|
422
|
+
removePath(absolute);
|
|
423
|
+
removed.push(dest);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// CLAUDE before AGENTS so content/realpath checks still resolve.
|
|
427
|
+
const claude = stripClaudeMd(appRoot);
|
|
428
|
+
const agents = stripAgentsMd(appRoot);
|
|
429
|
+
const emptyDirs = cleanupEmptyDirs(appRoot);
|
|
430
|
+
|
|
431
|
+
console.log(`Removed Bridge UI AI resources for ${packageName}`);
|
|
432
|
+
|
|
433
|
+
for (const path of removed) {
|
|
434
|
+
console.log(` removed ${path}`);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (claude) {
|
|
438
|
+
console.log(` cleaned ${relative(appRoot, claude)}`);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (agents) {
|
|
442
|
+
console.log(` cleaned ${relative(appRoot, agents)}`);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
for (const dir of emptyDirs) {
|
|
446
|
+
console.log(` removed ${dir}/`);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// ---------------------------------------------------------------------------
|
|
451
|
+
// Entry
|
|
452
|
+
// ---------------------------------------------------------------------------
|
|
453
|
+
|
|
454
|
+
const args = parseArgs(process.argv.slice(2));
|
|
455
|
+
|
|
456
|
+
switch (args.command) {
|
|
457
|
+
case "install":
|
|
458
|
+
install(args);
|
|
459
|
+
break;
|
|
460
|
+
case "remove":
|
|
461
|
+
remove(args);
|
|
462
|
+
break;
|
|
463
|
+
case "help":
|
|
464
|
+
printHelp();
|
|
465
|
+
break;
|
|
466
|
+
default:
|
|
467
|
+
printHelp();
|
|
468
|
+
process.exitCode = 1;
|
|
469
|
+
}
|
|
@@ -7,7 +7,7 @@ export declare function setI18nAdapterForTests(adapter: undefined | I18nAdapter)
|
|
|
7
7
|
/**
|
|
8
8
|
* Returns the active i18n adapter from {@link BridgeUIProvider}.
|
|
9
9
|
* When unset, {@link useResolveMessage} returns the English source string
|
|
10
|
-
* (see `packages/vue/examples`).
|
|
10
|
+
* (see `packages/vue/docs/examples`).
|
|
11
11
|
*/
|
|
12
12
|
export declare function useI18nAdapter(): ComputedRef<undefined | I18nAdapter>;
|
|
13
13
|
/**
|
|
@@ -6,6 +6,6 @@ import { IconAdapter } from '@bridge-ui/core';
|
|
|
6
6
|
export declare function setIconAdapterForTests(adapter: undefined | IconAdapter): void;
|
|
7
7
|
/**
|
|
8
8
|
* Returns the active icon adapter from {@link BridgeUIProvider}.
|
|
9
|
-
* Semantic icon names require `global.icons` (see `packages/vue/examples`).
|
|
9
|
+
* Semantic icon names require `global.icons` (see `packages/vue/docs/examples`).
|
|
10
10
|
*/
|
|
11
11
|
export declare function useIconAdapter(): ComputedRef<undefined | IconAdapter>;
|
|
@@ -9,26 +9,26 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
9
9
|
clear: () => any;
|
|
10
10
|
search: (query: string) => any;
|
|
11
11
|
select: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
12
|
-
"update:modelValue": (...args: unknown[]) => any;
|
|
13
12
|
change: (value: import('@bridge-ui/core').SelectModel) => any;
|
|
14
13
|
close: () => any;
|
|
15
|
-
open: () => any;
|
|
16
14
|
deselect: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
15
|
+
open: () => any;
|
|
16
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
17
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
18
|
onClear?: (() => any) | undefined;
|
|
19
19
|
onSearch?: ((query: string) => any) | undefined;
|
|
20
20
|
onSelect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
|
|
21
|
-
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
22
21
|
onChange?: ((value: import('@bridge-ui/core').SelectModel) => any) | undefined;
|
|
23
22
|
onClose?: (() => any) | undefined;
|
|
24
|
-
onOpen?: (() => any) | undefined;
|
|
25
23
|
onDeselect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
|
|
24
|
+
onOpen?: (() => any) | undefined;
|
|
25
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
26
26
|
}>, {
|
|
27
27
|
showErrorIcon: boolean;
|
|
28
28
|
clearable: boolean;
|
|
29
|
+
freeSolo: boolean;
|
|
29
30
|
minItemsForSearch: number;
|
|
30
31
|
searchable: boolean;
|
|
31
|
-
freeSolo: boolean;
|
|
32
32
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
34
|
declare const _default: typeof __VLS_export;
|
|
@@ -436,7 +436,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
436
436
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
437
437
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
438
438
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
439
|
-
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "
|
|
439
|
+
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
|
|
440
440
|
isNotched: import('vue').ComputedRef<boolean>;
|
|
441
441
|
isStacked: import('vue').ComputedRef<boolean>;
|
|
442
442
|
startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
@@ -719,13 +719,14 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
|
|
|
719
719
|
onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
|
|
720
720
|
onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
|
|
721
721
|
onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
|
|
722
|
-
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "
|
|
722
|
+
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>>;
|
|
723
723
|
selectOption: (option: SelectOption) => void;
|
|
724
724
|
containerRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
725
725
|
listboxProps: import('vue').ComputedRef<{
|
|
726
726
|
anchorEl?: null | HTMLElement;
|
|
727
727
|
classes?: import('../../Listbox').ListboxClasses;
|
|
728
728
|
color: "info" | "error" | "success" | "warning" | "dark" | "primary" | "secondary";
|
|
729
|
+
componentName: "Select" | "Autocomplete";
|
|
729
730
|
customProps?: import('../../Listbox').ListboxCustomProps;
|
|
730
731
|
disableAutoFocus: boolean;
|
|
731
732
|
disableMaxHeight: boolean;
|
|
@@ -136,6 +136,7 @@ function g(g, _, v, y, Ce) {
|
|
|
136
136
|
variant: "outline",
|
|
137
137
|
showErrorIcon: !0
|
|
138
138
|
}, {
|
|
139
|
+
componentName: "Autocomplete",
|
|
139
140
|
likeInput: () => P.value,
|
|
140
141
|
control: () => P.value ? "textarea" : "input"
|
|
141
142
|
}), J = (e) => {
|
|
@@ -255,13 +256,15 @@ function g(g, _, v, y, Ce) {
|
|
|
255
256
|
}
|
|
256
257
|
let Qe = a(() => {
|
|
257
258
|
let e = h(d(be, h(Ee.value, [
|
|
258
|
-
"
|
|
259
|
+
"Autocomplete",
|
|
259
260
|
"tokens",
|
|
261
|
+
"listbox",
|
|
260
262
|
"color"
|
|
261
263
|
])), q.merged.value.color ?? "primary");
|
|
262
264
|
return q.invalidated.value ? d(xe, h(Ee.value, [
|
|
263
|
-
"
|
|
265
|
+
"Autocomplete",
|
|
264
266
|
"tokens",
|
|
267
|
+
"listbox",
|
|
265
268
|
"invalidated"
|
|
266
269
|
])) : e;
|
|
267
270
|
}), $e = a(() => Qe.value?.value), et = a(() => {
|
|
@@ -330,6 +333,7 @@ function g(g, _, v, y, Ce) {
|
|
|
330
333
|
size: q.merged.value.size,
|
|
331
334
|
color: q.merged.value.color,
|
|
332
335
|
labelledBy: q.controlId.value,
|
|
336
|
+
componentName: "Autocomplete",
|
|
333
337
|
rounded: q.merged.value.rounded,
|
|
334
338
|
invalidated: q.invalidated.value,
|
|
335
339
|
highlightedIndex: T.value,
|
|
@@ -7,7 +7,7 @@ export declare function useAvatar(props: AvatarProps, libDefaults: AvatarLibDefa
|
|
|
7
7
|
[name: string]: import('vue').Slot<any> | undefined;
|
|
8
8
|
}>;
|
|
9
9
|
merged: import('vue').ComputedRef<AvatarMerged>;
|
|
10
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AvatarProps, "color" | "icon" | "size" | "classes" | "customProps" | "rounded" | "alt" | "
|
|
10
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AvatarProps, "color" | "icon" | "size" | "classes" | "customProps" | "rounded" | "alt" | "src" | "fallback">>>;
|
|
11
11
|
iconBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
|
|
12
12
|
hasImage: import('vue').ComputedRef<boolean>;
|
|
13
13
|
imageBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').ImgHTMLAttributes | undefined, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseFieldSlots } from './baseField.types';
|
|
2
|
+
import { UseBaseFieldReturn } from './composables/useBaseField';
|
|
3
|
+
type __VLS_Slots = BaseFieldSlots;
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
field: UseBaseFieldReturn;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { hasNamedSlot as e, hasSlotOrProp as t, resolveNamedSlot as n, resolveSlotOrProp as r } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import i from "./BaseFieldLabel.js";
|
|
3
|
+
import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeProps as m, openBlock as h, renderSlot as g, resolveDynamicComponent as _, unref as v, useSlots as y } from "vue";
|
|
4
|
+
//#region src/Components/BaseField/BaseField.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var b = [
|
|
6
|
+
"data-invalid",
|
|
7
|
+
"aria-disabled",
|
|
8
|
+
"aria-readonly"
|
|
9
|
+
], x = ["id"], S = ["id", "aria-hidden"], C = /* @__PURE__ */ d({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "BaseField",
|
|
12
|
+
props: { field: {} },
|
|
13
|
+
setup(d) {
|
|
14
|
+
let C = d, w = y(), T = a(() => ({
|
|
15
|
+
...C.field,
|
|
16
|
+
slots: {
|
|
17
|
+
...C.field.slots,
|
|
18
|
+
...w
|
|
19
|
+
}
|
|
20
|
+
})), E = a(() => t(T.value.slots, "label", T.value.merged.value.label) || t(T.value.slots, "corner", T.value.merged.value.corner));
|
|
21
|
+
return (a, d) => (h(), c("div", p(T.value.rootBind.value, {
|
|
22
|
+
"data-invalid": T.value.invalidated.value || void 0,
|
|
23
|
+
"aria-disabled": T.value.isDisabled.value || void 0,
|
|
24
|
+
"aria-readonly": T.value.isReadonly.value || void 0
|
|
25
|
+
}), [
|
|
26
|
+
E.value ? (h(), c("div", m(p({ key: 0 }, T.value.headerBind.value)), [u(i, { api: T.value }, null, 8, ["api"]), v(t)(T.value.slots, "corner", T.value.merged.value.corner) ? (h(), c("span", m(p({ key: 0 }, T.value.cornerBind.value)), [(h(), o(_(v(r)(T.value.slots, "corner", T.value.merged.value.corner))))], 16)) : s("", !0)], 16)) : s("", !0),
|
|
27
|
+
l("div", m(f(T.value.groupBind.value)), [
|
|
28
|
+
v(e)(T.value.slots, "start") ? (h(), c("div", m(p({ key: 0 }, T.value.startSlotBind.value)), [(h(), o(_(v(n)(T.value.slots, "start"))))], 16)) : s("", !0),
|
|
29
|
+
g(a.$slots, "default"),
|
|
30
|
+
v(e)(T.value.slots, "end") ? (h(), c("div", m(p({ key: 1 }, T.value.endSlotBind.value)), [(h(), o(_(v(n)(T.value.slots, "end"))))], 16)) : s("", !0)
|
|
31
|
+
], 16),
|
|
32
|
+
!T.value.invalidated.value && v(t)(T.value.slots, "description", T.value.merged.value.description) ? (h(), c("p", p({ key: 1 }, T.value.descriptionBind.value, { id: `${T.value.controlId.value}-description` }), [(h(), o(_(v(r)(T.value.slots, "description", T.value.merged.value.description))))], 16, x)) : s("", !0),
|
|
33
|
+
T.value.merged.value.hideErrorMessage ? s("", !0) : (h(), c("p", p({ key: 2 }, T.value.errorBind.value, {
|
|
34
|
+
id: `${T.value.controlId.value}-error`,
|
|
35
|
+
"aria-hidden": T.value.showErrorMessageContent.value ? void 0 : !0
|
|
36
|
+
}), [T.value.showErrorMessageContent.value ? (h(), o(_(v(r)(T.value.slots, "errorMessage", T.value.merged.value.errorMessage)), { key: 0 })) : s("", !0)], 16, S))
|
|
37
|
+
], 16, b));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
//#endregion
|
|
41
|
+
export { C as default };
|
package/dist/Components/{OtpField/OtpFieldLabel.vue.d.ts → BaseField/BaseFieldLabel.vue.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseBaseFieldReturn } from './composables/useBaseField';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
api:
|
|
3
|
+
api: UseBaseFieldReturn;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
declare const _default: typeof __VLS_export;
|