@imfusion/web-ui 0.8.1-dev.3.g40eaad1c → 0.8.1-dev.31.g7b15b0d3
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 +71 -0
- package/README.md +19 -17
- package/dist/components/card/card.d.ts +15 -1
- package/dist/components/field/field.d.ts +5 -2
- package/dist/components/slider/slider.d.ts +11 -1
- package/dist/components/typo/typo.d.ts +20 -11
- package/dist/index.js +1374 -1340
- package/dist/integrations/frame-selection/frame-selection-view.d.ts +24 -0
- package/dist/integrations/frame-selection/frame-selection.d.ts +21 -0
- package/dist/integrations/frame-selection/frame-selection.meta.d.ts +2 -0
- package/dist/integrations/frame-selection/index.d.ts +2 -0
- package/dist/integrations/frame-selection.js +121 -0
- package/dist/integrations/image-display-options.js +71 -70
- package/dist/llms/evals/runner/config.d.ts +1 -0
- package/dist/separator-BAxxttef.js +26 -0
- package/dist/slider-gyIYWSy3.js +116 -0
- package/dist/style.css +1 -1
- package/dist/tabs-9d4oaDwZ.js +295 -0
- package/dist/utils/status-glyphs.d.ts +4 -0
- package/dist/vite.js +1 -1
- package/dist/web-ui-cli.js +1 -1
- package/docs/user-guide/AgentTooling.mdx +8 -3
- package/package.json +4 -4
- package/src/docgen/doc.gen.json +149 -2
- package/src/llms/llms.gen.txt +8 -2
- package/src/llms/skills/imf-web-ui/SKILL.md +2 -0
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +5 -3
- package/src/llms/skills/imf-web-ui-components/SKILL.md +3 -1
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +2 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +5 -3
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +14 -0
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +2 -0
- package/src/llms/skills/imf-web-ui-update/SKILL.md +37 -6
- package/src/llms/skills/imf-web-ui-user-profile/SKILL.md +95 -0
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +2 -0
- package/src/llms/tokens.gen.json +3 -3
- package/dist/tabs-BS6rqrrA.js +0 -398
- /package/dist/{paths-Oi0v8x-w.js → paths-CUyf9wjm.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: imf-web-ui-audit
|
|
3
3
|
description:
|
|
4
|
-
"Audit an existing ImFusion frontend against the @imfusion/web-ui conventions without changing files. Use this for
|
|
5
|
-
project health check, a pre-setup review, or one named topic. Report broken and missing pieces, working deviations,
|
|
4
|
+
"Audit an existing ImFusion frontend against the @imfusion/web-ui conventions without changing project files. Use this for
|
|
5
|
+
a project health check, a pre-setup review, or one named topic. Report broken and missing pieces, working deviations,
|
|
6
6
|
evidence, and an ordered plan."
|
|
7
7
|
argument-hint: "[full|<topic>]"
|
|
8
|
-
allowed-tools: Read Glob Grep
|
|
8
|
+
allowed-tools: Read Glob Grep Skill
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Audit a consumer project
|
|
@@ -21,6 +21,8 @@ it low, and do not let it crowd the sections a consumer has to act on.
|
|
|
21
21
|
|
|
22
22
|
## Workflow
|
|
23
23
|
|
|
24
|
+
Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
|
|
25
|
+
|
|
24
26
|
1. Resolve the argument. Bare means `full`; an unknown topic is an error, not a reason to widen the scope.
|
|
25
27
|
2. Enter plan mode unless this audit is being called as verification by another skill or the host has no plan mode.
|
|
26
28
|
3. Read the report template and existing reviewer notes, then dispatch one investigator per in-scope topic. Tell each
|
|
@@ -4,13 +4,15 @@ description:
|
|
|
4
4
|
"Look up @imfusion/web-ui component APIs, compound parts, defaults, and icon glyphs without reading source. Use this
|
|
5
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
6
|
use it to choose between components or bootstrap a project."
|
|
7
|
-
allowed-tools: Bash
|
|
7
|
+
allowed-tools: Bash Skill
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Look up components
|
|
11
11
|
|
|
12
12
|
Use the generated package indexes. They are smaller and more reliable than reading the library source.
|
|
13
13
|
|
|
14
|
+
Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
|
|
15
|
+
|
|
14
16
|
## Component lookup
|
|
15
17
|
|
|
16
18
|
1. Read the identity index first, even when you already know the component's name: it gives the docgen key and the status.
|
|
@@ -19,7 +19,8 @@ Use one server-backed current-user query as the identity source:
|
|
|
19
19
|
|
|
20
20
|
- Put it in `api/auth/queries.ts` and define its key and schema with the [data.md](data.md) pattern.
|
|
21
21
|
- Expose query options as `context.api.auth.getUser()`.
|
|
22
|
-
- Call `
|
|
22
|
+
- Call `queryClient.query({ ...options, staleTime: "static" })` in a loader (see [data.md](data.md)) or a query hook in a
|
|
23
|
+
component.
|
|
23
24
|
- Keep credentials and access tokens out of React state.
|
|
24
25
|
- Do not infer authentication from local storage, decoded tokens, route flags, or permission-gated UI.
|
|
25
26
|
|
|
@@ -85,9 +85,11 @@ export function getDetails(options?: QueryOptions<User>) {
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Callers choose `
|
|
89
|
-
`
|
|
90
|
-
|
|
88
|
+
Callers choose `queryClient.query`, `useSuspenseQuery`, or another Query API. A router loader reads the cache with
|
|
89
|
+
`queryClient.query({ ...options, staleTime: "static" })`, not the deprecated `ensureQueryData` or `fetchQuery`. Keep
|
|
90
|
+
`"static"`: without it the factory's `staleTime` applies (default 0), so every loader run waits on the network and the page's
|
|
91
|
+
`useQuery` refetches on mount. Mutation factories likewise return `mutationOptions`, own their mutation key and parsing, and
|
|
92
|
+
are passed to `useMutation`; do not inline those options at the call site.
|
|
91
93
|
|
|
92
94
|
## Router context access
|
|
93
95
|
|
|
@@ -7,6 +7,8 @@ Use native CSS and Web UI's public seams. The library's CSS Modules and token na
|
|
|
7
7
|
- Use CSS Modules with native nesting. Do not add Sass, CSS-in-JS, or a utility-class framework for ordinary component
|
|
8
8
|
styles.
|
|
9
9
|
- Nest states, pseudo-elements, and child selectors under the root.
|
|
10
|
+
- Write declarations before nested rules; browsers before Chrome 130, Firefox 132, and Safari 18 move later ones above them.
|
|
11
|
+
- Do not nest under a selector list whose selectors differ in specificity. The nested rule takes the highest one.
|
|
10
12
|
- Lift repeated values into custom properties, especially when a state or variant changes several descendants.
|
|
11
13
|
- Keep structurally different rules explicit; not every repeated value needs an abstraction.
|
|
12
14
|
|
|
@@ -85,8 +87,8 @@ Foreground roles are for text, icons, borders, and focus rings. Background roles
|
|
|
85
87
|
|
|
86
88
|
## Browser floor
|
|
87
89
|
|
|
88
|
-
The library targets Safari
|
|
89
|
-
guarded fallback for older Safari:
|
|
90
|
+
The library targets Safari 17.5, Chrome 123, and Firefox 120 or newer, the first versions with native `light-dark()`.
|
|
91
|
+
`color-mix(in oklch, …)` is available at that floor. Relative color syntax needs a guarded fallback for older Safari:
|
|
90
92
|
|
|
91
93
|
```css
|
|
92
94
|
.subtle {
|
|
@@ -30,6 +30,20 @@ input. Use `toSorted` and `toReversed` instead of their mutating counterparts.
|
|
|
30
30
|
A loop is fine when it has a real early exit or measured hot-path benefit. A long chain or a `reduce` with several jobs wants
|
|
31
31
|
named intermediate values.
|
|
32
32
|
|
|
33
|
+
## Functions
|
|
34
|
+
|
|
35
|
+
Declare a named function with `function`, including a local helper inside a component. A callback passed inline as a prop or
|
|
36
|
+
argument stays an arrow.
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
function resetCaptcha() {
|
|
40
|
+
captcha.current?.reset();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
<Button onClick={() => setOpen(true)}>Open</Button>;
|
|
44
|
+
items.map(item => item.id);
|
|
45
|
+
```
|
|
46
|
+
|
|
33
47
|
## Naming
|
|
34
48
|
|
|
35
49
|
Name what a value is, not how it is built. Booleans read as assertions (`isOpen`, `hasAccess`, `canSubmit`). Props use `onX`;
|
|
@@ -15,6 +15,8 @@ working choices.
|
|
|
15
15
|
|
|
16
16
|
## Workflow
|
|
17
17
|
|
|
18
|
+
Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
|
|
19
|
+
|
|
18
20
|
1. Resolve the scope. A named topic limits the assessment to that topic. A bare invocation means `full`, unless the request
|
|
19
21
|
is about one topic, in which case that topic is the scope: answer what was asked and offer the wider sweep rather than
|
|
20
22
|
running it. If the argument is unknown, list the supported topics and point to `imf-web-ui-audit`.
|
|
@@ -5,7 +5,7 @@ description:
|
|
|
5
5
|
lifecycle hooks. Refresh the base first, verify it, then audit any consumer migration separately. Preserve user work and
|
|
6
6
|
get approval before each commit."
|
|
7
7
|
argument-hint: "[--dry-run] [optional version or reason]"
|
|
8
|
-
allowed-tools: Bash Read Grep
|
|
8
|
+
allowed-tools: Bash Read Grep Skill
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Update Web UI
|
|
@@ -13,6 +13,22 @@ allowed-tools: Bash Read Grep
|
|
|
13
13
|
This workflow has two possible commits: the package/tooling update, then an optional consumer migration. Keep them separate.
|
|
14
14
|
Never overwrite user changes or commit without fresh approval.
|
|
15
15
|
|
|
16
|
+
## Before you start
|
|
17
|
+
|
|
18
|
+
Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
|
|
19
|
+
|
|
20
|
+
Open with a short orientation, before any command runs, so the person knows the route and when they will be asked:
|
|
21
|
+
|
|
22
|
+
1. **Preflight**: check the project and stop on uncommitted work.
|
|
23
|
+
2. **Base update**: install the new package, refresh the skills and hooks, verify, then ask to commit.
|
|
24
|
+
3. **Migration check**: read what the new releases changed and report what this project needs; changes and their separate
|
|
25
|
+
commit wait for approval.
|
|
26
|
+
4. **Full audit**: offer `imf-web-ui-audit full`, a read-only check of the whole project against the conventions, wider than
|
|
27
|
+
what this release changed.
|
|
28
|
+
|
|
29
|
+
Name the decision points up front: `latest` or `dev` when the installed version is a prerelease, the base commit, the
|
|
30
|
+
migration commit, and the audit offer. With `--dry-run`, say the run stops after preflight and changes nothing.
|
|
31
|
+
|
|
16
32
|
## Preflight
|
|
17
33
|
|
|
18
34
|
1. Work from the frontend package root. In a monorepo, find the package that owns the Web UI dependency.
|
|
@@ -20,9 +36,22 @@ Never overwrite user changes or commit without fresh approval.
|
|
|
20
36
|
if another lockfile is the active one.
|
|
21
37
|
3. Record `git status --short`, the installed Web UI version, the installed skill harness(es), hooks, registrations, and
|
|
22
38
|
`AGENTS.md` fence.
|
|
23
|
-
4. Check for another npm process and stop on a conflict
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
4. Check for another npm process in this package and stop on a conflict:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
pgrep npm # process IDs only
|
|
43
|
+
lsof -a -d cwd -p <pid> -Fn # the folder a process runs in
|
|
44
|
+
ps -o args= -p <pid> # its command, only when that folder is this package
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
A running install, update, or `ci` in this package is a conflict; a long-running `npm exec` server is not. Full process
|
|
48
|
+
listings such as `pgrep -fl` or `ps aux` print every program's arguments, secrets included, so keep them out of the
|
|
49
|
+
transcript.
|
|
50
|
+
|
|
51
|
+
Uncommitted work is also a conflict: report it and stop before the first mutating command, even if it looks unrelated to
|
|
52
|
+
this workflow: what the update touches is only known once it runs, and the person can commit, stash, or wave it through in
|
|
53
|
+
one reply. Never reset, clean, restore, or hide it.
|
|
54
|
+
|
|
26
55
|
5. With `--dry-run`, stop after reporting what would happen. Do not install, format, stage, commit, or ask for commit
|
|
27
56
|
approval.
|
|
28
57
|
|
|
@@ -87,12 +116,13 @@ Update files : <paths>
|
|
|
87
116
|
Held back : <paths or none>
|
|
88
117
|
Conflicts : <paths or none>
|
|
89
118
|
Commit : <message or not proposed>
|
|
119
|
+
Next : migration check, then the optional full audit
|
|
90
120
|
```
|
|
91
121
|
|
|
92
122
|
Ask: **Approve these update-owned changes and commit them?** Stage only approved update paths and follow the repository's
|
|
93
123
|
commit workflow.
|
|
94
124
|
|
|
95
|
-
##
|
|
125
|
+
## Check the consumer migration
|
|
96
126
|
|
|
97
127
|
Start this phase only after the base update commit exists. Read `node_modules/@imfusion/web-ui/CHANGELOG.md`: every release
|
|
98
128
|
section after the pre-update version, up to and including the new one. Each section's highlights, migration guide, and
|
|
@@ -119,7 +149,8 @@ releases read, then report separately:
|
|
|
119
149
|
Do not infer a replacement from a name. Inspect the implementation, styles, and call sites. If there are no findings, say so
|
|
120
150
|
and do not make an empty migration commit.
|
|
121
151
|
|
|
122
|
-
|
|
152
|
+
Offer `imf-web-ui-audit full` as the next step: the migration check covered what the releases changed, the audit checks the
|
|
153
|
+
whole project against the conventions and changes nothing. Run it only after an explicit yes.
|
|
123
154
|
|
|
124
155
|
For approved migration work, ask: **Approve these consumer migration changes and commit them separately?** Then stage only
|
|
125
156
|
the approved paths, verify again, and use a separate imperative commit message.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: imf-web-ui-user-profile
|
|
3
|
+
description:
|
|
4
|
+
"Read or create the person's profile: technical background, experience, how they want things explained, and how they like
|
|
5
|
+
to work. Invoke it first in every Web UI skill, and when the person asks to change their profile or how the agent explains
|
|
6
|
+
or paces work."
|
|
7
|
+
user-invocable: false
|
|
8
|
+
allowed-tools: Bash Read Write
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Fit the work to the person
|
|
12
|
+
|
|
13
|
+
The profile records who the person is and how they learn, so every Web UI workflow explains what they need and paces the work
|
|
14
|
+
the way they like. Read it once per session; later skills in the same session reuse what is already loaded.
|
|
15
|
+
|
|
16
|
+
## Read the profile
|
|
17
|
+
|
|
18
|
+
Resolve the profile path with the shell, then read that exact path:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
printf '%s\n' "${XDG_CONFIG_HOME:-$HOME/.config}/imfusion/web-ui/consumer-profile.md"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The profile sits outside the project: it belongs to the person, never to the repository, so read-only promises such as the
|
|
25
|
+
audit's still hold when this skill writes it.
|
|
26
|
+
|
|
27
|
+
When the file exists, apply it and return to the calling workflow without comment. When it is missing, run the interview
|
|
28
|
+
before the workflow starts. When the router skips companions for a small task, do the task first and offer the interview
|
|
29
|
+
afterwards.
|
|
30
|
+
|
|
31
|
+
## Interview
|
|
32
|
+
|
|
33
|
+
Open with one question: may you ask six short questions and save the answers to the profile path, so every later workflow
|
|
34
|
+
fits them and they are never asked again? Mention that they can decline any single question. On no, use the defaults below
|
|
35
|
+
for this session and do not offer the interview again in it.
|
|
36
|
+
|
|
37
|
+
On yes, ask one question per message, in plain prose, and wait for each answer:
|
|
38
|
+
|
|
39
|
+
1. What is your name?
|
|
40
|
+
2. What is your technical background: the languages and tools you work with?
|
|
41
|
+
3. How much have you built for the web, for example with React, HTML, and CSS?
|
|
42
|
+
4. Beyond Git, how comfortable are you with npm and the terminal?
|
|
43
|
+
5. How much explanation do you want: just the results, a short gloss for new terms, or the reasoning behind each step?
|
|
44
|
+
6. How do you like to work: pause after every step, pause after each finished piece, or work freely and stop only before a
|
|
45
|
+
commit?
|
|
46
|
+
|
|
47
|
+
Derive the levels from the answers; ask a short follow-up only when an answer fits no level. The person can decline any
|
|
48
|
+
question: its field stays out of the file, and its default applies: `some`, `comfortable`, `terms`, `slice`.
|
|
49
|
+
|
|
50
|
+
## The file
|
|
51
|
+
|
|
52
|
+
Show the profile below before writing it. The person can correct or remove any line, or reject the whole profile; on a
|
|
53
|
+
rejection, save nothing and use the defaults for this session. After they confirm, write it and name its path so they can
|
|
54
|
+
edit or delete it later:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
---
|
|
58
|
+
name: <their name>
|
|
59
|
+
frontend: none | some | seasoned
|
|
60
|
+
tooling: new | comfortable
|
|
61
|
+
explanation: results | terms | reasoning
|
|
62
|
+
pace: step | slice | commit
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Background
|
|
66
|
+
|
|
67
|
+
<their answer to question 2, in their words>
|
|
68
|
+
|
|
69
|
+
## Notes
|
|
70
|
+
|
|
71
|
+
- <lasting preferences learned later>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
When the write fails, keep the answers for this session. When the person later states a lasting preference about how to work
|
|
75
|
+
with them, such as a language, a term they want avoided, or a tool they already know, add it under `Notes` and tell them.
|
|
76
|
+
When they ask to change their profile, run the interview again with the current answers as defaults.
|
|
77
|
+
|
|
78
|
+
## Apply the profile
|
|
79
|
+
|
|
80
|
+
The fields apply independently.
|
|
81
|
+
|
|
82
|
+
- **Name**: address the person by name.
|
|
83
|
+
- **Background**: explain by analogy to what they already know, such as a component compared to a class for a Java developer.
|
|
84
|
+
- **Frontend `none` or `some`**: give a one-line gloss the first time a frontend term appears, such as component, prop,
|
|
85
|
+
design token, CSS layer, or Storybook. For `none`, also say what a finding means for the running app.
|
|
86
|
+
- **Tooling `new`**: gloss tooling terms on first use, such as lockfile, dist-tag, prerelease, hook, harness, or the
|
|
87
|
+
`AGENTS.md` fence; say in one plain sentence what each command does before it runs, read-only checks included; and before
|
|
88
|
+
an approval question, say what yes changes and how to undo it.
|
|
89
|
+
- **Explanation**: `results` adds nothing beyond what the experience levels call for; `terms` glosses every new term;
|
|
90
|
+
`reasoning` also says why each step happens, and after a report block, what happened and what comes next.
|
|
91
|
+
- **Pace**: `step` ends the reply after each step or phase of the calling workflow and waits for a go-ahead; `slice` pauses
|
|
92
|
+
after each working piece; `commit` runs freely between the workflow's own approval points.
|
|
93
|
+
|
|
94
|
+
Pace adds pauses on top of the calling workflow's approval gates and keeps every one of them. Put explanations around report
|
|
95
|
+
blocks and approval questions, never inside them.
|
|
@@ -10,6 +10,8 @@ description:
|
|
|
10
10
|
Use this skill for screen-level decisions. Verify component APIs with `imf-web-ui-components`; put code and styling rules in
|
|
11
11
|
`imf-web-ui-conventions`.
|
|
12
12
|
|
|
13
|
+
Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
|
|
14
|
+
|
|
13
15
|
The identity index marks components as stable or experimental. Experimental components are usable, but prefer wrapping one
|
|
14
16
|
when it is used across many call sites so API movement stays local.
|
|
15
17
|
|
package/src/llms/tokens.gen.json
CHANGED
|
@@ -681,11 +681,11 @@
|
|
|
681
681
|
},
|
|
682
682
|
{
|
|
683
683
|
"name": "--imf-ui-font-weight-medium",
|
|
684
|
-
"value": "
|
|
684
|
+
"value": "400"
|
|
685
685
|
},
|
|
686
686
|
{
|
|
687
687
|
"name": "--imf-ui-font-weight-regular",
|
|
688
|
-
"value": "
|
|
688
|
+
"value": "300"
|
|
689
689
|
},
|
|
690
690
|
{
|
|
691
691
|
"name": "--imf-ui-font-weight-strong",
|
|
@@ -715,7 +715,7 @@
|
|
|
715
715
|
},
|
|
716
716
|
{
|
|
717
717
|
"name": "--imf-ui-inner-shadow-highlight",
|
|
718
|
-
"value": "inset calc(-0.5px * var(--imf-ui-shadow-x)) calc(-0.5px * var(--imf-ui-shadow-y)) 0 0 #fff, inset calc( 0.5px * var(--imf-ui-shadow-x)) calc( 0.5px * var(--imf-ui-shadow-y)) 0 0 #0001"
|
|
718
|
+
"value": "inset calc(-0.5px * var(--imf-ui-shadow-x)) calc(-0.5px * var(--imf-ui-shadow-y)) 0 0 light-dark(#fff, #fff1), inset calc( 0.5px * var(--imf-ui-shadow-x)) calc( 0.5px * var(--imf-ui-shadow-y)) 0 0 light-dark(#0001, #0007)"
|
|
719
719
|
},
|
|
720
720
|
{
|
|
721
721
|
"name": "--imf-ui-inner-shadow-tint",
|