@fractaldesign/fractalstyler 0.0.0-stage → 0.9.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 (46) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +123 -2
  3. package/cli/main.mjs +141 -0
  4. package/cli/scaffold.mjs +406 -0
  5. package/data/recipes.json +61 -0
  6. package/dist/asset.d.ts +3 -0
  7. package/dist/css/fractalstyler.css +2453 -0
  8. package/dist/css/fractalstyler.min.css +2 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.js +6 -0
  11. package/dist/styles/_00_config.sass +29 -0
  12. package/dist/styles/_00_fonts.sass +58 -0
  13. package/dist/styles/_00_tokens.sass +211 -0
  14. package/dist/styles/_01_base.sass +58 -0
  15. package/dist/styles/_02_dimensions.sass +70 -0
  16. package/dist/styles/_03_typography.sass +170 -0
  17. package/dist/styles/_04_containers.sass +173 -0
  18. package/dist/styles/_05_layouts.sass +104 -0
  19. package/dist/styles/_06_shells.sass +135 -0
  20. package/dist/styles/_07_interactions.sass +212 -0
  21. package/dist/styles/_08_visuals.sass +136 -0
  22. package/dist/styles/_09_own.sass +174 -0
  23. package/dist/styles/colorpacks.sass +119 -0
  24. package/dist/styles/index.sass +14 -0
  25. package/dist/styles/themeplates.sass +159 -0
  26. package/docs/REGISTRY.api.md +477 -0
  27. package/docs/REGISTRY.md +14 -0
  28. package/docs/references/configurations-api.md +220 -0
  29. package/docs/references/configurations.md +258 -0
  30. package/lint/browser.mjs +79 -0
  31. package/lint/cli.mjs +212 -0
  32. package/lint/lib/agent-reporter.mjs +51 -0
  33. package/lint/lib/fuzzy.mjs +45 -0
  34. package/lint/lib/registry.mjs +107 -0
  35. package/lint/lib/sass-linter.mjs +71 -0
  36. package/lint/lib/svelte-linter.mjs +116 -0
  37. package/lint/lib/token-linter.mjs +97 -0
  38. package/package.json +112 -5
  39. package/registry.json +3999 -0
  40. package/scripts/class-vocab.js +197 -0
  41. package/scripts/update-registry.js +934 -0
  42. package/skills/fractal-styler/references/fractals.md +630 -0
  43. package/skills/fractal-styler/references/tokens.md +226 -0
  44. package/skills/fractalstyler/SKILL.md +59 -0
  45. package/skills/fractalstyler/references/fractals.md +630 -0
  46. package/skills/fractalstyler/references/tokens.md +226 -0
@@ -0,0 +1,226 @@
1
+ # Fractalstyler2 — Token Reference
2
+
3
+ GENERATED FILE — do not edit. Emitted by `scripts/update-registry.js`
4
+ from `_00_tokens.sass` (light/dark mixins + `:root`) and the shadow specs in
5
+ `_00_config.sass`.
6
+
7
+ Every `--space-*` step is a class family: if `--space-md` exists, so do
8
+ `.gap-md`, `.pad-md` and `.mar-md` (plus the `.px`/`.py`/`.pt`… sides).
9
+ There is no second vocabulary to learn.
10
+
11
+ ## Type Scale
12
+
13
+ Fixed rem rungs up to base, then compounded by `--text-scaling` (1.25).
14
+
15
+ | Token | Class | Value |
16
+ |:---|:---|:---|
17
+ | `--text-xs` | `.text-xs` | `0.67rem` |
18
+ | `--text-sm` | `.text-sm` | `0.75rem` |
19
+ | `--text-md` | `.text-md` | `0.875rem` |
20
+ | `--text-bs` | `.text-bs` | `1rem` |
21
+ | `--text-lg` | `.text-lg` | `calc(var(--text-bs) * var(--text-scaling))` |
22
+ | `--text-xl` | `.text-xl` | `calc(var(--text-lg) * var(--text-scaling))` |
23
+ | `--text-2xl` | `.text-2xl` | `calc(var(--text-xl) * var(--text-scaling))` |
24
+ | `--text-3xl` | `.text-3xl` | `calc(var(--text-2xl) * var(--text-scaling))` |
25
+ | `--text-4xl` | `.text-4xl` | `calc(var(--text-3xl) * var(--text-scaling))` |
26
+ | `--text-5xl` | `.text-5xl` | `calc(var(--text-4xl) * var(--text-scaling))` |
27
+
28
+ | Token | Class | Value |
29
+ |:---|:---|:---|
30
+ | `--text-scaling` | — | `1.25` |
31
+
32
+ ## Space Scale
33
+
34
+ `--unit-space` (0.25rem) times a step multiplier. Every step feeds the
35
+ gap/pad/mar families in L1.
36
+
37
+ | Token | Class | Value |
38
+ |:---|:---|:---|
39
+ | `--unit-space` | — | `0.25rem` |
40
+
41
+ | Token | Class | Value |
42
+ |:---|:---|:---|
43
+ | `--space-xs` | `.gap-xs` `.pad-xs` `.mar-xs` + sides | `var(--unit-space)` |
44
+ | `--space-sm` | `.gap-sm` `.pad-sm` `.mar-sm` + sides | `calc(var(--unit-space) * 2)` |
45
+ | `--space-md` | `.gap-md` `.pad-md` `.mar-md` + sides | `calc(var(--unit-space) * 3)` |
46
+ | `--space-bs` | `.gap-bs` `.pad-bs` `.mar-bs` + sides | `calc(var(--unit-space) * 4)` |
47
+ | `--space-lg` | `.gap-lg` `.pad-lg` `.mar-lg` + sides | `calc(var(--unit-space) * 6)` |
48
+ | `--space-xl` | `.gap-xl` `.pad-xl` `.mar-xl` + sides | `calc(var(--unit-space) * 8)` |
49
+ | `--space-2xl` | `.gap-2xl` `.pad-2xl` `.mar-2xl` + sides | `calc(var(--unit-space) * 12)` |
50
+ | `--space-3xl` | `.gap-3xl` `.pad-3xl` `.mar-3xl` + sides | `calc(var(--unit-space) * 16)` |
51
+
52
+ ## Radius
53
+
54
+ Six channels. Compositions read the tokens, never a literal radius.
55
+
56
+ | Token | Class | Value |
57
+ |:---|:---|:---|
58
+ | `--radius-xs` | `.radius-xs` | `2px` |
59
+ | `--radius-sm` | `.radius-sm` | `4px` |
60
+ | `--radius-md` | `.radius-md` | `8px` |
61
+ | `--radius-bs` | `.radius-bs` | `16px` |
62
+ | `--radius-lg` | `.radius-lg` | `32px` |
63
+ | `--radius-full` | `.radius-full` | `9999px` |
64
+
65
+ ## Control & Component Metrics
66
+
67
+ Heights for inputs, selects and buttons; avatar and switch channels.
68
+
69
+ | Token | Class | Value |
70
+ |:---|:---|:---|
71
+ | `--control-h-sm` | — | `21px` |
72
+ | `--control-h-bs` | — | `32px` |
73
+ | `--control-h-lg` | — | `38px` |
74
+ | `--avatar-size` | — | `32px` |
75
+ | `--switch-w` | — | `40px` |
76
+ | `--switch-h` | — | `22px` |
77
+ | `--switch-thumb` | — | `16px` |
78
+ | `--height-sm` | `.h-sm` | `16px` |
79
+ | `--height-md` | `.h-md` | `20px` |
80
+ | `--height-bs` | `.h-bs` | `27px` |
81
+ | `--height-lg` | `.h-lg` | `32px` |
82
+
83
+ ## Motion Language
84
+
85
+ Durations, easings and the composed `--motion*` channels every transition reads.
86
+
87
+ | Token | Class | Value |
88
+ |:---|:---|:---|
89
+ | `--transin1` | — | `cubic-bezier(0.470, 0.000, 0.745, 0.715)` |
90
+ | `--transin2` | — | `cubic-bezier(0.550, 0.055, 0.675, 0.190)` |
91
+ | `--transin3` | — | `cubic-bezier(0.755, 0.050, 0.855, 0.060)` |
92
+ | `--transout1` | — | `cubic-bezier(0.390, 0.575, 0.565, 1.000)` |
93
+ | `--transout2` | — | `cubic-bezier(0.215, 0.610, 0.355, 1.000)` |
94
+ | `--transout3` | — | `cubic-bezier(0.230, 1.000, 0.320, 1.000)` |
95
+ | `--speed0` | — | `50ms` |
96
+ | `--speed1` | — | `90ms` |
97
+ | `--speed2` | — | `140ms` |
98
+ | `--speed3` | — | `220ms` |
99
+ | `--motionin1` | — | `var(--speed0) var(--transin1)` |
100
+ | `--motionout1` | — | `var(--speed1) var(--transout1)` |
101
+ | `--motionin2` | — | `var(--speed2) var(--transin2)` |
102
+ | `--motionout2` | — | `var(--speed2) var(--transout2)` |
103
+ | `--motionin3` | — | `var(--speed3) var(--transin3)` |
104
+ | `--motionout3` | — | `var(--speed3) var(--transout3)` |
105
+
106
+ ## Colour Roles
107
+
108
+ Name the role, never the hex. Values shown are the light default;
109
+ `[data-mode='dark']` remaps them via `=dark-theme-tokens`.
110
+
111
+ | Token | Class | Value |
112
+ |:---|:---|:---|
113
+ | `--white-fixed` | `.text-white` | `#FFFFFF` |
114
+ | `--black-fixed` | `.text-black` | `#171717` |
115
+ | `--bg` | — | `#ffffff` |
116
+ | `--bg-surface` | — | `#FBFBF9` |
117
+ | `--bg-panel` | — | `#FBFBF9` |
118
+ | `--bg-sunken` | — | `#F7F6F0` |
119
+ | `--bg-raised` | — | `#F4F4F5` |
120
+ | `--bg-extra` | — | `rgb(247, 248, 249)` |
121
+ | `--bg-input` | — | `#f8f9fa` |
122
+ | `--bg-button` | — | `#CED8D3` |
123
+ | `--text-primary` | .text-primary | `#262627` |
124
+ | `--text-secondary` | .text-secondary | `#777777` |
125
+ | `--text-muted` | .text-muted | `#a3a4a7` |
126
+ | `--text-inverse` | .text-inverse | `#ffffff` |
127
+ | `--state-surface` | — | `#F2EFE9` |
128
+ | `--state-hover` | — | `#ECE7DF` |
129
+ | `--state-selected` | — | `#E4DFD5` |
130
+ | `--border` | — | `#d8d8d8` |
131
+ | `--border-subtle` | — | `#eceaea` |
132
+ | `--border-strong` | — | `#cfcfcf` |
133
+ | `--theme-color` | `.text-theme` | `#ff4400` |
134
+ | `--theme-color-alt` | — | `#be2f00` |
135
+ | `--theme-color-sub` | — | `#feb18a` |
136
+ | `--success` | `.text-success` `.bg-success` | `#10B981` |
137
+ | `--success-hover` | — | `#059669` |
138
+ | `--warning` | `.text-warning` `.bg-warning` | `#F59E0B` |
139
+ | `--warning-hover` | — | `#D97706` |
140
+ | `--danger` | `.text-danger` `.bg-danger` | `#bf2a2a` |
141
+ | `--danger-hover` | — | `#DC2626` |
142
+ | `--info` | `.text-info` `.bg-info` | `#3B82F6` |
143
+ | `--info-hover` | — | `#2563EB` |
144
+ | `--ring` | — | `rgba(0, 127, 78, 0.35)` |
145
+
146
+ ## Elevation
147
+
148
+ `--shadow-*` channels are what the `.shadow-*` classes read; `--shade-*` are
149
+ loop-generated from `$shadow-specs` in `_00_config.sass` (rim + key + ambient).
150
+
151
+ | Token | Class | Value |
152
+ |:---|:---|:---|
153
+ | `--shadow-color` | — | `15 13 42` |
154
+ | `--shadow-rim` | — | `transparent` |
155
+ | `--shadow-xs` | `.shadow-xs` | `0 1px 2px rgb(var(--shadow-color) / 0.14)` |
156
+ | `--shadow-sm` | `.shadow-sm` | `0 1px 2px rgb(var(--shadow-color) / 0.10), 0 2px 4px rgb(var(--shadow-color) / 0.06)` |
157
+ | `--shadow-md` | `.shadow-md` | `0 2px 4px rgb(var(--shadow-color) / 0.06), 0 8px 16px rgb(var(--shadow-color) / 0.06)` |
158
+ | `--shadow-bs` | `.shadow-bs` | `0 2px 4px rgb(var(--shadow-color) / 0.06), 0 6px 14px rgb(var(--shadow-color) / 0.06)` |
159
+ | `--shadow-lg` | `.shadow-lg` | `0 4px 8px rgb(var(--shadow-color) / 0.06), 0 12px 24px rgb(var(--shadow-color) / 0.06)` |
160
+ | `--shadow-xl` | `.shadow-xl` | `0 8px 16px rgb(var(--shadow-color) / 0.06), 0 20px 36px rgb(var(--shadow-color) / 0.06)` |
161
+ | `--shadow-2xl` | `.shadow-2xl` | `0 12px 24px rgb(var(--shadow-color) / 0.06), 0 28px 48px rgb(var(--shadow-color) / 0.06)` |
162
+ | `--shadow-3xl` | `.shadow-3xl` | `0 16px 32px rgb(var(--shadow-color) / 0.06), 0 36px 64px rgb(var(--shadow-color) / 0.06)` |
163
+ | `--shadow-umbra` | — | `rgb(0 0 0 / 0.50)` |
164
+ | `--shade-xs` | — | `var(--shadow-rim), 0 1px 1px rgb(var(--shadow-color) / 0.14), 0 0px 0px rgb(var(--shadow-color) / 0.00)` |
165
+ | `--shade-sm` | — | `var(--shadow-rim), 0 1px 2px rgb(var(--shadow-color) / 0.12), 0 1px 3px rgb(var(--shadow-color) / 0.02)` |
166
+ | `--shade-md` | — | `var(--shadow-rim), 0 2px 4px rgb(var(--shadow-color) / 0.09), 0 3px 6px rgb(var(--shadow-color) / 0.04)` |
167
+ | `--shade-bs` | — | `var(--shadow-rim), 0 2px 4px rgb(var(--shadow-color) / 0.06), 0 6px 14px rgb(var(--shadow-color) / 0.06)` |
168
+ | `--shade-lg` | — | `var(--shadow-rim), 0 4px 8px rgb(var(--shadow-color) / 0.04), 0 12px 24px rgb(var(--shadow-color) / 0.08)` |
169
+ | `--shade-xl` | — | `var(--shadow-rim), 0 6px 12px rgb(var(--shadow-color) / 0.03), 0 20px 36px rgb(var(--shadow-color) / 0.09)` |
170
+ | `--shade-2xl` | — | `var(--shadow-rim), 0 8px 16px rgb(var(--shadow-color) / 0.02), 0 28px 48px rgb(var(--shadow-color) / 0.09)` |
171
+ | `--shade-3xl` | — | `var(--shadow-rim), 0 12px 24px rgb(var(--shadow-color) / 0.02), 0 36px 64px rgb(var(--shadow-color) / 0.08)` |
172
+ | `--shadow-color` | — | `15 13 42` |
173
+ | `--shadow-rim` | — | `transparent` |
174
+
175
+ ## Fonts, Layout Constants & Page Chrome
176
+
177
+ Font stacks plus the page geometry the shells and viewport classes read.
178
+
179
+ | Token | Class | Value |
180
+ |:---|:---|:---|
181
+ | `--font-sans` | — | `"Timeless Sans", sans-serif` |
182
+ | `--timeless-sans` | — | `"Timeless Sans", sans-serif` |
183
+ | `--timeless-grotesk` | — | `"Timeless Grotesk", sans-serif` |
184
+ | `--header-height` | — | `64px` |
185
+ | `--footer-height` | — | `32px` |
186
+ | `--fit-height` | — | `calc(var(--header-height) + var(--footer-height))` |
187
+ | `--prose-clamp` | — | `65ch` |
188
+ | `--content-clamp` | — | `1600px` |
189
+ | `--app-inline` | — | `var(--space-lg)` |
190
+ | `--card-min` | — | `240px` |
191
+ | `--sidebar-width` | — | `280px` |
192
+ | `--sidebar-width-left` | — | `280px` |
193
+ | `--sidebar-width-right` | — | `280px` |
194
+ | `--z-sticky` | — | `100` |
195
+ | `--z-raised` | — | `200` |
196
+ | `--z-modal` | — | `300` |
197
+ | `--z-toast` | — | `500` |
198
+
199
+ ## Pop Colors
200
+
201
+ Named accent literals. The `.orange1`…`.orange6` ink classes read
202
+ `--orangepop*`; the green set is reserved for future use.
203
+
204
+ | Token | Class | Value |
205
+ |:---|:---|:---|
206
+ | `--greenpop1` | — | `#70e000` |
207
+ | `--greenpop2` | — | `#00df89` |
208
+ | `--greenpop3` | — | `#69ff97` |
209
+ | `--greenpop4` | — | `#00e676` |
210
+ | `--orangepop1` | `.orange1` | `#ff7700` |
211
+ | `--orangepop2` | `.orange2` | `#ff4400` |
212
+ | `--orangepop3` | `.orange3` | `#ff0055` |
213
+ | `--orangepop4` | `.orange4` | `#ff5e36` |
214
+ | `--orangepop5` | `.orange5` | `#ff9966` |
215
+ | `--orangepop6` | `.orange6` | `#ff9f1c` |
216
+
217
+ ## Modes & Attribute Axes
218
+
219
+ `data-mode` on the root selects the token mixin: `light` (default) or `dark`.
220
+
221
+ | Attribute | Where | Values | Effect |
222
+ |:---|:---|:---|:---|
223
+ | `data-mode` | `<html>` | `light` \| `dark` | Swaps `=light-theme-tokens` / `=dark-theme-tokens` |
224
+ | `data-shape` | `.card`, `button` | `modern` \| `curved` \| `round` | Corner treatment of the component |
225
+ | `data-variant` | `button` | `primary` \| `secondary` \| `soft` \| `outline` \| `ghost` \| `link` \| `destructive` | Paint variant of the button quartet |
226
+ | `data-size` | `button` | `sm` \| `md` \| `bs` \| `lg` | Metrics variant of the button quartet |
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: fractalstyler
3
+ description: Build, compose, modify, or audit UI interfaces using the closed Fractalstyler composition styling system. Use whenever authoring HTML, Svelte, Sass, CSS, or TS/JS components where new ad-hoc classes, scoped style blocks, inline styles, custom properties, or arbitrary CSS are strictly forbidden.
4
+ ---
5
+
6
+ # Fractalstyler Styling System & Style Guard
7
+
8
+ Operate within the `fractalstyler` registry as a **closed world**. Never invent a class or styling definition, even when the requested design is not immediately obvious.
9
+
10
+ ## Mandatory Agent Workflow
11
+
12
+ 1. **Consult the Registry First**:
13
+ Read `REGISTRY.md` or `registry.json`. Search for existing utility classes, container bases, layouts, and shells before writing any markup.
14
+ 2. **Review Recipes**:
15
+ Check `data/recipes.json` for verified canonical compositions (segmented controls, search input bars, metrics grids, action rows, switches, modals).
16
+ 3. **Compose Only from Verified Classes**:
17
+ - Containers: `.box` (column), `.row` (horizontal), `.grid` (CSS grid).
18
+ - Physical Alignment: `.xcenter`, `.ycenter`, `.xbetween`, `.xright`, `.ytop`.
19
+ - Dimensions & Spacing: `.gap-*`, `.pad-*`, `.pad-x-*`, `.pad-y-*`, `.w-*`, `.h-*`.
20
+ - Visuals: `.surface`, `.raised`, `.border`, `.border-bottom`, `.radius-*`, `.shadow-*`.
21
+ - Typography: `.text-xs` .. `.text-5xl`, `.weight-500`, `.weight-600`, `.truncate`.
22
+ - Interactions: `.button`, `.primary`, `.ghost`, `.outline`, `.active`.
23
+ 4. **Hard Boundaries**:
24
+ - **NO in-component `<style>` blocks**: Components must remain pure markup and logic.
25
+ - **NO inline `style="..."` attributes**: Inline styles are unconstrained ad-hoc CSS.
26
+ - **NO raw hex colors (`#hex`)**: Every color must resolve through semantic tokens (`var(--bg)`, `var(--text-primary)`, `var(--border)`, etc.).
27
+ - **NO arbitrary pixel dimensions (>2px)**: Literal pixels bypass the dimension ladder. Only 1-2px (borders, hairlines) may be literal.
28
+ - **NO child combinators**: Selectors are plain descendants (`> *` is forbidden).
29
+ 5. **Mandatory Verification**:
30
+ Before claiming task completion, always execute:
31
+ ```bash
32
+ pnpm lint
33
+ pnpm check
34
+ ```
35
+ Both checks must pass with 0 errors.
36
+
37
+ ## Progressive Discovery Index
38
+
39
+ | Styling Task | File to Inspect | Responsibility |
40
+ |:---|:---|:---|
41
+ | Active files and cascade order | `src/lib/styles/index.sass` | Master composition contract. |
42
+ | Colors, semantic tokens, dark mode | `src/lib/styles/_00_tokens.sass` | Design token source of truth. |
43
+ | Global resets and typography defaults | `src/lib/styles/_01_base.sass` | Low-specificity element defaults. |
44
+ | Spacing, gaps, padding, dimensions | `src/lib/styles/_02_dimensions.sass` | L1 spacing & dimension ladders. |
45
+ | Text sizes, roles, weights, tracking | `src/lib/styles/_03_typography.sass` | L5 typography primitives, roles, and modifiers. |
46
+ | Flex/grid containers & axis alignment | `src/lib/styles/_04_containers.sass` | L2 structural layout containers. |
47
+ | Macro grid layouts & responsive columns | `src/lib/styles/_05_layouts.sass` | L3 column stepping (.grid-1..12). |
48
+ | Page frames, headers, sidebars, rails | `src/lib/styles/_06_shells.sass` | L4 application shell hierarchy. |
49
+ | Buttons, links, pills, states | `src/lib/styles/_07_interactions.sass` | L5 orthogonal interactive axes. |
50
+ | Backgrounds, ink, shadows, borders | `src/lib/styles/_08_visuals.sass` | L5 surface styling & decorative treatments. |
51
+ | Project-specific third-party overrides | `src/lib/styles/_09_own.sass` | Sanctioned extension point. |
52
+
53
+ ## Handling Coverage Gaps
54
+
55
+ If a visual requirement cannot be expressed with existing canonical classes:
56
+ 1. Do NOT write an ad-hoc inline style or component `<style>` block.
57
+ 2. Check if an existing token in `_00_tokens.sass` can be composed.
58
+ 3. If genuine new utility or shell class is required, add it to the designated layer partial in `src/lib/styles` with a trailing `// description` comment and run `pnpm registry`.
59
+ 4. If it is a project-specific extension, declare it in `_09_own.sass`.