@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,175 @@
|
|
|
1
|
+
# Checkbox Group
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: checkbox-group
|
|
6
|
+
|
|
7
|
+
# Checkbox Group agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Coordinate related multi-selection with structured item labels, optional descriptions, native repeated form values, and an optional aggregate parent control.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- Several independently selectable choices belong to one named group or need a select-all parent.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The choice is independent and does not share group state. Use Checkbox.
|
|
20
|
+
- Exactly one option must be selected. Use Radio Group or Select.
|
|
21
|
+
- The interface needs remote option loading, search, or a generated filter engine. Use Combobox or application-owned discovery controls.
|
|
22
|
+
|
|
23
|
+
## Required composition
|
|
24
|
+
|
|
25
|
+
- Give Root an accessible group name directly or compose it inside Fieldset with one visible Legend and shared description or error.
|
|
26
|
+
- Compose Root with Item children; wrap each primary label in ItemLabel and supporting text in ItemDescription when structured item relationships are needed.
|
|
27
|
+
- Use Parent only with an explicit allValues list containing the currently selectable declared values; omit individually disabled values and never infer the collection from rendered children.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- **MUST:** Use Checkbox Group only for related multi-selection; keep one-of-many choice, independent consent, remote search, and application filter execution in their owning patterns.
|
|
32
|
+
- **MUST:** Give Root a persistent accessible group name and every Item a complete visible associated label; placeholder or surrounding layout does not name the group.
|
|
33
|
+
- **MUST:** Give every Item a unique stable string value and let the application own persistence, query synchronization, result counts, and filtering side effects.
|
|
34
|
+
- **MUST:** Supply Parent allValues explicitly from the selectable declared set and do not include disabled choices or derive the set from DOM children.
|
|
35
|
+
- **MUST:** Use the vertical default for scan-heavy groups and horizontal only when wrapped reading order remains clear under narrow widths, zoom, and localization.
|
|
36
|
+
- **MUST:** Keep required or invalid messaging at group scope when any eligible option can satisfy the requirement; do not paint every Item as individually invalid.
|
|
37
|
+
- **MUST:** Preserve disabled and read-only Items, one-or-more required validity, first-enabled validation focus, Fieldset relationships, named repeated-value submission, external form association, and uncontrolled reset.
|
|
38
|
+
- **MUST:** Load styles.css or core.css plus checkbox-group.css and any Fieldset styles used.
|
|
39
|
+
|
|
40
|
+
## Common mistakes
|
|
41
|
+
|
|
42
|
+
- **Avoid:** Building a filter facet with unrelated standalone checkboxes and no group name. **Instead:** Use one named CheckboxGroup.Root with stable Item values and keep query execution in the application.
|
|
43
|
+
- **Avoid:** Using Parent without an explicit current selectable set. **Instead:** Pass allValues deliberately so none, mixed, and all state remain deterministic.
|
|
44
|
+
- **Avoid:** Adding custom row hover or focus paint around labels. **Instead:** Keep the full row clickable while Brick confines visual interaction feedback to the checkbox square.
|
|
45
|
+
|
|
46
|
+
## Validation checklist
|
|
47
|
+
|
|
48
|
+
- Inspect the group name, item labels and descriptions, unique values, repeated native form entries, required validity, reset, and disabled or read-only behavior.
|
|
49
|
+
- Toggle Items and Parent with keyboard, pointer, and touch; verify none, mixed, and all states against the exact declared allValues set.
|
|
50
|
+
- Check vertical and horizontal wrapping, long localized labels, 320 CSS pixels, 200% text, 400% zoom, RTL, dark appearance, and forced colors.
|
|
51
|
+
- Confirm application-owned filtering, persistence, URL state, counts, and asynchronous results remain outside Checkbox Group.
|
|
52
|
+
|
|
53
|
+
## Related guidance
|
|
54
|
+
|
|
55
|
+
- `@flowstack-ui/atom/agents/checkbox-group`
|
|
56
|
+
- `checkbox`
|
|
57
|
+
- `fieldset`
|
|
58
|
+
- `radio-group`
|
|
59
|
+
- `toggle-group`
|
|
60
|
+
- `select`
|
|
61
|
+
- `combobox`
|
|
62
|
+
- `form`
|
|
63
|
+
|
|
64
|
+
## Machine record
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"schema": "flowstack.agent-component.v1",
|
|
69
|
+
"id": "checkbox-group",
|
|
70
|
+
"name": "Checkbox Group",
|
|
71
|
+
"package": "@flowstack-ui/brick",
|
|
72
|
+
"layer": "brick",
|
|
73
|
+
"kind": "component",
|
|
74
|
+
"purpose": "Coordinate related multi-selection with structured item labels, optional descriptions, native repeated form values, and an optional aggregate parent control.",
|
|
75
|
+
"useWhen": [
|
|
76
|
+
"Several independently selectable choices belong to one named group or need a select-all parent."
|
|
77
|
+
],
|
|
78
|
+
"avoidWhen": [
|
|
79
|
+
{
|
|
80
|
+
"condition": "The choice is independent and does not share group state.",
|
|
81
|
+
"useInstead": "Checkbox"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"condition": "Exactly one option must be selected.",
|
|
85
|
+
"useInstead": "Radio Group or Select"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"condition": "The interface needs remote option loading, search, or a generated filter engine.",
|
|
89
|
+
"useInstead": "Combobox or application-owned discovery controls"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"composition": [
|
|
93
|
+
"Give Root an accessible group name directly or compose it inside Fieldset with one visible Legend and shared description or error.",
|
|
94
|
+
"Compose Root with Item children; wrap each primary label in ItemLabel and supporting text in ItemDescription when structured item relationships are needed.",
|
|
95
|
+
"Use Parent only with an explicit allValues list containing the currently selectable declared values; omit individually disabled values and never infer the collection from rendered children."
|
|
96
|
+
],
|
|
97
|
+
"rules": [
|
|
98
|
+
{
|
|
99
|
+
"id": "checkbox-group-related-choices",
|
|
100
|
+
"level": "must",
|
|
101
|
+
"statement": "Use Checkbox Group only for related multi-selection; keep one-of-many choice, independent consent, remote search, and application filter execution in their owning patterns."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "checkbox-group-naming",
|
|
105
|
+
"level": "must",
|
|
106
|
+
"statement": "Give Root a persistent accessible group name and every Item a complete visible associated label; placeholder or surrounding layout does not name the group."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "checkbox-group-value-identity",
|
|
110
|
+
"level": "must",
|
|
111
|
+
"statement": "Give every Item a unique stable string value and let the application own persistence, query synchronization, result counts, and filtering side effects."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "checkbox-group-parent-values",
|
|
115
|
+
"level": "must",
|
|
116
|
+
"statement": "Supply Parent allValues explicitly from the selectable declared set and do not include disabled choices or derive the set from DOM children."
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "checkbox-group-orientation",
|
|
120
|
+
"level": "must",
|
|
121
|
+
"statement": "Use the vertical default for scan-heavy groups and horizontal only when wrapped reading order remains clear under narrow widths, zoom, and localization."
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "checkbox-group-invalid-scope",
|
|
125
|
+
"level": "must",
|
|
126
|
+
"statement": "Keep required or invalid messaging at group scope when any eligible option can satisfy the requirement; do not paint every Item as individually invalid."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "checkbox-group-state-form",
|
|
130
|
+
"level": "must",
|
|
131
|
+
"statement": "Preserve disabled and read-only Items, one-or-more required validity, first-enabled validation focus, Fieldset relationships, named repeated-value submission, external form association, and uncontrolled reset."
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "checkbox-group-css",
|
|
135
|
+
"level": "must",
|
|
136
|
+
"statement": "Load styles.css or core.css plus checkbox-group.css and any Fieldset styles used."
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"commonMistakes": [
|
|
140
|
+
{
|
|
141
|
+
"mistake": "Building a filter facet with unrelated standalone checkboxes and no group name.",
|
|
142
|
+
"correction": "Use one named CheckboxGroup.Root with stable Item values and keep query execution in the application."
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"mistake": "Using Parent without an explicit current selectable set.",
|
|
146
|
+
"correction": "Pass allValues deliberately so none, mixed, and all state remain deterministic."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"mistake": "Adding custom row hover or focus paint around labels.",
|
|
150
|
+
"correction": "Keep the full row clickable while Brick confines visual interaction feedback to the checkbox square."
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"validation": [
|
|
154
|
+
"Inspect the group name, item labels and descriptions, unique values, repeated native form entries, required validity, reset, and disabled or read-only behavior.",
|
|
155
|
+
"Toggle Items and Parent with keyboard, pointer, and touch; verify none, mixed, and all states against the exact declared allValues set.",
|
|
156
|
+
"Check vertical and horizontal wrapping, long localized labels, 320 CSS pixels, 200% text, 400% zoom, RTL, dark appearance, and forced colors.",
|
|
157
|
+
"Confirm application-owned filtering, persistence, URL state, counts, and asynchronous results remain outside Checkbox Group."
|
|
158
|
+
],
|
|
159
|
+
"related": [
|
|
160
|
+
{
|
|
161
|
+
"kind": "package",
|
|
162
|
+
"package": "@flowstack-ui/atom",
|
|
163
|
+
"id": "checkbox-group",
|
|
164
|
+
"versionPolicy": "installed-exact"
|
|
165
|
+
},
|
|
166
|
+
"checkbox",
|
|
167
|
+
"fieldset",
|
|
168
|
+
"radio-group",
|
|
169
|
+
"toggle-group",
|
|
170
|
+
"select",
|
|
171
|
+
"combobox",
|
|
172
|
+
"form"
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: checkbox
|
|
6
|
+
|
|
7
|
+
# Checkbox agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Render a finished independent checked, unchecked, or mixed selection with Atom interaction and form behavior.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A user independently turns an option on or off, or an aggregate parent represents mixed child selection.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- Exactly one option must be selected from a set. Use RadioGroup.
|
|
20
|
+
|
|
21
|
+
## Required composition
|
|
22
|
+
|
|
23
|
+
- Compose Checkbox.Root with Checkbox.Indicator and a visible associated label, usually inside Field or Fieldset.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **MUST:** Give every checkbox a visible associated label unless context is genuinely redundant and an accessible name remains.
|
|
28
|
+
- **MUST:** Load styles.css or core.css plus checkbox.css and any Field/Fieldset styles used.
|
|
29
|
+
|
|
30
|
+
## Common mistakes
|
|
31
|
+
|
|
32
|
+
- **Avoid:** Using Checkbox for a one-of-many choice. **Instead:** Use RadioGroup for mutually exclusive options.
|
|
33
|
+
|
|
34
|
+
## Validation checklist
|
|
35
|
+
|
|
36
|
+
- Toggle with Space, pointer, and touch.
|
|
37
|
+
- Inspect checked/mixed and disabled states, label hit target, submitted value, focus, and contrast.
|
|
38
|
+
|
|
39
|
+
## Related guidance
|
|
40
|
+
|
|
41
|
+
- `@flowstack-ui/atom/agents/checkbox`
|
|
42
|
+
- `field`
|
|
43
|
+
- `fieldset`
|
|
44
|
+
- `radio-group`
|
|
45
|
+
|
|
46
|
+
## Machine record
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"schema": "flowstack.agent-component.v1",
|
|
51
|
+
"id": "checkbox",
|
|
52
|
+
"name": "Checkbox",
|
|
53
|
+
"package": "@flowstack-ui/brick",
|
|
54
|
+
"layer": "brick",
|
|
55
|
+
"kind": "component",
|
|
56
|
+
"purpose": "Render a finished independent checked, unchecked, or mixed selection with Atom interaction and form behavior.",
|
|
57
|
+
"useWhen": [
|
|
58
|
+
"A user independently turns an option on or off, or an aggregate parent represents mixed child selection."
|
|
59
|
+
],
|
|
60
|
+
"avoidWhen": [
|
|
61
|
+
{
|
|
62
|
+
"condition": "Exactly one option must be selected from a set.",
|
|
63
|
+
"useInstead": "RadioGroup"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"composition": [
|
|
67
|
+
"Compose Checkbox.Root with Checkbox.Indicator and a visible associated label, usually inside Field or Fieldset."
|
|
68
|
+
],
|
|
69
|
+
"rules": [
|
|
70
|
+
{
|
|
71
|
+
"id": "checkbox-label",
|
|
72
|
+
"level": "must",
|
|
73
|
+
"statement": "Give every checkbox a visible associated label unless context is genuinely redundant and an accessible name remains."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "checkbox-css",
|
|
77
|
+
"level": "must",
|
|
78
|
+
"statement": "Load styles.css or core.css plus checkbox.css and any Field/Fieldset styles used."
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"commonMistakes": [
|
|
82
|
+
{
|
|
83
|
+
"mistake": "Using Checkbox for a one-of-many choice.",
|
|
84
|
+
"correction": "Use RadioGroup for mutually exclusive options."
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"validation": [
|
|
88
|
+
"Toggle with Space, pointer, and touch.",
|
|
89
|
+
"Inspect checked/mixed and disabled states, label hit target, submitted value, focus, and contrast."
|
|
90
|
+
],
|
|
91
|
+
"related": [
|
|
92
|
+
{
|
|
93
|
+
"kind": "package",
|
|
94
|
+
"package": "@flowstack-ui/atom",
|
|
95
|
+
"id": "checkbox",
|
|
96
|
+
"versionPolicy": "installed-exact"
|
|
97
|
+
},
|
|
98
|
+
"field",
|
|
99
|
+
"fieldset",
|
|
100
|
+
"radio-group"
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: chip
|
|
6
|
+
|
|
7
|
+
# Chip agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present one compact authored or selected value with an optional, explicitly named remove action.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- An applied filter, recipient, assignee, category, or other value already in application state needs compact presentation and may be removable.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The content is passive metadata or status with no removal action. Use Badge.
|
|
20
|
+
- The user is choosing or toggling a value rather than removing an existing one. Use Toggle, ToggleGroup, CheckboxGroup, or another matching selection control.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Compose Root with Label and include RemoveTrigger only when the surrounding application can remove that value; give every RemoveTrigger a value-specific ariaLabel and onPress handler.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- **MUST:** Keep Root noninteractive; RemoveTrigger is the only removal control, so clicking the label does not silently perform the action.
|
|
29
|
+
- **MUST:** Name every RemoveTrigger with the value and action, such as ariaLabel="Remove Men filter"; never expose an unlabeled close icon.
|
|
30
|
+
- **MUST:** Treat onPress as a removal request; the parent owns state mutation, URL synchronization, focus recovery, and announcements.
|
|
31
|
+
- **MUST:** Keep the only removal action visible and operable at narrow widths, zoom, and increased text size.
|
|
32
|
+
- **MUST:** Load styles.css or core.css plus chip.css.
|
|
33
|
+
|
|
34
|
+
## Common mistakes
|
|
35
|
+
|
|
36
|
+
- **Avoid:** Using one Button for the complete chip so selecting the label removes the value, or adding a decorative x with no accessible action name. **Instead:** Use passive Chip.Root and Chip.Label with a separately named Chip.RemoveTrigger.
|
|
37
|
+
- **Avoid:** Using Chip as a complete editable token-entry system with automatic keyboard deletion and focus movement. **Instead:** Keep standalone Chip parent-controlled and use an Atom-backed collection owner when token-entry behavior is required.
|
|
38
|
+
|
|
39
|
+
## Validation checklist
|
|
40
|
+
|
|
41
|
+
- Check visible label, value-specific removal name, mouse and keyboard activation, disabled treatment, focus visibility, and parent-owned removal.
|
|
42
|
+
- Check narrow widths, zoom, long labels, RTL, forced colors, touch targeting, and CSS delivery.
|
|
43
|
+
|
|
44
|
+
## Related guidance
|
|
45
|
+
|
|
46
|
+
- `badge`
|
|
47
|
+
- `button`
|
|
48
|
+
- `toggle`
|
|
49
|
+
- `toggle-group`
|
|
50
|
+
- `checkbox-group`
|
|
51
|
+
|
|
52
|
+
## Machine record
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"schema": "flowstack.agent-component.v1",
|
|
57
|
+
"id": "chip",
|
|
58
|
+
"name": "Chip",
|
|
59
|
+
"package": "@flowstack-ui/brick",
|
|
60
|
+
"layer": "brick",
|
|
61
|
+
"kind": "component",
|
|
62
|
+
"purpose": "Present one compact authored or selected value with an optional, explicitly named remove action.",
|
|
63
|
+
"useWhen": [
|
|
64
|
+
"An applied filter, recipient, assignee, category, or other value already in application state needs compact presentation and may be removable."
|
|
65
|
+
],
|
|
66
|
+
"avoidWhen": [
|
|
67
|
+
{
|
|
68
|
+
"condition": "The content is passive metadata or status with no removal action.",
|
|
69
|
+
"useInstead": "Badge"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"condition": "The user is choosing or toggling a value rather than removing an existing one.",
|
|
73
|
+
"useInstead": "Toggle, ToggleGroup, CheckboxGroup, or another matching selection control"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"composition": [
|
|
77
|
+
"Compose Root with Label and include RemoveTrigger only when the surrounding application can remove that value; give every RemoveTrigger a value-specific ariaLabel and onPress handler."
|
|
78
|
+
],
|
|
79
|
+
"rules": [
|
|
80
|
+
{
|
|
81
|
+
"id": "chip-root-passive",
|
|
82
|
+
"level": "must",
|
|
83
|
+
"statement": "Keep Root noninteractive; RemoveTrigger is the only removal control, so clicking the label does not silently perform the action."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "chip-remove-name",
|
|
87
|
+
"level": "must",
|
|
88
|
+
"statement": "Name every RemoveTrigger with the value and action, such as ariaLabel=\"Remove Men filter\"; never expose an unlabeled close icon."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "chip-state-owner",
|
|
92
|
+
"level": "must",
|
|
93
|
+
"statement": "Treat onPress as a removal request; the parent owns state mutation, URL synchronization, focus recovery, and announcements."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "chip-responsive-removal",
|
|
97
|
+
"level": "must",
|
|
98
|
+
"statement": "Keep the only removal action visible and operable at narrow widths, zoom, and increased text size."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "chip-css",
|
|
102
|
+
"level": "must",
|
|
103
|
+
"statement": "Load styles.css or core.css plus chip.css."
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"commonMistakes": [
|
|
107
|
+
{
|
|
108
|
+
"mistake": "Using one Button for the complete chip so selecting the label removes the value, or adding a decorative x with no accessible action name.",
|
|
109
|
+
"correction": "Use passive Chip.Root and Chip.Label with a separately named Chip.RemoveTrigger."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"mistake": "Using Chip as a complete editable token-entry system with automatic keyboard deletion and focus movement.",
|
|
113
|
+
"correction": "Keep standalone Chip parent-controlled and use an Atom-backed collection owner when token-entry behavior is required."
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"validation": [
|
|
117
|
+
"Check visible label, value-specific removal name, mouse and keyboard activation, disabled treatment, focus visibility, and parent-owned removal.",
|
|
118
|
+
"Check narrow widths, zoom, long labels, RTL, forced colors, touch targeting, and CSS delivery."
|
|
119
|
+
],
|
|
120
|
+
"related": [
|
|
121
|
+
"badge",
|
|
122
|
+
"button",
|
|
123
|
+
"toggle",
|
|
124
|
+
"toggle-group",
|
|
125
|
+
"checkbox-group"
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Code Block
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: code-block
|
|
6
|
+
|
|
7
|
+
# Code Block agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present preserved multi-line technical source with native scrolling, explicit metadata, optional copy behavior, and consumer-owned syntax highlighting.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- Source examples, configuration, commands, generated markup, or other preserved multi-line technical content need a finished readable surface.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- A short technical literal belongs inside prose. Use Code.
|
|
20
|
+
- The source must be edited, executed, or behave like a terminal. Use an application-owned editor, sandbox, or terminal.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Pass the exact plain-text source to Root value, then place Content inside Root and give focusable Content a specific accessible label.
|
|
25
|
+
- Author Header, Title, Language, Actions, CopyTrigger, CopyStatus, and CopyIndicator only when the interface needs those optional parts.
|
|
26
|
+
- For syntax highlighting, generate trusted React token nodes outside Brick and pass them to Content while keeping Root value identical to the plain text that must be copied.
|
|
27
|
+
- Give the Code Block a bounded parent when vertical page or panel layout requires a fixed scrolling region; Content owns the code's horizontal overflow.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- **MUST:** Keep Root value authoritative and exactly aligned with rendered highlighted content so copy behavior never depends on rendered textContent.
|
|
32
|
+
- **MUST:** Keep tokenization, language loading, and syntax palettes in a consumer adapter; Brick accepts trusted React nodes and does not bundle a highlighter or unsafe HTML path.
|
|
33
|
+
- **MUST:** Let Content own canonical pre, code, focus, and horizontal scrolling instead of rebuilding them with a separate ScrollArea or native pre element.
|
|
34
|
+
- **MUST:** Give every focusable Content region a specific aria-label or aria-labelledby, especially when several examples share one page.
|
|
35
|
+
- **MUST:** Load styles.css or core.css plus code-block.css and its documented component dependencies.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- **Avoid:** Rendering highlighted HTML with dangerouslySetInnerHTML, copying from token text, or nesting another pre and ScrollArea inside Content. **Instead:** Render trusted React token spans, preserve the original string in Root value, and let Content own the canonical code viewport.
|
|
40
|
+
- **Avoid:** Adding a header, language label, copy action, or status region merely because those parts exist. **Instead:** Author only the optional anatomy required by the surrounding interface.
|
|
41
|
+
|
|
42
|
+
## Validation checklist
|
|
43
|
+
|
|
44
|
+
- Confirm the rendered tokens and copied plain text match exactly, unsafe HTML is absent, and copy success, failure, concurrency, and status wording remain truthful when copy anatomy is present.
|
|
45
|
+
- Check keyboard focus, uniquely named overflow landmarks, long-line scrolling or wrapping, mobile text sizing, zoom, selection, RTL/LTR, light and dark syntax contrast, and CSS delivery.
|
|
46
|
+
|
|
47
|
+
## Related guidance
|
|
48
|
+
|
|
49
|
+
- `code`
|
|
50
|
+
- `scroll-area`
|
|
51
|
+
- `button`
|
|
52
|
+
- `tabs`
|
|
53
|
+
- `interface-composition`
|
|
54
|
+
|
|
55
|
+
## Machine record
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"schema": "flowstack.agent-component.v1",
|
|
60
|
+
"id": "code-block",
|
|
61
|
+
"name": "Code Block",
|
|
62
|
+
"package": "@flowstack-ui/brick",
|
|
63
|
+
"layer": "brick",
|
|
64
|
+
"kind": "component",
|
|
65
|
+
"purpose": "Present preserved multi-line technical source with native scrolling, explicit metadata, optional copy behavior, and consumer-owned syntax highlighting.",
|
|
66
|
+
"useWhen": [
|
|
67
|
+
"Source examples, configuration, commands, generated markup, or other preserved multi-line technical content need a finished readable surface."
|
|
68
|
+
],
|
|
69
|
+
"avoidWhen": [
|
|
70
|
+
{
|
|
71
|
+
"condition": "A short technical literal belongs inside prose.",
|
|
72
|
+
"useInstead": "Code"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"condition": "The source must be edited, executed, or behave like a terminal.",
|
|
76
|
+
"useInstead": "an application-owned editor, sandbox, or terminal"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"composition": [
|
|
80
|
+
"Pass the exact plain-text source to Root value, then place Content inside Root and give focusable Content a specific accessible label.",
|
|
81
|
+
"Author Header, Title, Language, Actions, CopyTrigger, CopyStatus, and CopyIndicator only when the interface needs those optional parts.",
|
|
82
|
+
"For syntax highlighting, generate trusted React token nodes outside Brick and pass them to Content while keeping Root value identical to the plain text that must be copied.",
|
|
83
|
+
"Give the Code Block a bounded parent when vertical page or panel layout requires a fixed scrolling region; Content owns the code's horizontal overflow."
|
|
84
|
+
],
|
|
85
|
+
"rules": [
|
|
86
|
+
{
|
|
87
|
+
"id": "code-block-copy-source",
|
|
88
|
+
"level": "must",
|
|
89
|
+
"statement": "Keep Root value authoritative and exactly aligned with rendered highlighted content so copy behavior never depends on rendered textContent."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "code-block-highlighting-owner",
|
|
93
|
+
"level": "must",
|
|
94
|
+
"statement": "Keep tokenization, language loading, and syntax palettes in a consumer adapter; Brick accepts trusted React nodes and does not bundle a highlighter or unsafe HTML path."
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "code-block-scroll-owner",
|
|
98
|
+
"level": "must",
|
|
99
|
+
"statement": "Let Content own canonical pre, code, focus, and horizontal scrolling instead of rebuilding them with a separate ScrollArea or native pre element."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "code-block-accessible-name",
|
|
103
|
+
"level": "must",
|
|
104
|
+
"statement": "Give every focusable Content region a specific aria-label or aria-labelledby, especially when several examples share one page."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "code-block-css",
|
|
108
|
+
"level": "must",
|
|
109
|
+
"statement": "Load styles.css or core.css plus code-block.css and its documented component dependencies."
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"commonMistakes": [
|
|
113
|
+
{
|
|
114
|
+
"mistake": "Rendering highlighted HTML with dangerouslySetInnerHTML, copying from token text, or nesting another pre and ScrollArea inside Content.",
|
|
115
|
+
"correction": "Render trusted React token spans, preserve the original string in Root value, and let Content own the canonical code viewport."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"mistake": "Adding a header, language label, copy action, or status region merely because those parts exist.",
|
|
119
|
+
"correction": "Author only the optional anatomy required by the surrounding interface."
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"validation": [
|
|
123
|
+
"Confirm the rendered tokens and copied plain text match exactly, unsafe HTML is absent, and copy success, failure, concurrency, and status wording remain truthful when copy anatomy is present.",
|
|
124
|
+
"Check keyboard focus, uniquely named overflow landmarks, long-line scrolling or wrapping, mobile text sizing, zoom, selection, RTL/LTR, light and dark syntax contrast, and CSS delivery."
|
|
125
|
+
],
|
|
126
|
+
"related": [
|
|
127
|
+
"code",
|
|
128
|
+
"scroll-area",
|
|
129
|
+
"button",
|
|
130
|
+
"tabs",
|
|
131
|
+
"interface-composition"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
```
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Code
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: code
|
|
6
|
+
|
|
7
|
+
# Code agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Present a short inline technical literal with native code semantics and a finished Brick technical-text recipe.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- A short identifier, attribute, command, filename, value, or API name belongs inside prose or a compact label.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- The source is multi-line, preserves whitespace, needs language metadata, or may scroll. Use Code Block.
|
|
20
|
+
- The content represents keyboard input, computer output, a variable, editable source, or executable source. Use the correct native semantic element or an application-owned editor, terminal, or sandbox.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Keep Code inside the surrounding Text or component content owner when the literal completes that sentence or label.
|
|
25
|
+
- Choose subtle for an independently visible inline token and plain with tone inherit when the surrounding component already owns paint and foreground.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- **MUST:** Use Code only for a short computer-code fragment and preserve its one native code host; do not select it merely to obtain monospace typography.
|
|
30
|
+
- **MUST:** Keep Code inline with the prose or compact label it completes and use Code Block for multi-line or overflow-owned technical source.
|
|
31
|
+
- **MUST:** Choose variant, tone, and size through the closed Code recipes before overriding public variables; use tone inherit when a parent intentionally owns foreground contrast.
|
|
32
|
+
- **MUST:** Load styles.css or core.css plus code.css.
|
|
33
|
+
|
|
34
|
+
## Common mistakes
|
|
35
|
+
|
|
36
|
+
- **Avoid:** Using generic Text or a native span with monospace CSS for a real technical literal. **Instead:** Use Code so the literal keeps native code semantics and the shared Brick technical recipe.
|
|
37
|
+
- **Avoid:** Putting a complete diff, command transcript, or configuration example inside Code. **Instead:** Use Code Block so preserved whitespace, naming, focus, and overflow have one explicit owner.
|
|
38
|
+
|
|
39
|
+
## Validation checklist
|
|
40
|
+
|
|
41
|
+
- Confirm one native code element, correct surrounding sentence flow, safe wrapping of long tokens, and no unintended block or scroll behavior.
|
|
42
|
+
- Check inherited typography, subtle and plain recipes, light and dark appearances, forced colors, zoom, localization, RTL/bidi content, and CSS delivery.
|
|
43
|
+
|
|
44
|
+
## Related guidance
|
|
45
|
+
|
|
46
|
+
- `code-block`
|
|
47
|
+
- `text`
|
|
48
|
+
- `interface-composition`
|
|
49
|
+
|
|
50
|
+
## Machine record
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"schema": "flowstack.agent-component.v1",
|
|
55
|
+
"id": "code",
|
|
56
|
+
"name": "Code",
|
|
57
|
+
"package": "@flowstack-ui/brick",
|
|
58
|
+
"layer": "brick",
|
|
59
|
+
"kind": "component",
|
|
60
|
+
"purpose": "Present a short inline technical literal with native code semantics and a finished Brick technical-text recipe.",
|
|
61
|
+
"useWhen": [
|
|
62
|
+
"A short identifier, attribute, command, filename, value, or API name belongs inside prose or a compact label."
|
|
63
|
+
],
|
|
64
|
+
"avoidWhen": [
|
|
65
|
+
{
|
|
66
|
+
"condition": "The source is multi-line, preserves whitespace, needs language metadata, or may scroll.",
|
|
67
|
+
"useInstead": "Code Block"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"condition": "The content represents keyboard input, computer output, a variable, editable source, or executable source.",
|
|
71
|
+
"useInstead": "the correct native semantic element or an application-owned editor, terminal, or sandbox"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"composition": [
|
|
75
|
+
"Keep Code inside the surrounding Text or component content owner when the literal completes that sentence or label.",
|
|
76
|
+
"Choose subtle for an independently visible inline token and plain with tone inherit when the surrounding component already owns paint and foreground."
|
|
77
|
+
],
|
|
78
|
+
"rules": [
|
|
79
|
+
{
|
|
80
|
+
"id": "code-native-semantics",
|
|
81
|
+
"level": "must",
|
|
82
|
+
"statement": "Use Code only for a short computer-code fragment and preserve its one native code host; do not select it merely to obtain monospace typography."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "code-inline-boundary",
|
|
86
|
+
"level": "must",
|
|
87
|
+
"statement": "Keep Code inline with the prose or compact label it completes and use Code Block for multi-line or overflow-owned technical source."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "code-recipe-selection",
|
|
91
|
+
"level": "must",
|
|
92
|
+
"statement": "Choose variant, tone, and size through the closed Code recipes before overriding public variables; use tone inherit when a parent intentionally owns foreground contrast."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "code-css",
|
|
96
|
+
"level": "must",
|
|
97
|
+
"statement": "Load styles.css or core.css plus code.css."
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"commonMistakes": [
|
|
101
|
+
{
|
|
102
|
+
"mistake": "Using generic Text or a native span with monospace CSS for a real technical literal.",
|
|
103
|
+
"correction": "Use Code so the literal keeps native code semantics and the shared Brick technical recipe."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"mistake": "Putting a complete diff, command transcript, or configuration example inside Code.",
|
|
107
|
+
"correction": "Use Code Block so preserved whitespace, naming, focus, and overflow have one explicit owner."
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"validation": [
|
|
111
|
+
"Confirm one native code element, correct surrounding sentence flow, safe wrapping of long tokens, and no unintended block or scroll behavior.",
|
|
112
|
+
"Check inherited typography, subtle and plain recipes, light and dark appearances, forced colors, zoom, localization, RTL/bidi content, and CSS delivery."
|
|
113
|
+
],
|
|
114
|
+
"related": [
|
|
115
|
+
"code-block",
|
|
116
|
+
"text",
|
|
117
|
+
"interface-composition"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
```
|