@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,194 @@
|
|
|
1
|
+
# Surface
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: surface
|
|
6
|
+
|
|
7
|
+
# Surface agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Apply semantic background tones and layers, boundaries, elevation, radius, inset, and optional decorative media layering without implying a specific content object.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A region needs a semantic visual plane but Card, Dialog, or another purposeful component would add the wrong anatomy.
|
|
16
|
+
- Decorative image, video, canvas, or authored artwork needs to sit behind foreground content with an optional contrast scrim.
|
|
17
|
+
|
|
18
|
+
## Choose something else when
|
|
19
|
+
|
|
20
|
+
- The region represents one bounded subject with card anatomy. Use Card.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Choose Surface level and boundary by hierarchy, then compose public layout and content components inside. Use asChild around Section when paint must cover the Section rhythm without another host. For background media, author Media, optional Scrim, and Content in that order. When layered foreground content needs four-sided breathing room, set inset on the Surface root; Content owns foreground layering, not padding. Use xl and 2xl for page-sized panels or heroes, and the responsive value shape when that inset should grow with the viewport.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **SHOULD:** Choose surface level by information hierarchy, not decoration alone.
|
|
29
|
+
- **SHOULD:** Use accent tone only for a branded or conversion plane, never as a generic status surface.
|
|
30
|
+
- **MUST:** Use asChild only with one existing non-Fragment host that already owns the required semantics or layout; preserve that child's meaning and keep Surface responsible only for paint.
|
|
31
|
+
- **MUST:** Load styles.css or core.css plus surface.css.
|
|
32
|
+
- **MUST:** Use the Surface inset recipe for four-sided internal spacing; Surface.Content provides z-order only, and Stack startSpacing/endSpacing remain axis-specific.
|
|
33
|
+
- **SHOULD:** Use sm through lg for local panels and reserve xl or 2xl for page-sized panels, heroes, and split layouts.
|
|
34
|
+
- **MUST:** Write responsive inset mobile first with a required initial value and only the breakpoint overrides that change; omit a scalar inset none because none is already the default.
|
|
35
|
+
- **MUST:** Change a centered child's Frame or Container measure when the visible issue is line length or available width; Surface inset moves every child edge and does not replace content measure.
|
|
36
|
+
- **MUST:** Treat Surface.Media as decorative and noninteractive; keep meaningful media and controls in Content or ordinary document flow.
|
|
37
|
+
- **MUST:** Give Brick Image explicit fill inside Surface.Media so its actual Content and Fallback consume the complete media layer.
|
|
38
|
+
- **MUST:** Put every foreground child inside Surface.Content when Media or Scrim is used.
|
|
39
|
+
- **SHOULD:** Choose Scrim strength through the public prop and let the theme provide only the semantic scrim color unless one deliberate instance requires an advanced recipe override.
|
|
40
|
+
- **MUST:** Verify foreground contrast against every media state; Scrim does not prove contrast by itself.
|
|
41
|
+
|
|
42
|
+
## Common mistakes
|
|
43
|
+
|
|
44
|
+
- **Avoid:** Using arbitrary background colors to recreate a surface. **Instead:** Use Surface and theme its semantic tokens.
|
|
45
|
+
- **Avoid:** Adding absolute-positioning and z-index CSS for ordinary background media. **Instead:** Use Surface.Media, Surface.Scrim, and Surface.Content.
|
|
46
|
+
- **Avoid:** Expecting Surface.Content or Stack edge spacing to create padding on every foreground edge. **Instead:** Set inset on the Surface root, then use Stack only for child arrangement and primary-axis spacing.
|
|
47
|
+
- **Avoid:** Repeating page-panel padding in Block CSS. **Instead:** Use a larger or responsive Surface inset; use the public padding token only for one deliberate asymmetric relationship that the closed recipe cannot express.
|
|
48
|
+
- **Avoid:** Increasing inset to make a narrow centered child look wider. **Instead:** Adjust the child's Frame or Container measure independently.
|
|
49
|
+
|
|
50
|
+
## Validation checklist
|
|
51
|
+
|
|
52
|
+
- Check foreground contrast against the selected surface in every appearance.
|
|
53
|
+
- Confirm nested surfaces communicate hierarchy without excessive borders or elevation.
|
|
54
|
+
- Confirm Media and Scrim fill the root, remain hidden from assistive technology and pointer input, and Content stays above both.
|
|
55
|
+
- Check that layered foreground content has intentional spacing on all four logical edges at narrow and wide sizes.
|
|
56
|
+
- Check that responsive inset changes at the intended shared breakpoint while media and scrim remain edge-to-edge.
|
|
57
|
+
|
|
58
|
+
## Related guidance
|
|
59
|
+
|
|
60
|
+
- `card`
|
|
61
|
+
- `section`
|
|
62
|
+
- `container`
|
|
63
|
+
- `stack`
|
|
64
|
+
- `grid`
|
|
65
|
+
|
|
66
|
+
## Machine record
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"schema": "flowstack.agent-component.v1",
|
|
71
|
+
"id": "surface",
|
|
72
|
+
"name": "Surface",
|
|
73
|
+
"package": "@flowstack-ui/brick",
|
|
74
|
+
"layer": "brick",
|
|
75
|
+
"kind": "component",
|
|
76
|
+
"purpose": "Apply semantic background tones and layers, boundaries, elevation, radius, inset, and optional decorative media layering without implying a specific content object.",
|
|
77
|
+
"useWhen": [
|
|
78
|
+
"A region needs a semantic visual plane but Card, Dialog, or another purposeful component would add the wrong anatomy.",
|
|
79
|
+
"Decorative image, video, canvas, or authored artwork needs to sit behind foreground content with an optional contrast scrim."
|
|
80
|
+
],
|
|
81
|
+
"avoidWhen": [
|
|
82
|
+
{
|
|
83
|
+
"condition": "The region represents one bounded subject with card anatomy.",
|
|
84
|
+
"useInstead": "Card"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"composition": [
|
|
88
|
+
"Choose Surface level and boundary by hierarchy, then compose public layout and content components inside. Use asChild around Section when paint must cover the Section rhythm without another host. For background media, author Media, optional Scrim, and Content in that order. When layered foreground content needs four-sided breathing room, set inset on the Surface root; Content owns foreground layering, not padding. Use xl and 2xl for page-sized panels or heroes, and the responsive value shape when that inset should grow with the viewport."
|
|
89
|
+
],
|
|
90
|
+
"rules": [
|
|
91
|
+
{
|
|
92
|
+
"id": "surface-semantic-level",
|
|
93
|
+
"level": "should",
|
|
94
|
+
"statement": "Choose surface level by information hierarchy, not decoration alone."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "surface-accent-tone",
|
|
98
|
+
"level": "should",
|
|
99
|
+
"statement": "Use accent tone only for a branded or conversion plane, never as a generic status surface."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "surface-as-child",
|
|
103
|
+
"level": "must",
|
|
104
|
+
"statement": "Use asChild only with one existing non-Fragment host that already owns the required semantics or layout; preserve that child's meaning and keep Surface responsible only for paint."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "surface-css",
|
|
108
|
+
"level": "must",
|
|
109
|
+
"statement": "Load styles.css or core.css plus surface.css."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "surface-inset-owner",
|
|
113
|
+
"level": "must",
|
|
114
|
+
"statement": "Use the Surface inset recipe for four-sided internal spacing; Surface.Content provides z-order only, and Stack startSpacing/endSpacing remain axis-specific."
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "surface-inset-scale",
|
|
118
|
+
"level": "should",
|
|
119
|
+
"statement": "Use sm through lg for local panels and reserve xl or 2xl for page-sized panels, heroes, and split layouts."
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "surface-responsive-inset",
|
|
123
|
+
"level": "must",
|
|
124
|
+
"statement": "Write responsive inset mobile first with a required initial value and only the breakpoint overrides that change; omit a scalar inset none because none is already the default."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "surface-inset-measure",
|
|
128
|
+
"level": "must",
|
|
129
|
+
"statement": "Change a centered child's Frame or Container measure when the visible issue is line length or available width; Surface inset moves every child edge and does not replace content measure."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "surface-media-decoration",
|
|
133
|
+
"level": "must",
|
|
134
|
+
"statement": "Treat Surface.Media as decorative and noninteractive; keep meaningful media and controls in Content or ordinary document flow."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "surface-media-image-fill",
|
|
138
|
+
"level": "must",
|
|
139
|
+
"statement": "Give Brick Image explicit fill inside Surface.Media so its actual Content and Fallback consume the complete media layer."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "surface-media-content",
|
|
143
|
+
"level": "must",
|
|
144
|
+
"statement": "Put every foreground child inside Surface.Content when Media or Scrim is used."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "surface-scrim-strength",
|
|
148
|
+
"level": "should",
|
|
149
|
+
"statement": "Choose Scrim strength through the public prop and let the theme provide only the semantic scrim color unless one deliberate instance requires an advanced recipe override."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "surface-media-contrast",
|
|
153
|
+
"level": "must",
|
|
154
|
+
"statement": "Verify foreground contrast against every media state; Scrim does not prove contrast by itself."
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"commonMistakes": [
|
|
158
|
+
{
|
|
159
|
+
"mistake": "Using arbitrary background colors to recreate a surface.",
|
|
160
|
+
"correction": "Use Surface and theme its semantic tokens."
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"mistake": "Adding absolute-positioning and z-index CSS for ordinary background media.",
|
|
164
|
+
"correction": "Use Surface.Media, Surface.Scrim, and Surface.Content."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"mistake": "Expecting Surface.Content or Stack edge spacing to create padding on every foreground edge.",
|
|
168
|
+
"correction": "Set inset on the Surface root, then use Stack only for child arrangement and primary-axis spacing."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"mistake": "Repeating page-panel padding in Block CSS.",
|
|
172
|
+
"correction": "Use a larger or responsive Surface inset; use the public padding token only for one deliberate asymmetric relationship that the closed recipe cannot express."
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"mistake": "Increasing inset to make a narrow centered child look wider.",
|
|
176
|
+
"correction": "Adjust the child's Frame or Container measure independently."
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"validation": [
|
|
180
|
+
"Check foreground contrast against the selected surface in every appearance.",
|
|
181
|
+
"Confirm nested surfaces communicate hierarchy without excessive borders or elevation.",
|
|
182
|
+
"Confirm Media and Scrim fill the root, remain hidden from assistive technology and pointer input, and Content stays above both.",
|
|
183
|
+
"Check that layered foreground content has intentional spacing on all four logical edges at narrow and wide sizes.",
|
|
184
|
+
"Check that responsive inset changes at the intended shared breakpoint while media and scrim remain edge-to-edge."
|
|
185
|
+
],
|
|
186
|
+
"related": [
|
|
187
|
+
"card",
|
|
188
|
+
"section",
|
|
189
|
+
"container",
|
|
190
|
+
"stack",
|
|
191
|
+
"grid"
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
```
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# SwipeableItem
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: swipeable-item
|
|
6
|
+
|
|
7
|
+
# SwipeableItem agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Enhance a finished list-like row with logical start or end quick-action panels revealed by horizontal drag or keyboard while Atom owns state, measurement, gesture intent, scrolling preservation, and keyboard behavior.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A row has one or two frequent commands that benefit from touch reveal and every important command also remains available through an obvious tap or click route.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- There are many commands, discovery is critical, the row navigates or selects, or swipe would be surprising or the only pointer path. Use DropdownMenu, visible Button or IconButton controls, Link, or the appropriate selection component.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Compose Root with one focusable Content surface and a labelled Actions group for each supported logical start or end side. Put real named Button or Link controls inside Actions and keep an obvious non-swipe route, normally a visible overflow trigger, inside Content.
|
|
24
|
+
- Choose plain inside an existing row boundary or outline for a standalone boundary. Preserve surrounding List or Feed semantics and keep confirmation, undo, persistence, and coordination between rows in the application.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Treat swipe and keyboard reveal as enhancements; neither replaces the required obvious tap or click route to every important action.
|
|
29
|
+
- **MUST:** Give every Actions panel a localized accessible group name and every child complete native semantics; keep closed panels inert and accessibility-hidden.
|
|
30
|
+
- **MUST:** Preserve pan-y vertical scrolling, horizontal intent detection, pointer capture, cancellation rollback, measured logical-side widths, threshold settlement, and one owned pointer interaction.
|
|
31
|
+
- **MUST:** Keep Content focusable and preserve direction-aware Arrow reveal, opposite-Arrow close, and Escape close only when Content owns the key; nested controls retain their own keyboard behavior.
|
|
32
|
+
- **MUST:** Do not implement gesture execution around Brick SwipeableItem: Brick intentionally omits Atom's onFullSwipe and fullSwipeThreshold props so destructive or consequential commands require an explicit control.
|
|
33
|
+
- **MUST:** Use openSide with onOpenSideChange or defaultOpenSide, preserve disabled versus focusable read-only behavior, and treat start and end as logical sides that follow LTR and RTL.
|
|
34
|
+
- **MUST:** Keep authored Content wrapping, visible alternatives reachable, actions measured, and the shared clipped radius intact at narrow widths, zoom, RTL, forced colors, and reduced motion.
|
|
35
|
+
- **MUST:** Load styles.css or core.css plus swipeable-item.css and the CSS for every composed action or row component.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- **Avoid:** Making swipe the only route to Delete, blocking vertical scroll, firing a destructive threshold gesture, or letting Arrow keys from nested controls reveal actions. **Instead:** Provide an obvious explicit control, preserve pan-y and gesture intent, use Brick's no-full-swipe API, and retain keyboard target isolation.
|
|
40
|
+
- **Avoid:** Using SwipeableItem as List, Feed, navigation, selection, confirmation, or multi-row coordination ownership. **Instead:** Keep semantic row ownership and application effects outside the three-part enhancement boundary.
|
|
41
|
+
|
|
42
|
+
## Validation checklist
|
|
43
|
+
|
|
44
|
+
- Verify controlled/uncontrolled start/end/null state, LTR and RTL mapping, measured widths and offsets, pointer down/move/up settlement, threshold boundaries, cancellation, capture, vertical pan, disabled/read-only state, and action closeOnClick.
|
|
45
|
+
- Verify Content focus, Arrow reveal/close, Escape, descendant keyboard isolation, inert hidden panels, group and control names, obvious pointer fallback, absence of full-swipe execution, native props, refs, and real-browser mouse/touch scrolling.
|
|
46
|
+
- Verify plain and outline boundaries, long content, narrow widths, zoom, RTL, shared radii, focus, light/dark appearance, forced colors, reduced motion, and surrounding List or Feed semantics.
|
|
47
|
+
|
|
48
|
+
## Related guidance
|
|
49
|
+
|
|
50
|
+
- `@flowstack-ui/atom/agents/swipeable-item`
|
|
51
|
+
- `dropdown-menu`
|
|
52
|
+
- `button`
|
|
53
|
+
- `icon-button`
|
|
54
|
+
- `link`
|
|
55
|
+
- `list`
|
|
56
|
+
- `feed`
|
|
57
|
+
|
|
58
|
+
## Machine record
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"schema": "flowstack.agent-component.v1",
|
|
63
|
+
"id": "swipeable-item",
|
|
64
|
+
"name": "SwipeableItem",
|
|
65
|
+
"package": "@flowstack-ui/brick",
|
|
66
|
+
"layer": "brick",
|
|
67
|
+
"kind": "component",
|
|
68
|
+
"purpose": "Enhance a finished list-like row with logical start or end quick-action panels revealed by horizontal drag or keyboard while Atom owns state, measurement, gesture intent, scrolling preservation, and keyboard behavior.",
|
|
69
|
+
"useWhen": [
|
|
70
|
+
"A row has one or two frequent commands that benefit from touch reveal and every important command also remains available through an obvious tap or click route."
|
|
71
|
+
],
|
|
72
|
+
"avoidWhen": [
|
|
73
|
+
{
|
|
74
|
+
"condition": "There are many commands, discovery is critical, the row navigates or selects, or swipe would be surprising or the only pointer path.",
|
|
75
|
+
"useInstead": "DropdownMenu, visible Button or IconButton controls, Link, or the appropriate selection component"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"composition": [
|
|
79
|
+
"Compose Root with one focusable Content surface and a labelled Actions group for each supported logical start or end side. Put real named Button or Link controls inside Actions and keep an obvious non-swipe route, normally a visible overflow trigger, inside Content.",
|
|
80
|
+
"Choose plain inside an existing row boundary or outline for a standalone boundary. Preserve surrounding List or Feed semantics and keep confirmation, undo, persistence, and coordination between rows in the application."
|
|
81
|
+
],
|
|
82
|
+
"rules": [
|
|
83
|
+
{
|
|
84
|
+
"id": "swipeable-enhancement",
|
|
85
|
+
"level": "must",
|
|
86
|
+
"statement": "Treat swipe and keyboard reveal as enhancements; neither replaces the required obvious tap or click route to every important action."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "swipeable-actions",
|
|
90
|
+
"level": "must",
|
|
91
|
+
"statement": "Give every Actions panel a localized accessible group name and every child complete native semantics; keep closed panels inert and accessibility-hidden."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "swipeable-scroll-gesture",
|
|
95
|
+
"level": "must",
|
|
96
|
+
"statement": "Preserve pan-y vertical scrolling, horizontal intent detection, pointer capture, cancellation rollback, measured logical-side widths, threshold settlement, and one owned pointer interaction."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "swipeable-keyboard",
|
|
100
|
+
"level": "must",
|
|
101
|
+
"statement": "Keep Content focusable and preserve direction-aware Arrow reveal, opposite-Arrow close, and Escape close only when Content owns the key; nested controls retain their own keyboard behavior."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "swipeable-no-full-swipe",
|
|
105
|
+
"level": "must",
|
|
106
|
+
"statement": "Do not implement gesture execution around Brick SwipeableItem: Brick intentionally omits Atom's onFullSwipe and fullSwipeThreshold props so destructive or consequential commands require an explicit control."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "swipeable-state",
|
|
110
|
+
"level": "must",
|
|
111
|
+
"statement": "Use openSide with onOpenSideChange or defaultOpenSide, preserve disabled versus focusable read-only behavior, and treat start and end as logical sides that follow LTR and RTL."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "swipeable-responsive",
|
|
115
|
+
"level": "must",
|
|
116
|
+
"statement": "Keep authored Content wrapping, visible alternatives reachable, actions measured, and the shared clipped radius intact at narrow widths, zoom, RTL, forced colors, and reduced motion."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "swipeable-css",
|
|
120
|
+
"level": "must",
|
|
121
|
+
"statement": "Load styles.css or core.css plus swipeable-item.css and the CSS for every composed action or row component."
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"commonMistakes": [
|
|
125
|
+
{
|
|
126
|
+
"mistake": "Making swipe the only route to Delete, blocking vertical scroll, firing a destructive threshold gesture, or letting Arrow keys from nested controls reveal actions.",
|
|
127
|
+
"correction": "Provide an obvious explicit control, preserve pan-y and gesture intent, use Brick's no-full-swipe API, and retain keyboard target isolation."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"mistake": "Using SwipeableItem as List, Feed, navigation, selection, confirmation, or multi-row coordination ownership.",
|
|
131
|
+
"correction": "Keep semantic row ownership and application effects outside the three-part enhancement boundary."
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"validation": [
|
|
135
|
+
"Verify controlled/uncontrolled start/end/null state, LTR and RTL mapping, measured widths and offsets, pointer down/move/up settlement, threshold boundaries, cancellation, capture, vertical pan, disabled/read-only state, and action closeOnClick.",
|
|
136
|
+
"Verify Content focus, Arrow reveal/close, Escape, descendant keyboard isolation, inert hidden panels, group and control names, obvious pointer fallback, absence of full-swipe execution, native props, refs, and real-browser mouse/touch scrolling.",
|
|
137
|
+
"Verify plain and outline boundaries, long content, narrow widths, zoom, RTL, shared radii, focus, light/dark appearance, forced colors, reduced motion, and surrounding List or Feed semantics."
|
|
138
|
+
],
|
|
139
|
+
"related": [
|
|
140
|
+
{
|
|
141
|
+
"kind": "package",
|
|
142
|
+
"package": "@flowstack-ui/atom",
|
|
143
|
+
"id": "swipeable-item",
|
|
144
|
+
"versionPolicy": "installed-exact"
|
|
145
|
+
},
|
|
146
|
+
"dropdown-menu",
|
|
147
|
+
"button",
|
|
148
|
+
"icon-button",
|
|
149
|
+
"link",
|
|
150
|
+
"list",
|
|
151
|
+
"feed"
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: switch
|
|
6
|
+
|
|
7
|
+
# Switch agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a finished immediately applied on/off setting while Atom owns switch semantics, controlled or uncontrolled state, keyboard activation, validation, and optional form participation.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A setting becomes active or inactive immediately when the user operates it.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The choice is a form answer applied later, a command whose pressed state remains active, or one of several exclusive values. Use Checkbox, Toggle, or RadioGroup.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Give Switch.Root a stable visible or native accessible setting name and add Switch.Thumb as its decorative movable part. Compose Root in Field when visible Label, Description, Error, required, or invalid context is needed; use name, value, and form when checked state must submit.
|
|
24
|
+
- Choose Root size sm, md, or lg for the finished track, thumb, travel, and target geometry. Keep Thumb decorative and let Atom state attributes drive Brick paint.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Use Switch only for an immediately applied on/off setting; use Checkbox for a deferred form answer and Toggle for a persistent pressed command.
|
|
29
|
+
- **MUST:** Give Root a complete stable accessible setting name with visible Field Label, native labeling, aria-label, or aria-labelledby; Thumb remains decorative and aria-hidden.
|
|
30
|
+
- **MUST:** Use checked with onCheckedChange for controlled state or defaultChecked for uncontrolled state and preserve role=switch with boolean aria-checked.
|
|
31
|
+
- **MUST:** Use readOnly when the setting must stay focusable while Enter, Space, pointer, and custom-element activation cannot change state; do not replace it with disabled.
|
|
32
|
+
- **MUST:** Preserve named checked-value submission, required validity, Field state and descriptions, validation focus, external form association, and uncontrolled reset when form behavior applies.
|
|
33
|
+
- **MUST:** Use Brick's canonical checked, unchecked, focus, disabled, read-only, and invalid paint; invalid changes the boundary without replacing the checked meaning, and mixed or loading state is unsupported.
|
|
34
|
+
- **SHOULD:** Keep intrinsic geometry and complete target size, allow surrounding label text to reflow, and verify logical thumb travel in RTL without reversing on/off meaning.
|
|
35
|
+
- **MUST:** Load styles.css or core.css plus switch.css and Field CSS when composed.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- **Avoid:** Using Switch for a submit-later checkbox or pressed command, relying on Thumb as the accessible control, or changing the setting label between states. **Instead:** Choose by timing and semantics, name Root directly, keep Thumb decorative, and preserve one stable setting name.
|
|
40
|
+
- **Avoid:** Using disabled when the value should remain discoverable and read-only or inventing mixed, loading, tone, or shape props. **Instead:** Use readOnly for locked focusable state and stay within the canonical binary visual recipe.
|
|
41
|
+
|
|
42
|
+
## Validation checklist
|
|
43
|
+
|
|
44
|
+
- Verify accessible name, role and aria-checked, controlled and uncontrolled updates, pointer, Enter, and Space activation, disabled and read-only behavior, Thumb state inheritance, and native, asChild, and render semantics.
|
|
45
|
+
- Verify named checked-value submission, required validity with and without name, invalid and Field descriptions, validation focus, external form association, and uncontrolled reset.
|
|
46
|
+
- Verify three sizes, checked and unchecked contrast, focus, disabled, read-only and invalid paint, intrinsic and narrow layout, mobile targets, 200% text and 400% zoom, RTL travel, reduced motion, forced colors, and complete CSS.
|
|
47
|
+
|
|
48
|
+
## Related guidance
|
|
49
|
+
|
|
50
|
+
- `@flowstack-ui/atom/agents/switch`
|
|
51
|
+
- `checkbox`
|
|
52
|
+
- `toggle`
|
|
53
|
+
- `radio-group`
|
|
54
|
+
- `field`
|
|
55
|
+
- `form`
|
|
56
|
+
|
|
57
|
+
## Machine record
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"schema": "flowstack.agent-component.v1",
|
|
62
|
+
"id": "switch",
|
|
63
|
+
"name": "Switch",
|
|
64
|
+
"package": "@flowstack-ui/brick",
|
|
65
|
+
"layer": "brick",
|
|
66
|
+
"kind": "component",
|
|
67
|
+
"purpose": "Present a finished immediately applied on/off setting while Atom owns switch semantics, controlled or uncontrolled state, keyboard activation, validation, and optional form participation.",
|
|
68
|
+
"useWhen": [
|
|
69
|
+
"A setting becomes active or inactive immediately when the user operates it."
|
|
70
|
+
],
|
|
71
|
+
"avoidWhen": [
|
|
72
|
+
{
|
|
73
|
+
"condition": "The choice is a form answer applied later, a command whose pressed state remains active, or one of several exclusive values.",
|
|
74
|
+
"useInstead": "Checkbox, Toggle, or RadioGroup"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"composition": [
|
|
78
|
+
"Give Switch.Root a stable visible or native accessible setting name and add Switch.Thumb as its decorative movable part. Compose Root in Field when visible Label, Description, Error, required, or invalid context is needed; use name, value, and form when checked state must submit.",
|
|
79
|
+
"Choose Root size sm, md, or lg for the finished track, thumb, travel, and target geometry. Keep Thumb decorative and let Atom state attributes drive Brick paint."
|
|
80
|
+
],
|
|
81
|
+
"rules": [
|
|
82
|
+
{
|
|
83
|
+
"id": "switch-immediate",
|
|
84
|
+
"level": "must",
|
|
85
|
+
"statement": "Use Switch only for an immediately applied on/off setting; use Checkbox for a deferred form answer and Toggle for a persistent pressed command."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "switch-name",
|
|
89
|
+
"level": "must",
|
|
90
|
+
"statement": "Give Root a complete stable accessible setting name with visible Field Label, native labeling, aria-label, or aria-labelledby; Thumb remains decorative and aria-hidden."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "switch-state",
|
|
94
|
+
"level": "must",
|
|
95
|
+
"statement": "Use checked with onCheckedChange for controlled state or defaultChecked for uncontrolled state and preserve role=switch with boolean aria-checked."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "switch-readonly",
|
|
99
|
+
"level": "must",
|
|
100
|
+
"statement": "Use readOnly when the setting must stay focusable while Enter, Space, pointer, and custom-element activation cannot change state; do not replace it with disabled."
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "switch-form",
|
|
104
|
+
"level": "must",
|
|
105
|
+
"statement": "Preserve named checked-value submission, required validity, Field state and descriptions, validation focus, external form association, and uncontrolled reset when form behavior applies."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "switch-state-paint",
|
|
109
|
+
"level": "must",
|
|
110
|
+
"statement": "Use Brick's canonical checked, unchecked, focus, disabled, read-only, and invalid paint; invalid changes the boundary without replacing the checked meaning, and mixed or loading state is unsupported."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "switch-responsive",
|
|
114
|
+
"level": "should",
|
|
115
|
+
"statement": "Keep intrinsic geometry and complete target size, allow surrounding label text to reflow, and verify logical thumb travel in RTL without reversing on/off meaning."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "switch-css",
|
|
119
|
+
"level": "must",
|
|
120
|
+
"statement": "Load styles.css or core.css plus switch.css and Field CSS when composed."
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"commonMistakes": [
|
|
124
|
+
{
|
|
125
|
+
"mistake": "Using Switch for a submit-later checkbox or pressed command, relying on Thumb as the accessible control, or changing the setting label between states.",
|
|
126
|
+
"correction": "Choose by timing and semantics, name Root directly, keep Thumb decorative, and preserve one stable setting name."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"mistake": "Using disabled when the value should remain discoverable and read-only or inventing mixed, loading, tone, or shape props.",
|
|
130
|
+
"correction": "Use readOnly for locked focusable state and stay within the canonical binary visual recipe."
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"validation": [
|
|
134
|
+
"Verify accessible name, role and aria-checked, controlled and uncontrolled updates, pointer, Enter, and Space activation, disabled and read-only behavior, Thumb state inheritance, and native, asChild, and render semantics.",
|
|
135
|
+
"Verify named checked-value submission, required validity with and without name, invalid and Field descriptions, validation focus, external form association, and uncontrolled reset.",
|
|
136
|
+
"Verify three sizes, checked and unchecked contrast, focus, disabled, read-only and invalid paint, intrinsic and narrow layout, mobile targets, 200% text and 400% zoom, RTL travel, reduced motion, forced colors, and complete CSS."
|
|
137
|
+
],
|
|
138
|
+
"related": [
|
|
139
|
+
{
|
|
140
|
+
"kind": "package",
|
|
141
|
+
"package": "@flowstack-ui/atom",
|
|
142
|
+
"id": "switch",
|
|
143
|
+
"versionPolicy": "installed-exact"
|
|
144
|
+
},
|
|
145
|
+
"checkbox",
|
|
146
|
+
"toggle",
|
|
147
|
+
"radio-group",
|
|
148
|
+
"field",
|
|
149
|
+
"form"
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
```
|