skillui 1.1.2 → 1.1.3

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.
Files changed (61) hide show
  1. package/dist/cli.js +105073 -194
  2. package/package.json +15 -6
  3. package/dist/cli.d.ts +0 -3
  4. package/dist/extractors/components.d.ts +0 -11
  5. package/dist/extractors/components.js +0 -455
  6. package/dist/extractors/framework.d.ts +0 -4
  7. package/dist/extractors/framework.js +0 -126
  8. package/dist/extractors/tokens/computed.d.ts +0 -7
  9. package/dist/extractors/tokens/computed.js +0 -249
  10. package/dist/extractors/tokens/css.d.ts +0 -3
  11. package/dist/extractors/tokens/css.js +0 -510
  12. package/dist/extractors/tokens/http-css.d.ts +0 -14
  13. package/dist/extractors/tokens/http-css.js +0 -1689
  14. package/dist/extractors/tokens/tailwind.d.ts +0 -3
  15. package/dist/extractors/tokens/tailwind.js +0 -353
  16. package/dist/extractors/tokens/tokens-file.d.ts +0 -3
  17. package/dist/extractors/tokens/tokens-file.js +0 -229
  18. package/dist/extractors/ultra/animations.d.ts +0 -21
  19. package/dist/extractors/ultra/animations.js +0 -527
  20. package/dist/extractors/ultra/components-dom.d.ts +0 -13
  21. package/dist/extractors/ultra/components-dom.js +0 -149
  22. package/dist/extractors/ultra/interactions.d.ts +0 -14
  23. package/dist/extractors/ultra/interactions.js +0 -222
  24. package/dist/extractors/ultra/layout.d.ts +0 -14
  25. package/dist/extractors/ultra/layout.js +0 -123
  26. package/dist/extractors/ultra/pages.d.ts +0 -16
  27. package/dist/extractors/ultra/pages.js +0 -228
  28. package/dist/font-resolver.d.ts +0 -10
  29. package/dist/font-resolver.js +0 -280
  30. package/dist/modes/dir.d.ts +0 -6
  31. package/dist/modes/dir.js +0 -213
  32. package/dist/modes/repo.d.ts +0 -6
  33. package/dist/modes/repo.js +0 -76
  34. package/dist/modes/ultra.d.ts +0 -22
  35. package/dist/modes/ultra.js +0 -281
  36. package/dist/modes/url.d.ts +0 -14
  37. package/dist/modes/url.js +0 -161
  38. package/dist/normalizer.d.ts +0 -11
  39. package/dist/normalizer.js +0 -867
  40. package/dist/playwright-loader.d.ts +0 -10
  41. package/dist/playwright-loader.js +0 -71
  42. package/dist/screenshot.d.ts +0 -9
  43. package/dist/screenshot.js +0 -94
  44. package/dist/types-ultra.d.ts +0 -157
  45. package/dist/types-ultra.js +0 -4
  46. package/dist/types.d.ts +0 -182
  47. package/dist/types.js +0 -4
  48. package/dist/writers/animations-md.d.ts +0 -17
  49. package/dist/writers/animations-md.js +0 -313
  50. package/dist/writers/components-md.d.ts +0 -8
  51. package/dist/writers/components-md.js +0 -151
  52. package/dist/writers/design-md.d.ts +0 -7
  53. package/dist/writers/design-md.js +0 -704
  54. package/dist/writers/interactions-md.d.ts +0 -8
  55. package/dist/writers/interactions-md.js +0 -146
  56. package/dist/writers/layout-md.d.ts +0 -8
  57. package/dist/writers/layout-md.js +0 -120
  58. package/dist/writers/skill.d.ts +0 -12
  59. package/dist/writers/skill.js +0 -1006
  60. package/dist/writers/tokens-json.d.ts +0 -11
  61. package/dist/writers/tokens-json.js +0 -164
@@ -1,8 +0,0 @@
1
- import { InteractionRecord } from '../types-ultra';
2
- import { DesignProfile } from '../types';
3
- /**
4
- * Generate references/INTERACTIONS.md
5
- * Documents hover/focus micro-interactions with style diffs and screenshot references.
6
- */
7
- export declare function generateInteractionsMd(interactions: InteractionRecord[], profile: DesignProfile): string;
8
- //# sourceMappingURL=interactions-md.d.ts.map
@@ -1,146 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateInteractionsMd = generateInteractionsMd;
4
- /**
5
- * Generate references/INTERACTIONS.md
6
- * Documents hover/focus micro-interactions with style diffs and screenshot references.
7
- */
8
- function generateInteractionsMd(interactions, profile) {
9
- let md = `# Interaction Reference\n\n`;
10
- md += `> Micro-interactions extracted from live DOM. Recreate these exactly for authentic feel.\n\n`;
11
- if (interactions.length === 0) {
12
- md += `No interaction data extracted (Playwright required).\n`;
13
- return md;
14
- }
15
- // ── Overview ────────────────────────────────────────────────────────
16
- const byType = groupBy(interactions, i => i.componentType);
17
- md += `## Coverage\n\n`;
18
- md += `| Component Type | Count | States Captured |\n`;
19
- md += `|----------------|-------|----------------|\n`;
20
- for (const [type, records] of Object.entries(byType)) {
21
- const states = new Set();
22
- records.forEach(r => {
23
- if (r.screenshots.default)
24
- states.add('default');
25
- if (r.screenshots.hover)
26
- states.add('hover');
27
- if (r.screenshots.focus)
28
- states.add('focus');
29
- });
30
- md += `| ${formatType(type)} | ${records.length} | ${[...states].join(', ')} |\n`;
31
- }
32
- md += `\n`;
33
- // ── Transition System ───────────────────────────────────────────────
34
- const transitionValues = interactions
35
- .map(i => i.transitionValue)
36
- .filter(t => t && t !== 'all 0s ease 0s' && t !== 'none' && !t.startsWith('all 0s'));
37
- const uniqueTransitions = [...new Set(transitionValues)];
38
- if (uniqueTransitions.length > 0) {
39
- md += `## Transition System\n\n`;
40
- md += `These transition declarations were extracted from interactive elements:\n\n`;
41
- md += `\`\`\`css\n`;
42
- for (const t of uniqueTransitions.slice(0, 8)) {
43
- md += `transition: ${t};\n`;
44
- }
45
- md += `\`\`\`\n\n`;
46
- md += `Apply these to all interactive elements. Never invent new durations or easings.\n\n`;
47
- }
48
- // ── Per Component Type ─────────────────────────────────────────────
49
- for (const [type, records] of Object.entries(byType)) {
50
- md += `## ${formatType(type)} Interactions\n\n`;
51
- for (const rec of records) {
52
- md += `### ${formatType(type)} ${rec.index} — \`${rec.label}\`\n\n`;
53
- // Screenshots
54
- if (rec.screenshots.default || rec.screenshots.hover || rec.screenshots.focus) {
55
- md += `**States:**\n\n`;
56
- if (rec.screenshots.default) {
57
- md += `- Default: \`../${rec.screenshots.default}\`\n`;
58
- }
59
- if (rec.screenshots.hover) {
60
- md += `- Hover: \`../${rec.screenshots.hover}\`\n`;
61
- }
62
- if (rec.screenshots.focus) {
63
- md += `- Focus: \`../${rec.screenshots.focus}\`\n`;
64
- }
65
- md += `\n`;
66
- }
67
- // Hover changes
68
- if (rec.hoverChanges.length > 0) {
69
- md += `**On hover:**\n\n`;
70
- md += `\`\`\`css\n`;
71
- for (const diff of rec.hoverChanges) {
72
- md += `/* ${cssProperty(diff.property)}: ${diff.from} → */ ${cssProperty(diff.property)}: ${diff.to};\n`;
73
- }
74
- md += `\`\`\`\n\n`;
75
- }
76
- // Focus changes
77
- if (rec.focusChanges.length > 0) {
78
- md += `**On focus:**\n\n`;
79
- md += `\`\`\`css\n`;
80
- for (const diff of rec.focusChanges) {
81
- md += `/* ${cssProperty(diff.property)}: ${diff.from} → */ ${cssProperty(diff.property)}: ${diff.to};\n`;
82
- }
83
- md += `\`\`\`\n\n`;
84
- }
85
- // Transition
86
- if (rec.transitionValue && rec.transitionValue !== 'none' && rec.transitionValue !== 'all 0s ease 0s') {
87
- md += `**Transition:** \`${rec.transitionValue}\`\n\n`;
88
- }
89
- if (rec.hoverChanges.length === 0 && rec.focusChanges.length === 0) {
90
- md += `_No visible style changes detected for this element._\n\n`;
91
- }
92
- }
93
- }
94
- // ── Interaction Rules ──────────────────────────────────────────────
95
- md += `## Interaction Rules\n\n`;
96
- const accent = profile.colors.find(c => c.role === 'accent');
97
- if (accent) {
98
- md += `- Accent color \`${accent.hex}\` is used for focus rings, active states, and hover highlights\n`;
99
- }
100
- const hasOpacityHover = interactions.some(i => i.hoverChanges.some(d => d.property === 'opacity'));
101
- if (hasOpacityHover) {
102
- md += `- Hover effects use **opacity** changes, not color shifts\n`;
103
- }
104
- const hasColorHover = interactions.some(i => i.hoverChanges.some(d => d.property === 'color' || d.property === 'backgroundColor'));
105
- if (hasColorHover) {
106
- md += `- Hover effects include **color transitions** — use the extracted values, not approximations\n`;
107
- }
108
- const hasFocusOutline = interactions.some(i => i.focusChanges.some(d => d.property === 'outline' || d.property === 'outlineColor'));
109
- if (hasFocusOutline) {
110
- md += `- Focus states use **outline** (not box-shadow) — always match the extracted focus ring\n`;
111
- }
112
- if (uniqueTransitions.length > 0) {
113
- const durations = uniqueTransitions
114
- .join(' ')
115
- .match(/\d+(?:\.\d+)?(?:ms|s)/g) || [];
116
- const uniqueDurations = [...new Set(durations)];
117
- if (uniqueDurations.length > 0) {
118
- md += `- Transition durations in use: ${uniqueDurations.map(d => `\`${d}\``).join(', ')}\n`;
119
- }
120
- }
121
- md += `- Always respect \`prefers-reduced-motion\` — set all transitions to \`0s\` when enabled\n`;
122
- md += `\n`;
123
- return md;
124
- }
125
- function formatType(type) {
126
- const map = {
127
- button: 'Button',
128
- link: 'Link',
129
- input: 'Input',
130
- 'role-button': 'Role Button',
131
- };
132
- return map[type] || type;
133
- }
134
- function cssProperty(camelCase) {
135
- return camelCase.replace(/([A-Z])/g, '-$1').toLowerCase();
136
- }
137
- function groupBy(arr, key) {
138
- return arr.reduce((acc, item) => {
139
- const k = key(item);
140
- if (!acc[k])
141
- acc[k] = [];
142
- acc[k].push(item);
143
- return acc;
144
- }, {});
145
- }
146
- //# sourceMappingURL=interactions-md.js.map
@@ -1,8 +0,0 @@
1
- import { LayoutRecord } from '../types-ultra';
2
- import { DesignProfile } from '../types';
3
- /**
4
- * Generate references/LAYOUT.md
5
- * Documents DOM layout patterns, spacing relationships, and grid system.
6
- */
7
- export declare function generateLayoutMd(layouts: LayoutRecord[], profile: DesignProfile): string;
8
- //# sourceMappingURL=layout-md.d.ts.map
@@ -1,120 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateLayoutMd = generateLayoutMd;
4
- /**
5
- * Generate references/LAYOUT.md
6
- * Documents DOM layout patterns, spacing relationships, and grid system.
7
- */
8
- function generateLayoutMd(layouts, profile) {
9
- let md = `# Layout Reference\n\n`;
10
- md += `> Auto-extracted from live DOM. Use this to understand how the site is structured spatially.\n\n`;
11
- if (layouts.length === 0) {
12
- md += `No layout data extracted (Playwright required).\n`;
13
- return md;
14
- }
15
- // ── Spacing System ─────────────────────────────────────────────────
16
- md += `## Spacing System\n\n`;
17
- md += `**Base grid:** ${profile.spacing.base}px\n\n`;
18
- if (profile.spacing.values.length > 0) {
19
- md += `**Scale:** \`${profile.spacing.values.slice(0, 16).join(', ')}\` px\n\n`;
20
- }
21
- md += `| Spacing | Semantic Use |\n`;
22
- md += `|---------|-------------|\n`;
23
- const base = profile.spacing.base;
24
- md += `| ${base}px | Tight — within a component |\n`;
25
- md += `| ${base * 2}px | Medium — between sibling items |\n`;
26
- md += `| ${base * 4}px | Wide — between sections |\n`;
27
- md += `| ${base * 8}px | Vast — major section breaks |\n`;
28
- md += `\n`;
29
- // ── Flex Layouts ────────────────────────────────────────────────────
30
- const flexLayouts = layouts.filter(l => l.display === 'flex' || l.display === 'inline-flex');
31
- if (flexLayouts.length > 0) {
32
- md += `## Flex Layouts\n\n`;
33
- md += `| Element | Direction | Justify | Align | Gap | Children |\n`;
34
- md += `|---------|-----------|---------|-------|-----|----------|\n`;
35
- for (const l of flexLayouts.slice(0, 15)) {
36
- const dir = l.flexDirection || 'row';
37
- const justify = simplify(l.justifyContent);
38
- const align = simplify(l.alignItems);
39
- const gap = l.gap && l.gap !== 'normal' ? l.gap : '—';
40
- md += `| \`${l.selector}\` | ${dir} | ${justify} | ${align} | ${gap} | ${l.childCount} |\n`;
41
- }
42
- md += `\n`;
43
- }
44
- // ── Grid Layouts ────────────────────────────────────────────────────
45
- const gridLayouts = layouts.filter(l => l.display === 'grid' || l.display === 'inline-grid');
46
- if (gridLayouts.length > 0) {
47
- md += `## Grid Layouts\n\n`;
48
- md += `| Element | Template Columns | Gap | Children |\n`;
49
- md += `|---------|-----------------|-----|----------|\n`;
50
- for (const l of gridLayouts.slice(0, 10)) {
51
- const cols = l.gridTemplateColumns && l.gridTemplateColumns !== 'none'
52
- ? l.gridTemplateColumns.slice(0, 50)
53
- : '—';
54
- const gap = l.gap && l.gap !== 'normal' ? l.gap : '—';
55
- md += `| \`${l.selector}\` | \`${cols}\` | ${gap} | ${l.childCount} |\n`;
56
- }
57
- md += `\n`;
58
- }
59
- // ── Key Layout Containers ──────────────────────────────────────────
60
- const structural = layouts.filter(l => ['header', 'nav', 'main', 'footer', 'section', 'article'].includes(l.tag));
61
- if (structural.length > 0) {
62
- md += `## Structural Containers\n\n`;
63
- for (const l of structural.slice(0, 12)) {
64
- md += `### \`<${l.tag}>\` ${l.selector !== l.tag ? `(\`${l.selector}\`)` : ''}\n\n`;
65
- md += `\`\`\`\n`;
66
- md += `display: ${l.display}\n`;
67
- if (l.display === 'flex' || l.display === 'inline-flex') {
68
- md += `flex-direction: ${l.flexDirection || 'row'}\n`;
69
- md += `justify-content: ${simplify(l.justifyContent)}\n`;
70
- md += `align-items: ${simplify(l.alignItems)}\n`;
71
- }
72
- if (l.display === 'grid' || l.display === 'inline-grid') {
73
- if (l.gridTemplateColumns && l.gridTemplateColumns !== 'none') {
74
- md += `grid-template-columns: ${l.gridTemplateColumns.slice(0, 60)}\n`;
75
- }
76
- }
77
- if (l.gap && l.gap !== 'normal')
78
- md += `gap: ${l.gap}\n`;
79
- if (l.padding && l.padding !== '0px')
80
- md += `padding: ${l.padding}\n`;
81
- if (l.maxWidth && l.maxWidth !== 'none')
82
- md += `max-width: ${l.maxWidth}\n`;
83
- md += `children: ${l.childCount}\n`;
84
- md += `\`\`\`\n\n`;
85
- }
86
- }
87
- // ── Layout Anti-Patterns ───────────────────────────────────────────
88
- md += `## Layout Rules\n\n`;
89
- const hasContainer = layouts.some(l => l.maxWidth && l.maxWidth !== 'none' && l.maxWidth !== '');
90
- if (hasContainer) {
91
- const containerEl = layouts.find(l => l.maxWidth && l.maxWidth !== 'none');
92
- md += `- **Container max-width:** \`${containerEl?.maxWidth}\` — always center with \`margin: auto\`\n`;
93
- }
94
- const hasGrid = gridLayouts.length > 0;
95
- const hasFlex = flexLayouts.length > 0;
96
- if (hasFlex)
97
- md += `- Primary layout system: **Flexbox**\n`;
98
- if (hasGrid)
99
- md += `- Secondary layout system: **CSS Grid** (used for card grids and multi-column layouts)\n`;
100
- md += `- Every spacing value must be a multiple of **${base}px**\n`;
101
- md += `- Never use arbitrary margin/padding values outside the spacing scale\n`;
102
- md += `\n`;
103
- return md;
104
- }
105
- function simplify(val) {
106
- if (!val)
107
- return '—';
108
- const map = {
109
- 'flex-start': 'start',
110
- 'flex-end': 'end',
111
- 'space-between': 'space-between',
112
- 'space-around': 'space-around',
113
- 'space-evenly': 'space-evenly',
114
- 'center': 'center',
115
- 'stretch': 'stretch',
116
- 'normal': '—',
117
- };
118
- return map[val] || val;
119
- }
120
- //# sourceMappingURL=layout-md.js.map
@@ -1,12 +0,0 @@
1
- import { DesignProfile } from '../types';
2
- import { FullAnimationResult } from '../types-ultra';
3
- /**
4
- * Generate SKILL.md + references/DESIGN.md and package as .skill zip file.
5
- * @param screenshotPath - optional local path to homepage screenshot (relative to skillDir)
6
- * @param ultraResult - optional full animation/ultra data for embedding scroll journey
7
- */
8
- export declare function generateSkill(profile: DesignProfile, designMdContent: string, outputDir: string, screenshotPath?: string | null, ultraResult?: FullAnimationResult | null): Promise<{
9
- skillDir: string;
10
- skillFile: string;
11
- }>;
12
- //# sourceMappingURL=skill.d.ts.map