@molecule/app-ui-showcase 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/package.json +7 -6
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:53:06.297Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-ui-showcase
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
Component showcase specifications for cross-framework visual regression testing.
|
|
16
|
+
|
|
17
|
+
Provides framework-agnostic data describing which components to render
|
|
18
|
+
and which prop combinations to test. Used by showcase templates in mlcl
|
|
19
|
+
to generate minimal apps per framework, then screenshotted by Playwright.
|
|
20
|
+
|
|
21
|
+
## Type
|
|
22
|
+
|
|
23
|
+
`core`
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @molecule/app-ui-showcase @molecule/app-ui
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## API
|
|
32
|
+
|
|
33
|
+
### Interfaces
|
|
34
|
+
|
|
35
|
+
#### `ComponentShowcase`
|
|
36
|
+
|
|
37
|
+
Specification for showcasing a single component across all its visual variations.
|
|
38
|
+
|
|
39
|
+
The `propMatrix` defines axes of variation — every combination is rendered.
|
|
40
|
+
`defaultProps` supplies required or baseline props applied to every variation.
|
|
41
|
+
`children` provides text content (set to `false` for components with no children).
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
interface ComponentShowcase {
|
|
45
|
+
/**
|
|
46
|
+
* Component export name (must match the named export from `@molecule/app-ui-{framework}`).
|
|
47
|
+
* For Svelte, maps to the `get{Name}Classes` utility function.
|
|
48
|
+
*/
|
|
49
|
+
name: string
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Props to vary across the matrix. Each key is a prop name, each value is
|
|
53
|
+
* the array of values to test. All combinations are generated.
|
|
54
|
+
*
|
|
55
|
+
* Example: `{ variant: ['solid', 'outline'], color: ['primary', 'error'] }`
|
|
56
|
+
* produces 4 combinations.
|
|
57
|
+
*/
|
|
58
|
+
propMatrix: Record<string, unknown[]>
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Props applied to every variation (e.g., required props, sample data).
|
|
62
|
+
*/
|
|
63
|
+
defaultProps?: Record<string, unknown>
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Text content to render as children. Set to `false` for components that
|
|
67
|
+
* don't accept children (e.g., Spinner, Separator).
|
|
68
|
+
*/
|
|
69
|
+
children?: string | false
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The HTML element to render for Svelte class-utility components.
|
|
73
|
+
* Defaults to 'div'. Use 'button' for Button, 'input' for Input, etc.
|
|
74
|
+
*/
|
|
75
|
+
svelteElement?: string
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Functions
|
|
80
|
+
|
|
81
|
+
#### `generateCombinations(matrix)`
|
|
82
|
+
|
|
83
|
+
Generate all combinations from a prop matrix.
|
|
84
|
+
|
|
85
|
+
Given `{ variant: ['solid', 'outline'], color: ['primary', 'error'] }`,
|
|
86
|
+
returns:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
[
|
|
90
|
+
{ variant: 'solid', color: 'primary' },
|
|
91
|
+
{ variant: 'solid', color: 'error' },
|
|
92
|
+
{ variant: 'outline', color: 'primary' },
|
|
93
|
+
{ variant: 'outline', color: 'error' },
|
|
94
|
+
]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
function generateCombinations(matrix: Record<string, unknown[]>): Record<string, unknown>[]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- `matrix` — Object mapping prop names to arrays of possible values.
|
|
102
|
+
|
|
103
|
+
**Returns:** Array of objects, one per combination.
|
|
104
|
+
|
|
105
|
+
### Constants
|
|
106
|
+
|
|
107
|
+
#### `showcaseComponents`
|
|
108
|
+
|
|
109
|
+
Full showcase specification for all molecule UI components.
|
|
110
|
+
|
|
111
|
+
Components are ordered by category: actions, form inputs, data display,
|
|
112
|
+
feedback, layout, and overlay/interactive.
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const showcaseComponents: ComponentShowcase[]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Injection Notes
|
|
119
|
+
|
|
120
|
+
### Requirements
|
|
121
|
+
|
|
122
|
+
Peer dependencies:
|
|
123
|
+
|
|
124
|
+
- `@molecule/app-ui` ^1.0.1
|
|
125
|
+
|
|
126
|
+
### Runtime Dependencies
|
|
127
|
+
|
|
128
|
+
- `@molecule/app-ui`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-ui-showcase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Component showcase specifications for cross-framework visual regression testing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -27,20 +28,20 @@
|
|
|
27
28
|
],
|
|
28
29
|
"license": "Apache-2.0",
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"@molecule/app-ui": "^1.0.
|
|
31
|
+
"@molecule/app-ui": "^1.0.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@molecule/app-ui": "1.
|
|
34
|
+
"@molecule/app-ui": "1.1.1",
|
|
34
35
|
"@types/node": "26.1.2",
|
|
35
36
|
"typescript": "6.0.3",
|
|
36
|
-
"vitest": "4.1.
|
|
37
|
+
"vitest": "4.1.11"
|
|
37
38
|
},
|
|
38
39
|
"repository": {
|
|
39
40
|
"type": "git",
|
|
40
41
|
"url": "https://github.com/molecule-dev/molecule.git",
|
|
41
42
|
"directory": "packages/app/core/ui-showcase"
|
|
42
43
|
},
|
|
43
|
-
"homepage": "https://
|
|
44
|
+
"homepage": "https://www.molecule.dev/packages/app-ui-showcase",
|
|
44
45
|
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|