ui-foundations 0.1.2 → 0.3.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 (43) hide show
  1. package/README.md +64 -30
  2. package/dist/core/index.css +7 -7
  3. package/dist/main.css +462 -289
  4. package/dist/react/index.js +1 -0
  5. package/dist/react/switch.js +45 -0
  6. package/dist/tokens/css/{color.dark.tokens.css → appearance-(modes).tokens.mode-dark.css} +2 -2
  7. package/dist/tokens/css/{color.light.tokens.css → appearance-(modes).tokens.mode-light.css} +3 -3
  8. package/dist/tokens/css/{component.tokens.css → components-(ui).tokens.css} +70 -54
  9. package/dist/tokens/css/{primitives.tokens.css → core-(primitives).tokens.css} +21 -21
  10. package/dist/tokens/css/{semantic.tokens.css → semantics-(roles).tokens.css} +7 -6
  11. package/dist/tokens/css/{brand-a.tokens.css → themes-(brands).tokens.brand-a.css} +11 -11
  12. package/dist/tokens/css/{brand-b.tokens.css → themes-(brands).tokens.brand-b.css} +10 -10
  13. package/dist/tokens/json/appearance-(modes).tokens.mode-dark.json +182 -0
  14. package/dist/tokens/json/appearance-(modes).tokens.mode-light.json +182 -0
  15. package/dist/tokens/json/components-(ui).tokens.json +739 -0
  16. package/dist/tokens/json/{primitives.tokens.json → core-(primitives).tokens.json} +766 -772
  17. package/dist/tokens/json/semantics-(roles).tokens.json +203 -0
  18. package/dist/tokens/json/themes-(brands).tokens.brand-a.json +115 -0
  19. package/dist/tokens/json/themes-(brands).tokens.brand-b.json +115 -0
  20. package/dist/tokens/tokens.yaml +1068 -847
  21. package/dist/tokens/ts/{color.dark.tokens.ts → appearance-(modes).tokens.mode-dark.ts} +3 -3
  22. package/dist/tokens/ts/{color.light.tokens.ts → appearance-(modes).tokens.mode-light.ts} +4 -4
  23. package/dist/tokens/ts/{component.tokens.ts → components-(ui).tokens.ts} +71 -55
  24. package/dist/tokens/ts/{primitives.tokens.ts → core-(primitives).tokens.ts} +22 -22
  25. package/dist/tokens/ts/{semantic.tokens.ts → semantics-(roles).tokens.ts} +7 -6
  26. package/dist/tokens/ts/{brand-a.tokens.ts → themes-(brands).tokens.brand-a.ts} +13 -13
  27. package/dist/tokens/ts/{brand-b.tokens.ts → themes-(brands).tokens.brand-b.ts} +12 -12
  28. package/dist/ui/index.css +1 -0
  29. package/dist/ui/patterns/button.css +1 -0
  30. package/dist/ui/patterns/switch.css +155 -0
  31. package/docs/agentic/skills/README.md +51 -0
  32. package/docs/agentic/skills/design-ops-specialist/SKILL.md +28 -14
  33. package/docs/agentic/skills/design-system-architect/SKILL.md +106 -0
  34. package/docs/agentic/team-ai-playbook.md +10 -0
  35. package/docs/foundations/foundation-011-branching-and-release-governance.md +42 -0
  36. package/docs/foundations/foundation-012-minimal-markup-and-composition.md +42 -0
  37. package/package.json +20 -11
  38. package/dist/tokens/json/brand-a.tokens.json +0 -192
  39. package/dist/tokens/json/brand-b.tokens.json +0 -192
  40. package/dist/tokens/json/color.dark.tokens.json +0 -364
  41. package/dist/tokens/json/color.light.tokens.json +0 -364
  42. package/dist/tokens/json/component.tokens.json +0 -1101
  43. package/dist/tokens/json/semantic.tokens.json +0 -206
package/README.md CHANGED
@@ -1,13 +1,26 @@
1
1
  # UI Foundations
2
2
 
3
- Token-first UI foundations aligned with Figma variables.
3
+ A token-first design system that uses Figma as the single source of truth and automatically generates CSS, JSON, and TypeScript tokens.
4
4
 
5
- This package provides:
5
+ ## Pipeline
6
6
 
7
- - foundation and semantic design tokens
8
- - UI pattern CSS
9
- - optional React wrappers
10
- - docs/playground via Eleventy
7
+ ```
8
+ Figma Variables → Plugin Export → figma/exports/*.tokens.json → extract-tokens.js dist/ (CSS, JSON, TS, YAML)
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - 5 variable collections: Core Primitives, Themes (Brands), Appearance (Modes), Semantics (Roles), Components (UI)
14
+ - Multi-brand support (Brand A/B) via `data-brand` selectors
15
+ - Dark/light mode via `data-mode` selectors
16
+ - Content-based scope detection (independent of filenames)
17
+ - Figma plugin with Validate + Export tabs (see `figma/plugin/README.md`)
18
+ - CI pipeline: lint, unit tests, build, smoke check, docs build
19
+ - Docs site with Eleventy, auto-generated from token data
20
+
21
+ ## Tech Stack
22
+
23
+ Vanilla CSS (Custom Properties, Layers), Node.js scripts, Eleventy, Figma Plugin API, MCP.
11
24
 
12
25
  ## Install
13
26
 
@@ -15,26 +28,14 @@ This package provides:
15
28
  npm install ui-foundations
16
29
  ```
17
30
 
18
- ## Package Usage
31
+ ## Usage
19
32
 
20
33
  ```js
21
34
  import "ui-foundations/core.css";
22
35
  import "ui-foundations/ui.css";
23
36
  ```
24
37
 
25
- Optional token imports:
26
-
27
- ```js
28
- import "ui-foundations/tokens/primitives.css";
29
- import "ui-foundations/tokens/brand-a.css";
30
- import "ui-foundations/tokens/brand-b.css";
31
- import "ui-foundations/tokens/color-light.css";
32
- import "ui-foundations/tokens/color-dark.css";
33
- import "ui-foundations/tokens/semantic.css";
34
- import "ui-foundations/tokens/components.css";
35
- ```
36
-
37
- Runtime scope example:
38
+ Runtime scope switching:
38
39
 
39
40
  ```js
40
41
  const root = document.documentElement;
@@ -42,25 +43,58 @@ root.dataset.brand = "a"; // "a" | "b"
42
43
  root.dataset.mode = "light"; // "light" | "dark"
43
44
  ```
44
45
 
45
- ## Documentation
46
+ ## Local Development
46
47
 
47
- - Foundations (source of truth): `docs/foundations/`
48
- - Workflow + pipeline details: `docs/foundations/foundation-010-implementation-and-pipeline-workflow.md`
49
- - AI playbook: `docs/agentic/team-ai-playbook.md`
50
- - Shareable skill: `docs/agentic/skills/design-ops-specialist/SKILL.md`
51
- - Docs site content: `site/`
52
- - Vanilla starter guide: `site/examples/vanilla-starter.md`
48
+ ```bash
49
+ npm run build:all # generate tokens + build CSS
50
+ npm run docs:dev # build + serve docs site
51
+ ```
53
52
 
54
- ## Local Development
53
+ Figma sync workflow:
55
54
 
56
55
  ```bash
57
- npm run docs:dev
56
+ # 1. Export tokens via Figma plugin (📦 Export tab)
57
+ # 2. Place JSON files in figma/exports/
58
+ # 3. Build
59
+ npm run build:all
58
60
  ```
59
61
 
60
- Validation baseline:
62
+ Validation:
61
63
 
62
64
  ```bash
63
65
  npm run lint
64
66
  npm run test:unit
65
67
  npm run ci:check
66
68
  ```
69
+
70
+ ## MCP Integration
71
+
72
+ This repo supports Figma integration via MCP (Model Context Protocol). Two servers are used:
73
+
74
+ - `figma-developer-mcp` — REST API read access (requires `FIGMA_TOKEN` in `.env`)
75
+ - Figma Desktop MCP — local server via Figma Desktop app (enable in Dev Mode inspect panel)
76
+
77
+ Configure these in your agent's MCP config. Example for the REST API server:
78
+
79
+ ```json
80
+ {
81
+ "command": "npx",
82
+ "args": ["-y", "figma-developer-mcp", "--figma-api-key=YOUR_TOKEN", "--stdio"]
83
+ }
84
+ ```
85
+
86
+ ## Documentation
87
+
88
+ - Foundations: `docs/foundations/`
89
+ - AI playbook: `docs/agentic/team-ai-playbook.md`
90
+ - Figma plugin (Token Foundry): `figma/plugin/README.md`
91
+ - Docs site: `site/`
92
+ - Vanilla starter: `site/examples/vanilla-starter.md`
93
+
94
+ ## Release
95
+
96
+ ```bash
97
+ npm run release:patch # or release:minor / release:major
98
+ npm run release:push
99
+ npm run release:publish
100
+ ```
@@ -2,11 +2,11 @@
2
2
  @import url("./base/fonts.css") layer(base);
3
3
  @import url("./base/base.css") layer(base);
4
4
  @import url("./base/typography.css") layer(base);
5
- @import url("../tokens/css/primitives.tokens.css") layer(tokens);
6
- @import url("../tokens/css/brand-a.tokens.css") layer(tokens);
7
- @import url("../tokens/css/brand-b.tokens.css") layer(tokens);
8
- @import url("../tokens/css/semantic.tokens.css") layer(tokens);
9
- @import url("../tokens/css/component.tokens.css") layer(tokens);
10
- @import url("../tokens/css/color.light.tokens.css") layer(tokens);
11
- @import url("../tokens/css/color.dark.tokens.css") layer(tokens);
5
+ @import url("../tokens/css/semantics-(roles).tokens.css") layer(tokens);
6
+ @import url("../tokens/css/components-(ui).tokens.css") layer(tokens);
7
+ @import url("../tokens/css/appearance-(modes).tokens.mode-dark.css") layer(tokens);
8
+ @import url("../tokens/css/appearance-(modes).tokens.mode-light.css") layer(tokens);
9
+ @import url("../tokens/css/core-(primitives).tokens.css") layer(tokens);
10
+ @import url("../tokens/css/themes-(brands).tokens.brand-a.css") layer(tokens);
11
+ @import url("../tokens/css/themes-(brands).tokens.brand-b.css") layer(tokens);
12
12
  @import url("./themes/mode.css") layer(themes);