@motir/design-system 0.1.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 (107) hide show
  1. package/README.md +126 -0
  2. package/dist/appearance.d.ts +47 -0
  3. package/dist/appearance.js +3 -0
  4. package/dist/appearance.js.map +1 -0
  5. package/dist/components/theme/AppearancePickers.d.ts +97 -0
  6. package/dist/components/theme/AppearancePickers.js +542 -0
  7. package/dist/components/theme/AppearancePickers.js.map +1 -0
  8. package/dist/components/theme/HandDrawnFilter.d.ts +23 -0
  9. package/dist/components/theme/HandDrawnFilter.js +41 -0
  10. package/dist/components/theme/HandDrawnFilter.js.map +1 -0
  11. package/dist/components/theme/ImmersiveTilt.d.ts +3 -0
  12. package/dist/components/theme/ImmersiveTilt.js +113 -0
  13. package/dist/components/theme/ImmersiveTilt.js.map +1 -0
  14. package/dist/components/theme/StyleVignette.d.ts +60 -0
  15. package/dist/components/theme/StyleVignette.js +382 -0
  16. package/dist/components/theme/StyleVignette.js.map +1 -0
  17. package/dist/components/ui/Button.d.ts +32 -0
  18. package/dist/components/ui/Button.js +92 -0
  19. package/dist/components/ui/Button.js.map +1 -0
  20. package/dist/components/ui/Card.d.ts +33 -0
  21. package/dist/components/ui/Card.js +64 -0
  22. package/dist/components/ui/Card.js.map +1 -0
  23. package/dist/components/ui/ColorSwatchPicker.d.ts +19 -0
  24. package/dist/components/ui/ColorSwatchPicker.js +71 -0
  25. package/dist/components/ui/ColorSwatchPicker.js.map +1 -0
  26. package/dist/components/ui/Combobox.d.ts +84 -0
  27. package/dist/components/ui/Combobox.js +374 -0
  28. package/dist/components/ui/Combobox.js.map +1 -0
  29. package/dist/components/ui/EmptyState.d.ts +38 -0
  30. package/dist/components/ui/EmptyState.js +73 -0
  31. package/dist/components/ui/EmptyState.js.map +1 -0
  32. package/dist/components/ui/ErrorState.d.ts +43 -0
  33. package/dist/components/ui/ErrorState.js +169 -0
  34. package/dist/components/ui/ErrorState.js.map +1 -0
  35. package/dist/components/ui/FormField.d.ts +31 -0
  36. package/dist/components/ui/FormField.js +43 -0
  37. package/dist/components/ui/FormField.js.map +1 -0
  38. package/dist/components/ui/Input.d.ts +29 -0
  39. package/dist/components/ui/Input.js +105 -0
  40. package/dist/components/ui/Input.js.map +1 -0
  41. package/dist/components/ui/Modal.d.ts +84 -0
  42. package/dist/components/ui/Modal.js +153 -0
  43. package/dist/components/ui/Modal.js.map +1 -0
  44. package/dist/components/ui/MultiSelectPicker.d.ts +73 -0
  45. package/dist/components/ui/MultiSelectPicker.js +358 -0
  46. package/dist/components/ui/MultiSelectPicker.js.map +1 -0
  47. package/dist/components/ui/Pill.d.ts +49 -0
  48. package/dist/components/ui/Pill.js +107 -0
  49. package/dist/components/ui/Pill.js.map +1 -0
  50. package/dist/components/ui/Popover.d.ts +65 -0
  51. package/dist/components/ui/Popover.js +57 -0
  52. package/dist/components/ui/Popover.js.map +1 -0
  53. package/dist/components/ui/SectionLabel.d.ts +28 -0
  54. package/dist/components/ui/SectionLabel.js +27 -0
  55. package/dist/components/ui/SectionLabel.js.map +1 -0
  56. package/dist/components/ui/Segmented.d.ts +30 -0
  57. package/dist/components/ui/Segmented.js +65 -0
  58. package/dist/components/ui/Segmented.js.map +1 -0
  59. package/dist/components/ui/Spinner.d.ts +22 -0
  60. package/dist/components/ui/Spinner.js +39 -0
  61. package/dist/components/ui/Spinner.js.map +1 -0
  62. package/dist/components/ui/Switch.d.ts +34 -0
  63. package/dist/components/ui/Switch.js +50 -0
  64. package/dist/components/ui/Switch.js.map +1 -0
  65. package/dist/components/ui/Textarea.d.ts +19 -0
  66. package/dist/components/ui/Textarea.js +72 -0
  67. package/dist/components/ui/Textarea.js.map +1 -0
  68. package/dist/components/ui/Toast.d.ts +45 -0
  69. package/dist/components/ui/Toast.js +116 -0
  70. package/dist/components/ui/Toast.js.map +1 -0
  71. package/dist/components/ui/Tooltip.d.ts +25 -0
  72. package/dist/components/ui/Tooltip.js +43 -0
  73. package/dist/components/ui/Tooltip.js.map +1 -0
  74. package/dist/contexts/theme-context.d.ts +95 -0
  75. package/dist/contexts/theme-context.js +561 -0
  76. package/dist/contexts/theme-context.js.map +1 -0
  77. package/dist/index.d.ts +41 -0
  78. package/dist/index.js +67 -0
  79. package/dist/specimen/TokensSpecimen.d.ts +13 -0
  80. package/dist/specimen/TokensSpecimen.js +1090 -0
  81. package/dist/specimen/TokensSpecimen.js.map +1 -0
  82. package/dist/theme/appearance-resolution.d.ts +59 -0
  83. package/dist/theme/appearance-resolution.js +379 -0
  84. package/dist/theme/appearance-resolution.js.map +1 -0
  85. package/dist/theme/init-script.d.ts +48 -0
  86. package/dist/theme/init-script.js +391 -0
  87. package/dist/theme/init-script.js.map +1 -0
  88. package/dist/theme/palettes.d.ts +146 -0
  89. package/dist/theme/palettes.js +85 -0
  90. package/dist/theme/palettes.js.map +1 -0
  91. package/dist/theme/styles.d.ts +351 -0
  92. package/dist/theme/styles.js +264 -0
  93. package/dist/theme/styles.js.map +1 -0
  94. package/dist/theme/tilt.d.ts +41 -0
  95. package/dist/theme/tilt.js +18 -0
  96. package/dist/theme/tilt.js.map +1 -0
  97. package/dist/theme/types.d.ts +61 -0
  98. package/dist/theme/types.js +234 -0
  99. package/dist/theme/types.js.map +1 -0
  100. package/dist/theme/typography.d.ts +144 -0
  101. package/dist/theme/typography.js +57 -0
  102. package/dist/theme/typography.js.map +1 -0
  103. package/dist/utils/cn.d.ts +16 -0
  104. package/dist/utils/cn.js +11 -0
  105. package/dist/utils/cn.js.map +1 -0
  106. package/package.json +60 -0
  107. package/theme.css +3924 -0
@@ -0,0 +1,264 @@
1
+ // src/theme/typography.ts
2
+ var DEFAULT_TYPE_ID = "motir";
3
+
4
+ // src/theme/styles.ts
5
+ var STYLE_DIMENSIONS = [
6
+ {
7
+ key: "silhouette",
8
+ label: "Shape / silhouette",
9
+ description: "Corner-radius personality \u2014 sober rectangles vs. soft pills vs. hard right angles."
10
+ },
11
+ {
12
+ key: "stroke",
13
+ label: "Border / stroke",
14
+ description: "Hairline vs. heavy outline; whether structure is drawn with borders at all."
15
+ },
16
+ {
17
+ key: "elevation",
18
+ label: "Elevation philosophy",
19
+ description: "How depth is expressed \u2014 soft diffuse shadows, hard offset shadows, or flat."
20
+ },
21
+ {
22
+ key: "surface",
23
+ label: "Surface / background treatment",
24
+ description: "Opaque cards vs. translucent glass vs. tinted washes \u2014 the material of a surface."
25
+ },
26
+ {
27
+ key: "density",
28
+ label: "Density rhythm",
29
+ description: "Padding/sizing cadence \u2014 compact and efficient vs. roomy and relaxed."
30
+ },
31
+ {
32
+ key: "motion",
33
+ label: "Motion",
34
+ description: "Transition speed and easing \u2014 snappy, gentle, or springy."
35
+ },
36
+ {
37
+ key: "typography",
38
+ label: "Typography",
39
+ description: "The style's DEFAULT type pairing \u2014 type is the independent `data-type` axis now (see ./typography.ts + `defaultTypeId`); this describes the pairing the style ships with: editorial serif, all-sans, or mono headlines."
40
+ },
41
+ {
42
+ key: "components",
43
+ label: "Component silhouettes",
44
+ description: "Per-component shape overrides beyond tokens (e.g. a pill button vs. a square one)."
45
+ }
46
+ ];
47
+ var STYLE_REGISTRY = {
48
+ "warm-editorial": {
49
+ id: "warm-editorial",
50
+ name: "Warm Editorial",
51
+ tagline: "Thoughtful, warm, technical-but-not-cold, slightly editorial.",
52
+ inspiration: "Notion's warm palette + Source Serif headlines over Inter body.",
53
+ designDoc: "docs/styles/warm-editorial.md",
54
+ defaultTypeId: "motir",
55
+ dimensions: {
56
+ silhouette: "Sober rectangles \u2014 8px buttons, 12px cards. Restrained, document-like.",
57
+ stroke: "Hairline borders (1px warm-grey); structure drawn quietly, never heavy.",
58
+ elevation: "Modest, low-spread shadows; surfaces sit close to the page.",
59
+ surface: "Opaque cream surfaces over a white canvas; pastel tints for feature cards only.",
60
+ density: "Comfortable default rhythm \u2014 18\xD710 button padding, 24px card padding.",
61
+ motion: "Brisk 150ms ease; understated, gets out of the way.",
62
+ typography: "Source Serif 4 editorial headlines + Inter body + JetBrains Mono meta.",
63
+ components: "Rectangular buttons/inputs, hairline-bordered cards, badge pills for status only."
64
+ }
65
+ },
66
+ "soft-playful": {
67
+ id: "soft-playful",
68
+ name: "Soft / Playful",
69
+ tagline: "More energy \u2014 rounded, generous, gently animated.",
70
+ inspiration: "Figma's pill-shape language (50px pills, roomy spacing).",
71
+ designDoc: "docs/styles/soft-playful.md",
72
+ defaultTypeId: "motir",
73
+ dimensions: {
74
+ silhouette: "Pill buttons (fully rounded) and large 24px card/input radii. Friendly, bubbly.",
75
+ stroke: "Same hairline borders as the base; identity comes from radius, not stroke weight.",
76
+ elevation: "Softer, more diffused shadows \u2014 surfaces float a touch more.",
77
+ surface: "Opaque, like the base \u2014 colour stays the palette axis; only the shape softens.",
78
+ density: "Roomier \u2014 20\xD712 button padding, 28px card padding, taller controls.",
79
+ motion: "Gentler 200ms ease and a slightly deeper press scale for a springy feel.",
80
+ typography: "Inherits the base type pairing; the personality is in shape, not type.",
81
+ components: "Pill buttons, heavily-rounded inputs/cards/modals, rounder small affordances."
82
+ }
83
+ },
84
+ "swiss-minimal-flat": {
85
+ id: "swiss-minimal-flat",
86
+ name: "Swiss / Minimal-Flat",
87
+ tagline: "International-typographic, structural, calm \u2014 flat, sharp, gridded.",
88
+ inspiration: "Swiss International Typographic Style \u2014 M\xFCller-Brockmann grids, flat surfaces.",
89
+ designDoc: "docs/styles/swiss-minimal-flat.md",
90
+ defaultTypeId: "motir-sans",
91
+ dimensions: {
92
+ silhouette: "Sharp near-square corners (2px) on every surface \u2014 hard right angles, structural.",
93
+ stroke: "Hairline borders do ALL the structural work; with elevation removed, the 1px rule is the only divider.",
94
+ elevation: "Flat \u2014 every shadow is removed (none). Depth comes from borders + whitespace, not lift.",
95
+ surface: "Opaque, untinted panels delineated by hairline rules; no floating, no glass, no wash.",
96
+ density: "Tight, gridded controls (crisp 16\xD79 buttons, 34px control height) with generous 28px card whitespace.",
97
+ motion: "Minimal \u2014 fast 100ms transitions and NO press-scale (calm, mechanical, never springy).",
98
+ typography: "Restrained neo-grotesque sans throughout \u2014 headlines drop the editorial serif for Inter, tight and strong.",
99
+ components: "Square buttons/inputs/cards/modals, rectangular (non-pill) status chips, flat hairline-ruled surfaces."
100
+ }
101
+ },
102
+ "neo-brutalism": {
103
+ id: "neo-brutalism",
104
+ name: "Neo-Brutalism",
105
+ tagline: "Raw, punchy, utilitarian \u2014 0px corners, thick borders, hard-offset shadows.",
106
+ inspiration: "Neo-brutalist web design \u2014 Gumroad / Figma-community brutalism: blocky, unpolished, loud.",
107
+ designDoc: "docs/styles/neo-brutalism.md",
108
+ defaultTypeId: "motir-mono",
109
+ dimensions: {
110
+ silhouette: "Zero radius \u2014 hard 0px corners on EVERY surface (buttons, cards, inputs, modals, status chips). Blocky and uncompromising.",
111
+ stroke: "Heavy solid 2px outlines do the structural work \u2014 borders are LOUD, not hairline (the defining neo-brutalist move, applied via a style-scoped component-variant block).",
112
+ elevation: "Hard-offset drop shadows with ZERO blur (e.g. 4px 4px 0 0) \u2014 a solid block of shadow, never a soft lift; the chunky frame, not diffusion.",
113
+ surface: "Opaque, flat, untinted panels framed by the thick border + the hard shadow; no glass, no wash, no gradient.",
114
+ density: "Tight, utilitarian controls (16\xD710 buttons, 36px control height) with compact 20px card padding \u2014 no wasted space.",
115
+ motion: "Snappy and mechanical \u2014 near-instant 60ms transitions and NO press-scale; the UI reacts, it does not animate.",
116
+ typography: "Raw monospace headlines \u2014 the editorial serif is re-pointed at the JetBrains Mono stack, against the Inter grotesk body.",
117
+ components: "Square buttons/inputs/cards/modals, rectangular (non-pill) status chips, thick-bordered surfaces with hard-offset shadows."
118
+ }
119
+ },
120
+ glassmorphism: {
121
+ id: "glassmorphism",
122
+ name: "Glassmorphism",
123
+ tagline: "Translucent frosted glass floating over a soft, vibrant gradient.",
124
+ inspiration: "Apple's visionOS / macOS Big Sur 'frosted glass' material \u2014 backdrop-blur over depth.",
125
+ designDoc: "docs/styles/glassmorphism.md",
126
+ defaultTypeId: "motir",
127
+ dimensions: {
128
+ silhouette: "Soft, rounded glass tiles \u2014 12px buttons/inputs, 18px cards, 22px modals. Friendly, never sharp.",
129
+ stroke: "Light 1px hairlines at reduced opacity \u2014 a glass edge catching light, not a structural rule.",
130
+ elevation: "Layered, diffuse, low-opacity shadows \u2014 panels float as hovering frosted sheets above the canvas.",
131
+ surface: "The identity axis: translucent frosted panels (backdrop-blur) over a soft palette-derived gradient canvas \u2014 material, not opaque.",
132
+ density: "Comfortable, a touch roomy \u2014 20\xD711 buttons, 26px card padding, 38px controls; glass tiles want air.",
133
+ motion: "Gentle, smooth \u2014 220ms ease and a light press-scale; glass slides into place, it never snaps.",
134
+ typography: "Inherits the base editorial type pairing; the personality is in the material, not the type.",
135
+ components: "Rounded frosted cards / popovers / modals / sidebar / inputs (the data-surface material layer), pill status chips."
136
+ }
137
+ },
138
+ "cybercore-y2k": {
139
+ id: "cybercore-y2k",
140
+ name: "Cybercore / Y2K",
141
+ tagline: "Neon-on-dark retro-tech \u2014 glowing HUD panels, a tech grid, mono headlines.",
142
+ inspiration: "Y2K / cyberpunk HUDs \u2014 neon-on-dark terminals, Tron grids, glowing edges, monospace displays.",
143
+ designDoc: "docs/styles/cybercore-y2k.md",
144
+ defaultTypeId: "motir-mono",
145
+ dimensions: {
146
+ silhouette: "Hard terminal-frame corners (sharp 2\u20134px) \u2014 chiseled HUD panels, not soft cards.",
147
+ stroke: "Structure drawn by a lit edge \u2014 a 1px glow-ring (currentColor halo) on every surface, not a heavier border.",
148
+ elevation: "Neon GLOW instead of drop-shadow \u2014 surfaces emit an outward currentColor halo, lit rather than lifted.",
149
+ surface: "A faint tech grid (scanline/grid texture) washes the canvas behind opaque HUD panels.",
150
+ density: "Tight, technical HUD rhythm \u2014 compact controls (18\xD79 buttons, 34px control height) over snug 20px card padding.",
151
+ motion: "Snappy and electric \u2014 very fast 90ms transitions with a crisp press-scale.",
152
+ typography: "Mono/display headlines \u2014 the serif headline face is swapped to JetBrains Mono for a terminal read; body stays sans.",
153
+ components: "Sharp glow-ringed panels, mono headings, rectangular chips; the lit edge replaces the drop shadow everywhere."
154
+ }
155
+ },
156
+ aurora: {
157
+ id: "aurora",
158
+ name: "Aurora",
159
+ tagline: "Soft, drifting aurora light behind fluid, gently-glowing surfaces.",
160
+ inspiration: 'The northern lights \u2014 slow ribbons of colour over a night sky \u2014 and the soft animated-gradient "aurora" hero look (Stripe / Vercel ambient gradients).',
161
+ designDoc: "docs/styles/aurora.md",
162
+ defaultTypeId: "motir",
163
+ dimensions: {
164
+ silhouette: "Fluid, soft corners \u2014 14px buttons/inputs, 20px cards, 26px modals. Organic and rounded, a touch softer than glass.",
165
+ stroke: "Quiet 1px hairlines; structure is implied by the gentle glow and elevation, never drawn by a heavy rule.",
166
+ elevation: "A soft neutral lift PLUS a gentle palette-derived COLOUR glow halo \u2014 surfaces feel lit from within, never hard-edged.",
167
+ surface: "The identity axis: opaque fluid surfaces floating over a slowly-DRIFTING, animated aurora gradient canvas (palette-derived ribbons).",
168
+ density: "Comfortable and roomy \u2014 20\xD711 buttons, 26px card padding, 38px controls; the light wants space to breathe.",
169
+ motion: "Smooth and slow \u2014 260ms eased transitions, a faint press-scale, and a 28s ambient drift of the aurora canvas (stilled under prefers-reduced-motion).",
170
+ typography: "Inherits the base editorial pairing (Source Serif headlines + Inter body); the personality is in the moving light, not the type.",
171
+ components: "Fluid, gently-glowing cards / popovers / modals / sidebar (the data-surface material layer); pill status chips."
172
+ }
173
+ },
174
+ "3d-immersive": {
175
+ id: "3d-immersive",
176
+ name: "3D / Immersive",
177
+ tagline: "Depth and perspective \u2014 dimensional cards floating over the page.",
178
+ inspiration: "Spatial / depth UI \u2014 visionOS spatial layers, Stripe-era layered cards, soft real-world light.",
179
+ designDoc: "docs/styles/3d-immersive.md",
180
+ defaultTypeId: "motir",
181
+ dimensions: {
182
+ silhouette: "Generously rounded dimensional tiles \u2014 14px buttons/inputs, 20px cards, 28px modals. Soft, tactile, never sharp.",
183
+ stroke: "Borders nearly vanish (a faint hairline) \u2014 structure is read from depth + shadow, not an outline.",
184
+ elevation: "The identity axis: deep multi-layer shadows float every surface off the canvas, and on tilt a card becomes a TRUE 3D object \u2014 perspective + preserve-3d + per-slot translateZ planes (header pops forward, footer behind) parallax under a cursor-tracked glare. Not a flat-plane tilt.",
185
+ surface: "A palette-derived immersive background atmosphere on every page, with opaque dimensional panels (cards, tables, board columns, widgets) floating above it on deep resting shadows \u2014 depth (not tint or glass) is the material; nothing sits flat.",
186
+ density: "Roomy and immersive \u2014 22\xD712 buttons, 28px card padding, 40px controls; depth wants air around each tile.",
187
+ motion: 'The standard "3D card" pointer-parallax \u2014 tiles tip toward the cursor (rotateX/rotateY over a perspective) via the ImmersiveTilt engine, lifting as they turn; reduced-motion-gated, settling flat on leave.',
188
+ typography: "Inherits the base editorial type pairing; the personality is in depth + light, not the type.",
189
+ components: "Rounded cards / board cards / modals that tilt toward the pointer with layered parallax; PHYSICAL buttons with real thickness (a solid base edge) that press DOWN on click; each board column floats as its own card. Nothing is flat."
190
+ }
191
+ },
192
+ neumorphism: {
193
+ id: "neumorphism",
194
+ name: "Neumorphism",
195
+ tagline: "Soft extruded surfaces that swell out of a single monochrome field.",
196
+ inspiration: 'Neumorphism / soft-UI \u2014 Dribbble-era "soft shadow" interfaces where panels are pressed OUT of (or INTO) one continuous surface by a paired light + dark shadow.',
197
+ designDoc: "docs/styles/neumorphism.md",
198
+ defaultTypeId: "motir",
199
+ dimensions: {
200
+ silhouette: "Soft, generously rounded pebbles \u2014 12px buttons/inputs, 18px cards, 22px modals. Tactile and friendly, the rounding that lets a shadow wrap a surface.",
201
+ stroke: "Borders nearly vanish \u2014 a faint hairline kept ONLY as the accessibility fallback (see below); structure is read from the paired soft shadow, not an outline.",
202
+ elevation: "The identity axis: a DUAL soft shadow \u2014 a light highlight top-left + a palette-derived dark shadow bottom-right \u2014 extrudes each surface OUT of the canvas (raised), while inputs and pressed controls invert it to an INSET well (pressed in). Depth is a soft swell, never a hard drop.",
203
+ surface: 'Monochrome and continuous: the page canvas and every panel share ONE opaque palette surface, so a card looks moulded out of the background rather than placed on top of it \u2014 the soft-UI "single material" look. Opaque (text AA preserved), with the depth carried entirely by the shadows.',
204
+ density: "Comfortable and roomy \u2014 20\xD711 buttons, 26px card padding, 38px controls; the soft shadows need air around each surface to read as extruded.",
205
+ motion: "Gentle \u2014 200ms ease and a soft press-scale; nothing snaps, matching the moulded surfaces (form fields rest as concave inset wells, panels swell out raised).",
206
+ typography: "Inherits the base editorial type pairing; the personality is in the moulded surfaces, not the type.",
207
+ components: "Raised, soft-shadowed cards / popovers / modals / sidebar (the data-surface material layer); concave inset inputs; pill status chips. Every surface swells from or sinks into the one field."
208
+ }
209
+ },
210
+ "hand-drawn-indie": {
211
+ id: "hand-drawn-indie",
212
+ name: "Hand-Drawn / Indie",
213
+ tagline: "Sketchy and friendly \u2014 rough hand-inked edges, wonky corners, soft offset shadows, a playful bounce.",
214
+ inspiration: "Indie / zine + hand-drawn web design \u2014 Excalidraw\u2019s rough hand-sketched strokes and doodled notebook UIs: warm, imperfect, human.",
215
+ designDoc: "docs/styles/hand-drawn-indie.md",
216
+ defaultTypeId: "editorial",
217
+ dimensions: {
218
+ silhouette: "Wonky hand-drawn corners \u2014 every surface gets a strongly asymmetric multi-value radius (one corner near-sharp, the opposite generously round, no two alike) so cards/buttons/inputs read as DRAWN boxes, never machined rectangles.",
219
+ stroke: "Genuinely ROUGH, wavy ink edges \u2014 a turbulence-displacement filter (Excalidraw / rough.js style) warps each outline into a hand-inked wobble, drawn on a content-safe pseudo-border so the lines are sketchy but the text stays crisp.",
220
+ elevation: "Soft, hand-placed offset shadows \u2014 a gentle blurred drop nudged down-right (a doodled shadow), friendly and low; never a hard brutalist block nor a flat removal.",
221
+ surface: "Opaque, warm, paper-like panels \u2014 colour stays the palette axis; the personality is in the rough wavy outline + the soft shadow, not a tint or a wash.",
222
+ density: "Roomy and relaxed \u2014 generous 20\xD712 buttons, 26px card padding, taller 38px controls; the hand-drawn feel wants air, like margins round a sketch.",
223
+ motion: "Springy and playful \u2014 gentle 200ms transitions with a bouncy hover lift (1.02) and a deeper press squish (0.97); the UI has a friendly wobble.",
224
+ typography: "Ships the Editorial pairing (Fraunces display headlines + Inter body) \u2014 the warmest, most characterful registered face, its soft optical wonk echoing the hand-drawn shapes; an actual marker/script face is a future data-type addition.",
225
+ components: "Wonky-cornered buttons/inputs/cards/modals, irregular (non-pill) status chips, rough wavy-ink-bordered surfaces with soft hand-placed shadows."
226
+ }
227
+ },
228
+ retrofuturism: {
229
+ id: "retrofuturism",
230
+ name: "Retrofuturism",
231
+ tagline: "Chrome, gradient sweeps and a synthwave horizon \u2014 70s/80s sci-fi.",
232
+ inspiration: "Retrofuturism / Outrun \u2014 70s\u201380s sci-fi: chrome lettering, synthwave sunset gradients, airbrushed sci-fi paperbacks, and wide geometric display type.",
233
+ designDoc: "docs/styles/retrofuturism.md",
234
+ defaultTypeId: "grotesk",
235
+ dimensions: {
236
+ silhouette: "Streamlined chrome capsules \u2014 fully-rounded pill buttons + chips, 16px cards, 22px modals. Aerodynamic 70s/80s curves, never sharp.",
237
+ stroke: "A lit chrome edge \u2014 a bright inset highlight + a dark base line over a faint hairline, reading as a polished metal rim rather than a drawn border.",
238
+ elevation: "Chrome bevels + a diagonal SPECULAR streak + a palette-derived glow \u2014 a bright top highlight fading to a dark base with a swept light-bar across each panel, so surfaces read as polished reflective metal, not flat cards.",
239
+ surface: "The identity axis: a synthwave SKY + a bright HORIZON GLOW band + a receding neon perspective GRID floor (all palette-derived) behind chrome-bevelled, specular-streaked surfaces. Dark-first \u2014 the neon horizon + grid read strongest on a dark palette.",
240
+ density: "Confident and roomy \u2014 22\xD711 chrome-capsule buttons, 24px card padding, 38px controls; the chrome wants room to catch the light.",
241
+ motion: "Smooth and gliding \u2014 200ms eased transitions and a confident press-scale; the synthwave horizon + grid are a STATIC backdrop (no motion to distract the work surface).",
242
+ typography: "Wide geometric grotesque display (the `grotesk` type pairing) \u2014 the retro-futurist sci-fi headline read; body stays a legible sans.",
243
+ components: "Chrome-capsule buttons with a metallic glint, specular-streaked bevelled cards / popovers / modals / sidebar / inputs (the data-surface material layer), pill status chips \u2014 a synthwave horizon + neon grid behind it all."
244
+ }
245
+ }
246
+ };
247
+ var STYLE_IDS = Object.keys(STYLE_REGISTRY);
248
+ var DEFAULT_STYLE_ID = "warm-editorial";
249
+ function isStyleId(value) {
250
+ return typeof value === "string" && Object.prototype.hasOwnProperty.call(STYLE_REGISTRY, value);
251
+ }
252
+ function resolveStyle(value) {
253
+ return STYLE_REGISTRY[isStyleId(value) ? value : DEFAULT_STYLE_ID];
254
+ }
255
+ var STYLE_DEFAULT_TYPE = Object.fromEntries(
256
+ STYLE_IDS.map((id) => [id, STYLE_REGISTRY[id].defaultTypeId])
257
+ );
258
+ function defaultTypeForStyle(styleValue) {
259
+ return isStyleId(styleValue) ? STYLE_REGISTRY[styleValue].defaultTypeId : DEFAULT_TYPE_ID;
260
+ }
261
+
262
+ export { DEFAULT_STYLE_ID, STYLE_DEFAULT_TYPE, STYLE_DIMENSIONS, STYLE_IDS, STYLE_REGISTRY, defaultTypeForStyle, isStyleId, resolveStyle };
263
+ //# sourceMappingURL=styles.js.map
264
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/typography.ts","../../src/theme/styles.ts"],"names":[],"mappings":";AA8IO,IAAM,eAAA,GAA0B,OAAA;;;AClFhC,IAAM,gBAAA,GAAmB;AAAA,EAC9B;AAAA,IACE,GAAA,EAAK,YAAA;AAAA,IACL,KAAA,EAAO,oBAAA;AAAA,IACP,WAAA,EACE;AAAA,GACJ;AAAA,EACA;AAAA,IACE,GAAA,EAAK,QAAA;AAAA,IACL,KAAA,EAAO,iBAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACf;AAAA,EACA;AAAA,IACE,GAAA,EAAK,WAAA;AAAA,IACL,KAAA,EAAO,sBAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACf;AAAA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AE,CAAA,CAAE,aAAa,CAAC;AAC9D;AAGO,SAAS,oBAAoB,UAAA,EAA6B;AAC/D,EAAA,OAAO,UAAU,UAAU,CAAA,GAAI,cAAA,CAAe,UAAU,EAAE,aAAA,GAAgB,eAAA;AAC5E","file":"styles.js","sourcesContent":["/**\n * The Motir TYPOGRAPHY LIBRARY — the named-pairing registry (Subtask 7.3.53).\n *\n * A \"type pairing\" is a named TYPOGRAPHY scheme the whole UI can swap to at\n * runtime — the THIRD design axis, completing the token decomposition\n * (Colour `data-palette` · Type `data-type` · Shape/feel `data-style`). It is\n * deliberately INDEPENDENT of the other two: a pairing decides which TYPEFACES\n * the product wears (the headline / body / mono role mapping); it never touches\n * a hue (palette axis) or a radius (style axis).\n *\n * ── The three-axis runtime contract ─────────────────────────────────────\n * data-type=\"<type-id>\" — THIS axis. A `[data-type='<id>']` block in\n * app/globals.css re-points the `--font-*`\n * role tokens (sans / serif / mono) — and ONLY\n * font tokens, never colour or shape.\n * data-palette=\"<palette-id>\" — the INDEPENDENT colour axis (`--el-*`).\n * data-style=\"<style-id>\" — the INDEPENDENT shape/feel axis.\n *\n * The shared `--font-size-*` SCALE stays common across pairings — sizes are\n * layout, not brand; a pairing remaps the FACES, not the type scale.\n *\n * ── A style declares a DEFAULT pairing (overridable) ────────────────────\n * Typography used to be BUNDLED into the style axis: `swiss-minimal-flat`,\n * `neo-brutalism` and `cybercore-y2k` each re-pointed `--font-serif` inside\n * their own `[data-style]` block. That is now a disjointness violation (two\n * axes setting `--font-*`). The fix: each style declares a `defaultTypeId`\n * (see ./styles.ts) — the pairing applied when the user has NOT pinned an\n * explicit type — and the per-style font overrides move here, as pairings.\n * So out-of-the-box looks are UNCHANGED; the new freedom is that type is now\n * independently overridable (e.g. Swiss shape + a serif pairing).\n *\n * ── v1 — the base faces only (no new payload) ───────────────────────────\n * v1 registered three pairings built from the THREE already-loaded next/font\n * faces (Inter · Source Serif 4 · JetBrains Mono) — so they add ZERO font\n * payload and carry NO new-typeface design decision:\n * - `motir` — the base: editorial serif headlines over a sans body.\n * - `motir-sans` — all-sans (Inter headlines); reproduces the Swiss look.\n * - `motir-mono` — mono THROUGHOUT (headlines + body/UI); a code-native UI.\n * `motir` is the base — like the `motir` palette / `warm-editorial` style it\n * needs NO `[data-type]` override block; the base `--font-*` tokens already are\n * it.\n *\n * ── New-typeface pairings (Grotesk / Editorial / Mono-Technical, 7.3.54–56) ──\n * Each adds a real type-design decision and loads its own next/font face(s),\n * re-pointing a role in its own `[data-type]` block:\n * - `grotesk` (7.3.54) — Space Grotesk THROUGHOUT (headlines + body/UI).\n * - `editorial` (7.3.55) — Fraunces display-serif headlines over the Inter\n * body; a magazine, considered pairing (one new face — Inter + JetBrains reused).\n * Body STAYS Inter — a display serif is unreadable as UI, so this pairing\n * re-types headlines only (the legibility exception to whole-UI re-typing).\n * - `mono-technical` (7.3.56) — IBM Plex Mono THROUGHOUT (headlines + body/UI +\n * meta); a precise, developer-grade UI (one new face — Inter reused for nothing\n * now, kept as the ultimate fallback).\n *\n * ── Whole-UI re-typing (Yue, 2026-06-19) ────────────────────────────────\n * A type pairing re-types the WHOLE app, chrome included (nav, header, buttons),\n * not just headlines: a pairing whose signature face reads as a UI sans/mono\n * (`grotesk`, `motir-mono`, `mono-technical`) ALSO re-points the body/UI role\n * (`--font-sans`) in its `[data-type]` block. The display-serif `editorial` and\n * the all-Inter `motir` / `motir-sans` keep the Inter body for legibility.\n * Each later \"Type: …\" subtask ADDS its entry here + a `[data-type]` block (its\n * face loaded in `app/layout.tsx`) + its `docs/typography/<id>.md`.\n */\n\n/** A registered, runtime-selectable type pairing. */\nexport interface TypographyDefinition {\n /** The `data-type` attribute value. Stable; used as the localStorage value. */\n id: string;\n /** Display name shown in the gallery / `/tokens` toggle. */\n name: string;\n /** One-line characterization of the typographic feel. */\n tagline: string;\n /** The headline / body / mono face mapping (credit / what it loads). */\n faces: string;\n /**\n * Repo-relative path to this pairing's doc — the type-role reference a later\n * getdesign-style swap or the `/tokens` composer reads. Every registered\n * pairing maps to exactly one.\n */\n designDoc: string;\n}\n\n/**\n * The registry. Insertion order is the gallery order. Each non-base `id`\n * matches a `[data-type='<id>']` block in app/globals.css (`motir` is the base,\n * so its block is the Tier-0 `--font-*` defaults — no override block needed).\n */\nexport const TYPE_REGISTRY = {\n motir: {\n id: 'motir',\n name: 'Motir',\n tagline: 'Editorial serif headlines over a clean sans body — the house pairing.',\n faces: 'Source Serif 4 headlines · Inter body · JetBrains Mono meta.',\n designDoc: 'docs/typography/motir.md',\n },\n 'motir-sans': {\n id: 'motir-sans',\n name: 'Motir Sans',\n tagline: 'All-sans — Inter for headlines and body; structural, no serif.',\n faces: 'Inter headlines + body · JetBrains Mono meta.',\n designDoc: 'docs/typography/motir-sans.md',\n },\n 'motir-mono': {\n id: 'motir-mono',\n name: 'Motir Mono',\n tagline: 'Monospace throughout — a code-native UI, headlines, body and all.',\n faces: 'JetBrains Mono headlines + body/UI + meta.',\n designDoc: 'docs/typography/motir-mono.md',\n },\n grotesk: {\n id: 'grotesk',\n name: 'Grotesk',\n tagline: 'Geometric neo-grotesque across the whole UI — tight, confident, product-y.',\n faces: 'Space Grotesk headlines + body/UI · JetBrains Mono meta.',\n designDoc: 'docs/typography/grotesk.md',\n },\n editorial: {\n id: 'editorial',\n name: 'Editorial',\n tagline: 'A characterful display serif over a humanist sans — magazine, considered.',\n faces: 'Fraunces display headlines · Inter body · JetBrains Mono meta.',\n designDoc: 'docs/typography/editorial.md',\n },\n 'mono-technical': {\n id: 'mono-technical',\n name: 'Mono-Technical',\n tagline: 'IBM Plex Mono throughout — a precise, developer-grade UI.',\n faces: 'IBM Plex Mono headlines + body/UI + meta/code.',\n designDoc: 'docs/typography/mono-technical.md',\n },\n} satisfies Record<string, TypographyDefinition>;\n\n/** The id of every registered pairing — `data-type` value space. */\nexport type TypeId = keyof typeof TYPE_REGISTRY;\n\n/** All registered pairing ids, in gallery order. */\nexport const TYPE_IDS = Object.keys(TYPE_REGISTRY) as TypeId[];\n\n/**\n * The default pairing a fresh install / unset preference resolves to when the\n * active style declares none. Motir is the house pairing and the Tier-0 base.\n */\nexport const DEFAULT_TYPE_ID: TypeId = 'motir';\n\n/** Narrowing guard — is an arbitrary string a registered pairing id? */\nexport function isTypeId(value: unknown): value is TypeId {\n return typeof value === 'string' && Object.prototype.hasOwnProperty.call(TYPE_REGISTRY, value);\n}\n\n/** Resolve a (possibly stale / unknown) value to a valid pairing definition. */\nexport function resolveType(value: unknown): TypographyDefinition {\n return TYPE_REGISTRY[isTypeId(value) ? value : DEFAULT_TYPE_ID];\n}\n","/**\n * The Motir STYLE LIBRARY — the named-aesthetic registry (Subtask 7.3.32).\n *\n * A \"style\" is a named, end-to-end AESTHETIC the whole UI can swap to at\n * runtime — the foundation the onboarding design wizard (7.3.27) and the\n * `/tokens` composer (7.3.30) build on. It is the SHAPE/feel axis, and it is\n * deliberately INDEPENDENT of the COLOR axis (`data-palette` — see below): a\n * style decides how the product FEELS (silhouette, stroke, elevation, surface\n * treatment, density, motion, typography, component silhouettes); a palette\n * decides what colours it WEARS. Picking a style never changes a hue, and\n * picking a palette never changes a radius.\n *\n * ── The two-axis runtime contract ───────────────────────────────────────\n * data-style=\"<style-id>\" — THIS axis. Layers per-style shape/feel\n * tokens (+ component-variant overrides) over\n * the Tier-0 base scale in app/globals.css.\n * data-palette=\"<palette-id>\" — the INDEPENDENT colour axis (re-skins the\n * `--el-*` layer). Orthogonal to data-style.\n * data-theme=\"light|dark\" — the light/dark base within a palette.\n *\n * A `[data-style='…']` TOKEN block in globals.css MUST override ONLY shape/feel\n * tokens (radius / spacing / shadow / sizing / transition / type) — NEVER a\n * `--color-*` or `--el-*` colour token. That is the palette axis's job, and\n * keeping the two disjoint is what makes \"style × palette\" a true product of\n * two independent choices rather than 2×N hand-tuned combinations.\n *\n * A SURFACE-MATERIAL style (glassmorphism, 7.3.35; later cybercore, aurora,\n * neumorphism …) owns a richer surface — translucency, a gradient canvas,\n * frosted backdrop-blur — that the token block cannot express. It adds a\n * palette-DERIVED MATERIAL LAYER: style-scoped component rules\n * (`[data-style='id'] [data-surface='…'] { … }`) whose colour comes ONLY from\n * `color-mix()`/`var(--color-*|--el-*)` over the ACTIVE palette, never a raw\n * hue — so the two axes stay disjoint (a palette swap re-tints the material; a\n * style swap leaves hues untouched). Surfaces opt in via the `data-surface`\n * hook the shared primitives emit. Both rules are enforced by\n * tests/theme/styleRegistry.test.ts.\n *\n * ── Why a style is MORE than a token swap ───────────────────────────────\n * The feel-bearing DIMENSIONS below are the axes a pure token swap ignores:\n * two styles can share the Tier-0 scale yet feel utterly different because\n * their silhouette, elevation philosophy, surface treatment, and component\n * silhouettes diverge. The registry names those dimensions so each style (and\n * its DESIGN.md) is authored against the same rubric.\n *\n * This module is the schema + the registration of the styles. Each \"Style: …\"\n * subtask (7.3.33–7.3.42) ADDS its entry here, ships a `[data-style='<id>']`\n * token block in globals.css (plus, for a surface-material style, the\n * palette-derived material layer above), and authors its `docs/styles/<id>.md`\n * DESIGN.md.\n */\n\nimport { DEFAULT_TYPE_ID, type TypeId } from './typography';\n\n/**\n * The feel-bearing axes a named style controls. A token-only swap reaches the\n * first few; the rest (surface treatment, motion, typography, component\n * silhouettes) are what give a style its identity and must be authored, not\n * derived. The order here is the canonical presentation order (the `/tokens`\n * page + each style's DESIGN.md walk them in this sequence).\n */\nexport const STYLE_DIMENSIONS = [\n {\n key: 'silhouette',\n label: 'Shape / silhouette',\n description:\n 'Corner-radius personality — sober rectangles vs. soft pills vs. hard right angles.',\n },\n {\n key: 'stroke',\n label: 'Border / stroke',\n description: 'Hairline vs. heavy outline; whether structure is drawn with borders at all.',\n },\n {\n key: 'elevation',\n label: 'Elevation philosophy',\n description: 'How depth is expressed — soft diffuse shadows, hard offset shadows, or flat.',\n },\n {\n key: 'surface',\n label: 'Surface / background treatment',\n description:\n 'Opaque cards vs. translucent glass vs. tinted washes — the material of a surface.',\n },\n {\n key: 'density',\n label: 'Density rhythm',\n description: 'Padding/sizing cadence — compact and efficient vs. roomy and relaxed.',\n },\n {\n key: 'motion',\n label: 'Motion',\n description: 'Transition speed and easing — snappy, gentle, or springy.',\n },\n {\n key: 'typography',\n label: 'Typography',\n description:\n \"The style's DEFAULT type pairing — type is the independent `data-type` axis now (see ./typography.ts + `defaultTypeId`); this describes the pairing the style ships with: editorial serif, all-sans, or mono headlines.\",\n },\n {\n key: 'components',\n label: 'Component silhouettes',\n description:\n 'Per-component shape overrides beyond tokens (e.g. a pill button vs. a square one).',\n },\n] as const;\n\nexport type StyleDimensionKey = (typeof STYLE_DIMENSIONS)[number]['key'];\n\n/** A registered, runtime-selectable style. */\nexport interface StyleDefinition {\n /** The `data-style` attribute value. Stable; used as the localStorage value. */\n id: string;\n /** Display name shown in the gallery / `/tokens` toggle. */\n name: string;\n /** One-line characterization of the feel. */\n tagline: string;\n /** Where the look is drawn from (credit / mood anchor). */\n inspiration: string;\n /** One line per feel-bearing dimension — the authored rubric for this style. */\n dimensions: Record<StyleDimensionKey, string>;\n /**\n * Repo-relative path to this style's DESIGN.md — the doc the `/tokens` page\n * composes (and a later getdesign-style swap reads). Every registered style\n * maps to exactly one.\n */\n designDoc: string;\n /**\n * The type pairing (`data-type`, see ./typography.ts) this style applies when\n * the user has NOT pinned an explicit type — the style's curated default,\n * overridable. Type is its own axis now; this is how a style keeps its\n * out-of-the-box typographic feel (e.g. swiss → `motir-sans`, neo-brutalism /\n * cybercore-y2k → `motir-mono`) without owning `--font-*` in its own block.\n */\n defaultTypeId: TypeId;\n}\n\n/**\n * The registry. Insertion order is the gallery order. Each `id` matches a\n * `[data-style='<id>']` block in app/globals.css (Warm Editorial is the base,\n * so its block is the Tier-0 defaults — no override block needed).\n */\nexport const STYLE_REGISTRY = {\n 'warm-editorial': {\n id: 'warm-editorial',\n name: 'Warm Editorial',\n tagline: 'Thoughtful, warm, technical-but-not-cold, slightly editorial.',\n inspiration: \"Notion's warm palette + Source Serif headlines over Inter body.\",\n designDoc: 'docs/styles/warm-editorial.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette: 'Sober rectangles — 8px buttons, 12px cards. Restrained, document-like.',\n stroke: 'Hairline borders (1px warm-grey); structure drawn quietly, never heavy.',\n elevation: 'Modest, low-spread shadows; surfaces sit close to the page.',\n surface: 'Opaque cream surfaces over a white canvas; pastel tints for feature cards only.',\n density: 'Comfortable default rhythm — 18×10 button padding, 24px card padding.',\n motion: 'Brisk 150ms ease; understated, gets out of the way.',\n typography: 'Source Serif 4 editorial headlines + Inter body + JetBrains Mono meta.',\n components:\n 'Rectangular buttons/inputs, hairline-bordered cards, badge pills for status only.',\n },\n },\n 'soft-playful': {\n id: 'soft-playful',\n name: 'Soft / Playful',\n tagline: 'More energy — rounded, generous, gently animated.',\n inspiration: \"Figma's pill-shape language (50px pills, roomy spacing).\",\n designDoc: 'docs/styles/soft-playful.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette: 'Pill buttons (fully rounded) and large 24px card/input radii. Friendly, bubbly.',\n stroke: 'Same hairline borders as the base; identity comes from radius, not stroke weight.',\n elevation: 'Softer, more diffused shadows — surfaces float a touch more.',\n surface: 'Opaque, like the base — colour stays the palette axis; only the shape softens.',\n density: 'Roomier — 20×12 button padding, 28px card padding, taller controls.',\n motion: 'Gentler 200ms ease and a slightly deeper press scale for a springy feel.',\n typography: 'Inherits the base type pairing; the personality is in shape, not type.',\n components: 'Pill buttons, heavily-rounded inputs/cards/modals, rounder small affordances.',\n },\n },\n 'swiss-minimal-flat': {\n id: 'swiss-minimal-flat',\n name: 'Swiss / Minimal-Flat',\n tagline: 'International-typographic, structural, calm — flat, sharp, gridded.',\n inspiration: 'Swiss International Typographic Style — Müller-Brockmann grids, flat surfaces.',\n designDoc: 'docs/styles/swiss-minimal-flat.md',\n defaultTypeId: 'motir-sans',\n dimensions: {\n silhouette:\n 'Sharp near-square corners (2px) on every surface — hard right angles, structural.',\n stroke:\n 'Hairline borders do ALL the structural work; with elevation removed, the 1px rule is the only divider.',\n elevation:\n 'Flat — every shadow is removed (none). Depth comes from borders + whitespace, not lift.',\n surface:\n 'Opaque, untinted panels delineated by hairline rules; no floating, no glass, no wash.',\n density:\n 'Tight, gridded controls (crisp 16×9 buttons, 34px control height) with generous 28px card whitespace.',\n motion:\n 'Minimal — fast 100ms transitions and NO press-scale (calm, mechanical, never springy).',\n typography:\n 'Restrained neo-grotesque sans throughout — headlines drop the editorial serif for Inter, tight and strong.',\n components:\n 'Square buttons/inputs/cards/modals, rectangular (non-pill) status chips, flat hairline-ruled surfaces.',\n },\n },\n 'neo-brutalism': {\n id: 'neo-brutalism',\n name: 'Neo-Brutalism',\n tagline: 'Raw, punchy, utilitarian — 0px corners, thick borders, hard-offset shadows.',\n inspiration:\n 'Neo-brutalist web design — Gumroad / Figma-community brutalism: blocky, unpolished, loud.',\n designDoc: 'docs/styles/neo-brutalism.md',\n defaultTypeId: 'motir-mono',\n dimensions: {\n silhouette:\n 'Zero radius — hard 0px corners on EVERY surface (buttons, cards, inputs, modals, status chips). Blocky and uncompromising.',\n stroke:\n 'Heavy solid 2px outlines do the structural work — borders are LOUD, not hairline (the defining neo-brutalist move, applied via a style-scoped component-variant block).',\n elevation:\n 'Hard-offset drop shadows with ZERO blur (e.g. 4px 4px 0 0) — a solid block of shadow, never a soft lift; the chunky frame, not diffusion.',\n surface:\n 'Opaque, flat, untinted panels framed by the thick border + the hard shadow; no glass, no wash, no gradient.',\n density:\n 'Tight, utilitarian controls (16×10 buttons, 36px control height) with compact 20px card padding — no wasted space.',\n motion:\n 'Snappy and mechanical — near-instant 60ms transitions and NO press-scale; the UI reacts, it does not animate.',\n typography:\n 'Raw monospace headlines — the editorial serif is re-pointed at the JetBrains Mono stack, against the Inter grotesk body.',\n components:\n 'Square buttons/inputs/cards/modals, rectangular (non-pill) status chips, thick-bordered surfaces with hard-offset shadows.',\n },\n },\n glassmorphism: {\n id: 'glassmorphism',\n name: 'Glassmorphism',\n tagline: 'Translucent frosted glass floating over a soft, vibrant gradient.',\n inspiration:\n \"Apple's visionOS / macOS Big Sur 'frosted glass' material — backdrop-blur over depth.\",\n designDoc: 'docs/styles/glassmorphism.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette:\n 'Soft, rounded glass tiles — 12px buttons/inputs, 18px cards, 22px modals. Friendly, never sharp.',\n stroke:\n 'Light 1px hairlines at reduced opacity — a glass edge catching light, not a structural rule.',\n elevation:\n 'Layered, diffuse, low-opacity shadows — panels float as hovering frosted sheets above the canvas.',\n surface:\n 'The identity axis: translucent frosted panels (backdrop-blur) over a soft palette-derived gradient canvas — material, not opaque.',\n density:\n 'Comfortable, a touch roomy — 20×11 buttons, 26px card padding, 38px controls; glass tiles want air.',\n motion:\n 'Gentle, smooth — 220ms ease and a light press-scale; glass slides into place, it never snaps.',\n typography:\n 'Inherits the base editorial type pairing; the personality is in the material, not the type.',\n components:\n 'Rounded frosted cards / popovers / modals / sidebar / inputs (the data-surface material layer), pill status chips.',\n },\n },\n 'cybercore-y2k': {\n id: 'cybercore-y2k',\n name: 'Cybercore / Y2K',\n tagline: 'Neon-on-dark retro-tech — glowing HUD panels, a tech grid, mono headlines.',\n inspiration:\n 'Y2K / cyberpunk HUDs — neon-on-dark terminals, Tron grids, glowing edges, monospace displays.',\n designDoc: 'docs/styles/cybercore-y2k.md',\n defaultTypeId: 'motir-mono',\n dimensions: {\n silhouette:\n 'Hard terminal-frame corners (sharp 2–4px) — chiseled HUD panels, not soft cards.',\n stroke:\n 'Structure drawn by a lit edge — a 1px glow-ring (currentColor halo) on every surface, not a heavier border.',\n elevation:\n 'Neon GLOW instead of drop-shadow — surfaces emit an outward currentColor halo, lit rather than lifted.',\n surface:\n 'A faint tech grid (scanline/grid texture) washes the canvas behind opaque HUD panels.',\n density:\n 'Tight, technical HUD rhythm — compact controls (18×9 buttons, 34px control height) over snug 20px card padding.',\n motion: 'Snappy and electric — very fast 90ms transitions with a crisp press-scale.',\n typography:\n 'Mono/display headlines — the serif headline face is swapped to JetBrains Mono for a terminal read; body stays sans.',\n components:\n 'Sharp glow-ringed panels, mono headings, rectangular chips; the lit edge replaces the drop shadow everywhere.',\n },\n },\n aurora: {\n id: 'aurora',\n name: 'Aurora',\n tagline: 'Soft, drifting aurora light behind fluid, gently-glowing surfaces.',\n inspiration:\n 'The northern lights — slow ribbons of colour over a night sky — and the soft animated-gradient \"aurora\" hero look (Stripe / Vercel ambient gradients).',\n designDoc: 'docs/styles/aurora.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette:\n 'Fluid, soft corners — 14px buttons/inputs, 20px cards, 26px modals. Organic and rounded, a touch softer than glass.',\n stroke:\n 'Quiet 1px hairlines; structure is implied by the gentle glow and elevation, never drawn by a heavy rule.',\n elevation:\n 'A soft neutral lift PLUS a gentle palette-derived COLOUR glow halo — surfaces feel lit from within, never hard-edged.',\n surface:\n 'The identity axis: opaque fluid surfaces floating over a slowly-DRIFTING, animated aurora gradient canvas (palette-derived ribbons).',\n density:\n 'Comfortable and roomy — 20×11 buttons, 26px card padding, 38px controls; the light wants space to breathe.',\n motion:\n 'Smooth and slow — 260ms eased transitions, a faint press-scale, and a 28s ambient drift of the aurora canvas (stilled under prefers-reduced-motion).',\n typography:\n 'Inherits the base editorial pairing (Source Serif headlines + Inter body); the personality is in the moving light, not the type.',\n components:\n 'Fluid, gently-glowing cards / popovers / modals / sidebar (the data-surface material layer); pill status chips.',\n },\n },\n '3d-immersive': {\n id: '3d-immersive',\n name: '3D / Immersive',\n tagline: 'Depth and perspective — dimensional cards floating over the page.',\n inspiration:\n 'Spatial / depth UI — visionOS spatial layers, Stripe-era layered cards, soft real-world light.',\n designDoc: 'docs/styles/3d-immersive.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette:\n 'Generously rounded dimensional tiles — 14px buttons/inputs, 20px cards, 28px modals. Soft, tactile, never sharp.',\n stroke:\n 'Borders nearly vanish (a faint hairline) — structure is read from depth + shadow, not an outline.',\n elevation:\n 'The identity axis: deep multi-layer shadows float every surface off the canvas, and on tilt a card becomes a TRUE 3D object — perspective + preserve-3d + per-slot translateZ planes (header pops forward, footer behind) parallax under a cursor-tracked glare. Not a flat-plane tilt.',\n surface:\n 'A palette-derived immersive background atmosphere on every page, with opaque dimensional panels (cards, tables, board columns, widgets) floating above it on deep resting shadows — depth (not tint or glass) is the material; nothing sits flat.',\n density:\n 'Roomy and immersive — 22×12 buttons, 28px card padding, 40px controls; depth wants air around each tile.',\n motion:\n 'The standard \"3D card\" pointer-parallax — tiles tip toward the cursor (rotateX/rotateY over a perspective) via the ImmersiveTilt engine, lifting as they turn; reduced-motion-gated, settling flat on leave.',\n typography:\n 'Inherits the base editorial type pairing; the personality is in depth + light, not the type.',\n components:\n 'Rounded cards / board cards / modals that tilt toward the pointer with layered parallax; PHYSICAL buttons with real thickness (a solid base edge) that press DOWN on click; each board column floats as its own card. Nothing is flat.',\n },\n },\n neumorphism: {\n id: 'neumorphism',\n name: 'Neumorphism',\n tagline: 'Soft extruded surfaces that swell out of a single monochrome field.',\n inspiration:\n 'Neumorphism / soft-UI — Dribbble-era \"soft shadow\" interfaces where panels are pressed OUT of (or INTO) one continuous surface by a paired light + dark shadow.',\n designDoc: 'docs/styles/neumorphism.md',\n defaultTypeId: 'motir',\n dimensions: {\n silhouette:\n 'Soft, generously rounded pebbles — 12px buttons/inputs, 18px cards, 22px modals. Tactile and friendly, the rounding that lets a shadow wrap a surface.',\n stroke:\n 'Borders nearly vanish — a faint hairline kept ONLY as the accessibility fallback (see below); structure is read from the paired soft shadow, not an outline.',\n elevation:\n 'The identity axis: a DUAL soft shadow — a light highlight top-left + a palette-derived dark shadow bottom-right — extrudes each surface OUT of the canvas (raised), while inputs and pressed controls invert it to an INSET well (pressed in). Depth is a soft swell, never a hard drop.',\n surface:\n 'Monochrome and continuous: the page canvas and every panel share ONE opaque palette surface, so a card looks moulded out of the background rather than placed on top of it — the soft-UI \"single material\" look. Opaque (text AA preserved), with the depth carried entirely by the shadows.',\n density:\n 'Comfortable and roomy — 20×11 buttons, 26px card padding, 38px controls; the soft shadows need air around each surface to read as extruded.',\n motion:\n 'Gentle — 200ms ease and a soft press-scale; nothing snaps, matching the moulded surfaces (form fields rest as concave inset wells, panels swell out raised).',\n typography:\n 'Inherits the base editorial type pairing; the personality is in the moulded surfaces, not the type.',\n components:\n 'Raised, soft-shadowed cards / popovers / modals / sidebar (the data-surface material layer); concave inset inputs; pill status chips. Every surface swells from or sinks into the one field.',\n },\n },\n 'hand-drawn-indie': {\n id: 'hand-drawn-indie',\n name: 'Hand-Drawn / Indie',\n tagline:\n 'Sketchy and friendly — rough hand-inked edges, wonky corners, soft offset shadows, a playful bounce.',\n inspiration:\n 'Indie / zine + hand-drawn web design — Excalidraw’s rough hand-sketched strokes and doodled notebook UIs: warm, imperfect, human.',\n designDoc: 'docs/styles/hand-drawn-indie.md',\n defaultTypeId: 'editorial',\n dimensions: {\n silhouette:\n 'Wonky hand-drawn corners — every surface gets a strongly asymmetric multi-value radius (one corner near-sharp, the opposite generously round, no two alike) so cards/buttons/inputs read as DRAWN boxes, never machined rectangles.',\n stroke:\n 'Genuinely ROUGH, wavy ink edges — a turbulence-displacement filter (Excalidraw / rough.js style) warps each outline into a hand-inked wobble, drawn on a content-safe pseudo-border so the lines are sketchy but the text stays crisp.',\n elevation:\n 'Soft, hand-placed offset shadows — a gentle blurred drop nudged down-right (a doodled shadow), friendly and low; never a hard brutalist block nor a flat removal.',\n surface:\n 'Opaque, warm, paper-like panels — colour stays the palette axis; the personality is in the rough wavy outline + the soft shadow, not a tint or a wash.',\n density:\n 'Roomy and relaxed — generous 20×12 buttons, 26px card padding, taller 38px controls; the hand-drawn feel wants air, like margins round a sketch.',\n motion:\n 'Springy and playful — gentle 200ms transitions with a bouncy hover lift (1.02) and a deeper press squish (0.97); the UI has a friendly wobble.',\n typography:\n 'Ships the Editorial pairing (Fraunces display headlines + Inter body) — the warmest, most characterful registered face, its soft optical wonk echoing the hand-drawn shapes; an actual marker/script face is a future data-type addition.',\n components:\n 'Wonky-cornered buttons/inputs/cards/modals, irregular (non-pill) status chips, rough wavy-ink-bordered surfaces with soft hand-placed shadows.',\n },\n },\n retrofuturism: {\n id: 'retrofuturism',\n name: 'Retrofuturism',\n tagline: 'Chrome, gradient sweeps and a synthwave horizon — 70s/80s sci-fi.',\n inspiration:\n 'Retrofuturism / Outrun — 70s–80s sci-fi: chrome lettering, synthwave sunset gradients, airbrushed sci-fi paperbacks, and wide geometric display type.',\n designDoc: 'docs/styles/retrofuturism.md',\n defaultTypeId: 'grotesk',\n dimensions: {\n silhouette:\n 'Streamlined chrome capsules — fully-rounded pill buttons + chips, 16px cards, 22px modals. Aerodynamic 70s/80s curves, never sharp.',\n stroke:\n 'A lit chrome edge — a bright inset highlight + a dark base line over a faint hairline, reading as a polished metal rim rather than a drawn border.',\n elevation:\n 'Chrome bevels + a diagonal SPECULAR streak + a palette-derived glow — a bright top highlight fading to a dark base with a swept light-bar across each panel, so surfaces read as polished reflective metal, not flat cards.',\n surface:\n 'The identity axis: a synthwave SKY + a bright HORIZON GLOW band + a receding neon perspective GRID floor (all palette-derived) behind chrome-bevelled, specular-streaked surfaces. Dark-first — the neon horizon + grid read strongest on a dark palette.',\n density:\n 'Confident and roomy — 22×11 chrome-capsule buttons, 24px card padding, 38px controls; the chrome wants room to catch the light.',\n motion:\n 'Smooth and gliding — 200ms eased transitions and a confident press-scale; the synthwave horizon + grid are a STATIC backdrop (no motion to distract the work surface).',\n typography:\n 'Wide geometric grotesque display (the `grotesk` type pairing) — the retro-futurist sci-fi headline read; body stays a legible sans.',\n components:\n 'Chrome-capsule buttons with a metallic glint, specular-streaked bevelled cards / popovers / modals / sidebar / inputs (the data-surface material layer), pill status chips — a synthwave horizon + neon grid behind it all.',\n },\n },\n} satisfies Record<string, StyleDefinition>;\n\n/** The id of every registered style — `data-style` value space. */\nexport type StyleId = keyof typeof STYLE_REGISTRY;\n\n/** All registered style ids, in gallery order. */\nexport const STYLE_IDS = Object.keys(STYLE_REGISTRY) as StyleId[];\n\n/**\n * The default style a fresh install / unset preference resolves to. Warm\n * Editorial is Motir's house style and the Tier-0 base.\n */\nexport const DEFAULT_STYLE_ID: StyleId = 'warm-editorial';\n\n/** Narrowing guard — is an arbitrary string a registered style id? */\nexport function isStyleId(value: unknown): value is StyleId {\n return typeof value === 'string' && Object.prototype.hasOwnProperty.call(STYLE_REGISTRY, value);\n}\n\n/** Resolve a (possibly stale / unknown) value to a valid style definition. */\nexport function resolveStyle(value: unknown): StyleDefinition {\n return STYLE_REGISTRY[isStyleId(value) ? value : DEFAULT_STYLE_ID];\n}\n\n/**\n * styleId → its `defaultTypeId` — the type pairing applied when the user has\n * not pinned an explicit `data-type`. Baked into the FOUC init script (so the\n * pre-hydration pass can resolve the right type for the active style) and used\n * by the theme context's effective-type derivation. `resolveType` (the\n * registry) supplies the ultimate fallback, so every value here is a real id.\n */\nexport const STYLE_DEFAULT_TYPE: Record<StyleId, TypeId> = Object.fromEntries(\n STYLE_IDS.map((id) => [id, STYLE_REGISTRY[id].defaultTypeId]),\n) as Record<StyleId, TypeId>;\n\n/** The default type for a (possibly unknown) style value — the fallback chain. */\nexport function defaultTypeForStyle(styleValue: unknown): TypeId {\n return isStyleId(styleValue) ? STYLE_REGISTRY[styleValue].defaultTypeId : DEFAULT_TYPE_ID;\n}\n"]}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Pointer-parallax tilt math for the 3D / Immersive style (Subtask 7.3.39).
3
+ *
4
+ * The standard "3D card" effect (vanilla-tilt.js / react-parallax-tilt /
5
+ * Atropos): a tile tips toward the cursor. Given a tile's bounding rect and the
6
+ * pointer position, this maps the cursor to a pair of rotations:
7
+ *
8
+ * - `ry` (rotateY) follows the HORIZONTAL position: pointer on the right edge
9
+ * rotates the tile's right side AWAY (negative is toward the viewer on the
10
+ * left), so the face turns to follow the cursor.
11
+ * - `rx` (rotateX) follows the VERTICAL position: pointer near the top tips
12
+ * the top toward the viewer.
13
+ *
14
+ * Output degrees are clamped to ±`maxDeg`. Pure + DOM-free so it is unit-tested
15
+ * directly; the DOM wiring lives in components/theme/ImmersiveTilt.tsx.
16
+ */
17
+ interface TiltRect {
18
+ left: number;
19
+ top: number;
20
+ width: number;
21
+ height: number;
22
+ }
23
+ interface Tilt {
24
+ /** rotateX degrees (vertical axis of the cursor). */
25
+ rx: number;
26
+ /** rotateY degrees (horizontal axis of the cursor). */
27
+ ry: number;
28
+ /** Pointer X within the tile, 0..1 (left→right). */
29
+ px: number;
30
+ /** Pointer Y within the tile, 0..1 (top→bottom). */
31
+ py: number;
32
+ }
33
+ /** Clamp `n` to the inclusive range [min, max]. */
34
+ declare function clamp(n: number, min: number, max: number): number;
35
+ /**
36
+ * Map a pointer position over a tile to a tilt. `maxDeg` is the rotation at the
37
+ * tile's edge (the centre is flat, 0°). A zero-area rect returns a flat tilt.
38
+ */
39
+ declare function tiltFromPointer(rect: TiltRect, clientX: number, clientY: number, maxDeg: number): Tilt;
40
+
41
+ export { type Tilt, type TiltRect, clamp, tiltFromPointer };
@@ -0,0 +1,18 @@
1
+ // src/theme/tilt.ts
2
+ function clamp(n, min, max) {
3
+ return n < min ? min : n > max ? max : n;
4
+ }
5
+ function tiltFromPointer(rect, clientX, clientY, maxDeg) {
6
+ if (rect.width <= 0 || rect.height <= 0) {
7
+ return { rx: 0, ry: 0, px: 0.5, py: 0.5 };
8
+ }
9
+ const px = clamp((clientX - rect.left) / rect.width, 0, 1);
10
+ const py = clamp((clientY - rect.top) / rect.height, 0, 1);
11
+ const ry = (px - 0.5) * 2 * maxDeg;
12
+ const rx = -(py - 0.5) * 2 * maxDeg;
13
+ return { rx, ry, px, py };
14
+ }
15
+
16
+ export { clamp, tiltFromPointer };
17
+ //# sourceMappingURL=tilt.js.map
18
+ //# sourceMappingURL=tilt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/theme/tilt.ts"],"names":[],"mappings":";AAoCO,SAAS,KAAA,CAAM,CAAA,EAAW,GAAA,EAAa,GAAA,EAAqB;AACjE,EAAA,OAAO,CAAA,GAAI,GAAA,GAAM,GAAA,GAAM,CAAA,GAAI,MAAM,GAAA,GAAM,CAAA;AACzC;AAMO,SAAS,eAAA,CACd,IAAA,EACA,OAAA,EACA,OAAA,EACA,MAAA,EACM;AACN,EAAA,IAAI,IAAA,CAAK,KAAA,IAAS,CAAA,IAAK,IAAA,CAAK,UAAU,CAAA,EAAG;AACvC,IAAA,OAAO,EAAE,IAAI,CAAA,EAAG,EAAA,EAAI,GAAG,EAAA,EAAI,GAAA,EAAK,IAAI,GAAA,EAAI;AAAA,EAC1C;AAGA,EAAA,MAAM,EAAA,GAAK,OAAO,OAAA,GAAU,IAAA,CAAK,QAAQ,IAAA,CAAK,KAAA,EAAO,GAAG,CAAC,CAAA;AACzD,EAAA,MAAM,EAAA,GAAK,OAAO,OAAA,GAAU,IAAA,CAAK,OAAO,IAAA,CAAK,MAAA,EAAQ,GAAG,CAAC,CAAA;AAEzD,EAAA,MAAM,EAAA,GAAA,CAAM,EAAA,GAAK,GAAA,IAAO,CAAA,GAAI,MAAA;AAC5B,EAAA,MAAM,EAAA,GAAK,EAAE,EAAA,GAAK,GAAA,CAAA,GAAO,CAAA,GAAI,MAAA;AAC7B,EAAA,OAAO,EAAE,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA,EAAG;AAC1B","file":"tilt.js","sourcesContent":["/**\n * Pointer-parallax tilt math for the 3D / Immersive style (Subtask 7.3.39).\n *\n * The standard \"3D card\" effect (vanilla-tilt.js / react-parallax-tilt /\n * Atropos): a tile tips toward the cursor. Given a tile's bounding rect and the\n * pointer position, this maps the cursor to a pair of rotations:\n *\n * - `ry` (rotateY) follows the HORIZONTAL position: pointer on the right edge\n * rotates the tile's right side AWAY (negative is toward the viewer on the\n * left), so the face turns to follow the cursor.\n * - `rx` (rotateX) follows the VERTICAL position: pointer near the top tips\n * the top toward the viewer.\n *\n * Output degrees are clamped to ±`maxDeg`. Pure + DOM-free so it is unit-tested\n * directly; the DOM wiring lives in components/theme/ImmersiveTilt.tsx.\n */\n\nexport interface TiltRect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nexport interface Tilt {\n /** rotateX degrees (vertical axis of the cursor). */\n rx: number;\n /** rotateY degrees (horizontal axis of the cursor). */\n ry: number;\n /** Pointer X within the tile, 0..1 (left→right). */\n px: number;\n /** Pointer Y within the tile, 0..1 (top→bottom). */\n py: number;\n}\n\n/** Clamp `n` to the inclusive range [min, max]. */\nexport function clamp(n: number, min: number, max: number): number {\n return n < min ? min : n > max ? max : n;\n}\n\n/**\n * Map a pointer position over a tile to a tilt. `maxDeg` is the rotation at the\n * tile's edge (the centre is flat, 0°). A zero-area rect returns a flat tilt.\n */\nexport function tiltFromPointer(\n rect: TiltRect,\n clientX: number,\n clientY: number,\n maxDeg: number,\n): Tilt {\n if (rect.width <= 0 || rect.height <= 0) {\n return { rx: 0, ry: 0, px: 0.5, py: 0.5 };\n }\n // 0..1 within the tile, clamped so a pointer just outside the rect (a hover\n // straddling the edge) can't over-rotate past the edge value.\n const px = clamp((clientX - rect.left) / rect.width, 0, 1);\n const py = clamp((clientY - rect.top) / rect.height, 0, 1);\n // Re-centre to -1..1, scale to ±maxDeg.\n const ry = (px - 0.5) * 2 * maxDeg;\n const rx = -(py - 0.5) * 2 * maxDeg;\n return { rx, ry, px, py };\n}\n"]}
@@ -0,0 +1,61 @@
1
+ import { StyleId } from './styles.js';
2
+ import { PaletteId } from './palettes.js';
3
+ import { TypeId } from './typography.js';
4
+
5
+ /**
6
+ * Theme types for Motir's THREE-axis design system.
7
+ *
8
+ * Axis 1 — COLOR (`data-theme` light/dark base · `data-palette` full
9
+ * `--el-*` palette swap — the colour axis)
10
+ * Axis 2 — STYLE (`data-style` — a named aesthetic controlling shape /
11
+ * silhouette / elevation / surface / density / motion /
12
+ * component silhouettes)
13
+ * Axis 3 — TYPE (`data-type` — a named pairing controlling the `--font-*`
14
+ * role mapping; a style declares a default pairing, overridable)
15
+ *
16
+ * The three axes are INDEPENDENT: a style never touches a hue or a face, a
17
+ * palette never touches a radius, a type pairing never touches colour or shape.
18
+ * The registries live in `./styles.ts`, `./palettes.ts`, `./typography.ts`.
19
+ *
20
+ * Architecture mirrors dooooWeb. See docs/DESIGN.md for the rationale.
21
+ */
22
+
23
+ /** Tier 1 — light/dark base. `system` follows OS preference at runtime. */
24
+ type ThemePattern = 'system' | 'light' | 'dark';
25
+ /** Resolved pattern (what data-theme is set to after `system` resolves). */
26
+ type ResolvedThemePattern = 'light' | 'dark';
27
+
28
+ /** Storage keys for persisting user preferences. */
29
+ declare const THEME_STORAGE_KEYS: {
30
+ readonly pattern: "motir.theme.pattern";
31
+ readonly style: "motir.theme.style";
32
+ readonly palette: "motir.theme.palette";
33
+ readonly type: "motir.theme.type";
34
+ };
35
+ /**
36
+ * Sensible defaults if localStorage is empty. Note `type` is the GLOBAL fallback
37
+ * only — when no explicit type is pinned, the active STYLE's `defaultTypeId`
38
+ * wins (see `STYLE_DEFAULT_TYPE` / the theme context); this is the floor under
39
+ * an unknown style.
40
+ */
41
+ declare const THEME_DEFAULTS: {
42
+ readonly pattern: ThemePattern;
43
+ readonly style: StyleId;
44
+ readonly palette: PaletteId;
45
+ readonly type: TypeId;
46
+ };
47
+ /**
48
+ * Narrowing guard — is an arbitrary value a valid `pattern` axis id? The
49
+ * colour / style / type axes each ship `isXId` in their registry file; the
50
+ * pattern axis is a fixed three-value union, so its guard lives here next to
51
+ * the type. Mirrors `isStyleId` / `isPaletteId` / `isTypeId`.
52
+ */
53
+ declare function isThemePattern(value: unknown): value is ThemePattern;
54
+ /**
55
+ * Resolve a (possibly stale / unknown / null) value to a valid `pattern`,
56
+ * falling back to `THEME_DEFAULTS.pattern`. The pattern-axis analogue of
57
+ * `resolveStyle` / `resolvePalette` / `resolveType`.
58
+ */
59
+ declare function resolvePattern(value: unknown): ThemePattern;
60
+
61
+ export { PaletteId, type ResolvedThemePattern, StyleId, THEME_DEFAULTS, THEME_STORAGE_KEYS, type ThemePattern, TypeId, isThemePattern, resolvePattern };