@flamingo-stack/openframe-frontend-core 0.0.332 → 0.0.333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.332",
3
+ "version": "0.0.333",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,96 @@
1
+ # ODS Token Rules (canonical)
2
+
3
+ > **Single source of truth.** This file lives in `@flamingo-stack/openframe-frontend-core` and is
4
+ > consumed by every app via `@import` from the installed package. Edit it **only here** in the core
5
+ > lib; consumers pick up changes when they bump the package version. Do not copy it into other repos.
6
+
7
+ ## Principle
8
+
9
+ Never hardcode colors, font families, font sizes, or spacing. Always use ODS tokens — Tailwind
10
+ `ods-*` utilities or ODS CSS variables. This applies to **new and modified** components: convert
11
+ hardcoded values you touch, even when copying an existing pattern. Figma MCP output is a structural
12
+ hint only — translate it to ODS tokens before committing.
13
+
14
+ ## Colors
15
+
16
+ Source of truth: `src/styles/` + `tailwind.config.ts`. Use the Tailwind `ods-*` classes (the top
17
+ semantic layer). Never reach into the raw palette vars such as `var(--ods-attention-red-error)` —
18
+ the semantic layer (`--color-*`) exists so theming and renames don't break.
19
+
20
+ - **Backgrounds:** `bg-ods-bg` (page), `bg-ods-card`, `bg-ods-overlay`, `bg-ods-skeleton`
21
+ - **Text:** `text-ods-text-primary`, `-secondary`, `-tertiary`, `-muted`, `-on-accent`
22
+ - **Borders:** `border-ods-border` (+ `-hover`, `-active`, `-focus`)
23
+ - **Accent:** `bg-ods-accent`, `text-ods-accent` (+ `-hover`, `-active`)
24
+ - **Status:** `text-ods-error` / `bg-ods-error`, plus `-success`, `-warning`, `-info` — **NOT** `var(--ods-attention-*)`
25
+ - **Brand:** `bg-ods-flamingo-pink`, `bg-ods-flamingo-cyan`, `text-ods-open-yellow`
26
+ - **Adaptive:** `text-ods-current` / `bg-ods-current` (platform-aware brand color)
27
+
28
+ **Forbidden:** hex (`#fff`), `rgb()`, Tailwind color scales (`bg-gray-800`, `text-white`), and raw
29
+ `var(--ods-attention-*)` palette vars.
30
+
31
+ ## Spacing
32
+
33
+ ODS spacing is **not** mapped into Tailwind's spacing scale. Use arbitrary utilities that reference
34
+ the spacing CSS variables — the same way the Figma mockups do (`gap: var(--spacing-system-xl)`):
35
+
36
+ ```
37
+ gap-[var(--spacing-system-xl)] p-[var(--spacing-system-lf)] px-[var(--spacing-system-s)]
38
+ ```
39
+
40
+ The same applies to `py/pt/pb/pl/pr`, `mx/my/mt/mb/ml/mr`, `space-x`, `space-y`, `inset`,
41
+ `top/right/bottom/left`.
42
+
43
+ | Token | Mobile | Desktop |
44
+ |-------|--------|---------|
45
+ | `--spacing-system-zero` | 0 | 0 |
46
+ | `--spacing-system-xxs` | 4px | 4px |
47
+ | `--spacing-system-xs` | 4px | 8px |
48
+ | `--spacing-system-xsf` | 8px | 8px |
49
+ | `--spacing-system-s` | 8px | 12px |
50
+ | `--spacing-system-sf` | 12px | 12px |
51
+ | `--spacing-system-m` | 12px | 16px |
52
+ | `--spacing-system-mf` | 16px | 16px |
53
+ | `--spacing-system-l` | 16px | 24px |
54
+ | `--spacing-system-lf` | 24px | 24px |
55
+ | `--spacing-system-xl` | 24px | 40px |
56
+ | `--spacing-system-xlf` | 40px | 40px |
57
+ | `--spacing-system-xxl` | 40px | 40px |
58
+
59
+ Mapping from raw Tailwind: `gap-1` → `xxs` (4px), `gap-2` → `xsf` (8px), `gap-3` → `sf` (12px),
60
+ `gap-4` → `mf` (16px), `gap-6` → `lf` (24px), `gap-10` → `xlf` (40px). Use the `f` ("fixed") variant
61
+ to keep a value constant across breakpoints; the non-`f` variant grows on desktop. `gap-0` / `p-0`
62
+ are fine — `0` is unambiguous. Fixed component dimensions (`h-20`, `w-56`) are sizing, not spacing —
63
+ leave them as Tailwind sizing classes.
64
+
65
+ ## Typography
66
+
67
+ Use the ODS composite typography utilities (`text-h1` … `text-h6`). Never write raw `text-[16px]`,
68
+ `text-4xl`, or font-family overrides like `font-['DM_Sans']`.
69
+
70
+ | Class | Font | Weight | Size (tablet+) | Line-height | Text-transform |
71
+ |-------|------|--------|-----------------|-------------|----------------|
72
+ | `text-h3` | DM Sans | **700 (bold)** | 18px | 24px | none |
73
+ | `text-h4` | DM Sans | 500 (medium) | 18px | 24px | none |
74
+ | `text-h5` | Azeret Mono | 500 (medium) | 14px | 20px | **uppercase** |
75
+ | `text-h6` | DM Sans | 500 (medium) | 14px | 20px | none |
76
+
77
+ `text-h1` / `text-h2` cover larger headings. Key distinctions:
78
+
79
+ - `text-h3` vs `text-h4`: same size (18px) but h3 is **bold**, h4 is **medium** — h4 for stat values, h3 for bold headings.
80
+ - `text-h5` vs `text-h6`: same size (14px) but h5 is **Azeret Mono uppercase** (section labels like "POLICY TESTING"), h6 is **DM Sans sentence case** (regular labels like "Started", "Duration").
81
+
82
+ ## General
83
+
84
+ - Convert hardcoded values to ODS tokens even when copying patterns from existing code.
85
+ - Match Figma by choosing the typography class on **font family + weight + text-transform**, not just size.
86
+ - If Figma uses a token that doesn't exist in ODS, flag it — don't silently hardcode a fallback.
87
+ - **Z-index** — use the established hierarchy, don't invent numbers: header `z-[50]`, sidebar overlay
88
+ `z-[40]` / sidebar `z-[45]`, modals `z-[1300]`, toasts `z-[9999]`, tooltips `z-[2147483647]`.
89
+
90
+ ## Figma → code workflow
91
+
92
+ 1. Call `get_design_context` for the node.
93
+ 2. Treat the returned code as a *structural hint only*.
94
+ 3. Map every color, font-size, font-weight, and spacing value to an ODS token.
95
+ 4. Check the target project for existing components that already match the design — reuse over regenerate.
96
+ 5. If Figma uses a token absent from ODS, flag it — don't hardcode a fallback.