@flowstack-ui/agent-tools 0.1.0-bootstrap.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/.codex-plugin/plugin.json +37 -0
- package/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/docs/architecture.md +77 -0
- package/docs/releasing.md +26 -0
- package/docs/testing.md +32 -0
- package/package.json +63 -0
- package/public/index.json +2073 -0
- package/public/llms.txt +19 -0
- package/public/packages/atom/0.24.0/components/accordion.txt +131 -0
- package/public/packages/atom/0.24.0/components/alert-dialog.txt +112 -0
- package/public/packages/atom/0.24.0/components/app-bar.txt +96 -0
- package/public/packages/atom/0.24.0/components/aspect-ratio.txt +111 -0
- package/public/packages/atom/0.24.0/components/avatar.txt +119 -0
- package/public/packages/atom/0.24.0/components/badge.txt +123 -0
- package/public/packages/atom/0.24.0/components/bottom-navigation.txt +96 -0
- package/public/packages/atom/0.24.0/components/breadcrumb.txt +96 -0
- package/public/packages/atom/0.24.0/components/button.txt +98 -0
- package/public/packages/atom/0.24.0/components/carousel.txt +128 -0
- package/public/packages/atom/0.24.0/components/checkbox-group.txt +118 -0
- package/public/packages/atom/0.24.0/components/checkbox.txt +100 -0
- package/public/packages/atom/0.24.0/components/clipboard.txt +112 -0
- package/public/packages/atom/0.24.0/components/collapsible.txt +112 -0
- package/public/packages/atom/0.24.0/components/color-picker.txt +117 -0
- package/public/packages/atom/0.24.0/components/combobox.txt +126 -0
- package/public/packages/atom/0.24.0/components/context-menu.txt +114 -0
- package/public/packages/atom/0.24.0/components/data-grid.txt +136 -0
- package/public/packages/atom/0.24.0/components/dialog.txt +116 -0
- package/public/packages/atom/0.24.0/components/direction.txt +132 -0
- package/public/packages/atom/0.24.0/components/divider.txt +94 -0
- package/public/packages/atom/0.24.0/components/drag-drop.txt +141 -0
- package/public/packages/atom/0.24.0/components/drawer.txt +96 -0
- package/public/packages/atom/0.24.0/components/dropdown-menu.txt +112 -0
- package/public/packages/atom/0.24.0/components/feed.txt +132 -0
- package/public/packages/atom/0.24.0/components/field.txt +108 -0
- package/public/packages/atom/0.24.0/components/fieldset.txt +96 -0
- package/public/packages/atom/0.24.0/components/file-upload.txt +120 -0
- package/public/packages/atom/0.24.0/components/form.txt +98 -0
- package/public/packages/atom/0.24.0/components/hover-card.txt +114 -0
- package/public/packages/atom/0.24.0/components/image.txt +94 -0
- package/public/packages/atom/0.24.0/components/input.txt +96 -0
- package/public/packages/atom/0.24.0/components/label.txt +121 -0
- package/public/packages/atom/0.24.0/components/link.txt +100 -0
- package/public/packages/atom/0.24.0/components/list.txt +131 -0
- package/public/packages/atom/0.24.0/components/listbox.txt +120 -0
- package/public/packages/atom/0.24.0/components/menu.txt +126 -0
- package/public/packages/atom/0.24.0/components/menubar.txt +120 -0
- package/public/packages/atom/0.24.0/components/modal.txt +118 -0
- package/public/packages/atom/0.24.0/components/multi-select.txt +120 -0
- package/public/packages/atom/0.24.0/components/nav-list.txt +104 -0
- package/public/packages/atom/0.24.0/components/navigation-menu.txt +104 -0
- package/public/packages/atom/0.24.0/components/number-input.txt +124 -0
- package/public/packages/atom/0.24.0/components/otp-field.txt +122 -0
- package/public/packages/atom/0.24.0/components/pagination.txt +111 -0
- package/public/packages/atom/0.24.0/components/password-toggle-field.txt +116 -0
- package/public/packages/atom/0.24.0/components/popover.txt +122 -0
- package/public/packages/atom/0.24.0/components/pressable.txt +94 -0
- package/public/packages/atom/0.24.0/components/progress.txt +130 -0
- package/public/packages/atom/0.24.0/components/radio-group.txt +118 -0
- package/public/packages/atom/0.24.0/components/rating.txt +122 -0
- package/public/packages/atom/0.24.0/components/reorder.txt +141 -0
- package/public/packages/atom/0.24.0/components/scroll-area.txt +96 -0
- package/public/packages/atom/0.24.0/components/select.txt +126 -0
- package/public/packages/atom/0.24.0/components/sidebar.txt +96 -0
- package/public/packages/atom/0.24.0/components/skip-link.txt +96 -0
- package/public/packages/atom/0.24.0/components/slider.txt +124 -0
- package/public/packages/atom/0.24.0/components/swipeable-item.txt +118 -0
- package/public/packages/atom/0.24.0/components/switch.txt +116 -0
- package/public/packages/atom/0.24.0/components/table.txt +128 -0
- package/public/packages/atom/0.24.0/components/tabs.txt +96 -0
- package/public/packages/atom/0.24.0/components/textarea.txt +96 -0
- package/public/packages/atom/0.24.0/components/toast.txt +124 -0
- package/public/packages/atom/0.24.0/components/toggle-group.txt +118 -0
- package/public/packages/atom/0.24.0/components/toggle.txt +110 -0
- package/public/packages/atom/0.24.0/components/toolbar.txt +98 -0
- package/public/packages/atom/0.24.0/components/tooltip.txt +112 -0
- package/public/packages/atom/0.24.0/components/tree-grid.txt +138 -0
- package/public/packages/atom/0.24.0/components/tree.txt +138 -0
- package/public/packages/atom/0.24.0/components/visually-hidden.txt +119 -0
- package/public/packages/atom/0.24.0/docs/guides/agent-knowledge.txt +55 -0
- package/public/packages/atom/0.24.0/docs/guides/getting-started.txt +65 -0
- package/public/packages/atom/0.24.0/docs/guides/imports.txt +26 -0
- package/public/packages/atom/0.24.0/docs/guides/public-api.txt +100 -0
- package/public/packages/atom/0.24.0/guides/behavior-composition.txt +277 -0
- package/public/packages/atom/0.24.0/guides/layer-selection.txt +807 -0
- package/public/packages/atom/0.24.0/index.txt +89 -0
- package/public/packages/brick/0.1.11/components/accordion.txt +158 -0
- package/public/packages/brick/0.1.11/components/alert-dialog.txt +175 -0
- package/public/packages/brick/0.1.11/components/app-bar.txt +134 -0
- package/public/packages/brick/0.1.11/components/appearance.txt +143 -0
- package/public/packages/brick/0.1.11/components/aspect-ratio.txt +136 -0
- package/public/packages/brick/0.1.11/components/avatar.txt +152 -0
- package/public/packages/brick/0.1.11/components/badge.txt +139 -0
- package/public/packages/brick/0.1.11/components/bleed.txt +104 -0
- package/public/packages/brick/0.1.11/components/bottom-navigation.txt +106 -0
- package/public/packages/brick/0.1.11/components/breadcrumb.txt +96 -0
- package/public/packages/brick/0.1.11/components/button.txt +103 -0
- package/public/packages/brick/0.1.11/components/card.txt +132 -0
- package/public/packages/brick/0.1.11/components/carousel.txt +206 -0
- package/public/packages/brick/0.1.11/components/checkbox-group.txt +175 -0
- package/public/packages/brick/0.1.11/components/checkbox.txt +103 -0
- package/public/packages/brick/0.1.11/components/chip.txt +128 -0
- package/public/packages/brick/0.1.11/components/code-block.txt +134 -0
- package/public/packages/brick/0.1.11/components/code.txt +120 -0
- package/public/packages/brick/0.1.11/components/collapsible.txt +179 -0
- package/public/packages/brick/0.1.11/components/color-picker.txt +135 -0
- package/public/packages/brick/0.1.11/components/color-swatch.txt +98 -0
- package/public/packages/brick/0.1.11/components/combobox.txt +157 -0
- package/public/packages/brick/0.1.11/components/container.txt +112 -0
- package/public/packages/brick/0.1.11/components/context-menu.txt +174 -0
- package/public/packages/brick/0.1.11/components/data-grid.txt +199 -0
- package/public/packages/brick/0.1.11/components/data-list.txt +115 -0
- package/public/packages/brick/0.1.11/components/dialog.txt +176 -0
- package/public/packages/brick/0.1.11/components/divider.txt +104 -0
- package/public/packages/brick/0.1.11/components/drawer.txt +146 -0
- package/public/packages/brick/0.1.11/components/dropdown-menu.txt +179 -0
- package/public/packages/brick/0.1.11/components/feed.txt +143 -0
- package/public/packages/brick/0.1.11/components/field.txt +115 -0
- package/public/packages/brick/0.1.11/components/fieldset.txt +103 -0
- package/public/packages/brick/0.1.11/components/file-upload.txt +154 -0
- package/public/packages/brick/0.1.11/components/form.txt +108 -0
- package/public/packages/brick/0.1.11/components/frame.txt +132 -0
- package/public/packages/brick/0.1.11/components/grid.txt +141 -0
- package/public/packages/brick/0.1.11/components/group.txt +136 -0
- package/public/packages/brick/0.1.11/components/hide.txt +121 -0
- package/public/packages/brick/0.1.11/components/hover-card.txt +156 -0
- package/public/packages/brick/0.1.11/components/icon-button.txt +119 -0
- package/public/packages/brick/0.1.11/components/icon.txt +160 -0
- package/public/packages/brick/0.1.11/components/image.txt +163 -0
- package/public/packages/brick/0.1.11/components/input.txt +101 -0
- package/public/packages/brick/0.1.11/components/link-box.txt +161 -0
- package/public/packages/brick/0.1.11/components/link.txt +133 -0
- package/public/packages/brick/0.1.11/components/list.txt +139 -0
- package/public/packages/brick/0.1.11/components/menubar.txt +174 -0
- package/public/packages/brick/0.1.11/components/multi-select.txt +153 -0
- package/public/packages/brick/0.1.11/components/nav-list.txt +130 -0
- package/public/packages/brick/0.1.11/components/navigation-menu.txt +150 -0
- package/public/packages/brick/0.1.11/components/notification-badge.txt +148 -0
- package/public/packages/brick/0.1.11/components/number-input.txt +150 -0
- package/public/packages/brick/0.1.11/components/otp-field.txt +146 -0
- package/public/packages/brick/0.1.11/components/pagination.txt +124 -0
- package/public/packages/brick/0.1.11/components/password-toggle-field.txt +146 -0
- package/public/packages/brick/0.1.11/components/popover.txt +181 -0
- package/public/packages/brick/0.1.11/components/progress-circle.txt +142 -0
- package/public/packages/brick/0.1.11/components/progress.txt +150 -0
- package/public/packages/brick/0.1.11/components/radio-group.txt +152 -0
- package/public/packages/brick/0.1.11/components/rating.txt +151 -0
- package/public/packages/brick/0.1.11/components/reorderable-list.txt +130 -0
- package/public/packages/brick/0.1.11/components/scroll-area.txt +110 -0
- package/public/packages/brick/0.1.11/components/section.txt +118 -0
- package/public/packages/brick/0.1.11/components/segment-group.txt +116 -0
- package/public/packages/brick/0.1.11/components/select.txt +157 -0
- package/public/packages/brick/0.1.11/components/show.txt +121 -0
- package/public/packages/brick/0.1.11/components/sidebar.txt +126 -0
- package/public/packages/brick/0.1.11/components/skeleton.txt +127 -0
- package/public/packages/brick/0.1.11/components/skip-link.txt +102 -0
- package/public/packages/brick/0.1.11/components/slider.txt +147 -0
- package/public/packages/brick/0.1.11/components/stack.txt +155 -0
- package/public/packages/brick/0.1.11/components/status.txt +110 -0
- package/public/packages/brick/0.1.11/components/surface.txt +194 -0
- package/public/packages/brick/0.1.11/components/swipeable-item.txt +154 -0
- package/public/packages/brick/0.1.11/components/switch.txt +152 -0
- package/public/packages/brick/0.1.11/components/table.txt +183 -0
- package/public/packages/brick/0.1.11/components/tabs.txt +136 -0
- package/public/packages/brick/0.1.11/components/text.txt +148 -0
- package/public/packages/brick/0.1.11/components/textarea.txt +101 -0
- package/public/packages/brick/0.1.11/components/toast.txt +150 -0
- package/public/packages/brick/0.1.11/components/toggle-group.txt +149 -0
- package/public/packages/brick/0.1.11/components/toggle.txt +140 -0
- package/public/packages/brick/0.1.11/components/toolbar.txt +118 -0
- package/public/packages/brick/0.1.11/components/tooltip.txt +156 -0
- package/public/packages/brick/0.1.11/components/tree-grid.txt +160 -0
- package/public/packages/brick/0.1.11/components/tree.txt +156 -0
- package/public/packages/brick/0.1.11/components/visually-hidden.txt +123 -0
- package/public/packages/brick/0.1.11/components/z-stack.txt +143 -0
- package/public/packages/brick/0.1.11/docs/guides/agent-knowledge.txt +67 -0
- package/public/packages/brick/0.1.11/docs/guides/appearance-and-tokens.txt +179 -0
- package/public/packages/brick/0.1.11/docs/guides/browser-support.txt +25 -0
- package/public/packages/brick/0.1.11/docs/guides/control-sizing.txt +59 -0
- package/public/packages/brick/0.1.11/docs/guides/installation.txt +79 -0
- package/public/packages/brick/0.1.11/docs/guides/theme-contract.txt +90 -0
- package/public/packages/brick/0.1.11/guides/interface-composition.txt +665 -0
- package/public/packages/brick/0.1.11/guides/layer-selection.txt +1437 -0
- package/public/packages/brick/0.1.11/index.txt +110 -0
- package/public/packages/colors/0.1.1/docs/agent-knowledge.txt +63 -0
- package/public/packages/colors/0.1.1/docs/architecture.txt +74 -0
- package/public/packages/colors/0.1.1/docs/color-foundations.txt +128 -0
- package/public/packages/colors/0.1.1/docs/compatibility.txt +75 -0
- package/public/packages/colors/0.1.1/docs/dependency-qualification.txt +117 -0
- package/public/packages/colors/0.1.1/docs/installation.txt +48 -0
- package/public/packages/colors/0.1.1/docs/palette-generation.txt +151 -0
- package/public/packages/colors/0.1.1/docs/releasing.txt +34 -0
- package/public/packages/colors/0.1.1/docs/testing.txt +51 -0
- package/public/packages/colors/0.1.1/guides/colors-system.txt +282 -0
- package/public/packages/colors/0.1.1/index.txt +29 -0
- package/public/packages/colors/0.1.1/operations/color-conversion.txt +14 -0
- package/public/packages/colors/0.1.1/operations/color-inspection.txt +23 -0
- package/public/packages/colors/0.1.1/operations/color-measurement.txt +18 -0
- package/public/packages/colors/0.1.1/operations/color-provenance.txt +14 -0
- package/public/packages/colors/0.1.1/operations/named-palette-reference.txt +15 -0
- package/public/packages/colors/0.1.1/operations/palette-candidate.txt +37 -0
- package/public/packages/theme/0.1.1/docs/agent-knowledge.txt +44 -0
- package/public/packages/theme/0.1.1/docs/appearances-and-portals.txt +41 -0
- package/public/packages/theme/0.1.1/docs/architecture.txt +121 -0
- package/public/packages/theme/0.1.1/docs/authoring.txt +141 -0
- package/public/packages/theme/0.1.1/docs/colors-interchange.txt +82 -0
- package/public/packages/theme/0.1.1/docs/fonts.txt +40 -0
- package/public/packages/theme/0.1.1/docs/installation.txt +45 -0
- package/public/packages/theme/0.1.1/docs/migration.txt +40 -0
- package/public/packages/theme/0.1.1/docs/testing.txt +64 -0
- package/public/packages/theme/0.1.1/docs/troubleshooting.txt +53 -0
- package/public/packages/theme/0.1.1/guides/theme-system.txt +340 -0
- package/public/packages/theme/0.1.1/index.txt +31 -0
- package/public/packages/theme/0.1.1/operations/brick-contract-compatibility.txt +35 -0
- package/public/packages/theme/0.1.1/operations/colors-interchange.txt +35 -0
- package/public/packages/theme/0.1.1/operations/theme-artifacts.txt +19 -0
- package/public/packages/theme/0.1.1/operations/theme-cli.txt +10 -0
- package/public/packages/theme/0.1.1/operations/theme-compilation.txt +23 -0
- package/public/packages/theme/0.1.1/operations/theme-definition.txt +36 -0
- package/public/packages/theme/0.1.1/operations/theme-validation.txt +19 -0
- package/public/tasks/data.txt +39 -0
- package/public/tasks/forms.txt +65 -0
- package/public/tasks/layout.txt +37 -0
- package/public/tasks/navigation.txt +51 -0
- package/public/tasks/overlays.txt +39 -0
- package/public/tasks/theming.txt +37 -0
- package/skills/flowstack-ui-builder/SKILL.md +35 -0
- package/skills/flowstack-ui-builder/agents/openai.yaml +4 -0
- package/skills/flowstack-ui-builder/scripts/resolve-agent-knowledge.mjs +399 -0
- package/skills/flowstack-ui-compose/SKILL.md +32 -0
- package/skills/flowstack-ui-compose/agents/openai.yaml +4 -0
- package/skills/flowstack-ui-compose/scripts/resolve-agent-knowledge.mjs +399 -0
- package/skills/flowstack-ui-maintainer/SKILL.md +40 -0
- package/skills/flowstack-ui-maintainer/agents/openai.yaml +4 -0
- package/skills/flowstack-ui-maintainer/scripts/resolve-agent-knowledge.mjs +399 -0
- package/skills/flowstack-ui-review/SKILL.md +29 -0
- package/skills/flowstack-ui-review/agents/openai.yaml +4 -0
- package/skills/flowstack-ui-review/scripts/resolve-agent-knowledge.mjs +399 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# HoverCard
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: hover-card
|
|
6
|
+
|
|
7
|
+
# HoverCard agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a finished supplemental, nonessential, non-interactive preview from a genuine link or similarly meaningful trigger while Atom owns hover, focus-visible, dismissal, portal, and positioning behavior.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A genuine link or other focusable subject benefits from a richer passive preview whose information is redundant with the destination or visible page.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The content is a brief text hint, contains controls or required actions, must hold focus, or is essential on touch and non-hover input. Use Tooltip, Popover, Dialog, or visible inline content.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Compose HoverCard.Root with HoverCard.Trigger asChild around a genuine semantic link, plus HoverCard.Portal and HoverCard.Content; add HoverCard.Arrow only when the styled preview needs a pointer. Content may contain passive Brick text, Avatar, Badge, and layout components but no interactive descendants.
|
|
24
|
+
- Choose Content size sm, md, or lg from preview measure. Brick keeps non-Arrow children in its private scrolling viewport and Arrow as a direct Content child; do not target the private viewport. Reproduce any local Appearance scope on portalled Content.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Keep every essential fact and required action available outside Content because touch does not open HoverCard and the preview is not promised to assistive technology.
|
|
29
|
+
- **MUST:** Do not put links, buttons, inputs, menus, or required interaction inside Content; use Popover for interactive floating content.
|
|
30
|
+
- **MUST:** Preserve Trigger's genuine native destination, complete accessible name, action, and tab order through asChild or render; do not add popup, expanded, controls, or dialog semantics.
|
|
31
|
+
- **MUST:** Preserve Atom's mouse-capable hover, focus-visible opening, delays, safe pointer corridor, Escape handling, and touch and compatibility-event suppression; touch must retain the native Trigger action without opening the preview.
|
|
32
|
+
- **MUST:** Keep Content generic and nonsemantic, choose size only for bounded measure, let the private viewport own constrained scrolling, and keep optional Arrow as a direct Content child.
|
|
33
|
+
- **SHOULD:** Style and validate from the collision-resolved data-side and available viewport bounds rather than assuming the requested placement always wins.
|
|
34
|
+
- **MUST:** When Portal leaves a local Appearance scope, reproduce that scope on Content or target a portal container inside it.
|
|
35
|
+
- **MUST:** Load styles.css or core.css plus hover-card.css and every composed child component stylesheet.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- **Avoid:** Putting a profile action or essential fact only in HoverCard, expecting touch to open it, or adding popup ARIA relationships. **Instead:** Keep the preview passive and redundant, preserve the trigger destination, and use Popover or visible content when users must interact or access the information.
|
|
40
|
+
- **Avoid:** Using HoverCard for a short label, targeting its private viewport, or assuming portalled Content inherits local Appearance. **Instead:** Use Tooltip for brief hints, customize only public parts and tokens, and make the portal scope explicit.
|
|
41
|
+
|
|
42
|
+
## Validation checklist
|
|
43
|
+
|
|
44
|
+
- Verify the genuine Trigger destination and name, controlled and disabled state, mouse hover and focus-visible opening, delays, Trigger-to-Content pointer corridor, Escape, focus stability, and that touch taps and long presses preserve native Trigger activation without opening.
|
|
45
|
+
- Audit Content for no essential or interactive descendants and no popup ARIA; verify portal and render composition, three bounded sizes, private scrolling, direct optional Arrow, collision flips and shifts, and available-size containment.
|
|
46
|
+
- Verify 256px containment, zoom, long localization, LTR and RTL, reduced motion, forced colors, light and dark portalled appearance, and complete CSS.
|
|
47
|
+
|
|
48
|
+
## Related guidance
|
|
49
|
+
|
|
50
|
+
- `@flowstack-ui/atom/agents/hover-card`
|
|
51
|
+
- `tooltip`
|
|
52
|
+
- `popover`
|
|
53
|
+
- `dialog`
|
|
54
|
+
- `link`
|
|
55
|
+
- `avatar`
|
|
56
|
+
- `badge`
|
|
57
|
+
- `appearance`
|
|
58
|
+
|
|
59
|
+
## Machine record
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"schema": "flowstack.agent-component.v1",
|
|
64
|
+
"id": "hover-card",
|
|
65
|
+
"name": "HoverCard",
|
|
66
|
+
"package": "@flowstack-ui/brick",
|
|
67
|
+
"layer": "brick",
|
|
68
|
+
"kind": "component",
|
|
69
|
+
"purpose": "Present a finished supplemental, nonessential, non-interactive preview from a genuine link or similarly meaningful trigger while Atom owns hover, focus-visible, dismissal, portal, and positioning behavior.",
|
|
70
|
+
"useWhen": [
|
|
71
|
+
"A genuine link or other focusable subject benefits from a richer passive preview whose information is redundant with the destination or visible page."
|
|
72
|
+
],
|
|
73
|
+
"avoidWhen": [
|
|
74
|
+
{
|
|
75
|
+
"condition": "The content is a brief text hint, contains controls or required actions, must hold focus, or is essential on touch and non-hover input.",
|
|
76
|
+
"useInstead": "Tooltip, Popover, Dialog, or visible inline content"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"composition": [
|
|
80
|
+
"Compose HoverCard.Root with HoverCard.Trigger asChild around a genuine semantic link, plus HoverCard.Portal and HoverCard.Content; add HoverCard.Arrow only when the styled preview needs a pointer. Content may contain passive Brick text, Avatar, Badge, and layout components but no interactive descendants.",
|
|
81
|
+
"Choose Content size sm, md, or lg from preview measure. Brick keeps non-Arrow children in its private scrolling viewport and Arrow as a direct Content child; do not target the private viewport. Reproduce any local Appearance scope on portalled Content."
|
|
82
|
+
],
|
|
83
|
+
"rules": [
|
|
84
|
+
{
|
|
85
|
+
"id": "hover-card-supplemental",
|
|
86
|
+
"level": "must",
|
|
87
|
+
"statement": "Keep every essential fact and required action available outside Content because touch does not open HoverCard and the preview is not promised to assistive technology."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "hover-card-noninteractive",
|
|
91
|
+
"level": "must",
|
|
92
|
+
"statement": "Do not put links, buttons, inputs, menus, or required interaction inside Content; use Popover for interactive floating content."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "hover-card-trigger-native",
|
|
96
|
+
"level": "must",
|
|
97
|
+
"statement": "Preserve Trigger's genuine native destination, complete accessible name, action, and tab order through asChild or render; do not add popup, expanded, controls, or dialog semantics."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "hover-card-input-contract",
|
|
101
|
+
"level": "must",
|
|
102
|
+
"statement": "Preserve Atom's mouse-capable hover, focus-visible opening, delays, safe pointer corridor, Escape handling, and touch and compatibility-event suppression; touch must retain the native Trigger action without opening the preview."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "hover-card-content-anatomy",
|
|
106
|
+
"level": "must",
|
|
107
|
+
"statement": "Keep Content generic and nonsemantic, choose size only for bounded measure, let the private viewport own constrained scrolling, and keep optional Arrow as a direct Content child."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "hover-card-positioning",
|
|
111
|
+
"level": "should",
|
|
112
|
+
"statement": "Style and validate from the collision-resolved data-side and available viewport bounds rather than assuming the requested placement always wins."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "hover-card-theme-scope",
|
|
116
|
+
"level": "must",
|
|
117
|
+
"statement": "When Portal leaves a local Appearance scope, reproduce that scope on Content or target a portal container inside it."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "hover-card-css",
|
|
121
|
+
"level": "must",
|
|
122
|
+
"statement": "Load styles.css or core.css plus hover-card.css and every composed child component stylesheet."
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"commonMistakes": [
|
|
126
|
+
{
|
|
127
|
+
"mistake": "Putting a profile action or essential fact only in HoverCard, expecting touch to open it, or adding popup ARIA relationships.",
|
|
128
|
+
"correction": "Keep the preview passive and redundant, preserve the trigger destination, and use Popover or visible content when users must interact or access the information."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"mistake": "Using HoverCard for a short label, targeting its private viewport, or assuming portalled Content inherits local Appearance.",
|
|
132
|
+
"correction": "Use Tooltip for brief hints, customize only public parts and tokens, and make the portal scope explicit."
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"validation": [
|
|
136
|
+
"Verify the genuine Trigger destination and name, controlled and disabled state, mouse hover and focus-visible opening, delays, Trigger-to-Content pointer corridor, Escape, focus stability, and that touch taps and long presses preserve native Trigger activation without opening.",
|
|
137
|
+
"Audit Content for no essential or interactive descendants and no popup ARIA; verify portal and render composition, three bounded sizes, private scrolling, direct optional Arrow, collision flips and shifts, and available-size containment.",
|
|
138
|
+
"Verify 256px containment, zoom, long localization, LTR and RTL, reduced motion, forced colors, light and dark portalled appearance, and complete CSS."
|
|
139
|
+
],
|
|
140
|
+
"related": [
|
|
141
|
+
{
|
|
142
|
+
"kind": "package",
|
|
143
|
+
"package": "@flowstack-ui/atom",
|
|
144
|
+
"id": "hover-card",
|
|
145
|
+
"versionPolicy": "installed-exact"
|
|
146
|
+
},
|
|
147
|
+
"tooltip",
|
|
148
|
+
"popover",
|
|
149
|
+
"dialog",
|
|
150
|
+
"link",
|
|
151
|
+
"avatar",
|
|
152
|
+
"badge",
|
|
153
|
+
"appearance"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# IconButton
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: icon-button
|
|
6
|
+
|
|
7
|
+
# IconButton agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Provide a compact finished icon-only action or deliberate icon-only navigation control with an explicit accessible name.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A familiar icon represents one action and visible button text would be redundant in the available space.
|
|
16
|
+
- A compact rail or similarly constrained navigation context deliberately uses a recognizable icon-only destination.
|
|
17
|
+
|
|
18
|
+
## Choose something else when
|
|
19
|
+
|
|
20
|
+
- A destination needs persistent visible explanatory text or should read as an ordinary inline or standalone link. Use Link or a navigation collection's Link part.
|
|
21
|
+
- The control represents a persistent pressed selection. Use Toggle.
|
|
22
|
+
|
|
23
|
+
## Required composition
|
|
24
|
+
|
|
25
|
+
- Place one decorative Icon or SVG inside IconButton, provide an accessible label through the component's naming API, and supply href when the control is a destination. Tooltip may supplement an unfamiliar icon but never replaces the control name.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- **MUST:** Give every IconButton a concise discernible accessible name; the icon alone and a portalled Tooltip are not names.
|
|
30
|
+
- **MUST:** Use the default button path for operations and supply href for a deliberate icon-only navigation destination so the final host remains a native anchor.
|
|
31
|
+
- **MUST:** Keep temporary aria-expanded feedback distinct from a persistent pressed selection; use Toggle when the state itself is the user-controlled value.
|
|
32
|
+
- **MUST:** Load styles.css or core.css plus icon-button.css and icon.css when using Brick Icon.
|
|
33
|
+
|
|
34
|
+
## Common mistakes
|
|
35
|
+
|
|
36
|
+
- **Avoid:** Using a random glyph, code icon for GitHub, an unlabeled SVG inside a generic button, a command button without href for a route, or Tooltip as the only name. **Instead:** Use the correct icon asset in a named IconButton, supply href for navigation, and keep Tooltip supplemental.
|
|
37
|
+
|
|
38
|
+
## Validation checklist
|
|
39
|
+
|
|
40
|
+
- Check accessible name, button versus anchor semantics, href, icon alignment, touch target, focus ring, Tooltip discovery when present, expanded disclosure feedback, disabled/loading states, contrast, and forced colors.
|
|
41
|
+
- Confirm component CSS and every composed Tooltip or Icon stylesheet are loaded.
|
|
42
|
+
|
|
43
|
+
## Related guidance
|
|
44
|
+
|
|
45
|
+
- `button`
|
|
46
|
+
- `icon`
|
|
47
|
+
- `link`
|
|
48
|
+
- `toolbar`
|
|
49
|
+
- `tooltip`
|
|
50
|
+
|
|
51
|
+
## Machine record
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"schema": "flowstack.agent-component.v1",
|
|
56
|
+
"id": "icon-button",
|
|
57
|
+
"name": "IconButton",
|
|
58
|
+
"package": "@flowstack-ui/brick",
|
|
59
|
+
"layer": "brick",
|
|
60
|
+
"kind": "component",
|
|
61
|
+
"purpose": "Provide a compact finished icon-only action or deliberate icon-only navigation control with an explicit accessible name.",
|
|
62
|
+
"useWhen": [
|
|
63
|
+
"A familiar icon represents one action and visible button text would be redundant in the available space.",
|
|
64
|
+
"A compact rail or similarly constrained navigation context deliberately uses a recognizable icon-only destination."
|
|
65
|
+
],
|
|
66
|
+
"avoidWhen": [
|
|
67
|
+
{
|
|
68
|
+
"condition": "A destination needs persistent visible explanatory text or should read as an ordinary inline or standalone link.",
|
|
69
|
+
"useInstead": "Link or a navigation collection's Link part"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"condition": "The control represents a persistent pressed selection.",
|
|
73
|
+
"useInstead": "Toggle"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"composition": [
|
|
77
|
+
"Place one decorative Icon or SVG inside IconButton, provide an accessible label through the component's naming API, and supply href when the control is a destination. Tooltip may supplement an unfamiliar icon but never replaces the control name."
|
|
78
|
+
],
|
|
79
|
+
"rules": [
|
|
80
|
+
{
|
|
81
|
+
"id": "icon-button-name",
|
|
82
|
+
"level": "must",
|
|
83
|
+
"statement": "Give every IconButton a concise discernible accessible name; the icon alone and a portalled Tooltip are not names."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "icon-button-semantics",
|
|
87
|
+
"level": "must",
|
|
88
|
+
"statement": "Use the default button path for operations and supply href for a deliberate icon-only navigation destination so the final host remains a native anchor."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "icon-button-expanded-feedback",
|
|
92
|
+
"level": "must",
|
|
93
|
+
"statement": "Keep temporary aria-expanded feedback distinct from a persistent pressed selection; use Toggle when the state itself is the user-controlled value."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "icon-button-css",
|
|
97
|
+
"level": "must",
|
|
98
|
+
"statement": "Load styles.css or core.css plus icon-button.css and icon.css when using Brick Icon."
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"commonMistakes": [
|
|
102
|
+
{
|
|
103
|
+
"mistake": "Using a random glyph, code icon for GitHub, an unlabeled SVG inside a generic button, a command button without href for a route, or Tooltip as the only name.",
|
|
104
|
+
"correction": "Use the correct icon asset in a named IconButton, supply href for navigation, and keep Tooltip supplemental."
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"validation": [
|
|
108
|
+
"Check accessible name, button versus anchor semantics, href, icon alignment, touch target, focus ring, Tooltip discovery when present, expanded disclosure feedback, disabled/loading states, contrast, and forced colors.",
|
|
109
|
+
"Confirm component CSS and every composed Tooltip or Icon stylesheet are loaded."
|
|
110
|
+
],
|
|
111
|
+
"related": [
|
|
112
|
+
"button",
|
|
113
|
+
"icon",
|
|
114
|
+
"link",
|
|
115
|
+
"toolbar",
|
|
116
|
+
"tooltip"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Icon
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: icon
|
|
6
|
+
|
|
7
|
+
# Icon agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Normalize one consumer-authored SVG with Brick sizing, semantic foreground, alignment, direction, and decorative-or-informative accessibility semantics.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- An authored SVG needs Brick size, currentColor-based tone, alignment, or opt-in directional RTL mirroring.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The graphic performs an action or needs its own touch target. Use Button, IconButton, Toggle, or the owning interactive component.
|
|
20
|
+
- The content is a photo, raster asset, responsive media object, fallback, or loading state. Use Image.
|
|
21
|
+
- The graphic is a logo, illustration, chart, or multiregion visual with independent semantics. Use an application-owned SVG or media composition with explicit semantics.
|
|
22
|
+
|
|
23
|
+
## Required composition
|
|
24
|
+
|
|
25
|
+
- Pass exactly one consumer-authored SVG element; prefer the default span wrapper and use asChild only when the direct root must remain that SVG.
|
|
26
|
+
- When visible nearby text already provides the meaning, keep Icon decorative; when a standalone icon conveys information, provide label or aria-labelledby.
|
|
27
|
+
- Inside an icon-only control, label the control and leave its nested Icon decorative.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- **MUST:** Use Icon only for visual content; never use it as an interactive host or touch target.
|
|
32
|
+
- **MUST:** Keep the decorative default when meaning is redundant, or provide exactly one nonempty label or aria-labelledby reference when the standalone graphic is informative.
|
|
33
|
+
- **MUST:** Give an icon-only Button, IconButton, Toggle, or other control its accessible name on the control, not on its nested Icon.
|
|
34
|
+
- **SHOULD:** Use currentColor for single-color SVG fills or strokes so Brick tone and inherited control state can apply.
|
|
35
|
+
- **MUST:** Enable directional only for glyphs whose meaning reverses in RTL, such as arrows and forward/back controls.
|
|
36
|
+
- **MUST:** Use asChild only with one direct non-interactive SVG; never compose Icon onto a button, anchor, input, or other interactive host.
|
|
37
|
+
- **MUST:** Use Brick Stack, layout components, or an owning component icon slot for sibling alignment instead of wrapper spans or application offsets.
|
|
38
|
+
- **MUST:** Load styles.css or core.css plus icon.css.
|
|
39
|
+
|
|
40
|
+
## Common mistakes
|
|
41
|
+
|
|
42
|
+
- **Avoid:** Using a raw SVG with ad hoc width, color, alignment, or ARIA inside ordinary Brick composition. **Instead:** Wrap the authored SVG in Icon, choose the semantic size/tone recipe, and let the owning Stack or control align it.
|
|
43
|
+
- **Avoid:** Giving both the control and its nested Icon the same accessible label. **Instead:** Label the control and keep the nested Icon decorative to prevent duplicate announcements.
|
|
44
|
+
- **Avoid:** Using directional on logos, status symbols, checks, clocks, or other glyphs that do not reverse meaning in RTL. **Instead:** Leave directional false unless the glyph itself communicates direction.
|
|
45
|
+
|
|
46
|
+
## Validation checklist
|
|
47
|
+
|
|
48
|
+
- Check decorative and informative accessibility trees, icon-only control naming, all sizes and tones, currentColor adoption, flex shrinking, and RTL directional mirroring.
|
|
49
|
+
- Confirm asChild targets only one SVG and that CSS is present.
|
|
50
|
+
|
|
51
|
+
## Related guidance
|
|
52
|
+
|
|
53
|
+
- `icon-button`
|
|
54
|
+
- `image`
|
|
55
|
+
- `button`
|
|
56
|
+
- `stack`
|
|
57
|
+
- `text`
|
|
58
|
+
|
|
59
|
+
## Machine record
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"schema": "flowstack.agent-component.v1",
|
|
64
|
+
"id": "icon",
|
|
65
|
+
"name": "Icon",
|
|
66
|
+
"package": "@flowstack-ui/brick",
|
|
67
|
+
"layer": "brick",
|
|
68
|
+
"kind": "component",
|
|
69
|
+
"purpose": "Normalize one consumer-authored SVG with Brick sizing, semantic foreground, alignment, direction, and decorative-or-informative accessibility semantics.",
|
|
70
|
+
"useWhen": [
|
|
71
|
+
"An authored SVG needs Brick size, currentColor-based tone, alignment, or opt-in directional RTL mirroring."
|
|
72
|
+
],
|
|
73
|
+
"avoidWhen": [
|
|
74
|
+
{
|
|
75
|
+
"condition": "The graphic performs an action or needs its own touch target.",
|
|
76
|
+
"useInstead": "Button, IconButton, Toggle, or the owning interactive component"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"condition": "The content is a photo, raster asset, responsive media object, fallback, or loading state.",
|
|
80
|
+
"useInstead": "Image"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"condition": "The graphic is a logo, illustration, chart, or multiregion visual with independent semantics.",
|
|
84
|
+
"useInstead": "an application-owned SVG or media composition with explicit semantics"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"composition": [
|
|
88
|
+
"Pass exactly one consumer-authored SVG element; prefer the default span wrapper and use asChild only when the direct root must remain that SVG.",
|
|
89
|
+
"When visible nearby text already provides the meaning, keep Icon decorative; when a standalone icon conveys information, provide label or aria-labelledby.",
|
|
90
|
+
"Inside an icon-only control, label the control and leave its nested Icon decorative."
|
|
91
|
+
],
|
|
92
|
+
"rules": [
|
|
93
|
+
{
|
|
94
|
+
"id": "icon-not-control",
|
|
95
|
+
"level": "must",
|
|
96
|
+
"statement": "Use Icon only for visual content; never use it as an interactive host or touch target."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "icon-accessibility-mode",
|
|
100
|
+
"level": "must",
|
|
101
|
+
"statement": "Keep the decorative default when meaning is redundant, or provide exactly one nonempty label or aria-labelledby reference when the standalone graphic is informative."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "icon-control-name",
|
|
105
|
+
"level": "must",
|
|
106
|
+
"statement": "Give an icon-only Button, IconButton, Toggle, or other control its accessible name on the control, not on its nested Icon."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "icon-current-color",
|
|
110
|
+
"level": "should",
|
|
111
|
+
"statement": "Use currentColor for single-color SVG fills or strokes so Brick tone and inherited control state can apply."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "icon-directional",
|
|
115
|
+
"level": "must",
|
|
116
|
+
"statement": "Enable directional only for glyphs whose meaning reverses in RTL, such as arrows and forward/back controls."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "icon-as-child",
|
|
120
|
+
"level": "must",
|
|
121
|
+
"statement": "Use asChild only with one direct non-interactive SVG; never compose Icon onto a button, anchor, input, or other interactive host."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "icon-layout",
|
|
125
|
+
"level": "must",
|
|
126
|
+
"statement": "Use Brick Stack, layout components, or an owning component icon slot for sibling alignment instead of wrapper spans or application offsets."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "icon-css",
|
|
130
|
+
"level": "must",
|
|
131
|
+
"statement": "Load styles.css or core.css plus icon.css."
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"commonMistakes": [
|
|
135
|
+
{
|
|
136
|
+
"mistake": "Using a raw SVG with ad hoc width, color, alignment, or ARIA inside ordinary Brick composition.",
|
|
137
|
+
"correction": "Wrap the authored SVG in Icon, choose the semantic size/tone recipe, and let the owning Stack or control align it."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"mistake": "Giving both the control and its nested Icon the same accessible label.",
|
|
141
|
+
"correction": "Label the control and keep the nested Icon decorative to prevent duplicate announcements."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"mistake": "Using directional on logos, status symbols, checks, clocks, or other glyphs that do not reverse meaning in RTL.",
|
|
145
|
+
"correction": "Leave directional false unless the glyph itself communicates direction."
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"validation": [
|
|
149
|
+
"Check decorative and informative accessibility trees, icon-only control naming, all sizes and tones, currentColor adoption, flex shrinking, and RTL directional mirroring.",
|
|
150
|
+
"Confirm asChild targets only one SVG and that CSS is present."
|
|
151
|
+
],
|
|
152
|
+
"related": [
|
|
153
|
+
"icon-button",
|
|
154
|
+
"image",
|
|
155
|
+
"button",
|
|
156
|
+
"stack",
|
|
157
|
+
"text"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
```
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Image
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: image
|
|
6
|
+
|
|
7
|
+
# Image agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Provide styled resilient media with Atom loading/fallback behavior, sizing recipes, and accessible image semantics.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A product image, brand asset, illustration, content image, or larger editorial/profile portrait needs Brick sizing, authored aspect ratio, fit, focal position, radius, loading, or fallback presentation.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- A person or entity needs a compact fixed-square identity token with explicit fallback content. Use Avatar.
|
|
20
|
+
- A framework optimizer provides a required measured optimization Brick does not expose. Use a documented Image adapter that preserves semantics and reports the capability gap.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Compose Image.Content and optional Image.Fallback inside Image.Root; use Brick Stack or layout components around it rather than wrapper spans for alignment.
|
|
25
|
+
- In a React Server Component, import ImageRoot, ImageContent, and ImageFallback directly; the compound Image namespace is intended for client module composition.
|
|
26
|
+
- Keep source state on Image.Root, then pass intrinsic width and height plus native responsive delivery props such as srcSet, sizes, loading, decoding, and fetchPriority to Image.Content.
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
- **MUST:** Use Brick Image for ordinary interface media; document any native or framework image fallback and the missing capability.
|
|
31
|
+
- **MUST:** Provide meaningful alt text, or alt="" for a decorative image.
|
|
32
|
+
- **MUST:** For a profile portrait, preserve the person's name as alt when the portrait communicates identity; use alt="" only when that specific portrait is intentionally decorative.
|
|
33
|
+
- **MUST:** Reserve intrinsic width and height or an authored parent aspect ratio so image arrival does not create layout shift.
|
|
34
|
+
- **MUST:** When a rendered slot changes materially by viewport or container, provide source candidates and an accurate sizes contract so the browser does not receive one oversized raster by default.
|
|
35
|
+
- **MUST:** Do not lazy-load a measured or strongly expected LCP image; keep it directly discoverable, load it eagerly, and use high fetch priority only for the small number of truly critical images.
|
|
36
|
+
- **MUST:** Use native lazy loading for ordinary deferred images; when an exact application proximity or intent boundary is required, let the application decide when to attach the source because loading=lazy remains a browser scheduling hint.
|
|
37
|
+
- **MUST:** Use explicit fill when Image must consume a parent-established block size, such as Surface.Media; retain fit and position for the intended crop.
|
|
38
|
+
- **MUST:** Name and preserve the parent sizing box when fill is used; Image propagates into available geometry but does not create that geometry.
|
|
39
|
+
- **MUST:** Load styles.css or core.css plus image.css.
|
|
40
|
+
- **MUST:** Use direct named Image parts across a React Server Component boundary instead of wrapping the complete consumer in use client.
|
|
41
|
+
|
|
42
|
+
## Common mistakes
|
|
43
|
+
|
|
44
|
+
- **Avoid:** Using next/image automatically, forcing a larger authored profile portrait into Avatar's compact square recipe, wrapping Image in spans for ordinary alignment, applying one blanket alt decision to all portraits, sending one desktop raster to every slot, or lazy-loading the likely LCP image. **Instead:** Start with Brick Image for larger authored media, use Avatar for compact identity, decide alt from each image's context, reserve geometry, provide responsive candidates and accurate sizes, keep critical media discoverable, and adapt only for a measured missing optimizer capability.
|
|
45
|
+
|
|
46
|
+
## Validation checklist
|
|
47
|
+
|
|
48
|
+
- Check loaded, loading, error, cached, narrow and wide source selection, transferred bytes, priority, parent-fill geometry, crop, layout shift, contextual alt text—including identity-bearing and intentionally decorative portraits—contrast of fallback content, and RTL where relevant.
|
|
49
|
+
- For delivery-sensitive media, verify cold, warm, constrained-network, blocked-image, first-viewport, and post-proximity behavior; keep localhost timing separate from production or field evidence.
|
|
50
|
+
- Confirm CSS and any adapter report are complete.
|
|
51
|
+
|
|
52
|
+
## Related guidance
|
|
53
|
+
|
|
54
|
+
- `aspect-ratio`
|
|
55
|
+
- `stack`
|
|
56
|
+
- `avatar`
|
|
57
|
+
- `surface`
|
|
58
|
+
|
|
59
|
+
## Machine record
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"schema": "flowstack.agent-component.v1",
|
|
64
|
+
"id": "image",
|
|
65
|
+
"name": "Image",
|
|
66
|
+
"package": "@flowstack-ui/brick",
|
|
67
|
+
"layer": "brick",
|
|
68
|
+
"kind": "component",
|
|
69
|
+
"purpose": "Provide styled resilient media with Atom loading/fallback behavior, sizing recipes, and accessible image semantics.",
|
|
70
|
+
"useWhen": [
|
|
71
|
+
"A product image, brand asset, illustration, content image, or larger editorial/profile portrait needs Brick sizing, authored aspect ratio, fit, focal position, radius, loading, or fallback presentation."
|
|
72
|
+
],
|
|
73
|
+
"avoidWhen": [
|
|
74
|
+
{
|
|
75
|
+
"condition": "A person or entity needs a compact fixed-square identity token with explicit fallback content.",
|
|
76
|
+
"useInstead": "Avatar"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"condition": "A framework optimizer provides a required measured optimization Brick does not expose.",
|
|
80
|
+
"useInstead": "a documented Image adapter that preserves semantics and reports the capability gap"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"composition": [
|
|
84
|
+
"Compose Image.Content and optional Image.Fallback inside Image.Root; use Brick Stack or layout components around it rather than wrapper spans for alignment.",
|
|
85
|
+
"In a React Server Component, import ImageRoot, ImageContent, and ImageFallback directly; the compound Image namespace is intended for client module composition.",
|
|
86
|
+
"Keep source state on Image.Root, then pass intrinsic width and height plus native responsive delivery props such as srcSet, sizes, loading, decoding, and fetchPriority to Image.Content."
|
|
87
|
+
],
|
|
88
|
+
"rules": [
|
|
89
|
+
{
|
|
90
|
+
"id": "image-brick-first",
|
|
91
|
+
"level": "must",
|
|
92
|
+
"statement": "Use Brick Image for ordinary interface media; document any native or framework image fallback and the missing capability."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "image-alt",
|
|
96
|
+
"level": "must",
|
|
97
|
+
"statement": "Provide meaningful alt text, or alt=\"\" for a decorative image."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "image-portrait-alt",
|
|
101
|
+
"level": "must",
|
|
102
|
+
"statement": "For a profile portrait, preserve the person's name as alt when the portrait communicates identity; use alt=\"\" only when that specific portrait is intentionally decorative."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "image-layout",
|
|
106
|
+
"level": "must",
|
|
107
|
+
"statement": "Reserve intrinsic width and height or an authored parent aspect ratio so image arrival does not create layout shift."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "image-responsive-delivery",
|
|
111
|
+
"level": "must",
|
|
112
|
+
"statement": "When a rendered slot changes materially by viewport or container, provide source candidates and an accurate sizes contract so the browser does not receive one oversized raster by default."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "image-lcp-delivery",
|
|
116
|
+
"level": "must",
|
|
117
|
+
"statement": "Do not lazy-load a measured or strongly expected LCP image; keep it directly discoverable, load it eagerly, and use high fetch priority only for the small number of truly critical images."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "image-deferred-delivery",
|
|
121
|
+
"level": "must",
|
|
122
|
+
"statement": "Use native lazy loading for ordinary deferred images; when an exact application proximity or intent boundary is required, let the application decide when to attach the source because loading=lazy remains a browser scheduling hint."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "image-parent-fill",
|
|
126
|
+
"level": "must",
|
|
127
|
+
"statement": "Use explicit fill when Image must consume a parent-established block size, such as Surface.Media; retain fit and position for the intended crop."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "image-parent-owner",
|
|
131
|
+
"level": "must",
|
|
132
|
+
"statement": "Name and preserve the parent sizing box when fill is used; Image propagates into available geometry but does not create that geometry."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"id": "image-css",
|
|
136
|
+
"level": "must",
|
|
137
|
+
"statement": "Load styles.css or core.css plus image.css."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "image-rsc-parts",
|
|
141
|
+
"level": "must",
|
|
142
|
+
"statement": "Use direct named Image parts across a React Server Component boundary instead of wrapping the complete consumer in use client."
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"commonMistakes": [
|
|
146
|
+
{
|
|
147
|
+
"mistake": "Using next/image automatically, forcing a larger authored profile portrait into Avatar's compact square recipe, wrapping Image in spans for ordinary alignment, applying one blanket alt decision to all portraits, sending one desktop raster to every slot, or lazy-loading the likely LCP image.",
|
|
148
|
+
"correction": "Start with Brick Image for larger authored media, use Avatar for compact identity, decide alt from each image's context, reserve geometry, provide responsive candidates and accurate sizes, keep critical media discoverable, and adapt only for a measured missing optimizer capability."
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"validation": [
|
|
152
|
+
"Check loaded, loading, error, cached, narrow and wide source selection, transferred bytes, priority, parent-fill geometry, crop, layout shift, contextual alt text—including identity-bearing and intentionally decorative portraits—contrast of fallback content, and RTL where relevant.",
|
|
153
|
+
"For delivery-sensitive media, verify cold, warm, constrained-network, blocked-image, first-viewport, and post-proximity behavior; keep localhost timing separate from production or field evidence.",
|
|
154
|
+
"Confirm CSS and any adapter report are complete."
|
|
155
|
+
],
|
|
156
|
+
"related": [
|
|
157
|
+
"aspect-ratio",
|
|
158
|
+
"stack",
|
|
159
|
+
"avatar",
|
|
160
|
+
"surface"
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
```
|