inkbridge 0.1.0-beta.17 → 0.1.0-beta.19

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 (67) hide show
  1. package/README.md +15 -11
  2. package/bin/inkbridge.mjs +0 -0
  3. package/code.js +24 -24
  4. package/package.json +46 -23
  5. package/scanner/block-cache-regression.ts +195 -0
  6. package/scanner/child-sizing-matrix-regression.ts +303 -0
  7. package/scanner/component-scanner.ts +230 -3
  8. package/scanner/component-sections-regression.ts +198 -0
  9. package/scanner/compound-classes-lookup-regression.ts +163 -0
  10. package/scanner/cva-jsx-child-fallback-regression.ts +98 -0
  11. package/scanner/cva-master-icon-regression.ts +315 -0
  12. package/scanner/data-attr-prop-alias-regression.ts +129 -0
  13. package/scanner/explicit-size-root-regression.ts +102 -0
  14. package/scanner/framework-adapter-shadcn-regression.ts +385 -0
  15. package/scanner/full-width-matrix-regression.ts +338 -0
  16. package/scanner/image-src-collector-regression.ts +204 -0
  17. package/scanner/instance-rendering-regression.ts +224 -0
  18. package/scanner/layout-sizing-regression.ts +71 -0
  19. package/scanner/provider-cascade-regression.ts +224 -0
  20. package/scanner/provider-flatten-regression.ts +235 -0
  21. package/scanner/render-prop-parser-regression.ts +161 -0
  22. package/scanner/sandbox-spread-regression.ts +125 -0
  23. package/scanner/selection-pressed-regression.ts +241 -0
  24. package/scanner/size-full-normalization-regression.ts +127 -0
  25. package/scanner/story-diagnostics-regression.ts +216 -0
  26. package/scanner/story-dimensioning-regression.ts +298 -0
  27. package/scanner/story-render-strategy-regression.ts +205 -0
  28. package/scanner/stretch-to-parent-width-regression.ts +113 -0
  29. package/scanner/text-resize-matrix-regression.ts +173 -0
  30. package/src/components/component-instance.ts +148 -0
  31. package/src/components/component-lookup.ts +4 -0
  32. package/src/design-system/block-cache.ts +130 -0
  33. package/src/design-system/component-sections.ts +107 -0
  34. package/src/design-system/cva-master.ts +16 -0
  35. package/src/design-system/instance-rendering.ts +307 -0
  36. package/src/design-system/node-helpers.ts +1 -1
  37. package/src/design-system/node-variants.ts +42 -3
  38. package/src/design-system/preview-builder.ts +35 -0
  39. package/src/design-system/render-prop-parser.ts +50 -0
  40. package/src/design-system/story-builder.ts +27 -854
  41. package/src/design-system/story-diagnostics.ts +80 -0
  42. package/src/design-system/story-dimensioning.ts +272 -0
  43. package/src/design-system/story-frames.ts +22 -0
  44. package/src/design-system/story-render-strategy.ts +150 -0
  45. package/src/design-system/symbol-source.ts +26 -1
  46. package/src/design-system/ui-builder.ts +171 -51
  47. package/src/effects/portal-panel.ts +7 -3
  48. package/src/framework-adapters/index.ts +34 -0
  49. package/src/framework-adapters/shadcn.ts +525 -0
  50. package/src/layout/deferred-layout.ts +7 -0
  51. package/src/layout/index.ts +1 -0
  52. package/src/layout/layout-parser.ts +26 -0
  53. package/src/layout/parser/ir.ts +2 -0
  54. package/src/layout/parser/sizing.ts +57 -0
  55. package/src/layout/parser/spacing.ts +10 -6
  56. package/src/layout/text-resize-decision.ts +51 -0
  57. package/src/layout/width-solver.ts +10 -2
  58. package/src/main.ts +1 -34
  59. package/src/plugin/dev-server.ts +1 -1
  60. package/src/plugin/image-src-collector.ts +52 -0
  61. package/src/render-engine-version.ts +1 -1
  62. package/src/tailwind/class-utils.ts +15 -0
  63. package/src/tailwind/jsx-utils.ts +1 -1
  64. package/src/tailwind/node-ir.ts +23 -5
  65. package/src/tailwind/tailwind.ts +172 -6
  66. package/src/tokens/colors.ts +6 -2
  67. package/src/tokens/tokens.ts +1 -1
package/README.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  Generates native Figma frames and reusable Figma component instances from your Tailwind React components, and syncs design tokens back to your codebase via GitHub PRs.
6
6
 
7
+ <img src="https://inkbridge.ink/docs/mediacards-figma.png" alt="An Inkbridge-generated Figma page showing component variants rendered as native Figma frames" />
8
+
9
+ > Read the methodology behind this — stories as the single source of truth between design and code: [inkbridge.ink/methodology](https://inkbridge.ink/methodology). Browse the full docs at [inkbridge.ink/docs](https://inkbridge.ink/docs).
10
+
7
11
  ## What it does
8
12
 
9
13
  | Feature | Description |
@@ -85,9 +89,9 @@ pnpm inkbridge:scan
85
89
 
86
90
  Writes `.inkbridge/component-definitions.json`. Useful for debugging scanner output.
87
91
 
88
- ### Push to Code (Pro)
92
+ ### Push to Code
89
93
 
90
- Requires a Pro license and GitHub configuration.
94
+ Sync token edits from Figma back to your codebase as a GitHub PR.
91
95
 
92
96
  1. **Plugins → Development → Inkbridge → Settings**
93
97
  2. Fill in:
@@ -101,7 +105,6 @@ Requires a Pro license and GitHub configuration.
101
105
  - **Allow New Tokens from Figma** — optional; permits creating new token keys on push (off by default)
102
106
  - **New Token Prefixes** — optional comma-separated allowlist (for example `chart-, brand-`)
103
107
  - **GitHub token** — a [fine-grained PAT](https://github.com/settings/tokens?type=beta) with `Contents` and `Pull requests` read & write
104
- - **License key** — from your Inkbridge account
105
108
  3. **Save Settings**
106
109
  4. **Plugins → Development → Inkbridge → Push to Code**
107
110
  5. Enter a commit message and click **Push Tokens to Code** (it auto-detects token changes and opens the PR step)
@@ -177,13 +180,13 @@ ignores:
177
180
  "react/forbid-dom-props": ["error", {
178
181
  "forbid": [{
179
182
  "propName": "style",
180
- "message": "Inkbridge ignores inline styles — use Tailwind classes (or arbitrary values like text-[#0a0]) so Figma rendering matches the browser."
183
+ "message": "Use Tailwind classes Inkbridge ignores inline styles."
181
184
  }]
182
185
  }],
183
186
  "react/forbid-component-props": ["error", {
184
187
  "forbid": [{
185
188
  "propName": "style",
186
- "message": "Inkbridge ignores inline styles — use Tailwind classes (or arbitrary values like text-[#0a0]) so Figma rendering matches the browser."
189
+ "message": "Use Tailwind classes Inkbridge ignores inline styles."
187
190
  }]
188
191
  }]
189
192
  }
@@ -258,15 +261,16 @@ Component data is always scanned live — you only need to update when a new `in
258
261
 
259
262
  ```
260
263
  Figma plugin (sandboxed)
261
- └── code.js Main logic — cannot make network requests directly
262
- └── ui.html Hidden iframe — relays all network requests to code.js
264
+ └── code.js Main logic — no direct network access
265
+ └── ui.html Hidden iframe — relays I/O for code.js
263
266
 
264
- code.js ui.html localhost:4000/api/inkbridge/scan-components
265
- localhost:4000/api/inkbridge/patch-tokens
266
- https://api.github.com
267
+ code.js ui.html localhost:4000/api/inkbridge/scan-components
268
+ localhost:4000/api/inkbridge/patch-tokens
269
+ https://api.github.com
267
270
  ```
268
271
 
269
- All network I/O is relayed through the UI iframe via `postMessage` due to the Figma sandbox restriction.
272
+ All network I/O is relayed through the UI iframe via `postMessage`
273
+ because the Figma plugin sandbox can't make requests directly.
270
274
 
271
275
  ---
272
276
 
package/bin/inkbridge.mjs CHANGED
File without changes