@imfusion/web-ui 0.5.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/README.md +60 -0
- package/bin/install-skill.js +180 -0
- package/dist/assets/vendors/base-ui.d.ts +8 -0
- package/dist/breakpoints/index.d.ts +3 -0
- package/dist/breakpoints/min-width.d.ts +9 -0
- package/dist/breakpoints/registry.d.ts +19 -0
- package/dist/code-qBbqAHK-.js +190 -0
- package/dist/codegen/gen-breakpoints-css.d.ts +6 -0
- package/dist/codegen/gen-css-types.d.ts +1 -0
- package/dist/codegen/gen-token-css.d.ts +6 -0
- package/dist/codegen/run.d.ts +1 -0
- package/dist/components/app-shell/app-shell.d.ts +66 -0
- package/dist/components/app-shell/app-shell.meta.d.ts +2 -0
- package/dist/components/app-shell/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +30 -0
- package/dist/components/button/button.meta.d.ts +2 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/callout/callout.d.ts +42 -0
- package/dist/components/callout/callout.meta.d.ts +2 -0
- package/dist/components/callout/index.d.ts +2 -0
- package/dist/components/card/card.d.ts +64 -0
- package/dist/components/card/card.meta.d.ts +2 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +56 -0
- package/dist/components/checkbox/checkbox.meta.d.ts +2 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/chip/chip.cva.d.ts +12 -0
- package/dist/components/chip/chip.d.ts +11 -0
- package/dist/components/chip/chip.meta.d.ts +2 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip-link/chip-link.d.ts +17 -0
- package/dist/components/chip-link/chip-link.meta.d.ts +2 -0
- package/dist/components/chip-link/index.d.ts +2 -0
- package/dist/components/code/code.d.ts +60 -0
- package/dist/components/code/code.meta.d.ts +2 -0
- package/dist/components/code/index.d.ts +2 -0
- package/dist/components/collapsible/collapsible.d.ts +57 -0
- package/dist/components/collapsible/collapsible.meta.d.ts +2 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/copy-button/copy-button.d.ts +21 -0
- package/dist/components/copy-button/copy-button.meta.d.ts +2 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/drawer/drawer.d.ts +191 -0
- package/dist/components/drawer/drawer.meta.d.ts +2 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.d.ts +25 -0
- package/dist/components/input/input.meta.d.ts +2 -0
- package/dist/components/logo/imfusion/imfusion.d.ts +16 -0
- package/dist/components/logo/imfusion/index.d.ts +1 -0
- package/dist/components/logo/index.d.ts +3 -0
- package/dist/components/logo/logo.d.ts +15 -0
- package/dist/components/logo/logo.meta.d.ts +2 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +20 -0
- package/dist/components/navigation-menu/navigation-menu.meta.d.ts +2 -0
- package/dist/components/navigation-menu/subs/flyout-link.d.ts +24 -0
- package/dist/components/navigation-menu/subs/inline-submenu.d.ts +41 -0
- package/dist/components/navigation-menu/subs/link.d.ts +64 -0
- package/dist/components/navigation-menu/subs/overlay.d.ts +75 -0
- package/dist/components/navigation-menu/subs/shared.d.ts +20 -0
- package/dist/components/navigation-menu/subs/structure.d.ts +64 -0
- package/dist/components/navigation-menu/subs/trigger.d.ts +47 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +181 -0
- package/dist/components/popover/popover.meta.d.ts +2 -0
- package/dist/components/row/index.d.ts +2 -0
- package/dist/components/row/row.d.ts +28 -0
- package/dist/components/row/row.meta.d.ts +2 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +278 -0
- package/dist/components/select/select.meta.d.ts +2 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +15 -0
- package/dist/components/separator/separator.meta.d.ts +2 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/slider.d.ts +111 -0
- package/dist/components/slider/slider.meta.d.ts +2 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/spinner.d.ts +19 -0
- package/dist/components/spinner/spinner.geometry.d.ts +37 -0
- package/dist/components/spinner/spinner.meta.d.ts +2 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/stack.d.ts +18 -0
- package/dist/components/stack/stack.meta.d.ts +2 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +45 -0
- package/dist/components/switch/switch.meta.d.ts +2 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/table.d.ts +66 -0
- package/dist/components/table/table.meta.d.ts +2 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +91 -0
- package/dist/components/tabs/tabs.meta.d.ts +2 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle.d.ts +31 -0
- package/dist/components/toggle/toggle.meta.d.ts +2 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/toggle-group.d.ts +30 -0
- package/dist/components/toggle-group/toggle-group.meta.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +164 -0
- package/dist/components/tooltip/tooltip.meta.d.ts +2 -0
- package/dist/components/typo/index.d.ts +2 -0
- package/dist/components/typo/typo.d.ts +100 -0
- package/dist/components/typo/typo.meta.d.ts +2 -0
- package/dist/config.d.ts +8 -0
- package/dist/docgen/gen-docgen.d.ts +1 -0
- package/dist/docgen/gen-docgen.utils.d.ts +13 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/use-clipboard.d.ts +12 -0
- package/dist/hooks/use-color-scheme.d.ts +31 -0
- package/dist/hooks/use-media-query.d.ts +13 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +13103 -0
- package/dist/integrations/code-highlight/code-highlight.d.ts +21 -0
- package/dist/integrations/code-highlight/code-highlight.meta.d.ts +2 -0
- package/dist/integrations/code-highlight/highlighter.d.ts +6 -0
- package/dist/integrations/code-highlight/index.d.ts +3 -0
- package/dist/integrations/code-highlight.js +97 -0
- package/dist/integrations/image-display-options/image-display-options-view.d.ts +22 -0
- package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +40 -0
- package/dist/integrations/image-display-options/image-display-options.d.ts +29 -0
- package/dist/integrations/image-display-options/image-display-options.meta.d.ts +2 -0
- package/dist/integrations/image-display-options/index.d.ts +2 -0
- package/dist/integrations/image-display-options.js +319 -0
- package/dist/llms/gen-llms.d.ts +1 -0
- package/dist/meta-B8C51eyL.js +74 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/web-ui-provider.d.ts +6 -0
- package/dist/style.css +2 -0
- package/dist/tabs-DqBFSqq6.js +3789 -0
- package/dist/tokens/apply.d.ts +55 -0
- package/dist/tokens/control-registry.d.ts +10 -0
- package/dist/tokens/token-registry.d.ts +13 -0
- package/dist/tokens/types.d.ts +71 -0
- package/dist/tokens/use-token-controls.d.ts +36 -0
- package/dist/types/docgen.d.ts +17 -0
- package/dist/types/meta.d.ts +108 -0
- package/dist/types/theme.d.ts +3 -0
- package/package.json +139 -0
- package/src/docgen/doc.gen.json +4695 -0
- package/src/llms/llms.gen.txt +176 -0
- package/src/llms/skills/imf-web-ui/SKILL.md +46 -0
- package/src/llms/skills/imf-web-ui-components/SKILL.md +100 -0
- package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +67 -0
- package/src/llms/skills/imf-web-ui-frontend-patterns/references/react-patterns.md +94 -0
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +30 -0
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +103 -0
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +48 -0
- package/src/llms/skills/imf-web-ui-ux/references/usability-heuristics.md +29 -0
- package/src/llms/skills/imf-web-ui-ux/references/visual-design.md +38 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Form UX
|
|
2
|
+
|
|
3
|
+
The 80/20 of forms, distilled from NN/g's form-design and error-guidelines articles
|
|
4
|
+
([form design](https://www.nngroup.com/articles/web-form-design/),
|
|
5
|
+
[errors](https://www.nngroup.com/articles/errors-forms-design-guidelines/)). Forms are where inexperienced UI work loses the
|
|
6
|
+
most users — a cited CHI study found guideline-compliant forms hit 78% one-try error-free submission vs. 42% for
|
|
7
|
+
non-compliant ones. Read before building any form beyond two fields.
|
|
8
|
+
|
|
9
|
+
The library ships the controls (`Input`, `Select`, `Checkbox`, `Switch`, `Slider`) but no form or field wrapper — labels,
|
|
10
|
+
grouping, and validation display are composed by you, which is exactly where these rules apply.
|
|
11
|
+
|
|
12
|
+
## Structure
|
|
13
|
+
|
|
14
|
+
- **Cut every cuttable field.** Each field that can be derived, deferred, or omitted costs completions. Optional fields:
|
|
15
|
+
first try to eliminate them; keep at most 1–2 and mark _them_ explicitly with "(optional)" — don't asterisk the required
|
|
16
|
+
majority.
|
|
17
|
+
- **Single column.** Multiple columns break the vertical momentum of filling a form. The one exception: short, logically
|
|
18
|
+
inseparable fields (city / postal code) may share a `Row`.
|
|
19
|
+
- **Group by topic.** Related fields sit tight in a `Stack`; groups separate with larger whitespace (proximity is grouping —
|
|
20
|
+
see [visual-design.md](visual-design.md)). Keep groups accessible: a labeled `fieldset` or heading per group.
|
|
21
|
+
- **Match field size to expected input.** A two-letter field shouldn't be full-width; a free-text reason shouldn't be one
|
|
22
|
+
line.
|
|
23
|
+
|
|
24
|
+
## Labels
|
|
25
|
+
|
|
26
|
+
- **Real `<label>` elements, outside the field, close to it.** Above the field is the default (works on mobile, scans fast).
|
|
27
|
+
- **Never placeholder text as the label.** It vanishes on input, so users can't review what a filled field means or check
|
|
28
|
+
errors. Persistent hints (format examples) go outside the field, stated _before_ the user types, not revealed by the error
|
|
29
|
+
afterward.
|
|
30
|
+
|
|
31
|
+
## Validation and errors
|
|
32
|
+
|
|
33
|
+
- **Validate when the user finishes a field, not while typing.** Premature validation — flagging a field as wrong while it's
|
|
34
|
+
still being filled — reads as hostile. Live feedback is only for cases where it genuinely helps as the user types (e.g. a
|
|
35
|
+
password-requirements checklist).
|
|
36
|
+
- **Errors sit next to the offending field**, with multiple cues — outline plus message, never color alone. Never rely solely
|
|
37
|
+
on a summary at the top of the form.
|
|
38
|
+
- **Error text is precise, human, and constructive**: what's wrong, and what to do — "Date must be in the future", not
|
|
39
|
+
"Invalid input". A form-level failure (server rejected) gets a `Callout` above the actions; field-level problems stay at
|
|
40
|
+
their fields.
|
|
41
|
+
- **Preserve the user's input.** An error never empties the field, and there is no Reset/Clear button — its main use is being
|
|
42
|
+
clicked by accident.
|
|
43
|
+
|
|
44
|
+
## Submission
|
|
45
|
+
|
|
46
|
+
- One primary submit `Button`, labeled with the action's outcome ("Create project", not "Submit"). While submitting: the
|
|
47
|
+
button shows progress and the form stays visible — on failure the user must see their input plus the error, not a blank
|
|
48
|
+
form (see also heuristic 9 in [usability-heuristics.md](usability-heuristics.md)).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Usability heuristics, applied
|
|
2
|
+
|
|
3
|
+
Nielsen's ten usability heuristics ([source](https://www.nngroup.com/articles/ten-usability-heuristics/)) are the highest
|
|
4
|
+
80/20 leverage in interaction design — most usability problems in a screen violate one of these. Walk them as a checklist
|
|
5
|
+
when reviewing or reworking a flow. Each entry: the rule, then what it means in a web-ui app.
|
|
6
|
+
|
|
7
|
+
1. **Visibility of system status** — always show what's happening via timely feedback. In practice: every async action gets a
|
|
8
|
+
`Spinner` or disabled-with-progress state; every mutation confirms visibly near its trigger; never leave a button that
|
|
9
|
+
"did nothing" for two seconds.
|
|
10
|
+
2. **Match the system to the real world** — use the users' words, not internal jargon; order information the way the domain
|
|
11
|
+
thinks. Label buttons and `Table` columns in the vocabulary of the people from the interview, not the API's field names.
|
|
12
|
+
3. **User control and freedom** — clearly marked exits. Every `Drawer` and `Popover` is dismissable (Esc, backdrop, visible
|
|
13
|
+
close); destructive actions get an undo or a confirm step — never both missing.
|
|
14
|
+
4. **Consistency and standards** — the same action looks the same everywhere; users' expectations come from every other
|
|
15
|
+
product they use (Jakob's Law). Using the library's components with their default semantics _is_ this heuristic; a second
|
|
16
|
+
hand-rolled pattern for something a component already does is a violation.
|
|
17
|
+
5. **Error prevention** — constraints and good defaults beat good error messages. Prefer `Select` over free text when options
|
|
18
|
+
are known; disable invalid actions instead of explaining them after the click; confirm before irreversible commitment.
|
|
19
|
+
6. **Recognition rather than recall** — keep options and context visible; don't force users to remember values across
|
|
20
|
+
screens. If step 2 needs a value from step 1, show it; that's what `Collapsible` summaries and persistent `Chip` labels
|
|
21
|
+
are for.
|
|
22
|
+
7. **Flexibility and efficiency of use** — accelerators for experts that novices never see. The interview's power-user answer
|
|
23
|
+
decides this: daily-use screens earn keyboard shortcuts and dense `Table` defaults.
|
|
24
|
+
8. **Aesthetic and minimalist design** — every extra element competes with the relevant ones. If a screen element doesn't
|
|
25
|
+
serve the primary action or the data, cut it — this is the design-side twin of "compose, don't configure."
|
|
26
|
+
9. **Help users recognize, diagnose, and recover from errors** — plain-language messages that state the problem precisely and
|
|
27
|
+
suggest the fix, in a `Callout` next to where it went wrong. "Something went wrong" is a violation, not a message.
|
|
28
|
+
10. **Help and documentation** — best if unneeded; when needed, contextual and task-focused. Prefer a one-line hint near the
|
|
29
|
+
control (not a `Tooltip` hiding essential information) over a help page.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Visual design fundamentals
|
|
2
|
+
|
|
3
|
+
The 80/20 of making a functionally complete screen _look right_, distilled from NN/g's visual-hierarchy and Gestalt articles
|
|
4
|
+
([hierarchy](https://www.nngroup.com/articles/visual-hierarchy-ux-definition/),
|
|
5
|
+
[proximity](https://www.nngroup.com/articles/gestalt-proximity/),
|
|
6
|
+
[similarity](https://www.nngroup.com/articles/gestalt-similarity/)). Read when a screen works but looks wrong and you can't
|
|
7
|
+
say why — the answer is almost always in here.
|
|
8
|
+
|
|
9
|
+
## Hierarchy: decide the eye's order first
|
|
10
|
+
|
|
11
|
+
Visual hierarchy means the eye consumes elements in order of intended importance. Before styling anything, write down the
|
|
12
|
+
order: what should be seen first, second, third? Then make the styling agree. If you can't rank the elements, the screen has
|
|
13
|
+
an information-architecture problem, not a styling problem — go back to the interview's "one primary action."
|
|
14
|
+
|
|
15
|
+
- **Contrast creates hierarchy, not hue.** What advances is what contrasts with its context. The primary `Button` variant is
|
|
16
|
+
the contrast peak of the screen — which is why there's only one. Reserve warm, saturated signals (red) for errors/warnings,
|
|
17
|
+
never decoration.
|
|
18
|
+
- **Scale = importance.** The most important element is the biggest; keep at most two genuinely large elements per screen.
|
|
19
|
+
- **Limit variation, or nothing stands out.** At most ~3 contrast treatments and 3 type sizes per screen. `Typo`'s role
|
|
20
|
+
levels are this rule made concrete — if you're reaching past them, you're adding a fourth size that dilutes the other
|
|
21
|
+
three.
|
|
22
|
+
|
|
23
|
+
## Grouping: proximity beats everything
|
|
24
|
+
|
|
25
|
+
- **Proximity is grouping.** Elements close together read as one unit — this overpowers color and shape cues. Tight gap
|
|
26
|
+
between a label and its control, larger gap between one group and the next. Use `Stack` gap steps for exactly this: small
|
|
27
|
+
within groups, large between them. Never equidistant spacing — it says nothing.
|
|
28
|
+
- **Common region.** A shared container (`Card`, a bordered region) makes enclosed items read as related. Powerful, and
|
|
29
|
+
clutter when overused — if `Stack` spacing already groups it, the border adds nothing.
|
|
30
|
+
- **Similarity.** Shared color/shape/size signals relatedness across distance — all `Chip`s of one meaning look the same
|
|
31
|
+
everywhere. Weaker than proximity, but it survives layout changes.
|
|
32
|
+
|
|
33
|
+
## Whitespace and the squint test
|
|
34
|
+
|
|
35
|
+
More space around an element gives it more attention — whitespace is an active tool, not leftover room. Verify with the
|
|
36
|
+
squint test: blur your eyes (or downscale a screenshot); the primary action and the screen's title should still dominate. If
|
|
37
|
+
everything blurs into one gray mass, contrast and spacing are too uniform — pick the one thing that matters and make the
|
|
38
|
+
styling say so.
|