@voxel51/voodo 2.0.0 → 2.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/bin/voodo.mjs +127 -0
- package/dist/cli/reference.d.ts +79 -0
- package/dist/cli/reference.d.ts.map +1 -0
- package/dist/cli.cjs +11 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +167 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/ActivityToast/ActivityToast.d.ts +1 -1
- package/dist/components/ActivityToast/ActivityToast.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +5 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +3 -3
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/RichCard.d.ts +3 -1
- package/dist/components/Card/RichCard.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Clickable/Clickable.d.ts +1 -1
- package/dist/components/Combobox/Combobox.d.ts +6 -3
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/Datepicker/DatePicker.d.ts +1 -1
- package/dist/components/Datepicker/DatepickerIconButton.d.ts.map +1 -1
- package/dist/components/Divider/Divider.d.ts +21 -14
- package/dist/components/Divider/Divider.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +37 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +3 -3
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/DropdownTrigger.d.ts +2 -2
- package/dist/components/Dropzone/Dropzone.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +11 -4
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/FormField/FormField.d.ts +2 -2
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormFieldGroup/FormFieldGroup.d.ts +4 -19
- package/dist/components/FormFieldGroup/FormFieldGroup.d.ts.map +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/IconAction/IconAction.d.ts +7 -1
- package/dist/components/IconAction/IconAction.d.ts.map +1 -1
- package/dist/components/Icons/Icon.d.ts +4 -3
- package/dist/components/Icons/Icon.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts +2 -0
- package/dist/components/Icons/IconBase.d.ts.map +1 -1
- package/dist/components/Icons/IconWrapper.d.ts +3 -1
- package/dist/components/Icons/IconWrapper.d.ts.map +1 -1
- package/dist/components/ImageList/ImageList.d.ts +4 -4
- package/dist/components/ImageList/ImageList.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +14 -19
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/InputIcon.d.ts +1 -1
- package/dist/components/Input/InputIcon.d.ts.map +1 -1
- package/dist/components/Input/styles.d.ts +11 -12
- package/dist/components/Input/styles.d.ts.map +1 -1
- package/dist/components/ListItem/ListItem.d.ts +2 -2
- package/dist/components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/components/LoadingDots/LoadingDots.d.ts +1 -1
- package/dist/components/Menu/MenuCheckItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuIconTextItem.d.ts +4 -4
- package/dist/components/Menu/MenuIconTextItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuSectionTitle.d.ts.map +1 -1
- package/dist/components/Menu/MenuTextItem.d.ts +3 -3
- package/dist/components/Menu/MenuTextItem.d.ts.map +1 -1
- package/dist/components/Menu/styles.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +17 -9
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Pill/Pill.d.ts +5 -4
- package/dist/components/Pill/Pill.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +5 -5
- package/dist/components/Popover/styles.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts +4 -4
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +15 -3
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +4 -4
- package/dist/components/Radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/RichButton/RichButton.d.ts +2 -0
- package/dist/components/RichButton/RichButton.d.ts.map +1 -1
- package/dist/components/RichList/RichList.d.ts +14 -13
- package/dist/components/RichList/RichList.d.ts.map +1 -1
- package/dist/components/Select/Option.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +17 -7
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.d.ts +9 -4
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +15 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/SliderBar.d.ts +1 -1
- package/dist/components/Slider/SliderKnob.d.ts +1 -1
- package/dist/components/Slider/SliderLabels.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Stack/Stack.d.ts +3 -3
- package/dist/components/StatusDot/StatusDot.d.ts +21 -0
- package/dist/components/StatusDot/StatusDot.d.ts.map +1 -0
- package/dist/components/StatusDot/index.d.ts +2 -0
- package/dist/components/StatusDot/index.d.ts.map +1 -0
- package/dist/components/StepRail/StepRail.d.ts.map +1 -1
- package/dist/components/Table/Table.d.ts +82 -0
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.d.ts +3 -0
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Text/Text.d.ts +7 -3
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/TextAction/TextAction.d.ts +9 -2
- package/dist/components/TextAction/TextAction.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +7 -3
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextBadge/TextBadge.d.ts +3 -3
- package/dist/components/TextBadge/TextBadge.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +4 -4
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/ToastContainer/ToastContainer.d.ts +9 -1
- package/dist/components/ToastContainer/ToastContainer.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +2 -2
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +12 -11
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/dist/components/Toolbar/Toolbar.d.ts +14 -14
- package/dist/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tree/TreeSelect.d.ts +1 -1
- package/dist/components/Tree/types.d.ts +2 -0
- package/dist/components/Tree/types.d.ts.map +1 -1
- package/dist/components/UnsetHint/UnsetHint.d.ts +2 -1
- package/dist/components/UnsetHint/UnsetHint.d.ts.map +1 -1
- package/dist/components/UploadList/UploadList.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4282 -4071
- package/dist/index.js.map +1 -1
- package/dist/{palette-C24I0BcT.js → palette-Boxwxq4V.js} +92 -24
- package/dist/palette-Boxwxq4V.js.map +1 -0
- package/dist/palette-DV12yAPS.cjs +2 -0
- package/dist/palette-DV12yAPS.cjs.map +1 -0
- package/dist/styles/text.d.ts +6 -0
- package/dist/styles/text.d.ts.map +1 -1
- package/dist/theme/tokens/index.d.ts +62 -0
- package/dist/theme/tokens/index.d.ts.map +1 -1
- package/dist/theme/tokens/typography.d.ts +139 -0
- package/dist/theme/tokens/typography.d.ts.map +1 -1
- package/dist/tokens.cjs +1 -1
- package/dist/tokens.js +2 -2
- package/dist/types/text.d.ts +43 -4
- package/dist/types/text.d.ts.map +1 -1
- package/dist/util/classes.d.ts.map +1 -1
- package/dist/voodo.css +1 -1
- package/package.json +5 -1
- package/dist/palette-C24I0BcT.js.map +0 -1
- package/dist/palette-yXRdZevG.cjs +0 -2
- package/dist/palette-yXRdZevG.cjs.map +0 -1
package/bin/voodo.mjs
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// @ts-check
|
|
3
|
+
/**
|
|
4
|
+
* `voodo`: agent-friendly docs for @voxel51/voodo, read from the installed
|
|
5
|
+
* package's own type declarations, so the output always matches the version
|
|
6
|
+
* that is installed.
|
|
7
|
+
*
|
|
8
|
+
* npx @voxel51/voodo list
|
|
9
|
+
* npx @voxel51/voodo docs Button
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
12
|
+
import { dirname, join, sep } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
findComponents,
|
|
17
|
+
findTokenGroups,
|
|
18
|
+
lookup,
|
|
19
|
+
renderDocs,
|
|
20
|
+
renderList,
|
|
21
|
+
renderTokens,
|
|
22
|
+
resolveExports,
|
|
23
|
+
} from "../dist/cli.js";
|
|
24
|
+
|
|
25
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
26
|
+
const { version } = JSON.parse(
|
|
27
|
+
readFileSync(join(root, "package.json"), "utf8")
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const USAGE = `voodo: docs for @voxel51/voodo ${version}
|
|
31
|
+
|
|
32
|
+
voodo list every component, one line each
|
|
33
|
+
voodo docs <Name> one component's props, docs and token values
|
|
34
|
+
voodo tokens [Group] token values, e.g. \`voodo tokens TextColor\`
|
|
35
|
+
voodo icons every per-icon component name`;
|
|
36
|
+
|
|
37
|
+
/** @param {string} dir Relative to the package root, `/`-separated. */
|
|
38
|
+
const readDeclarations = (dir) => {
|
|
39
|
+
const absolute = join(root, ...dir.split("/"));
|
|
40
|
+
|
|
41
|
+
if (!existsSync(absolute)) {
|
|
42
|
+
console.error(
|
|
43
|
+
`voodo: ${dir} not found. In the design-system repo, run \`npm run build\` first.`
|
|
44
|
+
);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return readdirSync(absolute, { recursive: true })
|
|
49
|
+
.map(String)
|
|
50
|
+
.filter((file) => file.endsWith(".d.ts"))
|
|
51
|
+
.sort()
|
|
52
|
+
.map((file) => ({
|
|
53
|
+
path: `${dir}/${file.split(sep).join("/")}`,
|
|
54
|
+
text: readFileSync(join(absolute, file), "utf8"),
|
|
55
|
+
}));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const ICONS_FILE = "dist/components/Icons/icons.d.ts";
|
|
59
|
+
|
|
60
|
+
const [command, argument] = process.argv.slice(2);
|
|
61
|
+
const componentFiles = readDeclarations("dist/components");
|
|
62
|
+
const exported = resolveExports(
|
|
63
|
+
new Map(componentFiles.map((file) => [file.path, file.text])),
|
|
64
|
+
"dist/components/index.d.ts"
|
|
65
|
+
);
|
|
66
|
+
// Only what the package exports: the dist also holds internal modules.
|
|
67
|
+
const published = findComponents(componentFiles).filter(
|
|
68
|
+
(entry) => exported.get(entry.name) === entry.file
|
|
69
|
+
);
|
|
70
|
+
const components = published.filter((entry) => entry.file !== ICONS_FILE);
|
|
71
|
+
const iconNames = published
|
|
72
|
+
.filter((entry) => entry.file === ICONS_FILE)
|
|
73
|
+
.map((entry) => entry.name);
|
|
74
|
+
const tokens = findTokenGroups([
|
|
75
|
+
...readDeclarations("dist/types"),
|
|
76
|
+
...componentFiles,
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
switch (command) {
|
|
80
|
+
case "list":
|
|
81
|
+
console.log(renderList(components, iconNames, version));
|
|
82
|
+
break;
|
|
83
|
+
|
|
84
|
+
case "docs": {
|
|
85
|
+
if (!argument) {
|
|
86
|
+
console.error("Usage: voodo docs <Name>. Run `voodo list` for names.");
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { match, suggestions } = lookup(components, argument);
|
|
91
|
+
|
|
92
|
+
if (!match) {
|
|
93
|
+
console.error(
|
|
94
|
+
suggestions.length
|
|
95
|
+
? `No component named ${argument}. Did you mean: ${suggestions.join(", ")}?`
|
|
96
|
+
: `No component named ${argument}. Run \`voodo list\` for names.`
|
|
97
|
+
);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const file = componentFiles.find((entry) => entry.path === match.file);
|
|
102
|
+
console.log(renderDocs(match, file?.text ?? "", tokens));
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
case "tokens": {
|
|
107
|
+
const output = renderTokens(tokens, argument);
|
|
108
|
+
|
|
109
|
+
if (!output) {
|
|
110
|
+
console.error(
|
|
111
|
+
`No token group named ${argument}. Run \`voodo tokens\` for all.`
|
|
112
|
+
);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
console.log(output);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
case "icons":
|
|
121
|
+
console.log(iconNames.join("\n"));
|
|
122
|
+
break;
|
|
123
|
+
|
|
124
|
+
default:
|
|
125
|
+
console.log(USAGE);
|
|
126
|
+
if (command && command !== "help" && command !== "--help") process.exit(1);
|
|
127
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the `voodo` command (`bin/voodo.mjs`). They read the
|
|
3
|
+
* package's shipped `.d.ts` files as plain text and turn them into short,
|
|
4
|
+
* agent-friendly output.
|
|
5
|
+
*
|
|
6
|
+
* Built as its own entry (`dist/cli.js`) so the command can run from an
|
|
7
|
+
* installed package without React. No dependencies and no TypeScript
|
|
8
|
+
* compiler: the emitted declarations are regular enough to read with a few
|
|
9
|
+
* regular expressions, and the spec pins down every shape this relies on.
|
|
10
|
+
*/
|
|
11
|
+
export interface ComponentEntry {
|
|
12
|
+
name: string;
|
|
13
|
+
/** Path of the declaring `.d.ts`, relative to the package root. */
|
|
14
|
+
file: string;
|
|
15
|
+
/** First sentence of the component's JSDoc. */
|
|
16
|
+
summary: string;
|
|
17
|
+
/** Whether its JSDoc carries at least one `@example`. */
|
|
18
|
+
hasExample: boolean;
|
|
19
|
+
deprecated: boolean;
|
|
20
|
+
internal: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface DeclarationFile {
|
|
23
|
+
/** `/`-separated, relative to the package root. */
|
|
24
|
+
path: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
/** Token string values, current ones apart from deprecated ones. */
|
|
28
|
+
export interface TokenValues {
|
|
29
|
+
values: string[];
|
|
30
|
+
deprecated: string[];
|
|
31
|
+
}
|
|
32
|
+
/** One token group's values, plus each member's value by member name. */
|
|
33
|
+
export interface TokenGroup extends TokenValues {
|
|
34
|
+
members: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/** Token group name → its values. */
|
|
37
|
+
export type TokenGroups = Record<string, TokenGroup>;
|
|
38
|
+
/**
|
|
39
|
+
* The first sentence of a JSDoc description: the text before the first blank
|
|
40
|
+
* line or tag, with links reduced to their names.
|
|
41
|
+
*
|
|
42
|
+
* @param doc Raw JSDoc body, without the delimiters.
|
|
43
|
+
*/
|
|
44
|
+
export declare const summarize: (doc: string) => string;
|
|
45
|
+
/** Every component declared in the given files, sorted by name. */
|
|
46
|
+
export declare const findComponents: (files: DeclarationFile[]) => ComponentEntry[];
|
|
47
|
+
/**
|
|
48
|
+
* Every value a barrel exports, mapped to the file that declares it. Follows
|
|
49
|
+
* `export * from` and `export { a, b as c } from` through other declaration
|
|
50
|
+
* files; `export type` re-exports carry no values and are skipped.
|
|
51
|
+
*
|
|
52
|
+
* @param files Path → text, `/`-separated.
|
|
53
|
+
* @param entry The barrel to start from.
|
|
54
|
+
*/
|
|
55
|
+
export declare const resolveExports: (files: ReadonlyMap<string, string>, entry: string) => Map<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* String-valued token consts (`export declare const Size: { readonly Sm: "sm" … }`)
|
|
58
|
+
* and string enums (`export declare enum X { A = "a" … }`), by name.
|
|
59
|
+
*/
|
|
60
|
+
export declare const findTokenGroups: (files: DeclarationFile[]) => TokenGroups;
|
|
61
|
+
export declare const renderList: (components: readonly ComponentEntry[], iconNames: readonly string[], version: string) => string;
|
|
62
|
+
/**
|
|
63
|
+
* The declaration file for one component, trimmed for reading, with the value
|
|
64
|
+
* of every token type it mentions written out below it. A narrowed alias
|
|
65
|
+
* (`type ButtonSize = Exclude<Size, …>`) is written out as the values it
|
|
66
|
+
* allows, and the group it narrows only when the file uses that group
|
|
67
|
+
* elsewhere.
|
|
68
|
+
*
|
|
69
|
+
* @param text The declaring file's contents.
|
|
70
|
+
*/
|
|
71
|
+
export declare const renderDocs: (entry: ComponentEntry, text: string, tokens: TokenGroups) => string;
|
|
72
|
+
/** Every token group, or only the one named `only` (case-insensitive). */
|
|
73
|
+
export declare const renderTokens: (tokens: TokenGroups, only?: string) => string;
|
|
74
|
+
/** Case-insensitive lookup, with near matches when there is no exact one. */
|
|
75
|
+
export declare const lookup: (components: readonly ComponentEntry[], query: string) => {
|
|
76
|
+
match?: ComponentEntry;
|
|
77
|
+
suggestions: string[];
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/cli/reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;G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AQG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,cAAc,EACrB,MAAM,MAAM,EACZ,QAAQ,WAAW,KAClB,MA6CF,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,YAAY,GAAI,QAAQ,WAAW,EAAE,OAAO,MAAM,KAAG,MAInD,CAAC;AAEhB,6EAA6E;AAC7E,eAAO,MAAM,MAAM,GACjB,YAAY,SAAS,cAAc,EAAE,EACrC,OAAO,MAAM,KACZ;IAAE,KAAK,CAAC,EAAE,cAAc,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAUjD,CAAC"}
|
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=/(?:\/\*\*((?:(?!\*\/)[\s\S])*)\*\/\s*)?^(?:export )?declare (const|function) ([A-Z][A-Za-z0-9]*)([^\n]*)/gm,C=/^(?:<[^>]*>)?\(|^: (?:React\.)?FC<|^: import\(['"]react['"]\)\.(?:ForwardRef|Memo|Named)ExoticComponent</,Z=(o,n,e)=>o==="function"||C.test(n)?!0:n===": {"&&/^\s*\(/.test(e),O=o=>o.split(`
|
|
2
|
+
`).map(n=>n.replace(/^\s*\* ?/,"").trimEnd()),$=/\{@link\s+([^}\s]+)\s*\}/g,L=o=>o.replace($,"$1"),x=o=>{const n=[];for(const s of O(o))if(!(!s.trim()&&!n.length)){if(!s.trim()||s.trimStart().startsWith("@"))break;n.push(s.trim())}const e=L(n.join(" ")).replace(/\s+/g," ").trim(),t=e.match(/^.*?[.!?](?=\s|$)/);return t?t[0]:e},M=o=>o.flatMap(({path:n,text:e})=>[...e.matchAll(E)].filter(t=>Z(t[2]??"",t[4]??"",e.slice((t.index??0)+t[0].length))).map(t=>{const s=t[1]??"";return{name:t[3]??"",file:n,summary:x(s),hasExample:/@example\b/.test(s),deprecated:/@deprecated\b/.test(s),internal:/@internal\b/.test(s)}})).sort((n,e)=>n.name.localeCompare(e.name)),N=o=>o.slice(0,o.lastIndexOf("/")),g=(o,n,e)=>{const t=[];for(const r of`${N(n)}/${e}`.split("/"))r===".."?t.pop():r!=="."&&t.push(r);const s=t.join("/");return[`${s}.d.ts`,`${s}/index.d.ts`].find(r=>o.has(r))},m=(o,n)=>{const e=new Map,t=o.get(n)??"";for(const[,s]of t.matchAll(/^export declare (?:const|function|enum) ([A-Za-z0-9_$]+)/gm))s&&e.set(s,n);for(const[,s]of t.matchAll(/^export \* from ['"]([^'"]+)['"];/gm)){const r=s&&g(o,n,s);if(r)for(const[c,i]of m(o,r))e.set(c,i)}for(const[,s,r]of t.matchAll(/^export \{([^}]*)\} from ['"]([^'"]+)['"];/gm)){const c=r&&g(o,n,r);if(!c||!s)continue;const i=m(o,c);for(const d of s.split(",").map(a=>a.trim())){if(!d)continue;const[a=d,l=a]=d.split(/\s+as\s+/),p=a==="default"?c:i.get(a);p&&e.set(l,p)}}return e},w=/^export declare const ([A-Z][A-Za-z0-9]*): \{\n([\s\S]*?)\n\};/gm,z=/^export declare enum ([A-Z][A-Za-z0-9]*) \{\n([\s\S]*?)\n\}/gm,b=o=>o.startsWith("/")||o.startsWith("*"),v=(o,n)=>{const e={values:[],deprecated:[],members:{}};let t=!1;for(const s of o.split(`
|
|
3
|
+
`).map(r=>r.trim())){if(!s)continue;if(b(s)){t||=s.includes("@deprecated");continue}const[,r,c]=s.match(n)??[];if(r===void 0||c===void 0)return;e.members[r]=c;const i=t?e.deprecated:e.values;i.includes(c)||i.push(c),t=!1}return e.values.length||e.deprecated.length?e:void 0},j=o=>{const n={};for(const{text:e}of o){for(const[,t,s]of e.matchAll(w)){const r=s===void 0?void 0:v(s,/^readonly ([A-Za-z0-9]+): "([^"]*)";$/);t&&r&&(n[t]=r)}for(const[,t,s]of e.matchAll(z)){const r=s===void 0?void 0:v(s,/^([A-Za-z0-9]+) = "([^"]*)",?$/);t&&r&&(n[t]=r)}}return Object.fromEntries(Object.entries(n).sort(([e],[t])=>e.localeCompare(t)))},R=/^(?:export )?type ([A-Z][A-Za-z0-9]*) = ([^\n]+);$/gm,k=/^(Exclude|Extract)<([A-Z][A-Za-z0-9]*), (.+)>$/,T=/^([A-Z][A-Za-z0-9]*)\.([A-Za-z0-9]+)$/,h=(o,n)=>{const e={values:[],deprecated:[]};for(const t of o.split("|").map(s=>s.trim())){const[,s="",r=""]=t.match(T)??[],c=n[s],i=c?.members[r];if(!c||i===void 0)return;(c.deprecated.includes(i)?e.deprecated:e.values).push(i)}return e},S=(o,n)=>{const e=o.match(/^`\$\{(.*)\}`$/)?.[1]??o,[,t,s="",r=""]=e.match(k)??[];if(!t)return h(e,n);const c=n[s],i=h(r,n);if(!c||!i)return;const d=[...i.values,...i.deprecated],a=l=>d.includes(l)===(t==="Extract");return{values:c.values.filter(a),deprecated:c.deprecated.filter(a)}},A=o=>o.map(n=>JSON.stringify(n)),u=(o,{values:n,deprecated:e})=>`type ${o} = ${A(n).join(" | ")||"never"};`+(e.length?` // deprecated: ${A(e).join(", ")}`:""),I=(o,n,e)=>{const t=o.filter(c=>!c.internal),s=Math.max(0,...t.map(c=>c.name.length)),r=t.map(c=>{const i=c.deprecated?" (deprecated)":"";return`${c.name.padEnd(s)} ${c.summary}${i}`});return[`@voxel51/voodo ${e}: ${t.length} components, plus ${n.length} icons.`,"Run `voodo docs <Name>` for a component's props, docs and token values.","",...r,"",`Icons are per-icon components such as ${n.slice(0,3).join(", ")}. Run \`voodo icons\` for every name.`].join(`
|
|
4
|
+
`)},W=(o,n,e)=>{const t=n.split(`
|
|
5
|
+
`).filter(a=>!a.startsWith("import ")&&!a.startsWith("//# sourceMappingURL")&&a!=="export {};").join(`
|
|
6
|
+
`).trim(),s=[...t.matchAll(R)].flatMap(([a,l,p])=>{const f=l&&p?S(p,e):void 0;return f?[{line:a,name:l,values:f}]:[]}),r=s.reduce((a,{line:l})=>a.replace(l,""),t).split(`
|
|
7
|
+
`).map(a=>b(a.trim())?[...a.matchAll($)].map(([,l])=>l).join(" "):a).join(`
|
|
8
|
+
`),c=Object.keys(j([{path:o.file,text:n}])),i=Object.entries(e).filter(([a])=>!c.includes(a)&&new RegExp(`\\b${a}\\b`).test(r)),d=[...s.map(({name:a,values:l})=>u(a,l)),...i.map(([a,l])=>u(a,l))];return[`import { ${o.name} } from "@voxel51/voodo";`,`// ${o.file}`,"",t,...d.length?["","// Token values used above",...d]:[]].join(`
|
|
9
|
+
`)},G=(o,n)=>Object.entries(o).filter(([e])=>!n||e.toLowerCase()===n.toLowerCase()).map(([e,t])=>u(e,t)).join(`
|
|
10
|
+
`),P=(o,n)=>{const e=n.toLowerCase(),t=o.find(r=>r.name.toLowerCase()===e),s=t?[]:o.filter(r=>r.name.toLowerCase().includes(e)).map(r=>r.name);return{match:t,suggestions:s}};exports.findComponents=M;exports.findTokenGroups=j;exports.lookup=P;exports.renderDocs=W;exports.renderList=I;exports.renderTokens=G;exports.resolveExports=m;exports.summarize=x;
|
|
11
|
+
//# sourceMappingURL=cli.cjs.map
|
package/dist/cli.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.cjs","sources":["../src/cli/reference.ts"],"sourcesContent":["/**\n * Pure helpers for the `voodo` command (`bin/voodo.mjs`). They read the\n * package's shipped `.d.ts` files as plain text and turn them into short,\n * agent-friendly output.\n *\n * Built as its own entry (`dist/cli.js`) so the command can run from an\n * installed package without React. No dependencies and no TypeScript\n * compiler: the emitted declarations are regular enough to read with a few\n * regular expressions, and the spec pins down every shape this relies on.\n */\n\nexport interface ComponentEntry {\n name: string;\n /** Path of the declaring `.d.ts`, relative to the package root. */\n file: string;\n /** First sentence of the component's JSDoc. */\n summary: string;\n /** Whether its JSDoc carries at least one `@example`. */\n hasExample: boolean;\n deprecated: boolean;\n internal: boolean;\n}\n\nexport interface DeclarationFile {\n /** `/`-separated, relative to the package root. */\n path: string;\n text: string;\n}\n\n/** Token string values, current ones apart from deprecated ones. */\nexport interface TokenValues {\n values: string[];\n deprecated: string[];\n}\n\n/** One token group's values, plus each member's value by member name. */\nexport interface TokenGroup extends TokenValues {\n members: Record<string, string>;\n}\n\n/** Token group name → its values. */\nexport type TokenGroups = Record<string, TokenGroup>;\n\n/**\n * An optional JSDoc block followed by a top-level `declare const` or\n * `declare function` whose name starts upper-case. The JSDoc body may not\n * contain `*\\/`, so a match never glues two comment blocks together.\n */\nconst DECLARATION =\n /(?:\\/\\*\\*((?:(?!\\*\\/)[\\s\\S])*)\\*\\/\\s*)?^(?:export )?declare (const|function) ([A-Z][A-Za-z0-9]*)([^\\n]*)/gm;\n\nconst COMPONENT_TYPE =\n /^(?:<[^>]*>)?\\(|^: (?:React\\.)?FC<|^: import\\(['\"]react['\"]\\)\\.(?:ForwardRef|Memo|Named)ExoticComponent</;\n\n/**\n * Whether a declaration's type describes a component. Object types count when\n * their first member is a call signature (`{ (props): JSX.Element; … }`, the\n * shape `displayName` assignments produce); token consts are object types too,\n * but their members are `readonly` string literals.\n */\nconst isComponent = (\n kind: string,\n rest: string,\n following: string\n): boolean => {\n if (kind === \"function\") return true;\n if (COMPONENT_TYPE.test(rest)) return true;\n\n return rest === \": {\" && /^\\s*\\(/.test(following);\n};\n\nconst docLines = (doc: string): string[] =>\n doc.split(\"\\n\").map((line) => line.replace(/^\\s*\\* ?/, \"\").trimEnd());\n\nconst LINK = /\\{@link\\s+([^}\\s]+)\\s*\\}/g;\n\nconst stripLinks = (text: string): string => text.replace(LINK, \"$1\");\n\n/**\n * The first sentence of a JSDoc description: the text before the first blank\n * line or tag, with links reduced to their names.\n *\n * @param doc Raw JSDoc body, without the delimiters.\n */\nexport const summarize = (doc: string): string => {\n const paragraph: string[] = [];\n\n for (const line of docLines(doc)) {\n // The body starts with the rest of the `/**` line, usually empty.\n if (!line.trim() && !paragraph.length) continue;\n if (!line.trim() || line.trimStart().startsWith(\"@\")) break;\n paragraph.push(line.trim());\n }\n\n const text = stripLinks(paragraph.join(\" \")).replace(/\\s+/g, \" \").trim();\n const sentence = text.match(/^.*?[.!?](?=\\s|$)/);\n\n return sentence ? sentence[0] : text;\n};\n\n/** Every component declared in the given files, sorted by name. */\nexport const findComponents = (files: DeclarationFile[]): ComponentEntry[] =>\n files\n .flatMap(({ path, text }) =>\n [...text.matchAll(DECLARATION)]\n .filter((match) =>\n isComponent(\n match[2] ?? \"\",\n match[4] ?? \"\",\n text.slice((match.index ?? 0) + match[0].length)\n )\n )\n .map((match) => {\n const doc = match[1] ?? \"\";\n\n return {\n name: match[3] ?? \"\",\n file: path,\n summary: summarize(doc),\n hasExample: /@example\\b/.test(doc),\n deprecated: /@deprecated\\b/.test(doc),\n internal: /@internal\\b/.test(doc),\n };\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name));\n\nconst directory = (path: string): string =>\n path.slice(0, path.lastIndexOf(\"/\"));\n\n/**\n * The declaration file a relative specifier points at: `./Button` is either\n * `Button.d.ts` or `Button/index.d.ts`.\n */\nconst resolveModule = (\n files: ReadonlyMap<string, string>,\n from: string,\n specifier: string\n): string | undefined => {\n const parts: string[] = [];\n\n for (const segment of `${directory(from)}/${specifier}`.split(\"/\")) {\n if (segment === \"..\") parts.pop();\n else if (segment !== \".\") parts.push(segment);\n }\n\n const base = parts.join(\"/\");\n\n return [`${base}.d.ts`, `${base}/index.d.ts`].find((path) => files.has(path));\n};\n\n/**\n * Every value a barrel exports, mapped to the file that declares it. Follows\n * `export * from` and `export { a, b as c } from` through other declaration\n * files; `export type` re-exports carry no values and are skipped.\n *\n * @param files Path → text, `/`-separated.\n * @param entry The barrel to start from.\n */\nexport const resolveExports = (\n files: ReadonlyMap<string, string>,\n entry: string\n): Map<string, string> => {\n const exported = new Map<string, string>();\n const text = files.get(entry) ?? \"\";\n\n for (const [, name] of text.matchAll(\n /^export declare (?:const|function|enum) ([A-Za-z0-9_$]+)/gm\n )) {\n if (name) exported.set(name, entry);\n }\n\n for (const [, specifier] of text.matchAll(\n /^export \\* from ['\"]([^'\"]+)['\"];/gm\n )) {\n const target = specifier && resolveModule(files, entry, specifier);\n\n if (target) {\n for (const [name, file] of resolveExports(files, target)) {\n exported.set(name, file);\n }\n }\n }\n\n for (const [, list, specifier] of text.matchAll(\n /^export \\{([^}]*)\\} from ['\"]([^'\"]+)['\"];/gm\n )) {\n const target = specifier && resolveModule(files, entry, specifier);\n\n if (!target || !list) continue;\n\n const inner = resolveExports(files, target);\n\n for (const spec of list.split(\",\").map((part) => part.trim())) {\n if (!spec) continue;\n\n const [local = spec, alias = local] = spec.split(/\\s+as\\s+/);\n // `default` re-exports name the file's own declaration.\n const file = local === \"default\" ? target : inner.get(local);\n\n if (file) exported.set(alias, file);\n }\n }\n\n return exported;\n};\n\nconst CONST_GROUP =\n /^export declare const ([A-Z][A-Za-z0-9]*): \\{\\n([\\s\\S]*?)\\n\\};/gm;\nconst ENUM_GROUP =\n /^export declare enum ([A-Z][A-Za-z0-9]*) \\{\\n([\\s\\S]*?)\\n\\}/gm;\n\nconst isComment = (line: string): boolean =>\n line.startsWith(\"/\") || line.startsWith(\"*\");\n\n/**\n * Reads a group body's members with `member`, which captures a member's name\n * and then its value, sorting each value into current or deprecated by\n * whether the JSDoc just above it says `@deprecated`. Returns `undefined`\n * when a non-comment line is not a string member, which means the body is\n * not a token group.\n */\nconst readMembers = (body: string, member: RegExp): TokenGroup | undefined => {\n const group: TokenGroup = { values: [], deprecated: [], members: {} };\n let deprecated = false;\n\n for (const line of body.split(\"\\n\").map((raw) => raw.trim())) {\n if (!line) continue;\n\n if (isComment(line)) {\n deprecated ||= line.includes(\"@deprecated\");\n continue;\n }\n\n const [, name, value] = line.match(member) ?? [];\n\n if (name === undefined || value === undefined) return undefined;\n\n group.members[name] = value;\n\n const list = deprecated ? group.deprecated : group.values;\n\n if (!list.includes(value)) list.push(value);\n deprecated = false;\n }\n\n return group.values.length || group.deprecated.length ? group : undefined;\n};\n\n/**\n * String-valued token consts (`export declare const Size: { readonly Sm: \"sm\" … }`)\n * and string enums (`export declare enum X { A = \"a\" … }`), by name.\n */\nexport const findTokenGroups = (files: DeclarationFile[]): TokenGroups => {\n const groups: TokenGroups = {};\n\n for (const { text } of files) {\n for (const [, name, body] of text.matchAll(CONST_GROUP)) {\n const group =\n body === undefined\n ? undefined\n : readMembers(body, /^readonly ([A-Za-z0-9]+): \"([^\"]*)\";$/);\n\n if (name && group) groups[name] = group;\n }\n\n for (const [, name, body] of text.matchAll(ENUM_GROUP)) {\n const group =\n body === undefined\n ? undefined\n : readMembers(body, /^([A-Za-z0-9]+) = \"([^\"]*)\",?$/);\n\n if (name && group) groups[name] = group;\n }\n }\n\n return Object.fromEntries(\n Object.entries(groups).sort(([a], [b]) => a.localeCompare(b))\n );\n};\n\n/** A one-line type alias: its name, then its type. */\nconst ALIAS = /^(?:export )?type ([A-Z][A-Za-z0-9]*) = ([^\\n]+);$/gm;\nconst NARROWING = /^(Exclude|Extract)<([A-Z][A-Za-z0-9]*), (.+)>$/;\nconst MEMBER = /^([A-Z][A-Za-z0-9]*)\\.([A-Za-z0-9]+)$/;\n\n/**\n * The values of a `|` list of members such as `Size.Sm | Size.Md`, each kept\n * current or deprecated as its own group has it. `undefined` when any part is\n * not a known member.\n */\nconst readMemberList = (\n list: string,\n tokens: TokenGroups\n): TokenValues | undefined => {\n const result: TokenValues = { values: [], deprecated: [] };\n\n for (const part of list.split(\"|\").map((raw) => raw.trim())) {\n const [, groupName = \"\", memberName = \"\"] = part.match(MEMBER) ?? [];\n const group: TokenGroup | undefined = tokens[groupName];\n const value: string | undefined = group?.members[memberName];\n\n if (!group || value === undefined) return undefined;\n\n const into = group.deprecated.includes(value)\n ? result.deprecated\n : result.values;\n\n into.push(value);\n }\n\n return result;\n};\n\n/**\n * The values a narrowed token type allows. Handles the shapes components\n * use: `Exclude<Size, Size.Lg | Size.Xl>`, `Extract<Size, Size.Sm | Size.Md>`\n * and `Size.Sm | Size.Md`, each with or without a `` `${…}` `` wrapper.\n * `undefined` for any other type, which is then left as written.\n */\nconst resolveAlias = (\n type: string,\n tokens: TokenGroups\n): TokenValues | undefined => {\n const inner = type.match(/^`\\$\\{(.*)\\}`$/)?.[1] ?? type;\n const [, kind, groupName = \"\", list = \"\"] = inner.match(NARROWING) ?? [];\n\n if (!kind) return readMemberList(inner, tokens);\n\n const group: TokenGroup | undefined = tokens[groupName];\n const named = readMemberList(list, tokens);\n\n if (!group || !named) return undefined;\n\n const listed = [...named.values, ...named.deprecated];\n const keep = (value: string): boolean =>\n listed.includes(value) === (kind === \"Extract\");\n\n return {\n values: group.values.filter(keep),\n deprecated: group.deprecated.filter(keep),\n };\n};\n\nconst quote = (values: readonly string[]): string[] =>\n values.map((value) => JSON.stringify(value));\n\n/** `type Size = \"sm\" | \"md\";`, plus a comment naming any deprecated values. */\nconst renderUnion = (\n name: string,\n { values, deprecated }: TokenValues\n): string =>\n `type ${name} = ${quote(values).join(\" | \") || \"never\"};` +\n (deprecated.length ? ` // deprecated: ${quote(deprecated).join(\", \")}` : \"\");\n\nexport const renderList = (\n components: readonly ComponentEntry[],\n iconNames: readonly string[],\n version: string\n): string => {\n const shown = components.filter((entry) => !entry.internal);\n const width = Math.max(0, ...shown.map((entry) => entry.name.length));\n const rows = shown.map((entry) => {\n const note = entry.deprecated ? \" (deprecated)\" : \"\";\n\n return `${entry.name.padEnd(width)} ${entry.summary}${note}`;\n });\n\n return [\n `@voxel51/voodo ${version}: ${shown.length} components, plus ${iconNames.length} icons.`,\n \"Run `voodo docs <Name>` for a component's props, docs and token values.\",\n \"\",\n ...rows,\n \"\",\n `Icons are per-icon components such as ${iconNames.slice(0, 3).join(\", \")}. Run \\`voodo icons\\` for every name.`,\n ].join(\"\\n\");\n};\n\n/**\n * The declaration file for one component, trimmed for reading, with the value\n * of every token type it mentions written out below it. A narrowed alias\n * (`type ButtonSize = Exclude<Size, …>`) is written out as the values it\n * allows, and the group it narrows only when the file uses that group\n * elsewhere.\n *\n * @param text The declaring file's contents.\n */\nexport const renderDocs = (\n entry: ComponentEntry,\n text: string,\n tokens: TokenGroups\n): string => {\n const body = text\n .split(\"\\n\")\n .filter(\n (line) =>\n !line.startsWith(\"import \") &&\n !line.startsWith(\"//# sourceMappingURL\") &&\n line !== \"export {};\"\n )\n .join(\"\\n\")\n .trim();\n const aliases = [...body.matchAll(ALIAS)].flatMap(([line, name, type]) => {\n const values = name && type ? resolveAlias(type, tokens) : undefined;\n\n return values ? [{ line, name, values }] : [];\n });\n // Types and `{@link}`s count as using a group. Prose does not (\"Size of\n // the toggle\"), and neither does the group a resolved alias narrows.\n const references = aliases\n .reduce((rest, { line }) => rest.replace(line, \"\"), body)\n .split(\"\\n\")\n .map((line) =>\n isComment(line.trim())\n ? [...line.matchAll(LINK)].map(([, target]) => target).join(\" \")\n : line\n )\n .join(\"\\n\");\n // Groups declared in this file are already visible in `body`.\n const local = Object.keys(findTokenGroups([{ path: entry.file, text }]));\n const used = Object.entries(tokens).filter(\n ([name]) =>\n !local.includes(name) && new RegExp(`\\\\b${name}\\\\b`).test(references)\n );\n const unions = [\n ...aliases.map(({ name, values }) => renderUnion(name, values)),\n ...used.map(([name, group]) => renderUnion(name, group)),\n ];\n\n return [\n `import { ${entry.name} } from \"@voxel51/voodo\";`,\n `// ${entry.file}`,\n \"\",\n body,\n ...(unions.length ? [\"\", \"// Token values used above\", ...unions] : []),\n ].join(\"\\n\");\n};\n\n/** Every token group, or only the one named `only` (case-insensitive). */\nexport const renderTokens = (tokens: TokenGroups, only?: string): string =>\n Object.entries(tokens)\n .filter(([name]) => !only || name.toLowerCase() === only.toLowerCase())\n .map(([name, group]) => renderUnion(name, group))\n .join(\"\\n\");\n\n/** Case-insensitive lookup, with near matches when there is no exact one. */\nexport const lookup = (\n components: readonly ComponentEntry[],\n query: string\n): { match?: ComponentEntry; suggestions: string[] } => {\n const wanted = query.toLowerCase();\n const match = components.find((entry) => entry.name.toLowerCase() === wanted);\n const suggestions = match\n ? []\n : components\n .filter((entry) => entry.name.toLowerCase().includes(wanted))\n .map((entry) => entry.name);\n\n return { match, suggestions };\n};\n"],"names":["DECLARATION","COMPONENT_TYPE","isComponent","kind","rest","following","docLines","doc","line","LINK","stripLinks","text","summarize","paragraph","sentence","findComponents","files","path","match","a","b","directory","resolveModule","from","specifier","parts","segment","base","resolveExports","entry","exported","name","target","file","list","inner","spec","part","local","alias","CONST_GROUP","ENUM_GROUP","isComment","readMembers","body","member","group","deprecated","raw","value","findTokenGroups","groups","ALIAS","NARROWING","MEMBER","readMemberList","tokens","result","groupName","memberName","resolveAlias","type","named","listed","keep","quote","values","renderUnion","renderList","components","iconNames","version","shown","width","rows","note","renderDocs","aliases","references","used","unions","renderTokens","only","lookup","query","wanted","suggestions"],"mappings":"gFAgDA,MAAMA,EACJ,6GAEIC,EACJ,2GAQIC,EAAc,CAClBC,EACAC,EACAC,IAEIF,IAAS,YACTF,EAAe,KAAKG,CAAI,EAAU,GAE/BA,IAAS,OAAS,SAAS,KAAKC,CAAS,EAG5CC,EAAYC,GAChBA,EAAI,MAAM;AAAA,CAAI,EAAE,IAAKC,GAASA,EAAK,QAAQ,WAAY,EAAE,EAAE,SAAS,EAEhEC,EAAO,4BAEPC,EAAcC,GAAyBA,EAAK,QAAQF,EAAM,IAAI,EAQvDG,EAAaL,GAAwB,CAChD,MAAMM,EAAsB,CAAA,EAE5B,UAAWL,KAAQF,EAASC,CAAG,EAE7B,GAAI,GAACC,EAAK,KAAA,GAAU,CAACK,EAAU,QAC/B,IAAI,CAACL,EAAK,QAAUA,EAAK,YAAY,WAAW,GAAG,EAAG,MACtDK,EAAU,KAAKL,EAAK,MAAM,EAG5B,MAAMG,EAAOD,EAAWG,EAAU,KAAK,GAAG,CAAC,EAAE,QAAQ,OAAQ,GAAG,EAAE,KAAA,EAC5DC,EAAWH,EAAK,MAAM,mBAAmB,EAE/C,OAAOG,EAAWA,EAAS,CAAC,EAAIH,CAClC,EAGaI,EAAkBC,GAC7BA,EACG,QAAQ,CAAC,CAAE,KAAAC,EAAM,KAAAN,KAChB,CAAC,GAAGA,EAAK,SAASX,CAAW,CAAC,EAC3B,OAAQkB,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\(|^: (?:React\.)?FC<|^: import\(['"]react['"]\)\.(?:ForwardRef|Memo|Named)ExoticComponent</, E = (o, n, e) => o === "function" || j.test(n) ? !0 : n === ": {" && /^\s*\(/.test(e), Z = (o) => o.split(`
|
|
2
|
+
`).map((n) => n.replace(/^\s*\* ?/, "").trimEnd()), $ = /\{@link\s+([^}\s]+)\s*\}/g, C = (o) => o.replace($, "$1"), O = (o) => {
|
|
3
|
+
const n = [];
|
|
4
|
+
for (const s of Z(o))
|
|
5
|
+
if (!(!s.trim() && !n.length)) {
|
|
6
|
+
if (!s.trim() || s.trimStart().startsWith("@")) break;
|
|
7
|
+
n.push(s.trim());
|
|
8
|
+
}
|
|
9
|
+
const e = C(n.join(" ")).replace(/\s+/g, " ").trim(), t = e.match(/^.*?[.!?](?=\s|$)/);
|
|
10
|
+
return t ? t[0] : e;
|
|
11
|
+
}, T = (o) => o.flatMap(
|
|
12
|
+
({ path: n, text: e }) => [...e.matchAll(b)].filter(
|
|
13
|
+
(t) => E(
|
|
14
|
+
t[2] ?? "",
|
|
15
|
+
t[4] ?? "",
|
|
16
|
+
e.slice((t.index ?? 0) + t[0].length)
|
|
17
|
+
)
|
|
18
|
+
).map((t) => {
|
|
19
|
+
const s = t[1] ?? "";
|
|
20
|
+
return {
|
|
21
|
+
name: t[3] ?? "",
|
|
22
|
+
file: n,
|
|
23
|
+
summary: O(s),
|
|
24
|
+
hasExample: /@example\b/.test(s),
|
|
25
|
+
deprecated: /@deprecated\b/.test(s),
|
|
26
|
+
internal: /@internal\b/.test(s)
|
|
27
|
+
};
|
|
28
|
+
})
|
|
29
|
+
).sort((n, e) => n.name.localeCompare(e.name)), L = (o) => o.slice(0, o.lastIndexOf("/")), f = (o, n, e) => {
|
|
30
|
+
const t = [];
|
|
31
|
+
for (const r of `${L(n)}/${e}`.split("/"))
|
|
32
|
+
r === ".." ? t.pop() : r !== "." && t.push(r);
|
|
33
|
+
const s = t.join("/");
|
|
34
|
+
return [`${s}.d.ts`, `${s}/index.d.ts`].find((r) => o.has(r));
|
|
35
|
+
}, g = (o, n) => {
|
|
36
|
+
const e = /* @__PURE__ */ new Map(), t = o.get(n) ?? "";
|
|
37
|
+
for (const [, s] of t.matchAll(
|
|
38
|
+
/^export declare (?:const|function|enum) ([A-Za-z0-9_$]+)/gm
|
|
39
|
+
))
|
|
40
|
+
s && e.set(s, n);
|
|
41
|
+
for (const [, s] of t.matchAll(
|
|
42
|
+
/^export \* from ['"]([^'"]+)['"];/gm
|
|
43
|
+
)) {
|
|
44
|
+
const r = s && f(o, n, s);
|
|
45
|
+
if (r)
|
|
46
|
+
for (const [c, i] of g(o, r))
|
|
47
|
+
e.set(c, i);
|
|
48
|
+
}
|
|
49
|
+
for (const [, s, r] of t.matchAll(
|
|
50
|
+
/^export \{([^}]*)\} from ['"]([^'"]+)['"];/gm
|
|
51
|
+
)) {
|
|
52
|
+
const c = r && f(o, n, r);
|
|
53
|
+
if (!c || !s) continue;
|
|
54
|
+
const i = g(o, c);
|
|
55
|
+
for (const p of s.split(",").map((a) => a.trim())) {
|
|
56
|
+
if (!p) continue;
|
|
57
|
+
const [a = p, l = a] = p.split(/\s+as\s+/), m = a === "default" ? c : i.get(a);
|
|
58
|
+
m && e.set(l, m);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return e;
|
|
62
|
+
}, M = /^export declare const ([A-Z][A-Za-z0-9]*): \{\n([\s\S]*?)\n\};/gm, N = /^export declare enum ([A-Z][A-Za-z0-9]*) \{\n([\s\S]*?)\n\}/gm, x = (o) => o.startsWith("/") || o.startsWith("*"), v = (o, n) => {
|
|
63
|
+
const e = { values: [], deprecated: [], members: {} };
|
|
64
|
+
let t = !1;
|
|
65
|
+
for (const s of o.split(`
|
|
66
|
+
`).map((r) => r.trim())) {
|
|
67
|
+
if (!s) continue;
|
|
68
|
+
if (x(s)) {
|
|
69
|
+
t ||= s.includes("@deprecated");
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const [, r, c] = s.match(n) ?? [];
|
|
73
|
+
if (r === void 0 || c === void 0) return;
|
|
74
|
+
e.members[r] = c;
|
|
75
|
+
const i = t ? e.deprecated : e.values;
|
|
76
|
+
i.includes(c) || i.push(c), t = !1;
|
|
77
|
+
}
|
|
78
|
+
return e.values.length || e.deprecated.length ? e : void 0;
|
|
79
|
+
}, w = (o) => {
|
|
80
|
+
const n = {};
|
|
81
|
+
for (const { text: e } of o) {
|
|
82
|
+
for (const [, t, s] of e.matchAll(M)) {
|
|
83
|
+
const r = s === void 0 ? void 0 : v(s, /^readonly ([A-Za-z0-9]+): "([^"]*)";$/);
|
|
84
|
+
t && r && (n[t] = r);
|
|
85
|
+
}
|
|
86
|
+
for (const [, t, s] of e.matchAll(N)) {
|
|
87
|
+
const r = s === void 0 ? void 0 : v(s, /^([A-Za-z0-9]+) = "([^"]*)",?$/);
|
|
88
|
+
t && r && (n[t] = r);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return Object.fromEntries(
|
|
92
|
+
Object.entries(n).sort(([e], [t]) => e.localeCompare(t))
|
|
93
|
+
);
|
|
94
|
+
}, R = /^(?:export )?type ([A-Z][A-Za-z0-9]*) = ([^\n]+);$/gm, z = /^(Exclude|Extract)<([A-Z][A-Za-z0-9]*), (.+)>$/, k = /^([A-Z][A-Za-z0-9]*)\.([A-Za-z0-9]+)$/, h = (o, n) => {
|
|
95
|
+
const e = { values: [], deprecated: [] };
|
|
96
|
+
for (const t of o.split("|").map((s) => s.trim())) {
|
|
97
|
+
const [, s = "", r = ""] = t.match(k) ?? [], c = n[s], i = c?.members[r];
|
|
98
|
+
if (!c || i === void 0) return;
|
|
99
|
+
(c.deprecated.includes(i) ? e.deprecated : e.values).push(i);
|
|
100
|
+
}
|
|
101
|
+
return e;
|
|
102
|
+
}, S = (o, n) => {
|
|
103
|
+
const e = o.match(/^`\$\{(.*)\}`$/)?.[1] ?? o, [, t, s = "", r = ""] = e.match(z) ?? [];
|
|
104
|
+
if (!t) return h(e, n);
|
|
105
|
+
const c = n[s], i = h(r, n);
|
|
106
|
+
if (!c || !i) return;
|
|
107
|
+
const p = [...i.values, ...i.deprecated], a = (l) => p.includes(l) === (t === "Extract");
|
|
108
|
+
return {
|
|
109
|
+
values: c.values.filter(a),
|
|
110
|
+
deprecated: c.deprecated.filter(a)
|
|
111
|
+
};
|
|
112
|
+
}, A = (o) => o.map((n) => JSON.stringify(n)), d = (o, { values: n, deprecated: e }) => `type ${o} = ${A(n).join(" | ") || "never"};` + (e.length ? ` // deprecated: ${A(e).join(", ")}` : ""), I = (o, n, e) => {
|
|
113
|
+
const t = o.filter((c) => !c.internal), s = Math.max(0, ...t.map((c) => c.name.length)), r = t.map((c) => {
|
|
114
|
+
const i = c.deprecated ? " (deprecated)" : "";
|
|
115
|
+
return `${c.name.padEnd(s)} ${c.summary}${i}`;
|
|
116
|
+
});
|
|
117
|
+
return [
|
|
118
|
+
`@voxel51/voodo ${e}: ${t.length} components, plus ${n.length} icons.`,
|
|
119
|
+
"Run `voodo docs <Name>` for a component's props, docs and token values.",
|
|
120
|
+
"",
|
|
121
|
+
...r,
|
|
122
|
+
"",
|
|
123
|
+
`Icons are per-icon components such as ${n.slice(0, 3).join(", ")}. Run \`voodo icons\` for every name.`
|
|
124
|
+
].join(`
|
|
125
|
+
`);
|
|
126
|
+
}, W = (o, n, e) => {
|
|
127
|
+
const t = n.split(`
|
|
128
|
+
`).filter(
|
|
129
|
+
(a) => !a.startsWith("import ") && !a.startsWith("//# sourceMappingURL") && a !== "export {};"
|
|
130
|
+
).join(`
|
|
131
|
+
`).trim(), s = [...t.matchAll(R)].flatMap(([a, l, m]) => {
|
|
132
|
+
const u = l && m ? S(m, e) : void 0;
|
|
133
|
+
return u ? [{ line: a, name: l, values: u }] : [];
|
|
134
|
+
}), r = s.reduce((a, { line: l }) => a.replace(l, ""), t).split(`
|
|
135
|
+
`).map(
|
|
136
|
+
(a) => x(a.trim()) ? [...a.matchAll($)].map(([, l]) => l).join(" ") : a
|
|
137
|
+
).join(`
|
|
138
|
+
`), c = Object.keys(w([{ path: o.file, text: n }])), i = Object.entries(e).filter(
|
|
139
|
+
([a]) => !c.includes(a) && new RegExp(`\\b${a}\\b`).test(r)
|
|
140
|
+
), p = [
|
|
141
|
+
...s.map(({ name: a, values: l }) => d(a, l)),
|
|
142
|
+
...i.map(([a, l]) => d(a, l))
|
|
143
|
+
];
|
|
144
|
+
return [
|
|
145
|
+
`import { ${o.name} } from "@voxel51/voodo";`,
|
|
146
|
+
`// ${o.file}`,
|
|
147
|
+
"",
|
|
148
|
+
t,
|
|
149
|
+
...p.length ? ["", "// Token values used above", ...p] : []
|
|
150
|
+
].join(`
|
|
151
|
+
`);
|
|
152
|
+
}, U = (o, n) => Object.entries(o).filter(([e]) => !n || e.toLowerCase() === n.toLowerCase()).map(([e, t]) => d(e, t)).join(`
|
|
153
|
+
`), G = (o, n) => {
|
|
154
|
+
const e = n.toLowerCase(), t = o.find((r) => r.name.toLowerCase() === e), s = t ? [] : o.filter((r) => r.name.toLowerCase().includes(e)).map((r) => r.name);
|
|
155
|
+
return { match: t, suggestions: s };
|
|
156
|
+
};
|
|
157
|
+
export {
|
|
158
|
+
T as findComponents,
|
|
159
|
+
w as findTokenGroups,
|
|
160
|
+
G as lookup,
|
|
161
|
+
W as renderDocs,
|
|
162
|
+
I as renderList,
|
|
163
|
+
U as renderTokens,
|
|
164
|
+
g as resolveExports,
|
|
165
|
+
O as summarize
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../src/cli/reference.ts"],"sourcesContent":["/**\n * Pure helpers for the `voodo` command (`bin/voodo.mjs`). They read the\n * package's shipped `.d.ts` files as plain text and turn them into short,\n * agent-friendly output.\n *\n * Built as its own entry (`dist/cli.js`) so the command can run from an\n * installed package without React. No dependencies and no TypeScript\n * compiler: the emitted declarations are regular enough to read with a few\n * regular expressions, and the spec pins down every shape this relies on.\n */\n\nexport interface ComponentEntry {\n name: string;\n /** Path of the declaring `.d.ts`, relative to the package root. */\n file: string;\n /** First sentence of the component's JSDoc. */\n summary: string;\n /** Whether its JSDoc carries at least one `@example`. */\n hasExample: boolean;\n deprecated: boolean;\n internal: boolean;\n}\n\nexport interface DeclarationFile {\n /** `/`-separated, relative to the package root. */\n path: string;\n text: string;\n}\n\n/** Token string values, current ones apart from deprecated ones. */\nexport interface TokenValues {\n values: string[];\n deprecated: string[];\n}\n\n/** One token group's values, plus each member's value by member name. */\nexport interface TokenGroup extends TokenValues {\n members: Record<string, string>;\n}\n\n/** Token group name → its values. */\nexport type TokenGroups = Record<string, TokenGroup>;\n\n/**\n * An optional JSDoc block followed by a top-level `declare const` or\n * `declare function` whose name starts upper-case. The JSDoc body may not\n * contain `*\\/`, so a match never glues two comment blocks together.\n */\nconst DECLARATION =\n /(?:\\/\\*\\*((?:(?!\\*\\/)[\\s\\S])*)\\*\\/\\s*)?^(?:export )?declare (const|function) ([A-Z][A-Za-z0-9]*)([^\\n]*)/gm;\n\nconst COMPONENT_TYPE =\n /^(?:<[^>]*>)?\\(|^: (?:React\\.)?FC<|^: import\\(['\"]react['\"]\\)\\.(?:ForwardRef|Memo|Named)ExoticComponent</;\n\n/**\n * Whether a declaration's type describes a component. Object types count when\n * their first member is a call signature (`{ (props): JSX.Element; … }`, the\n * shape `displayName` assignments produce); token consts are object types too,\n * but their members are `readonly` string literals.\n */\nconst isComponent = (\n kind: string,\n rest: string,\n following: string\n): boolean => {\n if (kind === \"function\") return true;\n if (COMPONENT_TYPE.test(rest)) return true;\n\n return rest === \": {\" && /^\\s*\\(/.test(following);\n};\n\nconst docLines = (doc: string): string[] =>\n doc.split(\"\\n\").map((line) => line.replace(/^\\s*\\* ?/, \"\").trimEnd());\n\nconst LINK = /\\{@link\\s+([^}\\s]+)\\s*\\}/g;\n\nconst stripLinks = (text: string): string => text.replace(LINK, \"$1\");\n\n/**\n * The first sentence of a JSDoc description: the text before the first blank\n * line or tag, with links reduced to their names.\n *\n * @param doc Raw JSDoc body, without the delimiters.\n */\nexport const summarize = (doc: string): string => {\n const paragraph: string[] = [];\n\n for (const line of docLines(doc)) {\n // The body starts with the rest of the `/**` line, usually empty.\n if (!line.trim() && !paragraph.length) continue;\n if (!line.trim() || line.trimStart().startsWith(\"@\")) break;\n paragraph.push(line.trim());\n }\n\n const text = stripLinks(paragraph.join(\" \")).replace(/\\s+/g, \" \").trim();\n const sentence = text.match(/^.*?[.!?](?=\\s|$)/);\n\n return sentence ? sentence[0] : text;\n};\n\n/** Every component declared in the given files, sorted by name. */\nexport const findComponents = (files: DeclarationFile[]): ComponentEntry[] =>\n files\n .flatMap(({ path, text }) =>\n [...text.matchAll(DECLARATION)]\n .filter((match) =>\n isComponent(\n match[2] ?? \"\",\n match[4] ?? \"\",\n text.slice((match.index ?? 0) + match[0].length)\n )\n )\n .map((match) => {\n const doc = match[1] ?? \"\";\n\n return {\n name: match[3] ?? \"\",\n file: path,\n summary: summarize(doc),\n hasExample: /@example\\b/.test(doc),\n deprecated: /@deprecated\\b/.test(doc),\n internal: /@internal\\b/.test(doc),\n };\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name));\n\nconst directory = (path: string): string =>\n path.slice(0, path.lastIndexOf(\"/\"));\n\n/**\n * The declaration file a relative specifier points at: `./Button` is either\n * `Button.d.ts` or `Button/index.d.ts`.\n */\nconst resolveModule = (\n files: ReadonlyMap<string, string>,\n from: string,\n specifier: string\n): string | undefined => {\n const parts: string[] = [];\n\n for (const segment of `${directory(from)}/${specifier}`.split(\"/\")) {\n if (segment === \"..\") parts.pop();\n else if (segment !== \".\") parts.push(segment);\n }\n\n const base = parts.join(\"/\");\n\n return [`${base}.d.ts`, `${base}/index.d.ts`].find((path) => files.has(path));\n};\n\n/**\n * Every value a barrel exports, mapped to the file that declares it. Follows\n * `export * from` and `export { a, b as c } from` through other declaration\n * files; `export type` re-exports carry no values and are skipped.\n *\n * @param files Path → text, `/`-separated.\n * @param entry The barrel to start from.\n */\nexport const resolveExports = (\n files: ReadonlyMap<string, string>,\n entry: string\n): Map<string, string> => {\n const exported = new Map<string, string>();\n const text = files.get(entry) ?? \"\";\n\n for (const [, name] of text.matchAll(\n /^export declare (?:const|function|enum) ([A-Za-z0-9_$]+)/gm\n )) {\n if (name) exported.set(name, entry);\n }\n\n for (const [, specifier] of text.matchAll(\n /^export \\* from ['\"]([^'\"]+)['\"];/gm\n )) {\n const target = specifier && resolveModule(files, entry, specifier);\n\n if (target) {\n for (const [name, file] of resolveExports(files, target)) {\n exported.set(name, file);\n }\n }\n }\n\n for (const [, list, specifier] of text.matchAll(\n /^export \\{([^}]*)\\} from ['\"]([^'\"]+)['\"];/gm\n )) {\n const target = specifier && resolveModule(files, entry, specifier);\n\n if (!target || !list) continue;\n\n const inner = resolveExports(files, target);\n\n for (const spec of list.split(\",\").map((part) => part.trim())) {\n if (!spec) continue;\n\n const [local = spec, alias = local] = spec.split(/\\s+as\\s+/);\n // `default` re-exports name the file's own declaration.\n const file = local === \"default\" ? target : inner.get(local);\n\n if (file) exported.set(alias, file);\n }\n }\n\n return exported;\n};\n\nconst CONST_GROUP =\n /^export declare const ([A-Z][A-Za-z0-9]*): \\{\\n([\\s\\S]*?)\\n\\};/gm;\nconst ENUM_GROUP =\n /^export declare enum ([A-Z][A-Za-z0-9]*) \\{\\n([\\s\\S]*?)\\n\\}/gm;\n\nconst isComment = (line: string): boolean =>\n line.startsWith(\"/\") || line.startsWith(\"*\");\n\n/**\n * Reads a group body's members with `member`, which captures a member's name\n * and then its value, sorting each value into current or deprecated by\n * whether the JSDoc just above it says `@deprecated`. Returns `undefined`\n * when a non-comment line is not a string member, which means the body is\n * not a token group.\n */\nconst readMembers = (body: string, member: RegExp): TokenGroup | undefined => {\n const group: TokenGroup = { values: [], deprecated: [], members: {} };\n let deprecated = false;\n\n for (const line of body.split(\"\\n\").map((raw) => raw.trim())) {\n if (!line) continue;\n\n if (isComment(line)) {\n deprecated ||= line.includes(\"@deprecated\");\n continue;\n }\n\n const [, name, value] = line.match(member) ?? [];\n\n if (name === undefined || value === undefined) return undefined;\n\n group.members[name] = value;\n\n const list = deprecated ? group.deprecated : group.values;\n\n if (!list.includes(value)) list.push(value);\n deprecated = false;\n }\n\n return group.values.length || group.deprecated.length ? group : undefined;\n};\n\n/**\n * String-valued token consts (`export declare const Size: { readonly Sm: \"sm\" … }`)\n * and string enums (`export declare enum X { A = \"a\" … }`), by name.\n */\nexport const findTokenGroups = (files: DeclarationFile[]): TokenGroups => {\n const groups: TokenGroups = {};\n\n for (const { text } of files) {\n for (const [, name, body] of text.matchAll(CONST_GROUP)) {\n const group =\n body === undefined\n ? undefined\n : readMembers(body, /^readonly ([A-Za-z0-9]+): \"([^\"]*)\";$/);\n\n if (name && group) groups[name] = group;\n }\n\n for (const [, name, body] of text.matchAll(ENUM_GROUP)) {\n const group =\n body === undefined\n ? undefined\n : readMembers(body, /^([A-Za-z0-9]+) = \"([^\"]*)\",?$/);\n\n if (name && group) groups[name] = group;\n }\n }\n\n return Object.fromEntries(\n Object.entries(groups).sort(([a], [b]) => a.localeCompare(b))\n );\n};\n\n/** A one-line type alias: its name, then its type. */\nconst ALIAS = /^(?:export )?type ([A-Z][A-Za-z0-9]*) = ([^\\n]+);$/gm;\nconst NARROWING = /^(Exclude|Extract)<([A-Z][A-Za-z0-9]*), (.+)>$/;\nconst MEMBER = /^([A-Z][A-Za-z0-9]*)\\.([A-Za-z0-9]+)$/;\n\n/**\n * The values of a `|` list of members such as `Size.Sm | Size.Md`, each kept\n * current or deprecated as its own group has it. `undefined` when any part is\n * not a known member.\n */\nconst readMemberList = (\n list: string,\n tokens: TokenGroups\n): TokenValues | undefined => {\n const result: TokenValues = { values: [], deprecated: [] };\n\n for (const part of list.split(\"|\").map((raw) => raw.trim())) {\n const [, groupName = \"\", memberName = \"\"] = part.match(MEMBER) ?? [];\n const group: TokenGroup | undefined = tokens[groupName];\n const value: string | undefined = group?.members[memberName];\n\n if (!group || value === undefined) return undefined;\n\n const into = group.deprecated.includes(value)\n ? result.deprecated\n : result.values;\n\n into.push(value);\n }\n\n return result;\n};\n\n/**\n * The values a narrowed token type allows. Handles the shapes components\n * use: `Exclude<Size, Size.Lg | Size.Xl>`, `Extract<Size, Size.Sm | Size.Md>`\n * and `Size.Sm | Size.Md`, each with or without a `` `${…}` `` wrapper.\n * `undefined` for any other type, which is then left as written.\n */\nconst resolveAlias = (\n type: string,\n tokens: TokenGroups\n): TokenValues | undefined => {\n const inner = type.match(/^`\\$\\{(.*)\\}`$/)?.[1] ?? type;\n const [, kind, groupName = \"\", list = \"\"] = inner.match(NARROWING) ?? [];\n\n if (!kind) return readMemberList(inner, tokens);\n\n const group: TokenGroup | undefined = tokens[groupName];\n const named = readMemberList(list, tokens);\n\n if (!group || !named) return undefined;\n\n const listed = [...named.values, ...named.deprecated];\n const keep = (value: string): boolean =>\n listed.includes(value) === (kind === \"Extract\");\n\n return {\n values: group.values.filter(keep),\n deprecated: group.deprecated.filter(keep),\n };\n};\n\nconst quote = (values: readonly string[]): string[] =>\n values.map((value) => JSON.stringify(value));\n\n/** `type Size = \"sm\" | \"md\";`, plus a comment naming any deprecated values. */\nconst renderUnion = (\n name: string,\n { values, deprecated }: TokenValues\n): string =>\n `type ${name} = ${quote(values).join(\" | \") || \"never\"};` +\n (deprecated.length ? ` // deprecated: ${quote(deprecated).join(\", \")}` : \"\");\n\nexport const renderList = (\n components: readonly ComponentEntry[],\n iconNames: readonly string[],\n version: string\n): string => {\n const shown = components.filter((entry) => !entry.internal);\n const width = Math.max(0, ...shown.map((entry) => entry.name.length));\n const rows = shown.map((entry) => {\n const note = entry.deprecated ? \" (deprecated)\" : \"\";\n\n return `${entry.name.padEnd(width)} ${entry.summary}${note}`;\n });\n\n return [\n `@voxel51/voodo ${version}: ${shown.length} components, plus ${iconNames.length} icons.`,\n \"Run `voodo docs <Name>` for a component's props, docs and token values.\",\n \"\",\n ...rows,\n \"\",\n `Icons are per-icon components such as ${iconNames.slice(0, 3).join(\", \")}. Run \\`voodo icons\\` for every name.`,\n ].join(\"\\n\");\n};\n\n/**\n * The declaration file for one component, trimmed for reading, with the value\n * of every token type it mentions written out below it. A narrowed alias\n * (`type ButtonSize = Exclude<Size, …>`) is written out as the values it\n * allows, and the group it narrows only when the file uses that group\n * elsewhere.\n *\n * @param text The declaring file's contents.\n */\nexport const renderDocs = (\n entry: ComponentEntry,\n text: string,\n tokens: TokenGroups\n): string => {\n const body = text\n .split(\"\\n\")\n .filter(\n (line) =>\n !line.startsWith(\"import \") &&\n !line.startsWith(\"//# sourceMappingURL\") &&\n line !== \"export {};\"\n )\n .join(\"\\n\")\n .trim();\n const aliases = [...body.matchAll(ALIAS)].flatMap(([line, name, type]) => {\n const values = name && type ? resolveAlias(type, tokens) : undefined;\n\n return values ? [{ line, name, values }] : [];\n });\n // Types and `{@link}`s count as using a group. Prose does not (\"Size of\n // the toggle\"), and neither does the group a resolved alias narrows.\n const references = aliases\n .reduce((rest, { line }) => rest.replace(line, \"\"), body)\n .split(\"\\n\")\n .map((line) =>\n isComment(line.trim())\n ? [...line.matchAll(LINK)].map(([, target]) => target).join(\" \")\n : line\n )\n .join(\"\\n\");\n // Groups declared in this file are already visible in `body`.\n const local = Object.keys(findTokenGroups([{ path: entry.file, text }]));\n const used = Object.entries(tokens).filter(\n ([name]) =>\n !local.includes(name) && new RegExp(`\\\\b${name}\\\\b`).test(references)\n );\n const unions = [\n ...aliases.map(({ name, values }) => renderUnion(name, values)),\n ...used.map(([name, group]) => renderUnion(name, group)),\n ];\n\n return [\n `import { ${entry.name} } from \"@voxel51/voodo\";`,\n `// ${entry.file}`,\n \"\",\n body,\n ...(unions.length ? [\"\", \"// Token values used above\", ...unions] : []),\n ].join(\"\\n\");\n};\n\n/** Every token group, or only the one named `only` (case-insensitive). */\nexport const renderTokens = (tokens: TokenGroups, only?: string): string =>\n Object.entries(tokens)\n .filter(([name]) => !only || name.toLowerCase() === only.toLowerCase())\n .map(([name, group]) => renderUnion(name, group))\n .join(\"\\n\");\n\n/** Case-insensitive lookup, with near matches when there is no exact one. */\nexport const lookup = (\n components: readonly ComponentEntry[],\n query: string\n): { match?: ComponentEntry; suggestions: string[] } => {\n const wanted = query.toLowerCase();\n const match = components.find((entry) => entry.name.toLowerCase() === wanted);\n const suggestions = match\n ? []\n : components\n .filter((entry) => entry.name.toLowerCase().includes(wanted))\n .map((entry) => entry.name);\n\n return { match, suggestions };\n};\n"],"names":["DECLARATION","COMPONENT_TYPE","isComponent","kind","rest","following","docLines","doc","line","LINK","stripLinks","text","summarize","paragraph","sentence","findComponents","files","path","match","a","b","directory","resolveModule","from","specifier","parts","segment","base","resolveExports","entry","exported","name","target","file","list","inner","spec","part","local","alias","CONST_GROUP","ENUM_GROUP","isComment","readMembers","body","member","group","deprecated","raw","value","findTokenGroups","groups","ALIAS","NARROWING","MEMBER","readMemberList","tokens","result","groupName","memberName","resolveAlias","type","named","listed","keep","quote","values","renderUnion","renderList","components","iconNames","version","shown","width","rows","note","renderDocs","aliases","references","used","unions","renderTokens","only","lookup","query","wanted","suggestions"],"mappings":"AAgDA,MAAMA,IACJ,8GAEIC,IACJ,4GAQIC,IAAc,CAClBC,GACAC,GACAC,MAEIF,MAAS,cACTF,EAAe,KAAKG,CAAI,IAAU,KAE/BA,MAAS,SAAS,SAAS,KAAKC,CAAS,GAG5CC,IAAW,CAACC,MAChBA,EAAI,MAAM;AAAA,CAAI,EAAE,IAAI,CAACC,MAASA,EAAK,QAAQ,YAAY,EAAE,EAAE,SAAS,GAEhEC,IAAO,6BAEPC,IAAa,CAACC,MAAyBA,EAAK,QAAQF,GAAM,IAAI,GAQvDG,IAAY,CAACL,MAAwB;AAChD,QAAMM,IAAsB,CAAA;AAE5B,aAAWL,KAAQF,EAASC,CAAG;AAE7B,QAAI,GAACC,EAAK,KAAA,KAAU,CAACK,EAAU,SAC/B;AAAA,UAAI,CAACL,EAAK,UAAUA,EAAK,YAAY,WAAW,GAAG,EA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O,SAAS,CAAC,IAAI,8BAA8B,GAAGA,CAAM,IAAI,CAAA;AAAA,EAAC,EACrE,KAAK;AAAA,CAAI;AACb,GAGaC,IAAe,CAACzB,GAAqB0B,MAChD,OAAO,QAAQ1B,CAAM,EAClB,OAAO,CAAC,CAACzB,CAAI,MAAM,CAACmD,KAAQnD,EAAK,kBAAkBmD,EAAK,YAAA,CAAa,EACrE,IAAI,CAAC,CAACnD,GAAMe,CAAK,MAAMqB,EAAYpC,GAAMe,CAAK,CAAC,EAC/C,KAAK;AAAA,CAAI,GAGDqC,IAAS,CACpBd,GACAe,MACsD;AACtD,QAAMC,IAASD,EAAM,YAAA,GACflE,IAAQmD,EAAW,KAAK,CAACxC,MAAUA,EAAM,KAAK,YAAA,MAAkBwD,CAAM,GACtEC,IAAcpE,IAChB,CAAA,IACAmD,EACG,OAAO,CAACxC,MAAUA,EAAM,KAAK,cAAc,SAASwD,CAAM,CAAC,EAC3D,IAAI,CAACxD,MAAUA,EAAM,IAAI;AAEhC,SAAO,EAAE,OAAAX,GAAO,aAAAoE,EAAA;AAClB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityToast.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityToast/ActivityToast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAKjE,OAAO,EACL,MAAM,
|
|
1
|
+
{"version":3,"file":"ActivityToast.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityToast/ActivityToast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAKjE,OAAO,EACL,MAAM,EAQN,OAAO,EACR,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAsChD,CAAC"}
|
|
@@ -20,13 +20,15 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Pi
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```tsx
|
|
23
|
-
* <Button
|
|
24
|
-
*
|
|
23
|
+
* <Button variant="primary" size="sm" leadingIcon={AddIcon} onClick={save}>
|
|
24
|
+
* Add dataset
|
|
25
25
|
* </Button>
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
28
|
* @param variant The button variant; this controls the general styling of the button. See {@link Variant}.
|
|
29
|
-
* @param size The size of the button; this controls both the text size and the button size
|
|
29
|
+
* @param size The size of the button; this controls both the text size and the button size: `"xs"`, `"sm"` or `"md"`. Defaults to `"md"`.
|
|
30
|
+
* @param target Link target; only used with `href`.
|
|
31
|
+
* @param rel Link rel; only used with `href`. Defaults to `"noreferrer"` when `target` is `"_blank"`.
|
|
30
32
|
* @param borderless Boolean controlling whether the button should be "borderless," removing any borders and
|
|
31
33
|
* rounding the corners.
|
|
32
34
|
* @param leadingIcon Optional icon component which prefixes the button's content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,EAAE,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,EAAE,EAEH,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAOL,IAAI,EAIJ,OAAO,EACR,MAAM,SAAS,CAAC;AAKjB,KAAK,UAAU,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAExD,MAAM,WAAW,WACf,SACE,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC1E;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA2HD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA2FlC,CAAC"}
|
|
@@ -24,16 +24,16 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```tsx
|
|
27
|
-
* <Card background=
|
|
27
|
+
* <Card background="secondary" compact>
|
|
28
28
|
* Card content here
|
|
29
29
|
* </Card>
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
-
* @param background The background color variant. Defaults to
|
|
32
|
+
* @param background The background color variant. Defaults to `"primary"`.
|
|
33
33
|
* @param border Whether to render a border around the card.
|
|
34
34
|
* @param className Additional CSS class names to apply to the card.
|
|
35
35
|
* @param compact When true, reduces internal padding.
|
|
36
|
-
* @param shadow The shadow depth applied to the card. Defaults to
|
|
36
|
+
* @param shadow The shadow depth applied to the card. Defaults to `"none"`.
|
|
37
37
|
* @param outlined When true, replaces the shadow with a border outline.
|
|
38
38
|
* @param children The content of the card.
|
|
39
39
|
* @param props Additional HTML properties to apply to the card.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,EAOL,MAAM,EACP,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAE5D,yBAAiB,cAAc,CAAC;IAC9B,KAAY,OAAO,GAAG,OAAO,cAAc,CAAC,OAAO,CAAC;IACpD,KAAY,SAAS,GAAG,OAAO,cAAc,CAAC,SAAS,CAAC;IACxD,KAAY,QAAQ,GAAG,OAAO,cAAc,CAAC,QAAQ,CAAC;CACvD;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,EAOL,MAAM,EACP,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AACX,MAAM,MAAM,cAAc,GACxB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,EAAE,CAAC;AAE5D,yBAAiB,cAAc,CAAC;IAC9B,KAAY,OAAO,GAAG,OAAO,cAAc,CAAC,OAAO,CAAC;IACpD,KAAY,SAAS,GAAG,OAAO,cAAc,CAAC,SAAS,CAAC;IACxD,KAAY,QAAQ,GAAG,OAAO,cAAc,CAAC,QAAQ,CAAC;CACvD;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA2B9B,CAAC"}
|
|
@@ -16,7 +16,7 @@ export interface RichCardProps extends CardProps {
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```tsx
|
|
18
18
|
* <RichCard
|
|
19
|
-
* icon={
|
|
19
|
+
* icon={SearchIcon}
|
|
20
20
|
* title="Getting Started"
|
|
21
21
|
* description="Follow these steps to set up your workspace."
|
|
22
22
|
* badge="New"
|
|
@@ -38,6 +38,8 @@ export declare const RichCard: FC<RichCardProps>;
|
|
|
38
38
|
* an array of strings is rendered as a bulleted list.
|
|
39
39
|
*
|
|
40
40
|
* @param text The description content.
|
|
41
|
+
*
|
|
42
|
+
* @internal Rendered by {@link RichCard}; pass `description` to it instead.
|
|
41
43
|
*/
|
|
42
44
|
export declare const Description: FC<{
|
|
43
45
|
text: string | string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichCard.d.ts","sourceRoot":"","sources":["../../../src/components/Card/RichCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAwB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,oBAAoB,CAAC;AAiBtE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"RichCard.d.ts","sourceRoot":"","sources":["../../../src/components/Card/RichCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAwB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,oBAAoB,CAAC;AAiBtE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA2DtC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAoBvD,CAAC"}
|
|
@@ -41,6 +41,7 @@ export interface CheckboxProps extends ModifiedCheckboxProps {
|
|
|
41
41
|
* @param radius Border radius of the checkbox; this controls the styling of the checkbox itself. See {@link Radius}.
|
|
42
42
|
* @param className `class` overrides to apply to the checkbox.
|
|
43
43
|
* @param labelClassName `class` overrides for custom styling of the checkbox's label.
|
|
44
|
+
* @param disabled If `true`, disables the checkbox.
|
|
44
45
|
* @param label Label to display alongside the checkbox.
|
|
45
46
|
* @param showUnsetHint If `true`, displays a hint to the user for checkbox interaction.
|
|
46
47
|
* @param props Additional HTML properties to apply to the checkbox.
|