@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.
Files changed (152) hide show
  1. package/README.md +60 -0
  2. package/bin/install-skill.js +180 -0
  3. package/dist/assets/vendors/base-ui.d.ts +8 -0
  4. package/dist/breakpoints/index.d.ts +3 -0
  5. package/dist/breakpoints/min-width.d.ts +9 -0
  6. package/dist/breakpoints/registry.d.ts +19 -0
  7. package/dist/code-qBbqAHK-.js +190 -0
  8. package/dist/codegen/gen-breakpoints-css.d.ts +6 -0
  9. package/dist/codegen/gen-css-types.d.ts +1 -0
  10. package/dist/codegen/gen-token-css.d.ts +6 -0
  11. package/dist/codegen/run.d.ts +1 -0
  12. package/dist/components/app-shell/app-shell.d.ts +66 -0
  13. package/dist/components/app-shell/app-shell.meta.d.ts +2 -0
  14. package/dist/components/app-shell/index.d.ts +2 -0
  15. package/dist/components/button/button.d.ts +30 -0
  16. package/dist/components/button/button.meta.d.ts +2 -0
  17. package/dist/components/button/index.d.ts +2 -0
  18. package/dist/components/callout/callout.d.ts +42 -0
  19. package/dist/components/callout/callout.meta.d.ts +2 -0
  20. package/dist/components/callout/index.d.ts +2 -0
  21. package/dist/components/card/card.d.ts +64 -0
  22. package/dist/components/card/card.meta.d.ts +2 -0
  23. package/dist/components/card/index.d.ts +2 -0
  24. package/dist/components/checkbox/checkbox.d.ts +56 -0
  25. package/dist/components/checkbox/checkbox.meta.d.ts +2 -0
  26. package/dist/components/checkbox/index.d.ts +2 -0
  27. package/dist/components/chip/chip.cva.d.ts +12 -0
  28. package/dist/components/chip/chip.d.ts +11 -0
  29. package/dist/components/chip/chip.meta.d.ts +2 -0
  30. package/dist/components/chip/index.d.ts +2 -0
  31. package/dist/components/chip-link/chip-link.d.ts +17 -0
  32. package/dist/components/chip-link/chip-link.meta.d.ts +2 -0
  33. package/dist/components/chip-link/index.d.ts +2 -0
  34. package/dist/components/code/code.d.ts +60 -0
  35. package/dist/components/code/code.meta.d.ts +2 -0
  36. package/dist/components/code/index.d.ts +2 -0
  37. package/dist/components/collapsible/collapsible.d.ts +57 -0
  38. package/dist/components/collapsible/collapsible.meta.d.ts +2 -0
  39. package/dist/components/collapsible/index.d.ts +2 -0
  40. package/dist/components/copy-button/copy-button.d.ts +21 -0
  41. package/dist/components/copy-button/copy-button.meta.d.ts +2 -0
  42. package/dist/components/copy-button/index.d.ts +2 -0
  43. package/dist/components/drawer/drawer.d.ts +191 -0
  44. package/dist/components/drawer/drawer.meta.d.ts +2 -0
  45. package/dist/components/drawer/index.d.ts +2 -0
  46. package/dist/components/input/index.d.ts +2 -0
  47. package/dist/components/input/input.d.ts +25 -0
  48. package/dist/components/input/input.meta.d.ts +2 -0
  49. package/dist/components/logo/imfusion/imfusion.d.ts +16 -0
  50. package/dist/components/logo/imfusion/index.d.ts +1 -0
  51. package/dist/components/logo/index.d.ts +3 -0
  52. package/dist/components/logo/logo.d.ts +15 -0
  53. package/dist/components/logo/logo.meta.d.ts +2 -0
  54. package/dist/components/navigation-menu/index.d.ts +2 -0
  55. package/dist/components/navigation-menu/navigation-menu.d.ts +20 -0
  56. package/dist/components/navigation-menu/navigation-menu.meta.d.ts +2 -0
  57. package/dist/components/navigation-menu/subs/flyout-link.d.ts +24 -0
  58. package/dist/components/navigation-menu/subs/inline-submenu.d.ts +41 -0
  59. package/dist/components/navigation-menu/subs/link.d.ts +64 -0
  60. package/dist/components/navigation-menu/subs/overlay.d.ts +75 -0
  61. package/dist/components/navigation-menu/subs/shared.d.ts +20 -0
  62. package/dist/components/navigation-menu/subs/structure.d.ts +64 -0
  63. package/dist/components/navigation-menu/subs/trigger.d.ts +47 -0
  64. package/dist/components/popover/index.d.ts +2 -0
  65. package/dist/components/popover/popover.d.ts +181 -0
  66. package/dist/components/popover/popover.meta.d.ts +2 -0
  67. package/dist/components/row/index.d.ts +2 -0
  68. package/dist/components/row/row.d.ts +28 -0
  69. package/dist/components/row/row.meta.d.ts +2 -0
  70. package/dist/components/select/index.d.ts +2 -0
  71. package/dist/components/select/select.d.ts +278 -0
  72. package/dist/components/select/select.meta.d.ts +2 -0
  73. package/dist/components/separator/index.d.ts +2 -0
  74. package/dist/components/separator/separator.d.ts +15 -0
  75. package/dist/components/separator/separator.meta.d.ts +2 -0
  76. package/dist/components/slider/index.d.ts +2 -0
  77. package/dist/components/slider/slider.d.ts +111 -0
  78. package/dist/components/slider/slider.meta.d.ts +2 -0
  79. package/dist/components/spinner/index.d.ts +2 -0
  80. package/dist/components/spinner/spinner.d.ts +19 -0
  81. package/dist/components/spinner/spinner.geometry.d.ts +37 -0
  82. package/dist/components/spinner/spinner.meta.d.ts +2 -0
  83. package/dist/components/stack/index.d.ts +2 -0
  84. package/dist/components/stack/stack.d.ts +18 -0
  85. package/dist/components/stack/stack.meta.d.ts +2 -0
  86. package/dist/components/switch/index.d.ts +2 -0
  87. package/dist/components/switch/switch.d.ts +45 -0
  88. package/dist/components/switch/switch.meta.d.ts +2 -0
  89. package/dist/components/table/index.d.ts +2 -0
  90. package/dist/components/table/table.d.ts +66 -0
  91. package/dist/components/table/table.meta.d.ts +2 -0
  92. package/dist/components/tabs/index.d.ts +2 -0
  93. package/dist/components/tabs/tabs.d.ts +91 -0
  94. package/dist/components/tabs/tabs.meta.d.ts +2 -0
  95. package/dist/components/toggle/index.d.ts +2 -0
  96. package/dist/components/toggle/toggle.d.ts +31 -0
  97. package/dist/components/toggle/toggle.meta.d.ts +2 -0
  98. package/dist/components/toggle-group/index.d.ts +2 -0
  99. package/dist/components/toggle-group/toggle-group.d.ts +30 -0
  100. package/dist/components/toggle-group/toggle-group.meta.d.ts +2 -0
  101. package/dist/components/tooltip/index.d.ts +2 -0
  102. package/dist/components/tooltip/tooltip.d.ts +164 -0
  103. package/dist/components/tooltip/tooltip.meta.d.ts +2 -0
  104. package/dist/components/typo/index.d.ts +2 -0
  105. package/dist/components/typo/typo.d.ts +100 -0
  106. package/dist/components/typo/typo.meta.d.ts +2 -0
  107. package/dist/config.d.ts +8 -0
  108. package/dist/docgen/gen-docgen.d.ts +1 -0
  109. package/dist/docgen/gen-docgen.utils.d.ts +13 -0
  110. package/dist/hooks/index.d.ts +5 -0
  111. package/dist/hooks/use-clipboard.d.ts +12 -0
  112. package/dist/hooks/use-color-scheme.d.ts +31 -0
  113. package/dist/hooks/use-media-query.d.ts +13 -0
  114. package/dist/index.d.ts +38 -0
  115. package/dist/index.js +13103 -0
  116. package/dist/integrations/code-highlight/code-highlight.d.ts +21 -0
  117. package/dist/integrations/code-highlight/code-highlight.meta.d.ts +2 -0
  118. package/dist/integrations/code-highlight/highlighter.d.ts +6 -0
  119. package/dist/integrations/code-highlight/index.d.ts +3 -0
  120. package/dist/integrations/code-highlight.js +97 -0
  121. package/dist/integrations/image-display-options/image-display-options-view.d.ts +22 -0
  122. package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +40 -0
  123. package/dist/integrations/image-display-options/image-display-options.d.ts +29 -0
  124. package/dist/integrations/image-display-options/image-display-options.meta.d.ts +2 -0
  125. package/dist/integrations/image-display-options/index.d.ts +2 -0
  126. package/dist/integrations/image-display-options.js +319 -0
  127. package/dist/llms/gen-llms.d.ts +1 -0
  128. package/dist/meta-B8C51eyL.js +74 -0
  129. package/dist/provider/index.d.ts +1 -0
  130. package/dist/provider/web-ui-provider.d.ts +6 -0
  131. package/dist/style.css +2 -0
  132. package/dist/tabs-DqBFSqq6.js +3789 -0
  133. package/dist/tokens/apply.d.ts +55 -0
  134. package/dist/tokens/control-registry.d.ts +10 -0
  135. package/dist/tokens/token-registry.d.ts +13 -0
  136. package/dist/tokens/types.d.ts +71 -0
  137. package/dist/tokens/use-token-controls.d.ts +36 -0
  138. package/dist/types/docgen.d.ts +17 -0
  139. package/dist/types/meta.d.ts +108 -0
  140. package/dist/types/theme.d.ts +3 -0
  141. package/package.json +139 -0
  142. package/src/docgen/doc.gen.json +4695 -0
  143. package/src/llms/llms.gen.txt +176 -0
  144. package/src/llms/skills/imf-web-ui/SKILL.md +46 -0
  145. package/src/llms/skills/imf-web-ui-components/SKILL.md +100 -0
  146. package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +67 -0
  147. package/src/llms/skills/imf-web-ui-frontend-patterns/references/react-patterns.md +94 -0
  148. package/src/llms/skills/imf-web-ui-setup/SKILL.md +30 -0
  149. package/src/llms/skills/imf-web-ui-ux/SKILL.md +103 -0
  150. package/src/llms/skills/imf-web-ui-ux/references/forms.md +48 -0
  151. package/src/llms/skills/imf-web-ui-ux/references/usability-heuristics.md +29 -0
  152. 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.