@ladder-ui/manifests 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ivan Avila
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ export declare const inventory: any;
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifest } from "../types";
2
+ export declare const manifests: Record<string, ComponentManifest>;
@@ -0,0 +1 @@
1
+ export declare const recipes: any;
@@ -0,0 +1,125 @@
1
+ export type { ComponentManifest, ComponentEntry, PropEntry, SlotEntry, TokenEntry, EventEntry, EventsBlock, EventPayloadField, CssImports, ComponentCategory, TokenType, PropType, Inventory, PackageIndexEntry, RecipeEntry, RecipeNode, Recipe, } from "./types";
2
+ import type { ComponentManifest, Inventory, Recipe } from "./types";
3
+ /**
4
+ * The complete component inventory — categories, composition graph, and package index.
5
+ */
6
+ export declare const inventory: Inventory;
7
+ /**
8
+ * All component manifests indexed by package name (e.g. "button", "dialog").
9
+ */
10
+ export declare const manifests: Record<string, ComponentManifest>;
11
+ /**
12
+ * All recipes indexed by ID (e.g. "contact-form", "pricing-table").
13
+ */
14
+ export declare const recipes: Record<string, Recipe>;
15
+ /**
16
+ * Get a single component manifest by package name.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const dialog = getManifest('dialog');
21
+ * dialog.props.DialogContent.placement.values
22
+ * // → ["top", "right", "bottom", "left", "center"]
23
+ * ```
24
+ */
25
+ export declare function getManifest(packageName: string): ComponentManifest | undefined;
26
+ /**
27
+ * Get all component names in a category.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * getComponentsByCategory('form')
32
+ * // → ["Calendar", "Checkbox", "Combobox", "Input", ...]
33
+ * ```
34
+ */
35
+ export declare function getComponentsByCategory(category: string): string[];
36
+ /**
37
+ * Get the valid children for a parent component from the composition graph.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * getValidChildren('Card')
42
+ * // → ["CardHeader", "CardContent", "CardFooter", ...]
43
+ * ```
44
+ */
45
+ export declare function getValidChildren(parentComponent: string): string[];
46
+ /**
47
+ * Check if a child component is valid inside a parent component.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * canContain('Card', 'CardHeader') // → true
52
+ * canContain('Card', 'TabsList') // → false
53
+ * ```
54
+ */
55
+ export declare function canContain(parent: string, child: string): boolean;
56
+ /**
57
+ * Find which manifest a component belongs to.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * findComponentPackage('DialogContent')
62
+ * // → { packageName: "dialog", manifest: ComponentManifest }
63
+ * ```
64
+ */
65
+ export declare function findComponentPackage(componentName: string): {
66
+ packageName: string;
67
+ manifest: ComponentManifest;
68
+ } | undefined;
69
+ /**
70
+ * Get the props definition for a specific component.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * getComponentProps('Button')
75
+ * // → { variant: { type: "enum", values: [...], ... }, size: { ... }, ... }
76
+ * ```
77
+ */
78
+ export declare function getComponentProps(componentName: string): Record<string, import("./types").PropEntry> | undefined;
79
+ /**
80
+ * Get a recipe by ID. Returns undefined if not found.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const recipe = getRecipe('contact-form');
85
+ * recipe.tree.component // → "Card"
86
+ * ```
87
+ */
88
+ export declare function getRecipe(recipeId: string): Recipe | undefined;
89
+ /**
90
+ * List all available recipe IDs and their descriptions.
91
+ *
92
+ * @example
93
+ * ```ts
94
+ * listRecipes()
95
+ * // → [{ id: "contact-form", description: "Contact form with...", tags: ["form", "landing"] }, ...]
96
+ * ```
97
+ */
98
+ export declare function listRecipes(): Array<{
99
+ id: string;
100
+ description: string;
101
+ tags: string[];
102
+ }>;
103
+ /**
104
+ * Find recipes by tag.
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * getRecipesByTag('dashboard')
109
+ * // → [{ id: "dashboard-stats", ... }, { id: "dashboard-table", ... }]
110
+ * ```
111
+ */
112
+ export declare function getRecipesByTag(tag: string): Recipe[];
113
+ /**
114
+ * Get all CSS imports required for a recipe (deduced from component tree).
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * getRecipeImports('contact-form')
119
+ * // → { js: "import { Card, ... } from ...", css: ["@ladder-ui/card/card.css", ...] }
120
+ * ```
121
+ */
122
+ export declare function getRecipeImports(recipeId: string): {
123
+ js: string[];
124
+ css: string[];
125
+ } | undefined;