@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,176 @@
|
|
|
1
|
+
# Dialog
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: dialog
|
|
6
|
+
|
|
7
|
+
# Dialog agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a finished modal task, form, settings flow, or focused information surface while Atom owns focus, dismissal, portal, background-isolation, and scroll-lock behavior.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A user must focus on a temporary blocking task, form, settings flow, or detailed information surface before returning to the underlying application.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The user must make an urgent consequential choice, the surface belongs at a screen edge, or the panel is compact and anchored to a trigger. Use AlertDialog, Drawer, or Popover.
|
|
20
|
+
- The content is an in-page disclosure, a command menu, or passive transient feedback. Use Collapsible or Accordion, Menu, or Toast.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Compose Dialog.Root with Dialog.Trigger and Dialog.Portal; inside Portal keep Dialog.Overlay and Dialog.Content as siblings. Inside Content, arrange Dialog.Header with Dialog.Title and an optional Dialog.Description, put scrollable task content in Dialog.Body, and place actions and Dialog.Close in Dialog.Footer as the workflow requires.
|
|
25
|
+
- Use Dialog.Branch only for an unavoidable consumer-owned third-party portal that cannot mount inside Content. When a local Appearance scope owns the trigger, portal into that scope or apply the same Appearance to the portalled visual root.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- **MUST:** Use Dialog for an ordinary blocking task or information surface; use AlertDialog for an urgent consequential decision and Popover for compact anchored work.
|
|
30
|
+
- **MUST:** Render Overlay and Content as siblings inside Portal; never place Content beneath the aria-hidden Overlay.
|
|
31
|
+
- **MUST:** Give Content an accessible name with one visible Title or an explicit native aria-label or aria-labelledby; add Description only when it supplies useful context.
|
|
32
|
+
- **MUST:** Use Dialog-owned focus containment and restoration, background isolation, scroll locking, Escape handling, direct-target backdrop dismissal, and nested top-layer behavior instead of recreating them.
|
|
33
|
+
- **MUST:** Put long or variable task content in Body so the header and footer remain available while the body owns overflow within the safe viewport bounds.
|
|
34
|
+
- **MUST:** Use Footer justify for simple action distribution and Brick layout components for complex grouping; preserve a clear primary action and a visible close or cancellation path when the workflow requires one.
|
|
35
|
+
- **MUST:** Mount descendant interactive portals inside Content when possible; otherwise wrap only the unavoidable same-document third-party portal owner with Branch.
|
|
36
|
+
- **SHOULD:** Choose sm, md, or lg from the content measure rather than importance, and verify safe-area bounds, Body overflow, footer reflow, zoom, and narrow or short effective viewports.
|
|
37
|
+
- **MUST:** When Portal leaves a local Appearance scope, reproduce that scope on the portalled visual root or target a portal container inside it.
|
|
38
|
+
- **MUST:** Load styles.css or core.css plus dialog.css.
|
|
39
|
+
|
|
40
|
+
## Common mistakes
|
|
41
|
+
|
|
42
|
+
- **Avoid:** Nesting Content inside Overlay, hand-building focus or document listeners, or using Dialog for an anchored utility panel. **Instead:** Keep Overlay and Content siblings, rely on Dialog and Atom Modal behavior, and choose Popover for compact anchored work.
|
|
43
|
+
- **Avoid:** Letting long content scroll the whole surface or assuming an unrelated third-party portal is automatically inside the modal. **Instead:** Put overflow in Body and mount the descendant portal inside Content or register its owner with Branch.
|
|
44
|
+
|
|
45
|
+
## Validation checklist
|
|
46
|
+
|
|
47
|
+
- Verify trigger semantics, accessible name and optional description, keyboard, pointer, touch, and programmatic initial focus, Tab containment, Close, top-layer Escape, direct-target backdrop dismissal, and focus restoration.
|
|
48
|
+
- Verify controlled state, nested dialogs and every Branch, background isolation, document scroll lock, long Body scrolling, footer reflow, exit presence, zoom, reduced motion, forced colors, and narrow and short viewports.
|
|
49
|
+
- Check light and dark appearance on the actual portalled Content and confirm Dialog CSS plus every composed child component stylesheet is loaded.
|
|
50
|
+
|
|
51
|
+
## Related guidance
|
|
52
|
+
|
|
53
|
+
- `@flowstack-ui/atom/agents/dialog`
|
|
54
|
+
- `@flowstack-ui/atom/agents/modal`
|
|
55
|
+
- `alert-dialog`
|
|
56
|
+
- `drawer`
|
|
57
|
+
- `popover`
|
|
58
|
+
- `button`
|
|
59
|
+
- `appearance`
|
|
60
|
+
|
|
61
|
+
## Machine record
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"schema": "flowstack.agent-component.v1",
|
|
66
|
+
"id": "dialog",
|
|
67
|
+
"name": "Dialog",
|
|
68
|
+
"package": "@flowstack-ui/brick",
|
|
69
|
+
"layer": "brick",
|
|
70
|
+
"kind": "component",
|
|
71
|
+
"purpose": "Present a finished modal task, form, settings flow, or focused information surface while Atom owns focus, dismissal, portal, background-isolation, and scroll-lock behavior.",
|
|
72
|
+
"useWhen": [
|
|
73
|
+
"A user must focus on a temporary blocking task, form, settings flow, or detailed information surface before returning to the underlying application."
|
|
74
|
+
],
|
|
75
|
+
"avoidWhen": [
|
|
76
|
+
{
|
|
77
|
+
"condition": "The user must make an urgent consequential choice, the surface belongs at a screen edge, or the panel is compact and anchored to a trigger.",
|
|
78
|
+
"useInstead": "AlertDialog, Drawer, or Popover"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"condition": "The content is an in-page disclosure, a command menu, or passive transient feedback.",
|
|
82
|
+
"useInstead": "Collapsible or Accordion, Menu, or Toast"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"composition": [
|
|
86
|
+
"Compose Dialog.Root with Dialog.Trigger and Dialog.Portal; inside Portal keep Dialog.Overlay and Dialog.Content as siblings. Inside Content, arrange Dialog.Header with Dialog.Title and an optional Dialog.Description, put scrollable task content in Dialog.Body, and place actions and Dialog.Close in Dialog.Footer as the workflow requires.",
|
|
87
|
+
"Use Dialog.Branch only for an unavoidable consumer-owned third-party portal that cannot mount inside Content. When a local Appearance scope owns the trigger, portal into that scope or apply the same Appearance to the portalled visual root."
|
|
88
|
+
],
|
|
89
|
+
"rules": [
|
|
90
|
+
{
|
|
91
|
+
"id": "dialog-modal-task",
|
|
92
|
+
"level": "must",
|
|
93
|
+
"statement": "Use Dialog for an ordinary blocking task or information surface; use AlertDialog for an urgent consequential decision and Popover for compact anchored work."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "dialog-overlay-content-siblings",
|
|
97
|
+
"level": "must",
|
|
98
|
+
"statement": "Render Overlay and Content as siblings inside Portal; never place Content beneath the aria-hidden Overlay."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "dialog-accessible-name",
|
|
102
|
+
"level": "must",
|
|
103
|
+
"statement": "Give Content an accessible name with one visible Title or an explicit native aria-label or aria-labelledby; add Description only when it supplies useful context."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "dialog-atom-behavior",
|
|
107
|
+
"level": "must",
|
|
108
|
+
"statement": "Use Dialog-owned focus containment and restoration, background isolation, scroll locking, Escape handling, direct-target backdrop dismissal, and nested top-layer behavior instead of recreating them."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "dialog-body-scroll",
|
|
112
|
+
"level": "must",
|
|
113
|
+
"statement": "Put long or variable task content in Body so the header and footer remain available while the body owns overflow within the safe viewport bounds."
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "dialog-footer-actions",
|
|
117
|
+
"level": "must",
|
|
118
|
+
"statement": "Use Footer justify for simple action distribution and Brick layout components for complex grouping; preserve a clear primary action and a visible close or cancellation path when the workflow requires one."
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "dialog-branch-scope",
|
|
122
|
+
"level": "must",
|
|
123
|
+
"statement": "Mount descendant interactive portals inside Content when possible; otherwise wrap only the unavoidable same-document third-party portal owner with Branch."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "dialog-size-responsive",
|
|
127
|
+
"level": "should",
|
|
128
|
+
"statement": "Choose sm, md, or lg from the content measure rather than importance, and verify safe-area bounds, Body overflow, footer reflow, zoom, and narrow or short effective viewports."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "dialog-theme-scope",
|
|
132
|
+
"level": "must",
|
|
133
|
+
"statement": "When Portal leaves a local Appearance scope, reproduce that scope on the portalled visual root or target a portal container inside it."
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "dialog-css",
|
|
137
|
+
"level": "must",
|
|
138
|
+
"statement": "Load styles.css or core.css plus dialog.css."
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"commonMistakes": [
|
|
142
|
+
{
|
|
143
|
+
"mistake": "Nesting Content inside Overlay, hand-building focus or document listeners, or using Dialog for an anchored utility panel.",
|
|
144
|
+
"correction": "Keep Overlay and Content siblings, rely on Dialog and Atom Modal behavior, and choose Popover for compact anchored work."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"mistake": "Letting long content scroll the whole surface or assuming an unrelated third-party portal is automatically inside the modal.",
|
|
148
|
+
"correction": "Put overflow in Body and mount the descendant portal inside Content or register its owner with Branch."
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"validation": [
|
|
152
|
+
"Verify trigger semantics, accessible name and optional description, keyboard, pointer, touch, and programmatic initial focus, Tab containment, Close, top-layer Escape, direct-target backdrop dismissal, and focus restoration.",
|
|
153
|
+
"Verify controlled state, nested dialogs and every Branch, background isolation, document scroll lock, long Body scrolling, footer reflow, exit presence, zoom, reduced motion, forced colors, and narrow and short viewports.",
|
|
154
|
+
"Check light and dark appearance on the actual portalled Content and confirm Dialog CSS plus every composed child component stylesheet is loaded."
|
|
155
|
+
],
|
|
156
|
+
"related": [
|
|
157
|
+
{
|
|
158
|
+
"kind": "package",
|
|
159
|
+
"package": "@flowstack-ui/atom",
|
|
160
|
+
"id": "dialog",
|
|
161
|
+
"versionPolicy": "installed-exact"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"kind": "package",
|
|
165
|
+
"package": "@flowstack-ui/atom",
|
|
166
|
+
"id": "modal",
|
|
167
|
+
"versionPolicy": "installed-exact"
|
|
168
|
+
},
|
|
169
|
+
"alert-dialog",
|
|
170
|
+
"drawer",
|
|
171
|
+
"popover",
|
|
172
|
+
"button",
|
|
173
|
+
"appearance"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
```
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Divider
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: divider
|
|
6
|
+
|
|
7
|
+
# Divider agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Render a finished decorative or semantic content boundary with horizontal or vertical visual recipes.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- Adjacent content groups need a visible boundary and Atom Divider semantics.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- Spacing alone expresses the relationship or the boundary is interactive. Use Stack gap or a dedicated splitter.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Use Divider inside the layout owner shared by the adjacent complete groups and choose decorative=false only when the separation has meaning.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **MUST:** Choose semantic versus decorative behavior independently from color, thickness, and orientation.
|
|
28
|
+
- **MUST:** Place Divider between complete semantic or interactive groups under one consistent layout owner; do not split a trigger from the content it controls.
|
|
29
|
+
- **MUST:** Load styles.css or core.css plus divider.css.
|
|
30
|
+
|
|
31
|
+
## Common mistakes
|
|
32
|
+
|
|
33
|
+
- **Avoid:** Using a bordered div or text glyph for every separator, or placing a Divider inside only part of a repeated group's anatomy. **Instead:** Use Divider when there is a boundary, Stack gap when there is only spacing, and keep repeated boundaries after complete groups under the same owner.
|
|
34
|
+
|
|
35
|
+
## Validation checklist
|
|
36
|
+
|
|
37
|
+
- Check orientation, adjacent-group ownership, contrast, forced colors, zoom, and semantics.
|
|
38
|
+
- Confirm it is not focusable and CSS is loaded.
|
|
39
|
+
|
|
40
|
+
## Related guidance
|
|
41
|
+
|
|
42
|
+
- `stack`
|
|
43
|
+
- `toolbar`
|
|
44
|
+
- `surface`
|
|
45
|
+
- `nav-list`
|
|
46
|
+
|
|
47
|
+
## Machine record
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"schema": "flowstack.agent-component.v1",
|
|
52
|
+
"id": "divider",
|
|
53
|
+
"name": "Divider",
|
|
54
|
+
"package": "@flowstack-ui/brick",
|
|
55
|
+
"layer": "brick",
|
|
56
|
+
"kind": "component",
|
|
57
|
+
"purpose": "Render a finished decorative or semantic content boundary with horizontal or vertical visual recipes.",
|
|
58
|
+
"useWhen": [
|
|
59
|
+
"Adjacent content groups need a visible boundary and Atom Divider semantics."
|
|
60
|
+
],
|
|
61
|
+
"avoidWhen": [
|
|
62
|
+
{
|
|
63
|
+
"condition": "Spacing alone expresses the relationship or the boundary is interactive.",
|
|
64
|
+
"useInstead": "Stack gap or a dedicated splitter"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"composition": [
|
|
68
|
+
"Use Divider inside the layout owner shared by the adjacent complete groups and choose decorative=false only when the separation has meaning."
|
|
69
|
+
],
|
|
70
|
+
"rules": [
|
|
71
|
+
{
|
|
72
|
+
"id": "divider-meaning",
|
|
73
|
+
"level": "must",
|
|
74
|
+
"statement": "Choose semantic versus decorative behavior independently from color, thickness, and orientation."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "divider-group-owner",
|
|
78
|
+
"level": "must",
|
|
79
|
+
"statement": "Place Divider between complete semantic or interactive groups under one consistent layout owner; do not split a trigger from the content it controls."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "divider-css",
|
|
83
|
+
"level": "must",
|
|
84
|
+
"statement": "Load styles.css or core.css plus divider.css."
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"commonMistakes": [
|
|
88
|
+
{
|
|
89
|
+
"mistake": "Using a bordered div or text glyph for every separator, or placing a Divider inside only part of a repeated group's anatomy.",
|
|
90
|
+
"correction": "Use Divider when there is a boundary, Stack gap when there is only spacing, and keep repeated boundaries after complete groups under the same owner."
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"validation": [
|
|
94
|
+
"Check orientation, adjacent-group ownership, contrast, forced colors, zoom, and semantics.",
|
|
95
|
+
"Confirm it is not focusable and CSS is loaded."
|
|
96
|
+
],
|
|
97
|
+
"related": [
|
|
98
|
+
"stack",
|
|
99
|
+
"toolbar",
|
|
100
|
+
"surface",
|
|
101
|
+
"nav-list"
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
```
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: drawer
|
|
6
|
+
|
|
7
|
+
# Drawer agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a finished modal side sheet while Atom owns focus, dismissal, portal, scroll-lock, and labeling behavior.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A temporary modal task or navigation panel should enter from a screen edge.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The side region is persistent layout or the overlay has no edge meaning. Use Sidebar or Dialog.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Compose Trigger and Portal with Overlay and Content; put a header containing Title, Description when useful, and Close inside Content, then use Stack/NavList for its body.
|
|
24
|
+
- Title is a native heading rather than a polymorphic layout host. Use its as prop to choose the heading level; do not pass a multi-element brand or layout through asChild. When the surface intentionally has no visible heading, give Content an explicit accessible name such as aria-label="Mobile navigation".
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Use Drawer parts rather than hand-building overlay, focus trap, Escape, outside interaction, or portal behavior.
|
|
29
|
+
- **MUST:** Give Content an accessible name with a concise Title or, when no visible heading is appropriate, an explicit aria-label or aria-labelledby on Content.
|
|
30
|
+
- **MUST:** Choose size and placement from content needs: use xl when content may need the viewport but should shrink when short, and full only when the surface must always fill it.
|
|
31
|
+
- **MUST:** Let top and bottom Drawers grow naturally to their selected size cap; keep long overflow in Drawer.Body instead of forcing a fixed application height.
|
|
32
|
+
- **MUST:** Use Footer justify for simple action distribution, a Brick layout component inside Footer for complex grouping, and Button fullWidth only when the action itself should fill the row.
|
|
33
|
+
- **MUST:** In React Server Components, import the component subpath as import * as Drawer from @flowstack-ui/brick/drawer; use the legacy root-package runtime object only inside a client-owned module.
|
|
34
|
+
- **MUST:** Load styles.css or core.css plus drawer.css.
|
|
35
|
+
|
|
36
|
+
## Common mistakes
|
|
37
|
+
|
|
38
|
+
- **Avoid:** Building a mobile menu as an absolutely positioned div or placing Close outside the labeled content hierarchy. **Instead:** Use Drawer anatomy and compose the menu content with Brick navigation and layout components.
|
|
39
|
+
- **Avoid:** Adding use client to an entire Next page only to dereference the legacy Drawer runtime object. **Instead:** Use the RSC-safe module-namespace subpath so only Drawer remains client-owned.
|
|
40
|
+
- **Avoid:** Using asChild on Title or treating a brand lockup as a heading. **Instead:** Keep branding in the visual header and name Content explicitly when there is no concise visible title.
|
|
41
|
+
|
|
42
|
+
## Validation checklist
|
|
43
|
+
|
|
44
|
+
- Test labeling, initial focus, focus containment/return, Escape, overlay, Close, scroll lock, content growth and capped Body overflow, touch, reduced motion, narrow screens, and nested portals.
|
|
45
|
+
- Confirm CSS and every composed child component stylesheet are loaded.
|
|
46
|
+
- In a React Server Component consumer, confirm the module-namespace form passes a production prerender without promoting the page to use client.
|
|
47
|
+
|
|
48
|
+
## Related guidance
|
|
49
|
+
|
|
50
|
+
- `sidebar`
|
|
51
|
+
- `dialog`
|
|
52
|
+
- `nav-list`
|
|
53
|
+
- `stack`
|
|
54
|
+
- `show`
|
|
55
|
+
- `hide`
|
|
56
|
+
|
|
57
|
+
## Machine record
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"schema": "flowstack.agent-component.v1",
|
|
62
|
+
"id": "drawer",
|
|
63
|
+
"name": "Drawer",
|
|
64
|
+
"package": "@flowstack-ui/brick",
|
|
65
|
+
"layer": "brick",
|
|
66
|
+
"kind": "component",
|
|
67
|
+
"purpose": "Present a finished modal side sheet while Atom owns focus, dismissal, portal, scroll-lock, and labeling behavior.",
|
|
68
|
+
"useWhen": [
|
|
69
|
+
"A temporary modal task or navigation panel should enter from a screen edge."
|
|
70
|
+
],
|
|
71
|
+
"avoidWhen": [
|
|
72
|
+
{
|
|
73
|
+
"condition": "The side region is persistent layout or the overlay has no edge meaning.",
|
|
74
|
+
"useInstead": "Sidebar or Dialog"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"composition": [
|
|
78
|
+
"Compose Trigger and Portal with Overlay and Content; put a header containing Title, Description when useful, and Close inside Content, then use Stack/NavList for its body.",
|
|
79
|
+
"Title is a native heading rather than a polymorphic layout host. Use its as prop to choose the heading level; do not pass a multi-element brand or layout through asChild. When the surface intentionally has no visible heading, give Content an explicit accessible name such as aria-label=\"Mobile navigation\"."
|
|
80
|
+
],
|
|
81
|
+
"rules": [
|
|
82
|
+
{
|
|
83
|
+
"id": "drawer-anatomy",
|
|
84
|
+
"level": "must",
|
|
85
|
+
"statement": "Use Drawer parts rather than hand-building overlay, focus trap, Escape, outside interaction, or portal behavior."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "drawer-accessible-name",
|
|
89
|
+
"level": "must",
|
|
90
|
+
"statement": "Give Content an accessible name with a concise Title or, when no visible heading is appropriate, an explicit aria-label or aria-labelledby on Content."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "drawer-responsive",
|
|
94
|
+
"level": "must",
|
|
95
|
+
"statement": "Choose size and placement from content needs: use xl when content may need the viewport but should shrink when short, and full only when the surface must always fill it."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "drawer-content-growth",
|
|
99
|
+
"level": "must",
|
|
100
|
+
"statement": "Let top and bottom Drawers grow naturally to their selected size cap; keep long overflow in Drawer.Body instead of forcing a fixed application height."
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "drawer-footer-layout",
|
|
104
|
+
"level": "must",
|
|
105
|
+
"statement": "Use Footer justify for simple action distribution, a Brick layout component inside Footer for complex grouping, and Button fullWidth only when the action itself should fill the row."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "drawer-rsc-import",
|
|
109
|
+
"level": "must",
|
|
110
|
+
"statement": "In React Server Components, import the component subpath as import * as Drawer from @flowstack-ui/brick/drawer; use the legacy root-package runtime object only inside a client-owned module."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "drawer-css",
|
|
114
|
+
"level": "must",
|
|
115
|
+
"statement": "Load styles.css or core.css plus drawer.css."
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"commonMistakes": [
|
|
119
|
+
{
|
|
120
|
+
"mistake": "Building a mobile menu as an absolutely positioned div or placing Close outside the labeled content hierarchy.",
|
|
121
|
+
"correction": "Use Drawer anatomy and compose the menu content with Brick navigation and layout components."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"mistake": "Adding use client to an entire Next page only to dereference the legacy Drawer runtime object.",
|
|
125
|
+
"correction": "Use the RSC-safe module-namespace subpath so only Drawer remains client-owned."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"mistake": "Using asChild on Title or treating a brand lockup as a heading.",
|
|
129
|
+
"correction": "Keep branding in the visual header and name Content explicitly when there is no concise visible title."
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"validation": [
|
|
133
|
+
"Test labeling, initial focus, focus containment/return, Escape, overlay, Close, scroll lock, content growth and capped Body overflow, touch, reduced motion, narrow screens, and nested portals.",
|
|
134
|
+
"Confirm CSS and every composed child component stylesheet are loaded.",
|
|
135
|
+
"In a React Server Component consumer, confirm the module-namespace form passes a production prerender without promoting the page to use client."
|
|
136
|
+
],
|
|
137
|
+
"related": [
|
|
138
|
+
"sidebar",
|
|
139
|
+
"dialog",
|
|
140
|
+
"nav-list",
|
|
141
|
+
"stack",
|
|
142
|
+
"show",
|
|
143
|
+
"hide"
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# DropdownMenu
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: dropdown-menu
|
|
6
|
+
|
|
7
|
+
# DropdownMenu agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a finished compact command or settings menu from a visible button while Atom owns menu semantics, real item focus, keyboard navigation, selection, dismissal, portals, and collision-aware placement.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A visible named button should reveal a short list of commands, independent settings, exclusive settings, secondary destinations, or nested commands.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- Commands belong to a contextual gesture, several persistent application command categories, a form value, or ordinary site navigation. Use ContextMenu, Menubar, Select, or NavigationMenu or NavList.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Compose DropdownMenu.Root with DropdownMenu.Trigger asChild around a finished named Button or IconButton, plus DropdownMenu.Portal and DropdownMenu.Content. Build Content from uniquely valued Item, CheckboxItem, RadioGroup and RadioItem, Group and Label, Separator, and paired Sub, SubTrigger, and SubContent parts; use Leading, ItemLabel, Description, Shortcut, and ItemIndicator for finished rows.
|
|
24
|
+
- For a genuine secondary destination, compose Item asChild around one Brick Link and preserve its href; command rows use onSelect. Reproduce any local Appearance scope on portalled Content and SubContent.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Use DropdownMenu for commands or settings opened by a visible button; use Select for a form value, ContextMenu for contextual invocation, Menubar for persistent command categories, and navigation owners for route lists.
|
|
29
|
+
- **MUST:** Compose Trigger around a visible finished Button or IconButton with a complete accessible name and preserve Atom's button, popup, expanded, controls, disabled, and input-aware opening semantics.
|
|
30
|
+
- **MUST:** Use uniquely valued Item, CheckboxItem, and RadioItem for their matching roles, provide textValue when rendered children are not searchable text, and preserve real focus, typeahead, and disabled-item navigation without activation.
|
|
31
|
+
- **MUST:** Choose closeOnSelect by job: commands normally close while checkbox and radio settings normally remain open; do not close the tree with competing handlers or document listeners.
|
|
32
|
+
- **MUST:** Keep SubTrigger and SubContent inside one Sub and preserve direction-aware cascade keys, hover intent, whole-tree dismissal, and collision-resolved placement instead of inventing responsive drill-in behavior.
|
|
33
|
+
- **MUST:** Compose a genuine destination Item around one Brick Link so href and menuitem semantics share the same interactive owner; do not attach routing to a command-only div.
|
|
34
|
+
- **MUST:** Use Leading, ItemLabel, Description, Shortcut, ItemIndicator, and tone=danger for their documented jobs instead of rebuilding columns, selection glyphs, icon sizing, or destructive emphasis.
|
|
35
|
+
- **SHOULD:** Let Content use its collision-aware available height and native internal scrolling; verify three densities, long labels, zoom, narrow viewports, LTR and RTL, and reachable nested commands without semantic transformation.
|
|
36
|
+
- **MUST:** When Portal leaves a local Appearance scope, reproduce that scope on Content and SubContent or target a portal container inside it.
|
|
37
|
+
- **MUST:** Load styles.css or core.css plus dropdown-menu.css and every composed child component stylesheet.
|
|
38
|
+
|
|
39
|
+
## Common mistakes
|
|
40
|
+
|
|
41
|
+
- **Avoid:** Using an unlabeled icon trigger, Popover for menu commands, DropdownMenu for form selection or primary navigation, or custom key and document dismissal handlers. **Instead:** Use a named Button or IconButton, choose the semantic owner, and rely on DropdownMenu and shared Menu behavior.
|
|
42
|
+
- **Avoid:** Nesting a Button inside Item, rebuilding row columns, or treating Shortcut text as registered keyboard behavior. **Instead:** Keep one interactive owner, compose the public row anatomy, and register application shortcuts outside DropdownMenu.
|
|
43
|
+
|
|
44
|
+
## Validation checklist
|
|
45
|
+
|
|
46
|
+
- Verify Trigger name and semantics, click, tap, Enter, Space, ArrowDown, and ArrowUp opening, initial real item focus, Home/End, typeahead, controlled and disabled state, Tab exit, Escape, outside dismissal, and focus return.
|
|
47
|
+
- Verify command, destination-link, checkbox mixed, radio, group, indicator, separator, and submenu behavior; unique values and textValue; close policies; modal and parent-modal ownership; and LTR and RTL cascade keys.
|
|
48
|
+
- Verify three densities, Leading geometry, danger meaning, constrained scrolling, collision placement, zoom, narrow viewports, reduced motion, forced colors, light and dark portalled appearance, and complete CSS.
|
|
49
|
+
|
|
50
|
+
## Related guidance
|
|
51
|
+
|
|
52
|
+
- `@flowstack-ui/atom/agents/dropdown-menu`
|
|
53
|
+
- `@flowstack-ui/atom/agents/menu`
|
|
54
|
+
- `context-menu`
|
|
55
|
+
- `menubar`
|
|
56
|
+
- `select`
|
|
57
|
+
- `navigation-menu`
|
|
58
|
+
- `nav-list`
|
|
59
|
+
- `button`
|
|
60
|
+
- `icon-button`
|
|
61
|
+
- `link`
|
|
62
|
+
- `appearance`
|
|
63
|
+
|
|
64
|
+
## Machine record
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"schema": "flowstack.agent-component.v1",
|
|
69
|
+
"id": "dropdown-menu",
|
|
70
|
+
"name": "DropdownMenu",
|
|
71
|
+
"package": "@flowstack-ui/brick",
|
|
72
|
+
"layer": "brick",
|
|
73
|
+
"kind": "component",
|
|
74
|
+
"purpose": "Present a finished compact command or settings menu from a visible button while Atom owns menu semantics, real item focus, keyboard navigation, selection, dismissal, portals, and collision-aware placement.",
|
|
75
|
+
"useWhen": [
|
|
76
|
+
"A visible named button should reveal a short list of commands, independent settings, exclusive settings, secondary destinations, or nested commands."
|
|
77
|
+
],
|
|
78
|
+
"avoidWhen": [
|
|
79
|
+
{
|
|
80
|
+
"condition": "Commands belong to a contextual gesture, several persistent application command categories, a form value, or ordinary site navigation.",
|
|
81
|
+
"useInstead": "ContextMenu, Menubar, Select, or NavigationMenu or NavList"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"composition": [
|
|
85
|
+
"Compose DropdownMenu.Root with DropdownMenu.Trigger asChild around a finished named Button or IconButton, plus DropdownMenu.Portal and DropdownMenu.Content. Build Content from uniquely valued Item, CheckboxItem, RadioGroup and RadioItem, Group and Label, Separator, and paired Sub, SubTrigger, and SubContent parts; use Leading, ItemLabel, Description, Shortcut, and ItemIndicator for finished rows.",
|
|
86
|
+
"For a genuine secondary destination, compose Item asChild around one Brick Link and preserve its href; command rows use onSelect. Reproduce any local Appearance scope on portalled Content and SubContent."
|
|
87
|
+
],
|
|
88
|
+
"rules": [
|
|
89
|
+
{
|
|
90
|
+
"id": "dropdown-menu-selection",
|
|
91
|
+
"level": "must",
|
|
92
|
+
"statement": "Use DropdownMenu for commands or settings opened by a visible button; use Select for a form value, ContextMenu for contextual invocation, Menubar for persistent command categories, and navigation owners for route lists."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "dropdown-menu-trigger",
|
|
96
|
+
"level": "must",
|
|
97
|
+
"statement": "Compose Trigger around a visible finished Button or IconButton with a complete accessible name and preserve Atom's button, popup, expanded, controls, disabled, and input-aware opening semantics."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "dropdown-menu-item-model",
|
|
101
|
+
"level": "must",
|
|
102
|
+
"statement": "Use uniquely valued Item, CheckboxItem, and RadioItem for their matching roles, provide textValue when rendered children are not searchable text, and preserve real focus, typeahead, and disabled-item navigation without activation."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "dropdown-menu-selection-close",
|
|
106
|
+
"level": "must",
|
|
107
|
+
"statement": "Choose closeOnSelect by job: commands normally close while checkbox and radio settings normally remain open; do not close the tree with competing handlers or document listeners."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "dropdown-menu-submenu",
|
|
111
|
+
"level": "must",
|
|
112
|
+
"statement": "Keep SubTrigger and SubContent inside one Sub and preserve direction-aware cascade keys, hover intent, whole-tree dismissal, and collision-resolved placement instead of inventing responsive drill-in behavior."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "dropdown-menu-destination",
|
|
116
|
+
"level": "must",
|
|
117
|
+
"statement": "Compose a genuine destination Item around one Brick Link so href and menuitem semantics share the same interactive owner; do not attach routing to a command-only div."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "dropdown-menu-row-anatomy",
|
|
121
|
+
"level": "must",
|
|
122
|
+
"statement": "Use Leading, ItemLabel, Description, Shortcut, ItemIndicator, and tone=danger for their documented jobs instead of rebuilding columns, selection glyphs, icon sizing, or destructive emphasis."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "dropdown-menu-responsive",
|
|
126
|
+
"level": "should",
|
|
127
|
+
"statement": "Let Content use its collision-aware available height and native internal scrolling; verify three densities, long labels, zoom, narrow viewports, LTR and RTL, and reachable nested commands without semantic transformation."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "dropdown-menu-theme-scope",
|
|
131
|
+
"level": "must",
|
|
132
|
+
"statement": "When Portal leaves a local Appearance scope, reproduce that scope on Content and SubContent or target a portal container inside it."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"id": "dropdown-menu-css",
|
|
136
|
+
"level": "must",
|
|
137
|
+
"statement": "Load styles.css or core.css plus dropdown-menu.css and every composed child component stylesheet."
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"commonMistakes": [
|
|
141
|
+
{
|
|
142
|
+
"mistake": "Using an unlabeled icon trigger, Popover for menu commands, DropdownMenu for form selection or primary navigation, or custom key and document dismissal handlers.",
|
|
143
|
+
"correction": "Use a named Button or IconButton, choose the semantic owner, and rely on DropdownMenu and shared Menu behavior."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"mistake": "Nesting a Button inside Item, rebuilding row columns, or treating Shortcut text as registered keyboard behavior.",
|
|
147
|
+
"correction": "Keep one interactive owner, compose the public row anatomy, and register application shortcuts outside DropdownMenu."
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"validation": [
|
|
151
|
+
"Verify Trigger name and semantics, click, tap, Enter, Space, ArrowDown, and ArrowUp opening, initial real item focus, Home/End, typeahead, controlled and disabled state, Tab exit, Escape, outside dismissal, and focus return.",
|
|
152
|
+
"Verify command, destination-link, checkbox mixed, radio, group, indicator, separator, and submenu behavior; unique values and textValue; close policies; modal and parent-modal ownership; and LTR and RTL cascade keys.",
|
|
153
|
+
"Verify three densities, Leading geometry, danger meaning, constrained scrolling, collision placement, zoom, narrow viewports, reduced motion, forced colors, light and dark portalled appearance, and complete CSS."
|
|
154
|
+
],
|
|
155
|
+
"related": [
|
|
156
|
+
{
|
|
157
|
+
"kind": "package",
|
|
158
|
+
"package": "@flowstack-ui/atom",
|
|
159
|
+
"id": "dropdown-menu",
|
|
160
|
+
"versionPolicy": "installed-exact"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"kind": "package",
|
|
164
|
+
"package": "@flowstack-ui/atom",
|
|
165
|
+
"id": "menu",
|
|
166
|
+
"versionPolicy": "installed-exact"
|
|
167
|
+
},
|
|
168
|
+
"context-menu",
|
|
169
|
+
"menubar",
|
|
170
|
+
"select",
|
|
171
|
+
"navigation-menu",
|
|
172
|
+
"nav-list",
|
|
173
|
+
"button",
|
|
174
|
+
"icon-button",
|
|
175
|
+
"link",
|
|
176
|
+
"appearance"
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
```
|