@imfusion/web-ui 0.6.1-dev.12.ge86ac0a1 → 0.6.1-dev.14.g8fac1dfb
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/README.md +102 -170
- package/dist/{code-Blo48PGr.js → code-C_56u-Vk.js} +2 -2
- package/dist/{icons-wBmF0U2x.js → icons-Cy1HAosO.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.js +31 -31
- package/dist/integrations/code-highlight.js +2 -2
- package/dist/integrations/image-display-options.js +1 -1
- package/package.json +1 -1
- package/src/llms/install-templates/AGENTS.md +15 -18
- package/src/llms/llms.gen.txt +33 -33
- package/src/llms/skills/imf-web-ui/SKILL.md +29 -39
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +50 -102
- package/src/llms/skills/imf-web-ui-components/SKILL.md +47 -104
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +39 -52
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +40 -62
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +11 -12
- package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +31 -46
- package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +18 -23
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +20 -69
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +50 -146
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +17 -23
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +15 -20
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +28 -19
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +20 -16
- package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +28 -42
- package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +28 -30
- package/src/llms/skills/imf-web-ui-conventions/topics/react.md +28 -74
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +65 -62
- package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +12 -14
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +9 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +40 -68
- package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +26 -50
- package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +19 -25
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +43 -64
- package/src/llms/skills/imf-web-ui-update/SKILL.md +48 -114
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +64 -92
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +16 -36
- package/src/llms/skills/imf-web-ui-ux/references/usability-heuristics.md +14 -27
- package/src/llms/skills/imf-web-ui-ux/references/visual-design.md +22 -38
|
@@ -1,56 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui
|
|
3
3
|
description:
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
"Route UI work in a project that uses @imfusion/web-ui. Use this skill whenever a user adds, edits, styles, or reviews UI
|
|
5
|
+
in a consumer project, even if they do not mention the library. Decide whether guidance is needed, then open only the
|
|
6
|
+
companion skills that match the task."
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Route Web UI work
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
companion to open, or that you need none at all. Don't load a companion speculatively: route first, zoom second.
|
|
11
|
+
Start here for UI work in a project that uses `@imfusion/web-ui`. This skill is a map, not a second copy of every convention.
|
|
13
12
|
|
|
14
|
-
##
|
|
13
|
+
## 1. Decide whether guidance is needed
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Skip a companion when the task is explicit and small, an existing local pattern already solves it, and the library usage is
|
|
16
|
+
already correct. Do the work. Look up an API silently only when you are unsure.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- The components involved are already imported and used correctly.
|
|
18
|
+
Use a companion when the task involves a choice, a missing setup piece, a new file, or a library convention the project may
|
|
19
|
+
not already have.
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
Guidance skills exist to fill gaps, not to add ceremony to clear tasks.
|
|
21
|
+
## 2. Route the task
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
| Task | Open |
|
|
24
|
+
| ----------------------------------------------------------------- | ------------------------ |
|
|
25
|
+
| Look up a component, part, prop, default, or icon | `imf-web-ui-components` |
|
|
26
|
+
| Choose components or shape a screen or flow | `imf-web-ui-ux` |
|
|
27
|
+
| Write a wrapper, custom UI, CSS, data layer, validation, or tests | `imf-web-ui-conventions` |
|
|
28
|
+
| Install the library or bootstrap project tooling | `imf-web-ui-setup` |
|
|
29
|
+
| Inspect an existing project without changing it | `imf-web-ui-audit` |
|
|
30
|
+
| Update the package, skills, or hooks | `imf-web-ui-update` |
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| Using a specific component; checking props, sub-components, or defaults | `imf-web-ui-components` |
|
|
30
|
-
| First-time setup, adding a library dependency, or components rendering unstyled/broken | `imf-web-ui-setup` (`library-setup`) |
|
|
31
|
-
| Building/reshaping a screen or flow; choosing between components; layout, density, hierarchy, states | `imf-web-ui-ux` |
|
|
32
|
-
| Writing wrappers or custom UI; styling beyond defaults; adding files; TypeScript, naming, testing | `imf-web-ui-conventions` |
|
|
33
|
-
| Setting up or auditing an **ImFusion** repo's tooling: formatting, linting, hooks, scripts, structure | `imf-web-ui-setup` / `imf-web-ui-audit` |
|
|
34
|
-
| Installing or checking agent tooling: vendored skills, lifecycle hooks, registrations, and staleness | `imf-web-ui-setup` / `imf-web-ui-audit` |
|
|
32
|
+
A screen often needs both `imf-web-ui-ux` and `imf-web-ui-components`, in that order. Setup and audit are for project-wide
|
|
33
|
+
questions, not every one-file edit.
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
Being asked to add one config file is just that edit; make it, and don't open a skill to do so.
|
|
35
|
+
## 3. Keep project choices
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
The host project's existing conventions win. The companion skills fill gaps; they do not justify refactoring a working
|
|
38
|
+
styling system, state library, or folder structure.
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
When a task needs TanStack Router, Query, Form, Table, or Store and the project has no incumbent, propose the matching
|
|
41
|
+
library and read its current documentation with `npx @tanstack/cli` before using it.
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
project has no incumbent, propose it, and read the library's own docs (`npx @tanstack/cli`) rather than working from memory.
|
|
43
|
+
## 4. Ask only when the choice depends on missing context
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`imf-web-ui-ux` contains a short per-feature interview. Run it **only** when both hold:
|
|
50
|
-
|
|
51
|
-
1. The request is foggy — you couldn't say what the primary action of the screen is, who uses it, or what data it shows.
|
|
52
|
-
2. A human is available to answer.
|
|
53
|
-
|
|
54
|
-
Never interview when a spec, mockup, or clear instruction exists — asking questions the conversation already answered is
|
|
55
|
-
worse than not asking at all. When in doubt and no human is around, make the conservative choice, and say which assumptions
|
|
56
|
-
you made.
|
|
45
|
+
For a vague screen or flow, use the short interview in `imf-web-ui-ux`. Do not ask questions the prompt, a spec, or the
|
|
46
|
+
repository already answers.
|
|
@@ -1,119 +1,67 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui-audit
|
|
3
3
|
description:
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pieces, missing pieces, working deviations, present evidence, and unverified state, then turns them into an actionable
|
|
8
|
-
plan."
|
|
4
|
+
"Audit an existing ImFusion frontend against the @imfusion/web-ui conventions without changing files. Use this for a
|
|
5
|
+
project health check, a pre-setup review, or one named topic. Report broken and missing pieces, working deviations,
|
|
6
|
+
evidence, and an ordered plan."
|
|
9
7
|
argument-hint: "[full|<topic>]"
|
|
10
8
|
allowed-tools: Read Glob Grep
|
|
11
9
|
---
|
|
12
10
|
|
|
13
|
-
#
|
|
11
|
+
# Audit a consumer project
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
An audit belongs in plan mode: it ends in work to approve, not in files to write.
|
|
13
|
+
This is a read-only audit. Compare the project with the selected `imf-web-ui-conventions` topics, report evidence, and end
|
|
14
|
+
with work the human can approve. The baseline is an ImFusion default, not a universal law; a deliberate project choice is a
|
|
15
|
+
deviation, not a defect.
|
|
20
16
|
|
|
21
17
|
## Workflow
|
|
22
18
|
|
|
23
|
-
1. Resolve the argument. Bare means `full`;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
host
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
covered. Reconcile conflicts by reading the cited evidence, and drop any finding whose citation does not hold.
|
|
32
|
-
5. Deliver the merged report and the plan in the host plan, from the shared report contract at
|
|
33
|
-
[`../imf-web-ui-conventions/templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md), with the mode label
|
|
34
|
-
`audit`. The plan's ordered steps are the `Next action` lines of the findings, grouped by topic and cheapest-first;
|
|
35
|
-
`Present` findings produce no steps.
|
|
36
|
-
|
|
37
|
-
Some runs take the report somewhere other than a plan. When the human asks for the durable file, or the host has no plan
|
|
38
|
-
mode, write the same content to `AUDIT_REPORT.md` and preserve everything under `## Reviewer notes` verbatim. When another
|
|
39
|
-
skill invokes the audit as its verification step, report the findings to that caller and stay out of plan mode — the caller
|
|
40
|
-
owns the flow, and the human has usually just left plan mode to let its work happen.
|
|
41
|
-
|
|
42
|
-
## Dispatching an investigator
|
|
43
|
-
|
|
44
|
-
Each investigator prompt carries, in full:
|
|
45
|
-
|
|
46
|
-
- the topic name and the path of its convention topic file;
|
|
47
|
-
- the topic's block from the shared [convention audit checklist](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md), and
|
|
48
|
-
the instruction to check every box in it;
|
|
49
|
-
- the safety constraint below, verbatim — an investigator that reaches for a shell breaks the audit's only guarantee;
|
|
50
|
-
- the report contract's entry format, so findings arrive mergeable: severity, reference, short title, `path:line` evidence,
|
|
51
|
-
impact, next action;
|
|
52
|
-
- the instruction to report findings back as its result and write no files.
|
|
53
|
-
|
|
54
|
-
An investigator reports on its topic alone. Anything it notices outside that topic goes back as a note for the orchestrator
|
|
55
|
-
to route, not as a finding it rules on.
|
|
56
|
-
|
|
57
|
-
## Checklist
|
|
58
|
-
|
|
59
|
-
The shared [convention audit checklist](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md) is the working checklist: a
|
|
60
|
-
full audit covers every block, a scoped audit covers the requested block plus its dependencies. The audit is not complete
|
|
61
|
-
until every in-scope box has been checked by the investigator that owns it and its evidence appears in the report. The
|
|
62
|
-
checklist itself is not edited during an audit.
|
|
19
|
+
1. Resolve the argument. Bare means `full`; an unknown topic is an error, not a reason to widen the scope.
|
|
20
|
+
2. Enter plan mode unless this audit is being called as verification by another skill or the host has no plan mode.
|
|
21
|
+
3. Assign one investigator to each in-scope topic. An investigator checks every section in that topic and writes nothing. If
|
|
22
|
+
the host cannot dispatch agents, inspect the topics inline in the same order.
|
|
23
|
+
4. Merge the evidence into the shared report format in
|
|
24
|
+
[`templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md).
|
|
25
|
+
5. Put each finding's `Next action` into an ordered plan, grouped by topic and cheapest first. Present the report and wait
|
|
26
|
+
for approval; an audit does not edit the project.
|
|
63
27
|
|
|
64
|
-
|
|
28
|
+
If the caller needs a durable report, write `AUDIT_REPORT.md` and preserve everything under `## Reviewer notes` verbatim.
|
|
29
|
+
|
|
30
|
+
## Finding format
|
|
65
31
|
|
|
66
|
-
|
|
67
|
-
npm, npx, package scripts, hooks, config imports, linters, tests, builds, Git commands, or project binaries. Read config as
|
|
68
|
-
text and report runtime or machine-local state that cannot be established statically as unverified. This binds every
|
|
69
|
-
investigator too — a dispatched agent inherits the audit's constraint, not the host's default freedom, so the prompt that
|
|
70
|
-
dispatches it repeats this paragraph verbatim.
|
|
32
|
+
Classify every result as one of these:
|
|
71
33
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
static inspection.
|
|
34
|
+
- **Broken**: the project violates a rule in a way that blocks or risks the work.
|
|
35
|
+
- **Missing**: a required piece is absent.
|
|
36
|
+
- **Deviation**: the project works differently from the baseline.
|
|
37
|
+
- **Present**: the rule is met, with evidence.
|
|
38
|
+
- **Unverified**: static inspection cannot establish it.
|
|
39
|
+
|
|
40
|
+
Use the report contract's severity, `path:line` evidence, concrete impact, and smallest next action. Do not promote an
|
|
41
|
+
optional tool or a working alternative to a missing finding.
|
|
77
42
|
|
|
78
43
|
## Topics
|
|
79
44
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
## Agent-tooling assessment reference
|
|
105
|
-
|
|
106
|
-
The baseline is the conventions [agent-tooling topic](../imf-web-ui-conventions/topics/agent-tooling.md): the complete bundle
|
|
107
|
-
with matching version markers, the AGENTS fence, and the lifecycle hooks installed and registered for both hosts
|
|
108
|
-
(`.claude/settings.json` and `.codex/hooks.json`) or consciously adapted. Hooks or registrations beyond the shipped set — the
|
|
109
|
-
three injection hooks, the stop gate, plus `baseline-staleness.sh` — are drift, and the tracked pre-commit path calls
|
|
110
|
-
`baseline-staleness.sh`. Read files and settings as text—do not run installers, hooks, or local config queries during
|
|
111
|
-
assessment.
|
|
112
|
-
|
|
113
|
-
Version drift is part of this topic: compare the declared version in `package.json`, the installed
|
|
114
|
-
`node_modules/@imfusion/web-ui/package.json`, and every `.imf-web-ui-skill-version.json` marker, then report the drift and
|
|
115
|
-
point at `imf-web-ui-update`. The registry is unreachable from a static audit, so a line saying that a newer version may
|
|
116
|
-
exist is unverified.
|
|
117
|
-
|
|
118
|
-
Use the shared report template as the report contract. It defines the headings, ordering, empty-section marker, evidence
|
|
119
|
-
format, and reviewer-note preservation rules; do not duplicate that contract here.
|
|
45
|
+
`full` covers all of these; a named argument covers one:
|
|
46
|
+
|
|
47
|
+
`library-setup`, `library-boundary`, `react`, `components`, `typescript`, `styling`, `tokens`, `class-names`, `validation`,
|
|
48
|
+
`data`, `authentication`, `project-structure`, `testing`, `npm-project`, `tooling`, `git`, `assets`, `docs-structure`, and
|
|
49
|
+
`agent-tooling`.
|
|
50
|
+
|
|
51
|
+
Read the corresponding topic and the matching block in
|
|
52
|
+
[`templates/AUDIT_CHECKLIST.md`](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md). The audit is incomplete until every
|
|
53
|
+
in-scope box has evidence.
|
|
54
|
+
|
|
55
|
+
## Agent tooling checks
|
|
56
|
+
|
|
57
|
+
For `agent-tooling`, compare the declared version in `package.json`, the installed
|
|
58
|
+
`node_modules/@imfusion/web-ui/package.json`, every `.imf-web-ui-skill-version.json` marker, the `AGENTS.md` fence, hook
|
|
59
|
+
scripts, and both host registrations with the shipped topic. Version drift, extra hooks, stale markers, and missing
|
|
60
|
+
registrations are findings; point version drift to `imf-web-ui-update`. Registry availability is unverified. Read files as
|
|
61
|
+
text; do not run installers or hooks.
|
|
62
|
+
|
|
63
|
+
## Safety
|
|
64
|
+
|
|
65
|
+
Use only `Read`, `Glob`, `Grep`, and equivalent static inspection. Do not run Git, shells, Node, npm, npx, package scripts,
|
|
66
|
+
linters, tests, builds, hooks, or imported config. Report runtime state as unverified. Investigators inherit this
|
|
67
|
+
restriction.
|
|
@@ -1,113 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui-components
|
|
3
3
|
description:
|
|
4
|
-
"Look up @imfusion/web-ui component APIs and icon glyphs without reading source.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
"Look up @imfusion/web-ui component APIs, compound parts, defaults, and icon glyphs without reading source. Use this
|
|
5
|
+
whenever a consumer task names a Web UI component or icon and you need to choose a prop, part, default, or glyph. Do not
|
|
6
|
+
use it to choose between components or bootstrap a project."
|
|
7
7
|
allowed-tools: Bash
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# Look up components
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
reading source or checking out the library's repo:
|
|
12
|
+
Use the generated package indexes. They are smaller and more reliable than reading the library source.
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
and a one-sentence description of what it's for and what else it's called.
|
|
17
|
-
- **`node_modules/@imfusion/web-ui/src/docgen/doc.gen.json`** — full prop tables (name, type, default, description) for every
|
|
18
|
-
component, keyed by kebab-case folder name.
|
|
19
|
-
- **`node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json`** — searchable icon names, styles, categories, and tags.
|
|
20
|
-
Read it only when the task needs an icon.
|
|
14
|
+
## Component lookup
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
`@imfusion/web-ui/docgen.json`) — those are Node module-resolution aliases, meaningless to `cat`/`jq`/`grep` reading files
|
|
24
|
-
off disk. Use the `node_modules/...` paths above directly.
|
|
16
|
+
1. Read the identity index:
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
```sh
|
|
19
|
+
cat node_modules/@imfusion/web-ui/src/llms/llms.gen.txt
|
|
20
|
+
```
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
It lists each component's name, category, status, purpose, and docgen entry.
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
cat node_modules/@imfusion/web-ui/src/llms/llms.gen.txt
|
|
32
|
-
```
|
|
24
|
+
2. Read only the matching entry from docgen:
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
```sh
|
|
27
|
+
jq '.button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json
|
|
28
|
+
```
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- category: Buttons, status: stable
|
|
39
|
-
Triggers an action — submit, confirm, cancel, navigate, or destructive operations. Six semantic variants ...
|
|
40
|
-
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .button (jq: jq '.button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
41
|
-
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/button.md
|
|
42
|
-
```
|
|
30
|
+
Replace `.button` with the kebab-case key from the identity index. The result contains `root` and `subComponents`, with
|
|
31
|
+
each prop's type, default, and description.
|
|
43
32
|
|
|
44
|
-
|
|
45
|
-
one entry with the exact command the index gave you:
|
|
33
|
+
If `jq` is unavailable, use Node without loading the whole file into the conversation:
|
|
46
34
|
|
|
47
|
-
```sh
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
That returns `{ root: { name, description, props: [...] }, subComponents: [...] }`. `root` is the primary export (`Button`);
|
|
52
|
-
`subComponents` holds compound parts (e.g. `Drawer.Root`, `Drawer.Trigger`, `Drawer.Content` all live under the `drawer`
|
|
53
|
-
key). Match the sub-component you need by its dotted `name`.
|
|
54
|
-
|
|
55
|
-
**`jq` may not be installed.** Check with `which jq` before relying on it. If it's missing, do **not** fall back to reading
|
|
56
|
-
the whole `doc.gen.json` file — that defeats the entire point of the two-hop design (~500KB across all components vs. one
|
|
57
|
-
~9KB entry) and will burn your context budget for no reason. Use whatever's actually available instead:
|
|
58
|
-
|
|
59
|
-
```sh
|
|
60
|
-
node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync('node_modules/@imfusion/web-ui/src/docgen/doc.gen.json','utf8')).button, null, 2))"
|
|
61
|
-
```
|
|
35
|
+
```sh
|
|
36
|
+
node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync('node_modules/@imfusion/web-ui/src/docgen/doc.gen.json','utf8')).button, null, 2))"
|
|
37
|
+
```
|
|
62
38
|
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
Use `doc.gen.json` for Web UI props. A linked upstream page is useful for behavior, composition, and accessibility, but its
|
|
40
|
+
prop table is not authoritative for this package.
|
|
65
41
|
|
|
66
|
-
|
|
67
|
-
documentation for composition, anatomy, keyboard/focus behavior, and accessibility notes docgen can't express. Props always
|
|
68
|
-
come from `doc.gen.json` — never treat the linked page's prop table as authoritative for a web-ui component; web-ui may add,
|
|
69
|
-
remove, or default differently.
|
|
42
|
+
## If the component is missing
|
|
70
43
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
The index is regenerated on every `@imfusion/web-ui` release; it should be exhaustive. If a component you expect is missing,
|
|
74
|
-
don't guess at an API — that's a real gap to report, not something to work around by inventing props. Tell the web-ui
|
|
75
|
-
maintainer, or file it in the [WEBSDK Jira project](https://imfusion.atlassian.net/browse/WEBSDK) if you have access. If the
|
|
76
|
-
gap is about _which_ component to use rather than a missing one, that's a design question: open `imf-web-ui-ux`.
|
|
44
|
+
Treat a missing identity-index entry as a real gap. Do not invent an API or silently import the upstream component. Report
|
|
45
|
+
the gap to the Web UI maintainer. If the question is which existing component fits, use `imf-web-ui-ux` instead.
|
|
77
46
|
|
|
78
47
|
## Icons
|
|
79
48
|
|
|
80
|
-
When the task
|
|
81
|
-
not load it for ordinary component work.
|
|
82
|
-
|
|
83
|
-
Search one relevant term at a time, then read only the matching records:
|
|
49
|
+
When the task needs an icon, search the generated catalog before choosing a name:
|
|
84
50
|
|
|
85
51
|
```sh
|
|
86
52
|
node -e '
|
|
87
53
|
const q = process.argv[1].toLowerCase();
|
|
88
|
-
const icons = JSON.parse(
|
|
89
|
-
|
|
90
|
-
"node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json",
|
|
91
|
-
"utf8"
|
|
92
|
-
)
|
|
93
|
-
);
|
|
94
|
-
console.log(
|
|
95
|
-
JSON.stringify(
|
|
96
|
-
icons
|
|
97
|
-
.filter(icon => [icon.name, icon.category, ...icon.tags]
|
|
98
|
-
.join(" ")
|
|
99
|
-
.toLowerCase()
|
|
100
|
-
.includes(q))
|
|
101
|
-
.slice(0, 20),
|
|
102
|
-
null,
|
|
103
|
-
2
|
|
104
|
-
)
|
|
105
|
-
);
|
|
54
|
+
const icons = JSON.parse(require("fs").readFileSync("node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json", "utf8"));
|
|
55
|
+
console.log(JSON.stringify(icons.filter(icon => [icon.name, icon.category, ...icon.tags].join(" ").toLowerCase().includes(q)).slice(0, 20), null, 2));
|
|
106
56
|
' "add"
|
|
107
57
|
```
|
|
108
58
|
|
|
109
|
-
Import the
|
|
110
|
-
surrounding color:
|
|
59
|
+
Import the glyph and `Icon` from the Web UI icons entry. Always render the glyph through `Icon`:
|
|
111
60
|
|
|
112
61
|
```tsx
|
|
113
62
|
import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
|
|
@@ -115,39 +64,33 @@ import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
|
|
|
115
64
|
<Icon glyph={ArrowRight} aria-hidden />;
|
|
116
65
|
```
|
|
117
66
|
|
|
118
|
-
|
|
67
|
+
Do not import `iconoir-react` or another icon package directly.
|
|
119
68
|
|
|
120
|
-
|
|
121
|
-
import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
|
|
69
|
+
## Compound components
|
|
122
70
|
|
|
123
|
-
|
|
124
|
-
```
|
|
71
|
+
A non-empty `subComponents` array means the component is a namespace:
|
|
125
72
|
|
|
126
|
-
|
|
73
|
+
```tsx
|
|
74
|
+
import { Drawer } from "@imfusion/web-ui";
|
|
127
75
|
|
|
128
|
-
|
|
76
|
+
<Drawer.Root>
|
|
77
|
+
<Drawer.Trigger>Open</Drawer.Trigger>
|
|
78
|
+
<Drawer.Content>…</Drawer.Content>
|
|
79
|
+
</Drawer.Root>;
|
|
80
|
+
```
|
|
129
81
|
|
|
130
|
-
|
|
131
|
-
`import { Drawer } from "@imfusion/web-ui"` then `<Drawer.Root>`, `<Drawer.Trigger>`, `<Drawer.Content>`. The index's
|
|
132
|
-
category/description covers the whole family; look at `subComponents` in the docgen entry to see which parts exist and what
|
|
133
|
-
each one's own props are.
|
|
82
|
+
Use the identity index for the family description and the docgen entry for each part's props.
|
|
134
83
|
|
|
135
|
-
## Integrations
|
|
84
|
+
## Integrations
|
|
136
85
|
|
|
137
|
-
A
|
|
138
|
-
|
|
86
|
+
A component whose identity entry says it comes from `@imfusion/web-ui/integrations/*` is not in the main import. Install the
|
|
87
|
+
listed optional peer explicitly, then import from that path:
|
|
139
88
|
|
|
140
89
|
```tsx
|
|
141
90
|
import { Code } from "@imfusion/web-ui/integrations/code-highlight";
|
|
142
91
|
```
|
|
143
92
|
|
|
144
|
-
|
|
145
|
-
that most consumers shouldn't be forced to install. Check the component's description for which peer to add, and add it
|
|
146
|
-
explicitly to your own `package.json` — web-ui does not install it for you.
|
|
147
|
-
|
|
148
|
-
## Data grids (Table + a headless library)
|
|
93
|
+
## Data grids
|
|
149
94
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
/ `Table.Cell`, and use `Table.SortableHeaderCell` for sortable columns — it carries the `aria-sort` state and the sort
|
|
153
|
-
indicator. See the Table primitive's Storybook docs for the pairing.
|
|
95
|
+
`Table` supplies styled table parts, not sorting or pagination. Pair them with a headless table library installed by the
|
|
96
|
+
consumer. TanStack Table is the recommended choice. Use `Table.SortableHeaderCell` for sortable columns.
|
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui-conventions
|
|
3
3
|
description:
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
assets, and docs structure. Load when writing wrapper components, custom UI, styling beyond the defaults, validating
|
|
8
|
-
external data, adding new files to a consumer app, writing repo docs, touching tool config, choosing any dependency, or
|
|
9
|
-
installing the vendored skills and lifecycle hooks."
|
|
4
|
+
"Apply the ImFusion frontend conventions to consumer code. Use this whenever a task writes a wrapper or custom UI, CSS,
|
|
5
|
+
TypeScript, data fetching, validation, tests, project files, configuration, documentation, dependencies, or agent tooling
|
|
6
|
+
in a project that uses @imfusion/web-ui. Read only the topic references that match the task."
|
|
10
7
|
---
|
|
11
8
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Topic format
|
|
50
|
-
|
|
51
|
-
Topics are manifests, not essays: `##` sections group rule bullets, and each section is one auditable unit. A rule is one
|
|
52
|
-
imperative bullet; only a pushback-prone rule carries a one-line why. Snippets illustrate rules, prose never replaces them.
|
|
53
|
-
Each topic's `##` sections map 1:1 to its block in [templates/AUDIT_CHECKLIST.md](templates/AUDIT_CHECKLIST.md) — add,
|
|
54
|
-
remove, or rename a section and the checklist follows in the same change.
|
|
55
|
-
|
|
56
|
-
`imf-web-ui-setup` proposes approved bootstrap changes, while `imf-web-ui-audit` reports the current state against this
|
|
57
|
-
baseline.
|
|
9
|
+
# Frontend conventions
|
|
10
|
+
|
|
11
|
+
These are ImFusion defaults, not claims about every frontend. A host project's working choice wins. Use these topics to fill
|
|
12
|
+
a gap or to make a deliberate deviation visible; do not refactor a project just to match the baseline.
|
|
13
|
+
|
|
14
|
+
## Choose a topic
|
|
15
|
+
|
|
16
|
+
| Topic | Read when |
|
|
17
|
+
| ------------------------------------------------ | --------------------------------------------------------------- |
|
|
18
|
+
| [library-setup](topics/library-setup.md) | Installing or repairing stylesheet and provider wiring. |
|
|
19
|
+
| [library-boundary](topics/library-boundary.md) | Rendering Web UI components, wrapping them, or choosing a peer. |
|
|
20
|
+
| [authentication](topics/authentication.md) | Protecting routes or defining login and logout. |
|
|
21
|
+
| [react](topics/react.md) | Designing component roles, state ownership, or effects. |
|
|
22
|
+
| [components](topics/components.md) | Adding files or deciding component anatomy. |
|
|
23
|
+
| [typescript](topics/typescript.md) | Writing TypeScript or naming values. |
|
|
24
|
+
| [styling](topics/styling.md) | Writing CSS or customizing Web UI. |
|
|
25
|
+
| [tokens](topics/tokens.md) | Choosing an exact token name. |
|
|
26
|
+
| [class-names](topics/class-names.md) | Mapping variants and `className` to CSS. |
|
|
27
|
+
| [validation](topics/validation.md) | Accepting data from outside the frontend. |
|
|
28
|
+
| [data](topics/data.md) | Adding API queries, mutations, or invalidation. |
|
|
29
|
+
| [project-structure](topics/project-structure.md) | Adding files or routes. |
|
|
30
|
+
| [testing](topics/testing.md) | Deciding what to test. |
|
|
31
|
+
| [tooling](topics/tooling.md) | Adding a dependency or configuring a tool. |
|
|
32
|
+
| [npm-project](topics/npm-project.md) | Changing `package.json`, scripts, pins, or Node. |
|
|
33
|
+
| [git](topics/git.md) | Configuring hooks or choosing verification scope. |
|
|
34
|
+
| [agent-tooling](topics/agent-tooling.md) | Installing skills or lifecycle hooks. |
|
|
35
|
+
| [assets](topics/assets.md) | Adding images, icons, or other static files. |
|
|
36
|
+
| [docs-structure](topics/docs-structure.md) | Writing or reorganizing repository docs. |
|
|
37
|
+
|
|
38
|
+
## How to use the topics
|
|
39
|
+
|
|
40
|
+
Read the relevant file instead of loading the whole set. Each topic is a short checklist: follow its rules, use its examples
|
|
41
|
+
as patterns, and keep any exception explicit in the host project.
|
|
42
|
+
|
|
43
|
+
`imf-web-ui-setup` uses these topics to plan approved project changes. `imf-web-ui-audit` uses them to report the current
|
|
44
|
+
state without changing files.
|
|
@@ -58,6 +58,7 @@ sections one to one — change a topic's sections and this file follows in the s
|
|
|
58
58
|
- [ ] Build custom UI from tokens
|
|
59
59
|
- [ ] Override through the sanctioned seams
|
|
60
60
|
- [ ] The color system
|
|
61
|
+
- [ ] Browser floor
|
|
61
62
|
- [ ] Responsive styling
|
|
62
63
|
|
|
63
64
|
## Tokens — `tokens`
|