@molecule/app-ui-showcase 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +115 -0
- package/dist/components.d.ts +18 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +253 -0
- package/dist/components.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +24 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +48 -0
- package/dist/utils.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work.
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the
|
|
45
|
+
original version of the Work and any modifications or additions
|
|
46
|
+
to that Work, that is intentionally submitted to the Licensor for
|
|
47
|
+
inclusion in the Work by the copyright owner or by an individual or
|
|
48
|
+
Legal Entity authorized to submit on behalf of the copyright owner.
|
|
49
|
+
|
|
50
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
52
|
+
subsequently incorporated within the Work.
|
|
53
|
+
|
|
54
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
55
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
56
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
57
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
58
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
59
|
+
Work and such Derivative Works in Source or Object form.
|
|
60
|
+
|
|
61
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
63
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
65
|
+
and otherwise transfer the Work.
|
|
66
|
+
|
|
67
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
69
|
+
modifications, and in Source or Object form, provided that You
|
|
70
|
+
meet the following conditions:
|
|
71
|
+
|
|
72
|
+
(a) You must give any other recipients of the Work or
|
|
73
|
+
Derivative Works a copy of this License; and
|
|
74
|
+
|
|
75
|
+
(b) You must cause any modified files to carry prominent notices
|
|
76
|
+
stating that You changed the files; and
|
|
77
|
+
|
|
78
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
79
|
+
that You distribute, all copyright, patent, trademark, and
|
|
80
|
+
attribution notices from the Source form of the Work,
|
|
81
|
+
excluding those notices that do not pertain to any part of
|
|
82
|
+
the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
|
+
distribution, then any Derivative Works that You distribute must
|
|
86
|
+
include a readable copy of the attribution notices contained
|
|
87
|
+
within such NOTICE file.
|
|
88
|
+
|
|
89
|
+
5. Submission of Contributions.
|
|
90
|
+
|
|
91
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
+
names, trademarks, service marks, or product names of the Licensor.
|
|
93
|
+
|
|
94
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
+
agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
96
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
97
|
+
|
|
98
|
+
8. Limitation of Liability. In no event and under no legal theory shall
|
|
99
|
+
any Contributor be liable to You for damages.
|
|
100
|
+
|
|
101
|
+
9. Accepting Warranty or Additional Liability.
|
|
102
|
+
|
|
103
|
+
Copyright 2026 Molecule Dev, Inc.
|
|
104
|
+
|
|
105
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
|
+
you may not use this file except in compliance with the License.
|
|
107
|
+
You may obtain a copy of the License at
|
|
108
|
+
|
|
109
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
110
|
+
|
|
111
|
+
Unless required by applicable law or agreed to in writing, software
|
|
112
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
113
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
114
|
+
See the License for the specific language governing permissions and
|
|
115
|
+
limitations under the License.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component showcase specifications.
|
|
3
|
+
*
|
|
4
|
+
* Defines every component and its visual variation axes for cross-framework
|
|
5
|
+
* visual regression testing. Each entry generates a matrix of all prop
|
|
6
|
+
* combinations to render and screenshot.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { ComponentShowcase } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Full showcase specification for all molecule UI components.
|
|
13
|
+
*
|
|
14
|
+
* Components are ordered by category: actions, form inputs, data display,
|
|
15
|
+
* feedback, layout, and overlay/interactive.
|
|
16
|
+
*/
|
|
17
|
+
export declare const showcaseComponents: ComponentShowcase[];
|
|
18
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAKnD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,EAmPjD,CAAA"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component showcase specifications.
|
|
3
|
+
*
|
|
4
|
+
* Defines every component and its visual variation axes for cross-framework
|
|
5
|
+
* visual regression testing. Each entry generates a matrix of all prop
|
|
6
|
+
* combinations to render and screenshot.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
const COLORS = ['primary', 'secondary', 'success', 'warning', 'error', 'info'];
|
|
11
|
+
const SIZES = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
12
|
+
/**
|
|
13
|
+
* Full showcase specification for all molecule UI components.
|
|
14
|
+
*
|
|
15
|
+
* Components are ordered by category: actions, form inputs, data display,
|
|
16
|
+
* feedback, layout, and overlay/interactive.
|
|
17
|
+
*/
|
|
18
|
+
export const showcaseComponents = [
|
|
19
|
+
// ── Actions ──────────────────────────────────────────────────────────
|
|
20
|
+
{
|
|
21
|
+
name: 'Button',
|
|
22
|
+
propMatrix: {
|
|
23
|
+
variant: ['solid', 'outline', 'ghost', 'link'],
|
|
24
|
+
color: [...COLORS],
|
|
25
|
+
size: [...SIZES],
|
|
26
|
+
},
|
|
27
|
+
children: 'Button',
|
|
28
|
+
svelteElement: 'button',
|
|
29
|
+
},
|
|
30
|
+
// ── Form Inputs ──────────────────────────────────────────────────────
|
|
31
|
+
{
|
|
32
|
+
name: 'Input',
|
|
33
|
+
propMatrix: {
|
|
34
|
+
size: [...SIZES],
|
|
35
|
+
},
|
|
36
|
+
defaultProps: { placeholder: 'Enter text...' },
|
|
37
|
+
children: false,
|
|
38
|
+
svelteElement: 'input',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Input',
|
|
42
|
+
propMatrix: {
|
|
43
|
+
error: ['', 'This field is required'],
|
|
44
|
+
},
|
|
45
|
+
defaultProps: { placeholder: 'With error state', size: 'md', label: 'Label' },
|
|
46
|
+
children: false,
|
|
47
|
+
svelteElement: 'input',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Textarea',
|
|
51
|
+
propMatrix: {
|
|
52
|
+
size: [...SIZES],
|
|
53
|
+
},
|
|
54
|
+
defaultProps: { placeholder: 'Enter text...', rows: 3 },
|
|
55
|
+
children: false,
|
|
56
|
+
svelteElement: 'textarea',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Select',
|
|
60
|
+
propMatrix: {
|
|
61
|
+
size: [...SIZES],
|
|
62
|
+
},
|
|
63
|
+
defaultProps: {
|
|
64
|
+
options: [
|
|
65
|
+
{ value: 'a', label: 'Option A' },
|
|
66
|
+
{ value: 'b', label: 'Option B' },
|
|
67
|
+
{ value: 'c', label: 'Option C' },
|
|
68
|
+
],
|
|
69
|
+
placeholder: 'Select...',
|
|
70
|
+
},
|
|
71
|
+
children: false,
|
|
72
|
+
svelteElement: 'select',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Checkbox',
|
|
76
|
+
propMatrix: {
|
|
77
|
+
checked: [false, true],
|
|
78
|
+
size: ['sm', 'md', 'lg'],
|
|
79
|
+
},
|
|
80
|
+
defaultProps: { label: 'Checkbox label' },
|
|
81
|
+
children: false,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'RadioGroup',
|
|
85
|
+
propMatrix: {
|
|
86
|
+
size: ['sm', 'md', 'lg'],
|
|
87
|
+
direction: ['horizontal', 'vertical'],
|
|
88
|
+
},
|
|
89
|
+
defaultProps: {
|
|
90
|
+
options: [
|
|
91
|
+
{ value: 'a', label: 'Option A' },
|
|
92
|
+
{ value: 'b', label: 'Option B' },
|
|
93
|
+
{ value: 'c', label: 'Option C' },
|
|
94
|
+
],
|
|
95
|
+
value: 'a',
|
|
96
|
+
},
|
|
97
|
+
children: false,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Switch',
|
|
101
|
+
propMatrix: {
|
|
102
|
+
checked: [false, true],
|
|
103
|
+
color: [...COLORS],
|
|
104
|
+
size: ['sm', 'md', 'lg'],
|
|
105
|
+
},
|
|
106
|
+
defaultProps: { label: 'Toggle' },
|
|
107
|
+
children: false,
|
|
108
|
+
},
|
|
109
|
+
// ── Data Display ─────────────────────────────────────────────────────
|
|
110
|
+
{
|
|
111
|
+
name: 'Badge',
|
|
112
|
+
propMatrix: {
|
|
113
|
+
variant: ['solid', 'outline', 'subtle'],
|
|
114
|
+
color: [...COLORS],
|
|
115
|
+
size: [...SIZES],
|
|
116
|
+
},
|
|
117
|
+
children: 'Badge',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'Avatar',
|
|
121
|
+
propMatrix: {
|
|
122
|
+
size: [...SIZES],
|
|
123
|
+
},
|
|
124
|
+
defaultProps: { name: 'John Doe' },
|
|
125
|
+
children: false,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'Table',
|
|
129
|
+
propMatrix: {
|
|
130
|
+
bordered: [false, true],
|
|
131
|
+
striped: [false, true],
|
|
132
|
+
},
|
|
133
|
+
defaultProps: {
|
|
134
|
+
data: [
|
|
135
|
+
{ id: '1', name: 'Alice', role: 'Engineer' },
|
|
136
|
+
{ id: '2', name: 'Bob', role: 'Designer' },
|
|
137
|
+
{ id: '3', name: 'Charlie', role: 'Manager' },
|
|
138
|
+
],
|
|
139
|
+
columns: [
|
|
140
|
+
{ key: 'name', header: 'Name' },
|
|
141
|
+
{ key: 'role', header: 'Role' },
|
|
142
|
+
],
|
|
143
|
+
rowKey: 'id',
|
|
144
|
+
size: 'md',
|
|
145
|
+
},
|
|
146
|
+
children: false,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'Tabs',
|
|
150
|
+
propMatrix: {
|
|
151
|
+
variant: ['line', 'enclosed', 'soft-rounded', 'solid-rounded'],
|
|
152
|
+
size: ['sm', 'md', 'lg'],
|
|
153
|
+
},
|
|
154
|
+
defaultProps: {
|
|
155
|
+
items: [
|
|
156
|
+
{ value: 'tab1', label: 'Tab 1', content: 'Content 1' },
|
|
157
|
+
{ value: 'tab2', label: 'Tab 2', content: 'Content 2' },
|
|
158
|
+
{ value: 'tab3', label: 'Tab 3', content: 'Content 3' },
|
|
159
|
+
],
|
|
160
|
+
defaultValue: 'tab1',
|
|
161
|
+
},
|
|
162
|
+
children: false,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'Accordion',
|
|
166
|
+
propMatrix: {
|
|
167
|
+
multiple: [false, true],
|
|
168
|
+
},
|
|
169
|
+
defaultProps: {
|
|
170
|
+
items: [
|
|
171
|
+
{ value: 'item1', header: 'Section 1', content: 'Content for section 1.' },
|
|
172
|
+
{ value: 'item2', header: 'Section 2', content: 'Content for section 2.' },
|
|
173
|
+
{ value: 'item3', header: 'Section 3', content: 'Content for section 3.' },
|
|
174
|
+
],
|
|
175
|
+
defaultValue: 'item1',
|
|
176
|
+
collapsible: true,
|
|
177
|
+
},
|
|
178
|
+
children: false,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Pagination',
|
|
182
|
+
propMatrix: {
|
|
183
|
+
size: ['sm', 'md', 'lg'],
|
|
184
|
+
},
|
|
185
|
+
defaultProps: {
|
|
186
|
+
page: 3,
|
|
187
|
+
totalPages: 10,
|
|
188
|
+
onChange: () => { },
|
|
189
|
+
showPrevNext: true,
|
|
190
|
+
showFirstLast: true,
|
|
191
|
+
},
|
|
192
|
+
children: false,
|
|
193
|
+
},
|
|
194
|
+
// ── Feedback ─────────────────────────────────────────────────────────
|
|
195
|
+
{
|
|
196
|
+
name: 'Alert',
|
|
197
|
+
propMatrix: {
|
|
198
|
+
status: [...COLORS],
|
|
199
|
+
},
|
|
200
|
+
defaultProps: { title: 'Alert Title' },
|
|
201
|
+
children: 'This is an alert message with details.',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'Spinner',
|
|
205
|
+
propMatrix: {
|
|
206
|
+
size: [...SIZES],
|
|
207
|
+
color: ['primary', 'secondary', 'success', 'error'],
|
|
208
|
+
},
|
|
209
|
+
children: false,
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'Progress',
|
|
213
|
+
propMatrix: {
|
|
214
|
+
color: [...COLORS],
|
|
215
|
+
size: ['sm', 'md', 'lg'],
|
|
216
|
+
},
|
|
217
|
+
defaultProps: { value: 65, max: 100 },
|
|
218
|
+
children: false,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'Skeleton',
|
|
222
|
+
propMatrix: {
|
|
223
|
+
animation: ['pulse', 'wave', 'none'],
|
|
224
|
+
},
|
|
225
|
+
defaultProps: { width: 200, height: 20 },
|
|
226
|
+
children: false,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: 'Toast',
|
|
230
|
+
propMatrix: {
|
|
231
|
+
status: ['success', 'warning', 'error', 'info'],
|
|
232
|
+
},
|
|
233
|
+
defaultProps: { title: 'Toast Title', description: 'Toast description text.' },
|
|
234
|
+
children: false,
|
|
235
|
+
},
|
|
236
|
+
// ── Layout ───────────────────────────────────────────────────────────
|
|
237
|
+
{
|
|
238
|
+
name: 'Card',
|
|
239
|
+
propMatrix: {
|
|
240
|
+
variant: ['elevated', 'outlined', 'filled'],
|
|
241
|
+
padding: ['sm', 'md', 'lg'],
|
|
242
|
+
},
|
|
243
|
+
children: 'Card content goes here.',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'Separator',
|
|
247
|
+
propMatrix: {
|
|
248
|
+
orientation: ['horizontal', 'vertical'],
|
|
249
|
+
},
|
|
250
|
+
children: false,
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAU,CAAA;AACvF,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAA;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB;IACrD,wEAAwE;IAExE;QACE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,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
|
+
/**
|
|
2
|
+
* Component showcase specifications for cross-framework visual regression testing.
|
|
3
|
+
*
|
|
4
|
+
* Provides framework-agnostic data describing which components to render
|
|
5
|
+
* and which prop combinations to test. Used by showcase templates in mlcl
|
|
6
|
+
* to generate minimal apps per framework, then screenshotted by Playwright.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
export * from './components.js';
|
|
11
|
+
export * from './types.js';
|
|
12
|
+
export * from './utils.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component showcase specifications for cross-framework visual regression testing.
|
|
3
|
+
*
|
|
4
|
+
* Provides framework-agnostic data describing which components to render
|
|
5
|
+
* and which prop combinations to test. Used by showcase templates in mlcl
|
|
6
|
+
* to generate minimal apps per framework, then screenshotted by Playwright.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
export * from './components.js';
|
|
11
|
+
export * from './types.js';
|
|
12
|
+
export * from './utils.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for component showcase specifications.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Specification for showcasing a single component across all its visual variations.
|
|
8
|
+
*
|
|
9
|
+
* The `propMatrix` defines axes of variation — every combination is rendered.
|
|
10
|
+
* `defaultProps` supplies required or baseline props applied to every variation.
|
|
11
|
+
* `children` provides text content (set to `false` for components with no children).
|
|
12
|
+
*/
|
|
13
|
+
export interface ComponentShowcase {
|
|
14
|
+
/**
|
|
15
|
+
* Component export name (must match the named export from `@molecule/app-ui-{framework}`).
|
|
16
|
+
* For Svelte, maps to the `get{Name}Classes` utility function.
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* Props to vary across the matrix. Each key is a prop name, each value is
|
|
21
|
+
* the array of values to test. All combinations are generated.
|
|
22
|
+
*
|
|
23
|
+
* Example: `{ variant: ['solid', 'outline'], color: ['primary', 'error'] }`
|
|
24
|
+
* produces 4 combinations.
|
|
25
|
+
*/
|
|
26
|
+
propMatrix: Record<string, unknown[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Props applied to every variation (e.g., required props, sample data).
|
|
29
|
+
*/
|
|
30
|
+
defaultProps?: Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Text content to render as children. Set to `false` for components that
|
|
33
|
+
* don't accept children (e.g., Spinner, Separator).
|
|
34
|
+
*/
|
|
35
|
+
children?: string | false;
|
|
36
|
+
/**
|
|
37
|
+
* The HTML element to render for Svelte class-utility components.
|
|
38
|
+
* Defaults to 'div'. Use 'button' for Button, 'input' for Input, etc.
|
|
39
|
+
*/
|
|
40
|
+
svelteElement?: string;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IAErC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAEtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for generating prop combinations from a showcase matrix.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generate all combinations from a prop matrix.
|
|
8
|
+
*
|
|
9
|
+
* Given `{ variant: ['solid', 'outline'], color: ['primary', 'error'] }`,
|
|
10
|
+
* returns:
|
|
11
|
+
* ```
|
|
12
|
+
* [
|
|
13
|
+
* { variant: 'solid', color: 'primary' },
|
|
14
|
+
* { variant: 'solid', color: 'error' },
|
|
15
|
+
* { variant: 'outline', color: 'primary' },
|
|
16
|
+
* { variant: 'outline', color: 'error' },
|
|
17
|
+
* ]
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param matrix - Object mapping prop names to arrays of possible values.
|
|
21
|
+
* @returns Array of objects, one per combination.
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateCombinations(matrix: Record<string, unknown[]>): Record<string, unknown>[];
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CA0BjG"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for generating prop combinations from a showcase matrix.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generate all combinations from a prop matrix.
|
|
8
|
+
*
|
|
9
|
+
* Given `{ variant: ['solid', 'outline'], color: ['primary', 'error'] }`,
|
|
10
|
+
* returns:
|
|
11
|
+
* ```
|
|
12
|
+
* [
|
|
13
|
+
* { variant: 'solid', color: 'primary' },
|
|
14
|
+
* { variant: 'solid', color: 'error' },
|
|
15
|
+
* { variant: 'outline', color: 'primary' },
|
|
16
|
+
* { variant: 'outline', color: 'error' },
|
|
17
|
+
* ]
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @param matrix - Object mapping prop names to arrays of possible values.
|
|
21
|
+
* @returns Array of objects, one per combination.
|
|
22
|
+
*/
|
|
23
|
+
export function generateCombinations(matrix) {
|
|
24
|
+
const keys = Object.keys(matrix);
|
|
25
|
+
if (keys.length === 0)
|
|
26
|
+
return [{}];
|
|
27
|
+
const result = [];
|
|
28
|
+
/**
|
|
29
|
+
* Recursively build combinations by iterating through each matrix key.
|
|
30
|
+
*
|
|
31
|
+
* @param index - Current key index in the keys array.
|
|
32
|
+
* @param current - Accumulated prop combination so far.
|
|
33
|
+
*/
|
|
34
|
+
function recurse(index, current) {
|
|
35
|
+
if (index === keys.length) {
|
|
36
|
+
result.push({ ...current });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const key = keys[index];
|
|
40
|
+
for (const value of matrix[key]) {
|
|
41
|
+
current[key] = value;
|
|
42
|
+
recurse(index + 1, current);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
recurse(0, {});
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAiC;IACpE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAElC,MAAM,MAAM,GAA8B,EAAE,CAAA;IAE5C;;;;;OAKG;IACH,SAAS,OAAO,CAAC,KAAa,EAAE,OAAgC;QAC9D,IAAI,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;YAC3B,OAAM;QACR,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA;QACvB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;YACpB,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACd,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@molecule/app-ui-showcase",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Component showcase specifications for cross-framework visual regression testing",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"test": "vitest run",
|
|
11
|
+
"test:watch": "vitest"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"molecule",
|
|
24
|
+
"ui",
|
|
25
|
+
"showcase",
|
|
26
|
+
"visual-testing"
|
|
27
|
+
],
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@molecule/app-ui": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@molecule/app-ui": "1.0.0",
|
|
34
|
+
"@types/node": "26.1.2",
|
|
35
|
+
"typescript": "6.0.3",
|
|
36
|
+
"vitest": "4.1.10"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
41
|
+
"directory": "packages/app/core/ui-showcase"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/molecule-dev/molecule/tree/main/packages/app/core/ui-showcase",
|
|
44
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
}
|
|
48
|
+
}
|