fractalstyler2 0.4.0 → 0.7.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.
Files changed (87) hide show
  1. package/README.md +114 -95
  2. package/dist/cli.js +105 -25
  3. package/dist/components/Accordion.svelte +44 -0
  4. package/dist/components/Accordion.svelte.d.ts +23 -0
  5. package/dist/components/AccordionItem.svelte +44 -0
  6. package/dist/components/AccordionItem.svelte.d.ts +21 -0
  7. package/dist/components/AppShell.svelte +86 -0
  8. package/dist/components/AppShell.svelte.d.ts +39 -0
  9. package/dist/components/ColorPicker.svelte +38 -0
  10. package/dist/components/ColorPicker.svelte.d.ts +6 -0
  11. package/dist/components/Hero.svelte +14 -0
  12. package/dist/components/Hero.svelte.d.ts +9 -0
  13. package/dist/components/LayoutPicker.svelte +34 -0
  14. package/dist/components/LayoutPicker.svelte.d.ts +6 -0
  15. package/dist/components/MotionPicker.svelte +34 -0
  16. package/dist/components/MotionPicker.svelte.d.ts +6 -0
  17. package/dist/components/PageShell.svelte +14 -0
  18. package/dist/components/PageShell.svelte.d.ts +9 -0
  19. package/dist/components/PageSplit.svelte +26 -0
  20. package/dist/components/PageSplit.svelte.d.ts +18 -0
  21. package/dist/components/ShapePicker.svelte +37 -0
  22. package/dist/components/ShapePicker.svelte.d.ts +6 -0
  23. package/dist/css/fractalstyler.css +10643 -0
  24. package/dist/css/fractalstyler.min.css +2 -0
  25. package/dist/index.d.ts +18 -6
  26. package/dist/index.js +30 -12
  27. package/dist/mcp/schemas/compile_fractals.json +3 -3
  28. package/dist/mcp/schemas/css_to_fractals.json +1 -1
  29. package/dist/mcp/schemas/generate_component.json +2 -2
  30. package/dist/mcp/schemas/instructions.md +41 -14
  31. package/dist/mcp/schemas/list_fractals.json +9 -7
  32. package/dist/mcp/schemas/validate_recipe.json +2 -2
  33. package/dist/mcp/server.d.ts +1 -1
  34. package/dist/mcp/server.js +334 -237
  35. package/dist/presets.core.d.ts +42 -0
  36. package/dist/presets.core.js +190 -0
  37. package/dist/presets.svelte.d.ts +6 -0
  38. package/dist/presets.svelte.js +21 -0
  39. package/dist/styles/_00_presets.sass +111 -0
  40. package/dist/styles/_00_themes.sass +1061 -0
  41. package/dist/styles/_00_tokens.sass +57 -17
  42. package/dist/styles/_01_config.sass +77 -70
  43. package/dist/styles/_02_dimensions.sass +174 -0
  44. package/dist/styles/_03_containers.sass +105 -0
  45. package/dist/styles/_04_layouts.sass +100 -0
  46. package/dist/styles/_05_shells.sass +374 -0
  47. package/dist/styles/_06_visuals.sass +236 -0
  48. package/dist/styles/_07_interactions.sass +112 -0
  49. package/dist/styles/_08_own.sass +4 -0
  50. package/dist/styles/canonical-markups.md +160 -0
  51. package/dist/styles/index.sass +11 -18
  52. package/dist/themes.d.ts +7 -0
  53. package/dist/themes.js +45 -0
  54. package/dist/version.d.ts +1 -0
  55. package/dist/version.js +2 -0
  56. package/package.json +26 -15
  57. package/plugin.json +11 -10
  58. package/registry.json +2002 -0
  59. package/skills/fractal-styler/SKILL.md +137 -50
  60. package/skills/fractal-styler/references/fractals.md +416 -28
  61. package/skills/fractal-styler/references/tokens.md +110 -36
  62. package/dist/styles/_02_fonts.sass +0 -13
  63. package/dist/styles/_03_responsive.sass +0 -31
  64. package/dist/styles/_04_atoms.sass +0 -155
  65. package/dist/styles/_05_molecules.sass +0 -97
  66. package/dist/styles/_06_recipes.sass +0 -189
  67. package/dist/styles/_07_base.sass +0 -44
  68. package/dist/styles/_08_blocks.sass +0 -433
  69. package/dist/styles/_09_utilities.sass +0 -208
  70. package/dist/styles/_10_layouts.sass +0 -373
  71. package/dist/styles/_11_own.sass +0 -21
  72. package/dist/styles/_fractals.sass +0 -14
  73. package/skills/style-migration/SKILL.md +0 -45
  74. package/templates/_00_tokens.sass +0 -136
  75. package/templates/_01_config.sass +0 -66
  76. package/templates/_02_fonts.sass +0 -13
  77. package/templates/_03_responsive.sass +0 -31
  78. package/templates/_04_atoms.sass +0 -155
  79. package/templates/_05_molecules.sass +0 -97
  80. package/templates/_06_recipes.sass +0 -189
  81. package/templates/_07_base.sass +0 -44
  82. package/templates/_08_blocks.sass +0 -433
  83. package/templates/_09_utilities.sass +0 -207
  84. package/templates/_10_layouts.sass +0 -373
  85. package/templates/_11_own.sass +0 -21
  86. package/templates/_fractals.sass +0 -14
  87. package/templates/index.sass +0 -18
@@ -0,0 +1,160 @@
1
+ ---
2
+ title: Canonical Markups
3
+ description: Source of truth for shell and layout markups
4
+ ---
5
+
6
+ > An L4 class without a canonical markup is an incomplete definition: the
7
+ > stylesheet cannot hold up its end alone. These are the structures the shell
8
+ > classes in `_05_shells.sass` assume — copy them verbatim and the responsive
9
+ > behaviour follows.
10
+
11
+ ## 1 - Canonical App Shell and Children
12
+
13
+ ```html
14
+ <div class="app-shell">
15
+ <header class="app-header"></header>
16
+ <main class="app-main">
17
+ <aside class="sidebar-left"></aside>
18
+ <section class="main-section">
19
+ <article class="content-shell"></article>
20
+ </section>
21
+ <aside class="sidebar-right"></aside>
22
+ </main>
23
+ <footer class="app-footer"></footer>
24
+ </div>
25
+ ```
26
+
27
+ | Class | Responsibility |
28
+ |---|---|
29
+ | `.app-shell` | min-height fill; column; publishes `--header-height` |
30
+ | `.app-header` | fixed-height bar (sticky), `height: var(--header-height)` |
31
+ | `.app-main` | the row below the header; `min-height: calc(100vh - var(--header-height))` |
32
+ | `.sidebar-left` / `.sidebar-right` | sticky columns; `top: var(--header-height)`; width from `--sidebar-width`; dress your own bg |
33
+ | `.main-section` | `min-width: 0`; owns horizontal padding via `.page-main` semantics |
34
+ | `.content-shell` | max-width content column inside main-section |
35
+ | `.app-footer` | full-width footer bar |
36
+
37
+ Status: **implemented** — `_05_shells.sass`.
38
+
39
+ ## 2 - Canonical Shell with Nav + TOC (roles)
40
+
41
+ One markup — the shell is role-bound (Amendment A1): `.sidebar-left` is the nav, `.sidebar-right` is the TOC. This single markup IS the definition of docs/navtree/toc; there is no `.docs` modifier.
42
+
43
+ ```html
44
+ <div class="app-shell">
45
+ <header class="app-header">
46
+ <button class="button is-icon" aria-expanded="false" aria-label="Menu"></button>
47
+ </header>
48
+ <main class="app-main">
49
+ <aside class="sidebar-left">
50
+ <nav class="navtree">
51
+ <div class="accordion">
52
+ <div class="accordion-item open">
53
+ <button class="accordion-trigger" aria-expanded="true">Section title</button>
54
+ <div class="accordion-content">
55
+ <div class="accordion-panel box">
56
+ <a class="navtree-link active" href="…"></a>
57
+ <div class="navtree-sub">
58
+ <a class="navtree-link" href="…"></a>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </nav>
65
+ </aside>
66
+ <section class="main-section">
67
+ <details class="mobile-toc">
68
+ <summary>On this page</summary>
69
+ </details>
70
+ <article class="content-shell"></article>
71
+ </section>
72
+ <aside class="sidebar-right">
73
+ <nav class="toc">
74
+ <div class="toc-title"></div>
75
+ <ul class="toc-list">
76
+ <li><a class="toc-link" href="…"></a></li>
77
+ </ul>
78
+ <div class="toc-footer"></div>
79
+ </nav>
80
+ </aside>
81
+ </main>
82
+ <footer class="app-footer"></footer>
83
+ </div>
84
+ ```
85
+
86
+ Retraction physics:
87
+
88
+ | Rail | Visible | Below the seam |
89
+ |---|---|---|
90
+ | `.sidebar-left` (nav) | ≥ 1024px | off-canvas drawer — header menu toggles `.open` on `.app-shell` |
91
+ | `.sidebar-right` (TOC) | ≥ 1280px | `.mobile-toc` dropdown at the top of `.main-section` |
92
+
93
+ Tab strip, wherever it lives:
94
+
95
+ ```html
96
+ <div class="tab-list" role="tablist">
97
+ <button class="tab-trigger active" role="tab" aria-selected="true"></button>
98
+ </div>
99
+ ```
100
+
101
+ Current tab = `.active`; triggers carry native `aria-selected`.
102
+
103
+ Status: **implemented** — `_05_shells.sass` (Amendment A1 rails + `.navtree*`/`.toc*`/`.tab-*` role classes). Navtree groups ride the accordion family; `.navtree-title` is the flat-label variant for groups that don't collapse.
104
+
105
+ ## 3 - Canonical Sidebar with Accordions
106
+
107
+ ```html
108
+ <aside class="page-sidebar">
109
+ <div class="accordion">
110
+ <div class="accordion-item open">
111
+ <button class="accordion-trigger" aria-expanded="true"></button>
112
+ <div class="accordion-content">
113
+ <div class="accordion-panel">
114
+ <a class="navtree-link" href="…"></a>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ <div class="accordion-item">
119
+ <button class="accordion-trigger" aria-expanded="false"></button>
120
+ <div class="accordion-content">
121
+ <div class="accordion-panel"></div>
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </aside>
126
+ ```
127
+
128
+ `.open` on `.accordion-item` shows the content; triggers carry native `aria-expanded`.
129
+
130
+ `.accordion-panel` is required — it is the element that actually collapses, and
131
+ it carries the `overflow` and `min-height` the grid transition needs. Without it
132
+ the panel will not clip while closed.
133
+
134
+ Status: accordion family **implemented** — `_05_shells.sass`.
135
+
136
+ ## 4 - Canonical Page Frames
137
+
138
+ ```html
139
+ <!-- plain page: padded content frame -->
140
+ <section class="page-shell"> … </section>
141
+
142
+ <!-- sidebar page: full-bleed split, padding lives in .page-main -->
143
+ <section class="page-split">
144
+ <aside class="page-sidebar"></aside>
145
+ <main class="page-main"></main>
146
+ </section>
147
+ ```
148
+
149
+ Status: **implemented** — `_05_shells.sass`.
150
+
151
+ ## 5 - Canonical Hero
152
+
153
+ ```html
154
+ <section class="hero">
155
+ <h1 class="text-3xl"></h1>
156
+ <p class="text-lg text-muted"></p>
157
+ </section>
158
+ ```
159
+
160
+ Status: **implemented** — `_05_shells.sass` (documented sugar: `.box.ycenter` + `gap-lg` + `pad-y-xl`).
@@ -1,18 +1,11 @@
1
- // =============================================================================
2
- // FRACTALSTYLER2 — Master Stylesheet & Public Mixin API
3
- // -----------------------------------------------------------------------------
4
- // 1. Public API: Forwards all pure mixins, functions, and atoms (0 bytes CSS)
5
- // 2. Cascade Order: Emits CSS rules in strict specificity sequence
6
- // =============================================================================
7
-
8
- // Public Sass API — available to any file that @uses this module
9
- @forward 'fractals'
10
-
11
- // Global Stylesheet Cascade
12
- @use '02_fonts' as *
13
- @use '00_tokens' as *
14
- @use '07_base' as *
15
- @use '08_blocks' as *
16
- @use '09_utilities' as *
17
- @use '10_layouts' as *
18
- @use '11_own' as *
1
+ @forward '00_tokens'
2
+ @forward '00_themes'
3
+ @forward '00_presets'
4
+ @use '01_config' as *
5
+ @use '02_dimensions' as *
6
+ @use '03_containers' as *
7
+ @use '04_layouts' as *
8
+ @use '05_shells' as *
9
+ @use '06_visuals' as *
10
+ @use '07_interactions' as *
11
+ @use '08_own' as *
@@ -0,0 +1,7 @@
1
+ export interface ThemeMeta {
2
+ id: string;
3
+ mode: 'light' | 'dark';
4
+ }
5
+ /** The 41 built-in palettes. Apply with setTheme(id). */
6
+ export declare const themes: readonly ThemeMeta[];
7
+ export declare const themeIds: readonly string[];
package/dist/themes.js ADDED
@@ -0,0 +1,45 @@
1
+ /** The 41 built-in palettes. Apply with setTheme(id). */
2
+ export const themes = [
3
+ { id: 'theme-light-default', mode: 'light' },
4
+ { id: 'theme-himalaya-light', mode: 'light' },
5
+ { id: 'theme-editorial-light', mode: 'light' },
6
+ { id: 'theme-space-light', mode: 'light' },
7
+ { id: 'theme-sun-light', mode: 'light' },
8
+ { id: 'theme-monochrono-light', mode: 'light' },
9
+ { id: 'theme-molly-light', mode: 'light' },
10
+ { id: 'theme-malana-light', mode: 'light' },
11
+ { id: 'theme-coresync-light', mode: 'light' },
12
+ { id: 'theme-studio-light', mode: 'light' },
13
+ { id: 'theme-matcha-light', mode: 'light' },
14
+ { id: 'theme-sakura-light', mode: 'light' },
15
+ { id: 'theme-nordic-frost-light', mode: 'light' },
16
+ { id: 'theme-desert-dune-light', mode: 'light' },
17
+ { id: 'theme-lavender-mist-light', mode: 'light' },
18
+ { id: 'theme-botanical-light', mode: 'light' },
19
+ { id: 'theme-clay-studio-light', mode: 'light' },
20
+ { id: 'theme-solaris-light', mode: 'light' },
21
+ { id: 'theme-cyberpunk-day-light', mode: 'light' },
22
+ { id: 'theme-copper-patina-light', mode: 'light' },
23
+ { id: 'theme-dracula-light', mode: 'light' },
24
+ { id: 'theme-lagoona-dark', mode: 'dark' },
25
+ { id: 'theme-frozen-dark', mode: 'dark' },
26
+ { id: 'theme-night-dark', mode: 'dark' },
27
+ { id: 'theme-inkworm-dark', mode: 'dark' },
28
+ { id: 'theme-monochrono-dark', mode: 'dark' },
29
+ { id: 'theme-fouram-dark', mode: 'dark' },
30
+ { id: 'theme-wintercame-dark', mode: 'dark' },
31
+ { id: 'theme-sun-dark', mode: 'dark' },
32
+ { id: 'theme-console-dark', mode: 'dark' },
33
+ { id: 'theme-dracula-dark', mode: 'dark' },
34
+ { id: 'theme-catppuccin-mocha', mode: 'light' },
35
+ { id: 'theme-nord-dark', mode: 'dark' },
36
+ { id: 'theme-gruvbox-dark', mode: 'dark' },
37
+ { id: 'theme-onedark-pro', mode: 'light' },
38
+ { id: 'theme-rose-pine-dark', mode: 'dark' },
39
+ { id: 'theme-midnight-emerald-dark', mode: 'dark' },
40
+ { id: 'theme-obsidian-crimson-dark', mode: 'dark' },
41
+ { id: 'theme-synthwave-dark', mode: 'dark' },
42
+ { id: 'theme-deep-ocean-dark', mode: 'dark' },
43
+ { id: 'theme-amethyst-void-dark', mode: 'dark' }
44
+ ];
45
+ export const themeIds = themes.map((t) => t.id);
@@ -0,0 +1 @@
1
+ export declare const version = "0.7.0";
@@ -0,0 +1,2 @@
1
+ // Generated from package.json by scripts/update-registry.js — do not edit.
2
+ export const version = '0.7.0';
package/package.json CHANGED
@@ -1,26 +1,28 @@
1
1
  {
2
2
  "name": "fractalstyler2",
3
- "version": "0.4.0",
4
- "description": "A fractal-composition styling system for SvelteKit — every style unit is a SASS mixin, and components and layouts are recipes of smaller fractals.",
3
+ "version": "0.7.0",
4
+ "description": "A composition styling system, shipped as plain CSS and as editable SASS. The class registry is the public API: compose in markup, write no stylesheet.",
5
5
  "bin": {
6
6
  "fractalstyler2": "./dist/cli.js",
7
7
  "fractalstyler": "./dist/cli.js",
8
8
  "fractalstyler2-mcp": "./dist/mcp/server.js"
9
9
  },
10
10
  "scripts": {
11
- "dev": "vite dev",
12
- "build": "vite build && npm run prepack",
13
- "preview": "vite preview",
11
+ "registry": "node scripts/update-registry.js",
12
+ "build": "npm run registry && npm run prepack",
14
13
  "prepare": "svelte-kit sync || echo ''",
15
- "prepack": "svelte-kit sync && svelte-package && chmod +x dist/cli.js && chmod +x dist/mcp/server.js && publint",
16
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
17
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
14
+ "prepack": "npm run registry && svelte-kit sync && svelte-package && npm run css && chmod +x dist/cli.js && chmod +x dist/mcp/server.js && publint",
15
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && node scripts/validate-deck.js",
16
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
17
+ "validate:deck": "node scripts/validate-deck.js",
18
+ "css": "node scripts/build-css.js",
19
+ "version": "npm run registry && git add -A"
18
20
  },
19
21
  "files": [
20
22
  "dist",
21
23
  "!dist/**/*.test.*",
22
24
  "!dist/**/*.spec.*",
23
- "templates",
25
+ "registry.json",
24
26
  "skills",
25
27
  "plugin.json",
26
28
  "mcp.json"
@@ -38,10 +40,17 @@
38
40
  },
39
41
  "./styles": "./dist/styles/index.sass",
40
42
  "./styles/*": "./dist/styles/*",
41
- "./fractals": "./dist/styles/_fractals.sass",
42
43
  "./tokens": "./dist/styles/_00_tokens.sass",
43
44
  "./mcp": "./dist/mcp/server.js",
44
- "./package.json": "./package.json"
45
+ "./package.json": "./package.json",
46
+ "./themes": "./dist/styles/_00_themes.sass",
47
+ "./presets": {
48
+ "types": "./dist/presets.core.d.ts",
49
+ "default": "./dist/presets.core.js"
50
+ },
51
+ "./css": "./dist/css/fractalstyler.css",
52
+ "./css/min": "./dist/css/fractalstyler.min.css",
53
+ "./styles/presets": "./dist/styles/_00_presets.sass"
45
54
  },
46
55
  "peerDependencies": {
47
56
  "svelte": "^5.0.0"
@@ -60,12 +69,14 @@
60
69
  "vite": "^8.0.16"
61
70
  },
62
71
  "keywords": [
63
- "svelte",
64
- "sveltekit",
65
- "sass",
66
72
  "css",
73
+ "sass",
67
74
  "design-system",
68
- "mixins",
75
+ "styling",
76
+ "svelte",
77
+ "sveltekit",
78
+ "utility-classes",
79
+ "design-tokens",
69
80
  "fractal"
70
81
  ],
71
82
  "dependencies": {
package/plugin.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "fractalstyler2",
3
- "version": "0.3.0",
4
- "description": "Fractal-composition styling system and design token engine for SvelteKit and AI design tools (OpenDesign, Pencil, Cursor).",
3
+ "version": "0.7.0",
4
+ "description": "Composition styling system and design token engine — plain CSS or SASS — for web projects and AI coding agents.",
5
5
  "author": {
6
6
  "name": "Amrit",
7
- "url": "https://github.com/fractal-mandala"
7
+ "url": "https://github.com/fractalmandala"
8
8
  },
9
9
  "license": "MIT",
10
10
  "keywords": [
11
- "svelte",
12
- "sveltekit",
13
- "sass",
14
11
  "css",
12
+ "sass",
15
13
  "design-system",
14
+ "styling",
15
+ "svelte",
16
+ "sveltekit",
16
17
  "mcp",
17
- "tokens",
18
- "fractals"
18
+ "design-tokens",
19
+ "fractal"
19
20
  ],
20
- "homepage": "https://github.com/fractal-mandala/fractalstyler2",
21
- "repository": "https://github.com/fractal-mandala/fractalstyler2"
21
+ "homepage": "https://github.com/fractalmandala/fractalstyler2",
22
+ "repository": "https://github.com/fractalmandala/fractalstyler2"
22
23
  }