@imfusion/web-ui 0.6.4-dev.8.g41d03f2f → 0.7.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.
- package/CHANGELOG.md +391 -0
- package/README.md +22 -55
- package/dist/assets/vendors/base-ui.d.ts +2 -3
- package/dist/breakpoints/min-width.d.ts +3 -7
- package/dist/breakpoints/registry.d.ts +3 -9
- package/dist/{code-Ce8uiPsv.js → code-D2lwxHgd.js} +15 -15
- package/dist/codegen/gen-breakpoints-css.d.ts +0 -4
- package/dist/codegen/gen-token-css.d.ts +0 -2
- package/dist/components/app-shell/app-shell.d.ts +7 -11
- package/dist/components/button/button.d.ts +7 -12
- package/dist/components/callout/callout.d.ts +11 -18
- package/dist/components/card/card.d.ts +11 -10
- package/dist/components/checkbox/checkbox.d.ts +2 -38
- package/dist/components/chip/chip.cva.d.ts +2 -4
- package/dist/components/chip/chip.d.ts +1 -1
- package/dist/components/code/code.d.ts +2 -2
- package/dist/components/collapsible/collapsible.d.ts +4 -35
- package/dist/components/copy-button/copy-button.d.ts +1 -1
- package/dist/components/drawer/drawer.d.ts +17 -100
- package/dist/components/field/field.d.ts +7 -67
- package/dist/components/fieldset/fieldset.d.ts +2 -15
- package/dist/components/icon/icon.d.ts +2 -2
- package/dist/components/input/input.d.ts +2 -8
- package/dist/components/logo/imfusion/imfusion.d.ts +2 -5
- package/dist/components/logo/imfusion/marks.d.ts +10 -0
- package/dist/components/logo/logo.d.ts +3 -3
- package/dist/components/navigation-menu/subs/flyout-link.d.ts +5 -19
- package/dist/components/navigation-menu/subs/inline-submenu.d.ts +2 -4
- package/dist/components/navigation-menu/subs/link.d.ts +6 -23
- package/dist/components/navigation-menu/subs/overlay.d.ts +6 -51
- package/dist/components/navigation-menu/subs/shared.d.ts +4 -14
- package/dist/components/navigation-menu/subs/structure.d.ts +7 -29
- package/dist/components/navigation-menu/subs/trigger.d.ts +11 -20
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.d.ts +72 -0
- package/dist/components/number-field/number-field.meta.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +23 -98
- package/dist/components/row/row.d.ts +1 -1
- package/dist/components/select/select.d.ts +26 -189
- package/dist/components/separator/separator.d.ts +5 -4
- package/dist/components/slider/slider.d.ts +7 -77
- package/dist/components/spinner/spinner.d.ts +13 -8
- package/dist/components/stack/stack.d.ts +3 -4
- package/dist/components/switch/switch.d.ts +2 -31
- package/dist/components/table/table.d.ts +10 -18
- package/dist/components/tabs/tabs.d.ts +18 -52
- package/dist/components/toast/toast.d.ts +16 -103
- package/dist/components/toggle/toggle.d.ts +3 -21
- package/dist/components/toggle-group/toggle-group.d.ts +3 -20
- package/dist/components/tooltip/tooltip.d.ts +26 -85
- package/dist/components/typo/typo.d.ts +25 -25
- package/dist/docgen/gen-docgen.utils.d.ts +3 -4
- package/dist/hooks/use-color-scheme.d.ts +5 -11
- package/dist/hooks/use-media-query.d.ts +2 -7
- package/dist/{icons-Cy1HAosO.js → icons-CaGCCwG-.js} +7 -7
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1486 -1368
- package/dist/integrations/code-highlight/highlighter.d.ts +1 -56
- package/dist/integrations/code-highlight.js +41 -189
- package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +0 -1
- package/dist/integrations/image-display-options.js +54 -54
- package/dist/llms/evals/runner/affected.d.ts +2 -0
- package/dist/llms/evals/runner/benchmark.d.ts +12 -0
- package/dist/llms/evals/runner/compare.d.ts +2 -0
- package/dist/llms/evals/runner/config.d.ts +29 -0
- package/dist/llms/evals/runner/evidence.d.ts +7 -0
- package/dist/llms/evals/runner/execute.d.ts +32 -0
- package/dist/llms/evals/runner/grade.d.ts +10 -0
- package/dist/llms/evals/runner/report-md.d.ts +2 -0
- package/dist/llms/evals/runner/report.d.ts +4 -0
- package/dist/llms/evals/runner/run.d.ts +2 -0
- package/dist/llms/evals/runner/scenario.d.ts +3 -0
- package/dist/llms/evals/runner/types.d.ts +140 -0
- package/dist/llms/evals/runner/workspace.d.ts +2 -0
- package/dist/llms/evals/runner/write-generated.d.ts +1 -0
- package/dist/provider/web-ui-provider.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/tabs-BS6rqrrA.js +398 -0
- package/dist/tokens/apply.d.ts +4 -9
- package/dist/tokens/control-registry.d.ts +3 -6
- package/dist/tokens/types.d.ts +7 -24
- package/dist/tokens/use-token-controls.d.ts +3 -12
- package/dist/types/meta.d.ts +15 -32
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/resolve-state-props.d.ts +4 -0
- package/dist/vite/brand-assets.d.ts +3 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/readable-css-module-names.d.ts +11 -0
- package/dist/vite.js +55 -0
- package/dist/web-ui-cli.js +322 -0
- package/docs/user-guide/AgentTooling.mdx +133 -0
- package/docs/user-guide/BrandAssets.mdx +103 -0
- package/docs/user-guide/Changelog.mdx +26 -0
- package/docs/user-guide/GettingStarted.mdx +71 -0
- package/docs/user-guide/HowItsBuilt.mdx +114 -0
- package/docs/user-guide/Tokens.mdx +88 -0
- package/docs/user-guide/UsagePatterns.mdx +123 -0
- package/package.json +28 -22
- package/src/assets/public/favicon/apple-touch-icon.png +0 -0
- package/src/assets/public/favicon/favicon-16.png +0 -0
- package/src/assets/public/favicon/favicon-32.png +0 -0
- package/src/assets/public/favicon/favicon.ico +0 -0
- package/src/assets/public/favicon/favicon.svg +7 -0
- package/src/assets/public/favicon/icon-192.png +0 -0
- package/src/assets/public/favicon/icon-512.png +0 -0
- package/src/assets/public/favicon/og-image.png +0 -0
- package/src/assets/public/spinner/imfusion-spinner-black.webp +0 -0
- package/src/assets/public/spinner/imfusion-spinner-blue.webp +0 -0
- package/src/assets/public/spinner/imfusion-spinner-white.webp +0 -0
- package/src/docgen/doc.gen.json +3255 -603
- package/src/llms/install-templates/AGENTS.md +4 -4
- package/src/llms/install-templates/hooks/baseline-staleness.sh +9 -2
- package/src/llms/llms.gen.txt +7 -1
- package/src/llms/skills/imf-web-ui/SKILL.md +44 -21
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +25 -11
- package/src/llms/skills/imf-web-ui-components/SKILL.md +7 -3
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +3 -2
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +0 -1
- package/src/llms/skills/imf-web-ui-conventions/templates/REPORT.md +21 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +15 -10
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +7 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +3 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +10 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +13 -11
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +17 -9
- package/src/llms/skills/imf-web-ui-update/SKILL.md +47 -19
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +6 -3
- package/src/llms/tokens.gen.json +79 -15
- package/bin/install.js +0 -446
- package/dist/build/vite-css-module-names/index.d.ts +0 -20
- package/dist/build/vite-css-module-names.js +0 -17
- package/dist/components/spinner/spinner.geometry.d.ts +0 -37
- package/dist/integrations/code-highlight/languages/cmake.d.ts +0 -1
- package/dist/integrations/code-highlight/languages/cpp.d.ts +0 -1
- package/dist/tabs-DIe1Utiy.js +0 -371
- /package/dist/{meta-CySnRuVp.js → meta-j-7HGrWv.js} +0 -0
|
@@ -20,11 +20,11 @@ or suggesting a command.
|
|
|
20
20
|
|
|
21
21
|
<The installer owns only the fenced block below. It refreshes that block on every install; the rest belongs to the project.>
|
|
22
22
|
|
|
23
|
-
<!-- imf-web-ui:begin — managed by `npx web-ui
|
|
23
|
+
<!-- imf-web-ui:begin — managed by `npx web-ui install`; edits inside the fence are overwritten -->
|
|
24
24
|
|
|
25
|
-
`.agents/skills/imf-web-ui-*` is vendored from `@imfusion/web-ui` and resynced with `npx web-ui
|
|
26
|
-
vendored copy or put project-specific conventions there. Load the matching skill before changing UI, styles, data, tests,
|
|
27
|
-
docs.
|
|
25
|
+
`.agents/skills/imf-web-ui-*` is vendored from `@imfusion/web-ui` and resynced with `npx web-ui install skills`. Do not edit
|
|
26
|
+
the vendored copy or put project-specific conventions there. Load the matching skill before changing UI, styles, data, tests,
|
|
27
|
+
or docs.
|
|
28
28
|
|
|
29
29
|
<!-- imf-web-ui:end -->
|
|
30
30
|
|
|
@@ -6,11 +6,18 @@ PKG=node_modules/@imfusion/web-ui/package.json
|
|
|
6
6
|
[ -f "$PKG" ] || exit 0
|
|
7
7
|
CURRENT=$(node -p "require('./$PKG').version" 2>/dev/null) || exit 0
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
# .claude/skills may be a symlink to .agents/skills; skip markers already read.
|
|
10
|
+
seen=""
|
|
11
|
+
for marker in .agents/skills/imf-web-ui*/.imf-web-ui-skill-version.json .claude/skills/imf-web-ui*/.imf-web-ui-skill-version.json; do
|
|
10
12
|
[ -f "$marker" ] || continue
|
|
13
|
+
real=$(cd "$(dirname "$marker")" && pwd -P)/$(basename "$marker")
|
|
14
|
+
case " $seen " in
|
|
15
|
+
*" $real "*) continue ;;
|
|
16
|
+
esac
|
|
17
|
+
seen="$seen $real"
|
|
11
18
|
INSTALLED=$(node -p "require('./$marker').version" 2>/dev/null) || continue
|
|
12
19
|
if [ "$INSTALLED" != "$CURRENT" ]; then
|
|
13
|
-
echo "imf-web-ui skills are stale ($INSTALLED installed, package is $CURRENT) — run: npx web-ui-install"
|
|
20
|
+
echo "imf-web-ui skills are stale ($INSTALLED installed, package is $CURRENT) — run /imf-web-ui-update, or: npx web-ui install skills && npx web-ui install hooks"
|
|
14
21
|
break
|
|
15
22
|
fi
|
|
16
23
|
done
|
package/src/llms/llms.gen.txt
CHANGED
|
@@ -113,6 +113,12 @@ Navigation menu with horizontal or vertical triggers and anchored flyout panels.
|
|
|
113
113
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .navigation-menu (jq: jq '.navigation-menu' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
114
114
|
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/navigation-menu.md
|
|
115
115
|
|
|
116
|
+
## NumberField
|
|
117
|
+
- category: Inputs, status: experimental
|
|
118
|
+
Numeric entry with increment and decrement controls. Also called a number field, spinner, or stepper; use it instead of Input with type="number" whenever a value is numeric. NumberField.Stepper composes the whole control in one element and takes a scrub prop that turns its label into a drag handle.
|
|
119
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .number-field (jq: jq '.number-field' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
120
|
+
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/number-field.md
|
|
121
|
+
|
|
116
122
|
## Popover
|
|
117
123
|
- category: Display, status: stable
|
|
118
124
|
Floating panel anchored to a trigger for contextual content, quick forms, or actions. Also called a popup or flyout; use Tooltip for hints without interaction.
|
|
@@ -195,5 +201,5 @@ Hover- or focus-triggered label for brief help about a control or term. Also cal
|
|
|
195
201
|
|
|
196
202
|
## Typo
|
|
197
203
|
- category: Display, status: stable
|
|
198
|
-
Semantic text primitives for headings, paragraphs, lists, quotes, links, and inline code. The namespace uses native HTML elements and token-based text roles.
|
|
204
|
+
Semantic text primitives for display and standard headings, paragraphs, lists, quotes, links, and inline code. The namespace uses native HTML elements and token-based text roles.
|
|
199
205
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .typo (jq: jq '.typo' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
@@ -1,45 +1,68 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui
|
|
3
3
|
description:
|
|
4
|
-
"Route UI work in a project that uses @imfusion/web-ui. Use this skill whenever a user adds, edits,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
"Route UI work and library questions in a project that uses @imfusion/web-ui. Use this skill whenever a user adds, edits,
|
|
5
|
+
styles, or reviews UI, or asks about library setup, brand assets, favicons, theming, or usage in a consumer project, even
|
|
6
|
+
if they do not mention the library. Open only the matching packaged guide or companion skill."
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# Route Web UI work
|
|
10
10
|
|
|
11
|
-
Start here for UI work in a project that uses `@imfusion/web-ui`. This skill is a map, not a second
|
|
11
|
+
Start here for UI work and library questions in a project that uses `@imfusion/web-ui`. This skill is a map, not a second
|
|
12
|
+
copy of every convention.
|
|
12
13
|
|
|
13
14
|
## 1. Decide whether guidance is needed
|
|
14
15
|
|
|
15
|
-
Skip a companion when the task is explicit and small, an existing local pattern already solves it
|
|
16
|
-
already correct. Do the work. Look up an API silently only when you are unsure.
|
|
16
|
+
Skip a companion when the task is explicit and small, an existing local pattern already solves it in the file being changed,
|
|
17
|
+
and the library usage is already correct. Do the work. Look up an API silently only when you are unsure.
|
|
17
18
|
|
|
18
|
-
Use a companion when the task involves a choice, a missing setup piece, a new file, or a library convention the project
|
|
19
|
-
not already have.
|
|
19
|
+
Use a companion when the task involves a choice, a missing setup piece, a new UI file, or a library convention the project
|
|
20
|
+
may not already have. Open a companion by invoking its skill; reading one of its files directly does not load its workflow.
|
|
20
21
|
|
|
21
22
|
## 2. Route the task
|
|
22
23
|
|
|
23
|
-
| Task
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
| Write
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
24
|
+
| Task | Open |
|
|
25
|
+
| -------------------------------------------------------------------- | -------------------------- |
|
|
26
|
+
| Understand library setup, brand assets, theming, or usage | Packaged user guides below |
|
|
27
|
+
| Look up a component, part, prop, default, or icon | `imf-web-ui-components` |
|
|
28
|
+
| Choose components or shape a screen, form, or flow | `imf-web-ui-ux` |
|
|
29
|
+
| Write or update documentation | `imf-web-ui-conventions` |
|
|
30
|
+
| Write a wrapper, custom UI, CSS, data layer, validation, or tests | `imf-web-ui-conventions` |
|
|
31
|
+
| Choose a routing, data, form, or validation library for the project | `imf-web-ui-conventions` |
|
|
32
|
+
| Install the library or bootstrap project tooling | `imf-web-ui-setup` |
|
|
33
|
+
| Diagnose a broken install: unstyled output, missing tokens, no theme | `imf-web-ui-setup` |
|
|
34
|
+
| Inspect an existing project without changing it | `imf-web-ui-audit` |
|
|
35
|
+
| Update the package, skills, or hooks | `imf-web-ui-update` |
|
|
32
36
|
|
|
33
|
-
A
|
|
34
|
-
questions, not every
|
|
37
|
+
A new form opens `imf-web-ui-ux`, even when its fields and action are already specified. A screen often needs both
|
|
38
|
+
`imf-web-ui-ux` and `imf-web-ui-components`, in that order. Setup and audit are for project-wide questions, not every
|
|
39
|
+
one-file edit.
|
|
40
|
+
|
|
41
|
+
### Read a packaged user guide
|
|
42
|
+
|
|
43
|
+
Read only the matching page under `node_modules/@imfusion/web-ui/docs/user-guide/` in the consumer project:
|
|
44
|
+
|
|
45
|
+
| Question | Page |
|
|
46
|
+
| ------------------------------------------------------------------------ | -------------------- |
|
|
47
|
+
| What the library provides, installation, stylesheet, and provider wiring | `GettingStarted.mdx` |
|
|
48
|
+
| Favicons, social sharing images, and static brand files | `BrandAssets.mdx` |
|
|
49
|
+
| Composition, CSS overrides, state attributes, and color schemes | `UsagePatterns.mdx` |
|
|
50
|
+
| Token families and customization | `Tokens.mdx` |
|
|
51
|
+
| Agent skills, hooks, and their installation | `AgentTooling.mdx` |
|
|
52
|
+
| Library boundaries and implementation choices | `HowItsBuilt.mdx` |
|
|
53
|
+
|
|
54
|
+
Read MDX as text. Its imports, JSX previews, and Storybook navigation are presentation, not instructions to install or run
|
|
55
|
+
Storybook in the consumer. Cite the packaged page when answering a library question. Use `imf-web-ui-components` for exact
|
|
56
|
+
props and the conventions `tokens` topic for exact token names and defaults.
|
|
35
57
|
|
|
36
58
|
## 3. Keep project choices
|
|
37
59
|
|
|
38
60
|
The host project's existing conventions win. The companion skills fill gaps; they do not justify refactoring a working
|
|
39
61
|
styling system, state library, or folder structure.
|
|
40
62
|
|
|
41
|
-
When a task needs TanStack Router, Query, Form, Table, or Store and the project has no incumbent,
|
|
42
|
-
|
|
63
|
+
When a task needs TanStack Router, Query, Form, Table, or Store and the project has no incumbent, open
|
|
64
|
+
`imf-web-ui-conventions` for the house position on that layer, then read the library's current documentation with
|
|
65
|
+
`npx @tanstack/cli` before using it. The recommendation lives in the conventions topics, not here.
|
|
43
66
|
|
|
44
67
|
## 4. Ask only when the choice depends on missing context
|
|
45
68
|
|
|
@@ -10,22 +10,35 @@ allowed-tools: Read Glob Grep
|
|
|
10
10
|
|
|
11
11
|
# Audit a consumer project
|
|
12
12
|
|
|
13
|
-
This is a read-only audit.
|
|
14
|
-
with work the human can approve.
|
|
15
|
-
|
|
13
|
+
This is a read-only audit. Its job is to align a project with its conventions: compare the project against the selected
|
|
14
|
+
`imf-web-ui-conventions` topics, report evidence, and end with work the human can approve.
|
|
15
|
+
|
|
16
|
+
A gap against a convention is high severity: the project agreed to the conventions. Only a deliberate, stated reason to
|
|
17
|
+
differ lowers it.
|
|
18
|
+
|
|
19
|
+
Anything else belongs under `Suggestions`: findings from running the code, investigating, or reading through. Report it, keep
|
|
20
|
+
it low, and do not let it crowd the sections a consumer has to act on.
|
|
16
21
|
|
|
17
22
|
## Workflow
|
|
18
23
|
|
|
19
24
|
1. Resolve the argument. Bare means `full`; an unknown topic is an error, not a reason to widen the scope.
|
|
20
25
|
2. Enter plan mode unless this audit is being called as verification by another skill or the host has no plan mode.
|
|
21
|
-
3.
|
|
22
|
-
|
|
26
|
+
3. Read the report template and existing reviewer notes, then dispatch one investigator per in-scope topic. Tell each
|
|
27
|
+
investigator to use only `Read`, `Glob`, and `Grep`, with no shell commands or writes. An investigator checks every
|
|
28
|
+
section in that topic and writes nothing. Once dispatch starts, the host performs no repository inspection: the returned
|
|
29
|
+
reports are the evidence, and the host merges them without reading or searching the files again. Gathering the evidence
|
|
30
|
+
twice spends context on the second pass and reports what the host still remembers. Inspect a topic inline only after its
|
|
31
|
+
dispatch has been tried and refused, and say which attempt failed.
|
|
23
32
|
4. Merge the evidence into the shared report format in
|
|
24
|
-
[`templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md).
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
[`templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md). Before presenting or writing it, check that every
|
|
34
|
+
Broken, Missing, Deviation, and Unverified entry has a severity, evidence, impact, and next action; do not compact
|
|
35
|
+
Unverified entries.
|
|
36
|
+
5. Put each finding's `Next action` into an ordered plan, grouped by topic and cheapest first. The plan is separate from the
|
|
37
|
+
report contract: present it in the host plan or response, never as another heading in `AUDIT_REPORT.md`. Present the
|
|
38
|
+
report and wait for approval; an audit does not edit the project.
|
|
27
39
|
|
|
28
|
-
If the caller needs a durable report, write `AUDIT_REPORT.md`
|
|
40
|
+
If the caller needs a durable report, write `AUDIT_REPORT.md` with exactly the template's H2 headings and preserve everything
|
|
41
|
+
under `## Reviewer notes` verbatim.
|
|
29
42
|
|
|
30
43
|
## Finding format
|
|
31
44
|
|
|
@@ -37,8 +50,9 @@ Classify every result as one of these:
|
|
|
37
50
|
- **Present**: the rule is met, with evidence.
|
|
38
51
|
- **Unverified**: static inspection cannot establish it.
|
|
39
52
|
|
|
40
|
-
Use the report contract's severity, `path:line` evidence, concrete impact, and smallest next action.
|
|
41
|
-
|
|
53
|
+
Use the report contract's severity, `path:line` evidence, concrete impact, and smallest next action. Unverified entries use
|
|
54
|
+
that same structure: unavailable runtime evidence, the impact of the unknown, and the check that resolves it. Do not promote
|
|
55
|
+
an optional tool or a working alternative to a missing finding.
|
|
42
56
|
|
|
43
57
|
## Topics
|
|
44
58
|
|
|
@@ -13,13 +13,14 @@ Use the generated package indexes. They are smaller and more reliable than readi
|
|
|
13
13
|
|
|
14
14
|
## Component lookup
|
|
15
15
|
|
|
16
|
-
1. Read the identity index:
|
|
16
|
+
1. Read the identity index first, even when you already know the component's name: it gives the docgen key and the status.
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
cat node_modules/@imfusion/web-ui/src/llms/llms.gen.txt
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
It lists each component's name, category, status, purpose, and docgen entry.
|
|
22
|
+
It lists each component's name, category, status, purpose, and docgen entry. The docgen entry is the prop source; the
|
|
23
|
+
`.d.ts` files in `dist/` carry no defaults and hide upstream props behind their base types.
|
|
23
24
|
|
|
24
25
|
2. Read only the matching entry from docgen:
|
|
25
26
|
|
|
@@ -39,6 +40,9 @@ Use the generated package indexes. They are smaller and more reliable than readi
|
|
|
39
40
|
Use `doc.gen.json` for Web UI props. A linked upstream page is useful for behavior, composition, and accessibility, but its
|
|
40
41
|
prop table is not authoritative for this package.
|
|
41
42
|
|
|
43
|
+
A `variant` value belongs to the component that defines it; one component's list is not a global one. `brand` means identity
|
|
44
|
+
color and `primary` means the action color, even where they look alike.
|
|
45
|
+
|
|
42
46
|
## If the component is missing
|
|
43
47
|
|
|
44
48
|
Treat a missing identity-index entry as a real gap. Do not invent an API or silently import the upstream component. Report
|
|
@@ -87,7 +91,7 @@ A component whose identity entry says it comes from `@imfusion/web-ui/integratio
|
|
|
87
91
|
listed optional peer explicitly, then import from that path:
|
|
88
92
|
|
|
89
93
|
```tsx
|
|
90
|
-
import {
|
|
94
|
+
import { ImageDisplayOptions } from "@imfusion/web-ui/integrations/image-display-options";
|
|
91
95
|
```
|
|
92
96
|
|
|
93
97
|
## Data grids
|
|
@@ -4,6 +4,7 @@ description:
|
|
|
4
4
|
"Apply the ImFusion frontend conventions to consumer code. Use this whenever a task writes a wrapper or custom UI, CSS,
|
|
5
5
|
TypeScript, data fetching, validation, tests, project files, configuration, documentation, dependencies, or agent tooling
|
|
6
6
|
in a project that uses @imfusion/web-ui. Read only the topic references that match the task."
|
|
7
|
+
user-invocable: false
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Frontend conventions
|
|
@@ -45,5 +46,5 @@ state without changing files.
|
|
|
45
46
|
|
|
46
47
|
## Documentation
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
Use the `docs-structure` topic for new or updated documentation. If `/documentation-writer` is available, invoke it for the
|
|
50
|
+
page type and outline; the topic supplies the repository-specific boundaries.
|
|
@@ -12,8 +12,23 @@ Broken, Missing, Deviations, and Unverified entries use:
|
|
|
12
12
|
- Impact: concrete consequence
|
|
13
13
|
- Next action: smallest selectable follow-up
|
|
14
14
|
|
|
15
|
-
Present entries name the topic and evidence path.
|
|
16
|
-
|
|
15
|
+
Present entries name the topic and evidence path. Optional tools are not missing findings.
|
|
16
|
+
|
|
17
|
+
Where a finding belongs follows from where it came from, not from how strongly you hold it.
|
|
18
|
+
|
|
19
|
+
A convention names it:
|
|
20
|
+
- Broken: the convention is followed but does not work. Something is unmounted, unwired, or fails at runtime.
|
|
21
|
+
- Missing: a convention expects it and the project has nothing there.
|
|
22
|
+
- Deviations: it works, and differs from what a convention says.
|
|
23
|
+
|
|
24
|
+
These three are high severity by default. The project agreed to the conventions; a gap against them is not a preference.
|
|
25
|
+
Drop the severity only when the project shows a deliberate reason to differ, and say what the reason is.
|
|
26
|
+
|
|
27
|
+
Nothing names it:
|
|
28
|
+
- Suggestions: real improvements that no convention asks for. What running the code revealed, what an investigation turned
|
|
29
|
+
up, what a reader would tidy on their way past. Never high severity, and never a reason to hold up the work.
|
|
30
|
+
|
|
31
|
+
- Unverified: it could not be checked from the files available.
|
|
17
32
|
-->
|
|
18
33
|
|
|
19
34
|
## Verdict
|
|
@@ -32,6 +47,10 @@ None.
|
|
|
32
47
|
|
|
33
48
|
None.
|
|
34
49
|
|
|
50
|
+
## Suggestions
|
|
51
|
+
|
|
52
|
+
None.
|
|
53
|
+
|
|
35
54
|
## Present
|
|
36
55
|
|
|
37
56
|
None.
|
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
# Agent tooling
|
|
2
2
|
|
|
3
|
-
`npx web-ui
|
|
4
|
-
choices around that installer.
|
|
3
|
+
`npx web-ui install` manages the Web UI skills and optional lifecycle hooks in a consumer project.
|
|
5
4
|
|
|
6
5
|
## The skill bundle
|
|
7
6
|
|
|
8
|
-
Run:
|
|
7
|
+
Run, on a first install:
|
|
9
8
|
|
|
10
9
|
```sh
|
|
11
|
-
npx web-ui
|
|
10
|
+
npx web-ui install skills --harness=claude
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
It installs or refreshes the `imf-web-ui-*` skills, updates the managed `AGENTS.md` fence, and removes skills that the
|
|
15
|
-
package no longer ships. The
|
|
16
|
-
|
|
14
|
+
package no longer ships. The skills always live in `.agents/skills/`. `--harness` selects `claude`, which also links each
|
|
15
|
+
skill into `.claude/skills/`, `codex`, or `all`; without it, the command prompts and remembers the choice. Pass
|
|
16
|
+
`--reconfigure` to choose again. On a project that already has an install, re-running `install skills` without `--harness`
|
|
17
|
+
reuses the remembered harness instead of narrowing it.
|
|
17
18
|
|
|
18
19
|
Skill version markers (`.imf-web-ui-skill-version.json`) show which package version installed each skill. Refresh them with
|
|
19
20
|
the installer; do not hand-edit the vendored files.
|
|
20
21
|
|
|
21
22
|
## The hooks
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
`install hooks` requires the skills to already be installed for the target harness; without them, it errors and tells you to
|
|
25
|
+
run `install skills` first:
|
|
24
26
|
|
|
25
27
|
```sh
|
|
26
|
-
npx web-ui
|
|
28
|
+
npx web-ui install skills --harness=claude
|
|
29
|
+
npx web-ui install hooks --harness=claude
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
The installer owns the scripts under `.agents/hooks/imf-web-ui/` and merges its registrations into
|
|
30
|
-
|
|
32
|
+
The installer owns the scripts under `.agents/hooks/imf-web-ui/` and merges its registrations into the registration file for
|
|
33
|
+
the chosen harness only: Claude Code's `.claude/settings.json`, Codex's `.codex/hooks.json`, or both with `--harness=all`. It
|
|
34
|
+
refreshes scripts and removes retired registrations without replacing unrelated entries, and removes its registrations from a
|
|
35
|
+
harness that is not selected.
|
|
31
36
|
|
|
32
37
|
The shipped events are:
|
|
33
38
|
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Importing
|
|
4
4
|
|
|
5
|
-
Import
|
|
6
|
-
|
|
5
|
+
Import application images from `src/assets/` so the bundler fingerprints and includes them. Use public URLs for files
|
|
6
|
+
consumed by document metadata or manifests, with a build step that serves the files at those URLs.
|
|
7
|
+
|
|
8
|
+
For the library's favicon set and social sharing image, read `BrandAssets.mdx` through the packaged user-guide route in
|
|
9
|
+
`imf-web-ui`.
|
|
7
10
|
|
|
8
11
|
## Photographs: WebP
|
|
9
12
|
|
|
@@ -17,8 +20,8 @@ Keep the long edge at 2000px or less. WebP is supported by the browser floor.
|
|
|
17
20
|
|
|
18
21
|
## Other formats
|
|
19
22
|
|
|
20
|
-
Use PNG when the image needs alpha or exact pixels. Use an inline SVG component for icons, logos, and line art so it
|
|
21
|
-
`currentColor` and follows the theme.
|
|
23
|
+
Use PNG when the image needs alpha or exact pixels. Use an inline SVG component for in-app icons, logos, and line art so it
|
|
24
|
+
inherits `currentColor` and follows the theme.
|
|
22
25
|
|
|
23
26
|
## Scope
|
|
24
27
|
|
|
@@ -85,7 +85,9 @@ export function getDetails(options?: QueryOptions<User>) {
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Callers choose `ensureQueryData`, `useSuspenseQuery`, or another Query API.
|
|
88
|
+
Callers choose `ensureQueryData`, `useSuspenseQuery`, or another Query API. Mutation factories likewise return
|
|
89
|
+
`mutationOptions`, own their mutation key and parsing, and are passed to `useMutation`; do not inline those options at the
|
|
90
|
+
call site.
|
|
89
91
|
|
|
90
92
|
## Router context access
|
|
91
93
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Documentation structure
|
|
2
2
|
|
|
3
|
-
Keep repository docs useful to a human who has just joined the project.
|
|
4
|
-
|
|
3
|
+
Keep repository docs useful to a human who has just joined the project. The setup skill can propose the shape; the audit
|
|
4
|
+
skill can check it.
|
|
5
5
|
|
|
6
6
|
## The shape
|
|
7
7
|
|
|
@@ -18,7 +18,8 @@ The hooks are tracked in `.githooks/`. Check both the Git setting and the direct
|
|
|
18
18
|
|
|
19
19
|
There are two scopes:
|
|
20
20
|
|
|
21
|
-
- **
|
|
21
|
+
- **commit**: `verify:staged`, run by pre-commit. It checks whole-repository lint and formatting, then runs project checks
|
|
22
|
+
for staged inputs.
|
|
22
23
|
- **full**: `verify:full`, the build and complete verification used by CI.
|
|
23
24
|
|
|
24
25
|
The scripts under `scripts/verify/` own the step lists. Hooks and npm scripts only launch them.
|
|
@@ -26,4 +27,5 @@ The scripts under `scripts/verify/` own the step lists. Hooks and npm scripts on
|
|
|
26
27
|
## Staleness at commit time
|
|
27
28
|
|
|
28
29
|
Pre-commit also runs advisory checks for vendored skill markers and documentation drift. If a staged change makes a doc
|
|
29
|
-
stale, update the doc in the same commit. For an outdated installed skill, run `npx web-ui
|
|
30
|
+
stale, update the doc in the same commit. For an outdated installed skill, run `npx web-ui install skills` (also
|
|
31
|
+
`npx web-ui install hooks` if the project uses hooks) with the project's existing `--harness` in the consumer project.
|
|
@@ -22,9 +22,18 @@ export function App() {
|
|
|
22
22
|
Components outside the provider do not receive the library's provider context. Keep upstream imports behind the library; see
|
|
23
23
|
[library-boundary.md](library-boundary.md).
|
|
24
24
|
|
|
25
|
+
The provider follows the OS color scheme by default. An app that paints its own surfaces from a fixed palette pins the scheme
|
|
26
|
+
instead, so component colors cannot resolve against the opposite scheme:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<WebUIProvider colorScheme="dark">
|
|
30
|
+
```
|
|
31
|
+
|
|
25
32
|
## Symptoms of broken setup
|
|
26
33
|
|
|
27
34
|
- Unstyled components usually mean the `styles.css` import is missing.
|
|
28
|
-
-
|
|
35
|
+
- Unresolved variables usually mean the component is outside `WebUIProvider`.
|
|
36
|
+
- Light component colors inside a dark app (or the reverse) mean the scheme is following the OS against a fixed palette. Pin
|
|
37
|
+
`colorScheme` on the provider.
|
|
29
38
|
- An integration import error usually means its optional peer is missing. Check the component entry in
|
|
30
39
|
`imf-web-ui-components` for the package to install.
|
|
@@ -45,7 +45,7 @@ Do not target generated CSS Module class names and do not use `!important` to fi
|
|
|
45
45
|
hook, not a state flag.
|
|
46
46
|
|
|
47
47
|
```css
|
|
48
|
-
[data-imf-ui-component="Switch"][data-checked] {
|
|
48
|
+
[data-imf-ui-component="Switch.Root"][data-checked] {
|
|
49
49
|
outline: var(--imf-ui-border-size-2) solid var(--imf-ui-color-fg-positive);
|
|
50
50
|
}
|
|
51
51
|
```
|
|
@@ -56,7 +56,7 @@ Use surface roles (`main`, `support`, `minor`), the separate `brand` and `primar
|
|
|
56
56
|
slots. Override a high-level control when a whole family should change; consume a semantic token in a component.
|
|
57
57
|
|
|
58
58
|
Foreground roles are for text, icons, borders, and focus rings. Background roles are for fills. The provider sets
|
|
59
|
-
`data-imf-ui-color-scheme="light" | "dark"` on `<html
|
|
59
|
+
`data-imf-ui-color-scheme="light" | "dark"` on `<html>`, from the OS preference unless its `colorScheme` prop pins one.
|
|
60
60
|
|
|
61
61
|
## Browser floor
|
|
62
62
|
|
|
@@ -8,5 +8,7 @@ Read:
|
|
|
8
8
|
node_modules/@imfusion/web-ui/src/llms/tokens.gen.json
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
It contains the shipped token names and authored defaults.
|
|
12
|
-
|
|
11
|
+
It contains the shipped token names and authored defaults. Before writing CSS, check every concrete `--imf-ui-*` name the
|
|
12
|
+
file will use against that index or the relevant component stylesheet. A family with one entry does not imply numbered
|
|
13
|
+
variants. When no matching token exists, use an existing documented seam or say that the token is absent instead of guessing
|
|
14
|
+
a plausible name.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Tooling
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the tool's current documentation rather than memory.
|
|
4
4
|
|
|
5
5
|
## Topic-to-tool map
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@ Read this topic before adding a dependency or configuring a tool. Use the tool's
|
|
|
17
17
|
| Format | Prettier |
|
|
18
18
|
| Lint | ESLint flat config |
|
|
19
19
|
| Types | `tsc --noEmit` |
|
|
20
|
-
|
|
|
20
|
+
| Pre-commit checks | Whole-repository lint and format checks |
|
|
21
21
|
| Dead code | Knip via `verify:knip` |
|
|
22
22
|
|
|
23
23
|
## When a library owns a layer
|
|
@@ -65,24 +65,26 @@ tests, requires the `#/` alias instead of parent-relative imports, and uses proj
|
|
|
65
65
|
Use strict TypeScript with bundler module resolution, `verbatimModuleSyntax`, unused-value checks, and `#/` paths. Keep
|
|
66
66
|
`import type` for type-only imports.
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## Pre-commit checks
|
|
69
69
|
|
|
70
|
-
The
|
|
71
|
-
|
|
70
|
+
The pre-commit hook checks the whole repository with ESLint and Prettier, then runs project checks for staged inputs that can
|
|
71
|
+
affect generated files, types, dependencies, or TeamCity configuration. It does not rewrite files during a commit; use
|
|
72
|
+
`npm run format` to apply Prettier changes explicitly.
|
|
72
73
|
|
|
73
|
-
##
|
|
74
|
+
## Vite plugins
|
|
74
75
|
|
|
75
|
-
Register Web UI's
|
|
76
|
-
Storybook, and production:
|
|
76
|
+
Register Web UI's Vite plugins in the application configuration:
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
import { defineConfig } from "vite";
|
|
80
80
|
import react from "@vitejs/plugin-react";
|
|
81
|
-
import { readableCssModuleNames } from "@imfusion/web-ui/
|
|
81
|
+
import { imfusionBrandAssets, readableCssModuleNames } from "@imfusion/web-ui/vite";
|
|
82
82
|
|
|
83
83
|
export default defineConfig({
|
|
84
|
-
plugins: [react(), readableCssModuleNames({ prefix: "app" })]
|
|
84
|
+
plugins: [react(), imfusionBrandAssets(), readableCssModuleNames({ prefix: "app" })]
|
|
85
85
|
});
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
`imfusionBrandAssets` serves the complete favicon set during development and emits it at stable root URLs during builds.
|
|
89
|
+
Register `readableCssModuleNames` in every compiler that processes the app's CSS, including development, Storybook, and
|
|
90
|
+
production. A compiler left out produces different class names and styles that appear to work only in some environments.
|
|
@@ -5,7 +5,7 @@ description:
|
|
|
5
5
|
needs library wiring, tooling, git, npm, authentication, structure, data, testing, docs, or agent tooling. Inspect first,
|
|
6
6
|
propose concrete files, and write only what the user approves. Use imf-web-ui-audit for read-only checks."
|
|
7
7
|
argument-hint: "[full|library-setup|tooling|git|npm-project|authentication|project-structure|docs-structure|data|testing|agent-tooling]"
|
|
8
|
-
allowed-tools: Read Glob Grep Write
|
|
8
|
+
allowed-tools: Read Glob Grep Write Skill
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Set up a consumer project
|
|
@@ -15,16 +15,24 @@ working choices.
|
|
|
15
15
|
|
|
16
16
|
## Workflow
|
|
17
17
|
|
|
18
|
-
1. Resolve the
|
|
19
|
-
|
|
18
|
+
1. Resolve the scope. A named topic limits the assessment to that topic. A bare invocation means `full`, unless the request
|
|
19
|
+
is about one topic, in which case that topic is the scope: answer what was asked and offer the wider sweep rather than
|
|
20
|
+
running it. If the argument is unknown, list the supported topics and point to `imf-web-ui-audit`.
|
|
20
21
|
2. Enter the host's plan mode before inspecting or proposing changes.
|
|
21
22
|
3. Read the selected convention topics and inspect the repository with `Read`, `Glob`, and `Grep` only.
|
|
22
23
|
4. Put a complete proposal in the host plan, using [`templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md).
|
|
23
|
-
For new or updated documentation,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
6.
|
|
24
|
+
For new or updated documentation, use the `docs-structure` topic for repository-specific boundaries. Name every file to
|
|
25
|
+
create or change, include its intended content, and cite the repository evidence behind the choice.
|
|
26
|
+
5. Wait for explicit approval. After approval, write only the listed files. Before calling setup complete, ensure every
|
|
27
|
+
package imported by those files and every tool named by their scripts is declared in `package.json`.
|
|
28
|
+
6. Offer `imf-web-ui-audit full` as an optional next step for checking the wider project, and run it only if the user says
|
|
29
|
+
yes. Setup is complete once the approved files are written; the audit reviews ground setup did not touch.
|
|
30
|
+
|
|
31
|
+
## Audit handoff
|
|
32
|
+
|
|
33
|
+
When the approved request includes an audit, the next tool call after the final setup write invokes `imf-web-ui-audit`
|
|
34
|
+
through the host's skill tool. Do not read audit files, inspect the project again, or dispatch audit investigators first;
|
|
35
|
+
reproducing the audit workflow does not load the skill.
|
|
28
36
|
|
|
29
37
|
## Greenfield `full` setup
|
|
30
38
|
|
|
@@ -41,7 +49,7 @@ The plan describes the exact starter files. It does not copy a generic starter p
|
|
|
41
49
|
|
|
42
50
|
## Installer steps
|
|
43
51
|
|
|
44
|
-
For `agent-tooling`, list the `npx web-ui
|
|
52
|
+
For `agent-tooling`, list the `npx web-ui install` commands as steps for the human. Read existing registrations first and do
|
|
45
53
|
not stack a hook on an event the project already covers. Include the Codex trust review when hooks are part of the plan.
|
|
46
54
|
|
|
47
55
|
## Safety
|