jfs-components 0.1.48 → 0.1.49

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.
@@ -4,7 +4,7 @@
4
4
  * Auto-generated from SVG files in src/icons/
5
5
  * DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
6
6
  *
7
- * Generated: 2026-07-22T21:03:43.084Z
7
+ * Generated: 2026-07-25T08:19:21.865Z
8
8
  */
9
9
 
10
10
  // Icon name to SVG data mapping
package/D2C.md DELETED
@@ -1,113 +0,0 @@
1
- # D2C — Design to Code with jfs-components
2
-
3
- Implement the supplied Figma design using the installed `jfs-components`
4
- package. Follow all four stages in order.
5
-
6
- ## Input
7
-
8
- Use the Figma URL supplied after `/D2C` or in the user's latest message. If no
9
- Figma URL was supplied, ask for one before doing anything else.
10
-
11
- ## 1. Read the design
12
-
13
- 1. Call the Figma MCP `get_design_context` for the linked node.
14
- 2. Call `get_screenshot` for the same node. Keep it as the visual reference for
15
- final QA.
16
- 3. Follow Code Connect mappings, design annotations, and provided assets. If
17
- Figma supplies an image or SVG URL, use it directly; do not create a
18
- placeholder or install an icon package.
19
-
20
- If the Figma MCP is unavailable or cannot read the node, report the blocker and
21
- stop. Do not recreate the design from the URL or from assumptions.
22
-
23
- ## 2. Extract and resolve explicit modes
24
-
25
- From the consuming project's root, run:
26
-
27
- ```bash
28
- npx jfs-extract-modes "<figma-url>" --out modes.json
29
- ```
30
-
31
- The CLI automatically loads `FIGMA_ACCESS_TOKEN` from the project-root `.env`.
32
- An already exported shell value takes precedence. The token only needs the
33
- Figma `file_content:read` scope. Never print, log, or ask the user to paste the
34
- token into chat.
35
-
36
- If the token is missing, stop and direct the user to `[Open .env](.env)` and
37
- add `FIGMA_ACCESS_TOKEN=` if needed. To create a token: in Figma's file browser,
38
- open the account menu → **Settings** → **Security** → **Personal access
39
- tokens** → **Generate new token**, choose an expiration, grant only
40
- `file_content:read`, generate it, and copy it immediately into `.env`. Figma
41
- shows the value only once. Use the
42
- [official PAT documentation](https://developers.figma.com/docs/rest-api/personal-access-tokens/)
43
- if the UI has changed. Never create or overwrite a token value yourself.
44
-
45
- If the bin is unavailable in a nonstandard monorepo, run:
46
-
47
- ```bash
48
- node node_modules/jfs-components/scripts/extract-figma-modes.js "<figma-url>" --out modes.json
49
- ```
50
-
51
- Resolve the effective modes for each represented component as follows:
52
-
53
- 1. Start with `inheritedFromAncestors`, when present.
54
- 2. Find every `modes` entry whose `path` is the component's path or an ancestor
55
- of it.
56
- 3. Merge those entries from root to leaf; deeper entries override inherited
57
- values.
58
- 4. Match by layer name and position, using `nodeId` to disambiguate duplicate
59
- names.
60
-
61
- If `unresolved` is present, report every item and its exact `reason`, then stop
62
- before implementation because mode fidelity cannot be guaranteed:
63
-
64
- - `local collection` means the design uses a file-local collection that the
65
- packaged library data cannot resolve.
66
- - `key not in variables JSON` or `mode not in collection` means the packaged
67
- design-token JSON is out of date.
68
-
69
- Do not guess or silently omit an unresolved mode.
70
-
71
- ## 3. Implement
72
-
73
- Before editing, inspect the installed package's exports/types and the consuming
74
- app's existing screens. Reuse its file placement, navigation, styling, and
75
- asset conventions. Never invent a `jfs-components` component or prop.
76
-
77
- - Prefer mapped `jfs-components` over rebuilding them from primitives.
78
- - Apply extracted collection/mode pairs exactly through each component's
79
- `modes` prop.
80
- - Put a mode on the closest code component that represents the reported Figma
81
- layer or subtree. Preserve parent inheritance and child overrides; never
82
- flatten a child override into its parent.
83
- - Do not substitute similar-looking modes, remove apparently redundant modes,
84
- or move modes between layers.
85
- - Match Figma content, order, visibility, variants, spacing, and assets.
86
-
87
- Run the consuming app's existing typecheck, tests, or build command relevant to
88
- the changed screen and fix implementation errors.
89
-
90
- ## 4. Render and visually verify
91
-
92
- Render the implemented screen on the target platform and capture it with the
93
- available mobile or browser tooling. Compare it with the Figma screenshot for:
94
-
95
- 1. component size, variant, and emphasis;
96
- 2. color and appearance;
97
- 3. spacing, padding, alignment, and gaps;
98
- 4. text, wrapping, and truncation; and
99
- 5. icons, imagery, and layer visibility.
100
-
101
- Fix every implementation-caused difference and capture the screen again.
102
- Platform or environment differences that cannot be fixed in code, such as a
103
- missing system font or renderer-specific antialiasing, must be identified
104
- explicitly rather than hidden.
105
-
106
- If no suitable render or screenshot tooling is available, do not claim visual
107
- completion. Report what remains to be checked and give the exact manual run and
108
- comparison steps.
109
-
110
- ## Completion report
111
-
112
- Report the files changed, the effective modes applied to each component, the
113
- validation commands and results, and the final visual comparison status.