@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,143 @@
|
|
|
1
|
+
# ZStack
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
Kind: component
|
|
5
|
+
ID: z-stack
|
|
6
|
+
|
|
7
|
+
# ZStack agent guide
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Overlap authored children in one depth-aware layout while preserving source, reading, and focus order.
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
|
|
15
|
+
- Two or more visual layers intentionally share the same region.
|
|
16
|
+
|
|
17
|
+
## Choose something else when
|
|
18
|
+
|
|
19
|
+
- Content follows one row or column. Use Stack.
|
|
20
|
+
- Content is an ordinary image-backed card or hero. Use Surface.Media, Surface.Scrim, and Surface.Content.
|
|
21
|
+
|
|
22
|
+
## Required composition
|
|
23
|
+
|
|
24
|
+
- Place natural-size layers directly in ZStack.Root and use ZStack.Item only when one layer needs its own nine-position alignment.
|
|
25
|
+
- For a corner action over media, use ZStack.Root isolation="open" and ZStack.Item layer="action" with edgeSpacing instead of recreating stacking, z-index, and inset margins in local CSS.
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- **MUST:** Keep DOM order meaningful because later children paint above earlier children.
|
|
30
|
+
- **MUST:** Keep media before its overlay in source; ZStack preserves that order even when the media establishes a positioned layer.
|
|
31
|
+
- **MUST:** Keep decorative layers from intercepting input intended for interactive content.
|
|
32
|
+
- **MUST:** Use responsive logical alignment only to move the same authored layer; never change source order, depth order, or focus order at a breakpoint.
|
|
33
|
+
- **MUST:** Use the closed content and action layers only for authored overlay participation; do not invent arbitrary z-index values or use layer to reorder meaning.
|
|
34
|
+
- **MUST:** Use edgeSpacing for a positioned layer that needs theme-space inset from its aligned edges; it supports the same responsive spacing vocabulary as Stack.
|
|
35
|
+
- **MUST:** Load styles.css or core.css plus z-stack.css.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- **Avoid:** Replacing ordinary linear layout with overlap. **Instead:** Use Stack or Grid unless layers intentionally share space.
|
|
40
|
+
- **Avoid:** Rebuilding Surface media anatomy. **Instead:** Prefer Surface for standard media-backed content.
|
|
41
|
+
- **Avoid:** Adding inline isolation, z-index, or margin styles to make an overlay action clickable and inset. **Instead:** Use isolation="open", layer="action", and edgeSpacing on ZStack's public composition API.
|
|
42
|
+
|
|
43
|
+
## Validation checklist
|
|
44
|
+
|
|
45
|
+
- Check natural sizing, responsive logical placement, focus order, zoom, RTL, and pointer access.
|
|
46
|
+
|
|
47
|
+
## Related guidance
|
|
48
|
+
|
|
49
|
+
- `stack`
|
|
50
|
+
- `grid`
|
|
51
|
+
- `surface`
|
|
52
|
+
- `image`
|
|
53
|
+
|
|
54
|
+
## Machine record
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"schema": "flowstack.agent-component.v1",
|
|
59
|
+
"id": "z-stack",
|
|
60
|
+
"name": "ZStack",
|
|
61
|
+
"package": "@flowstack-ui/brick",
|
|
62
|
+
"layer": "brick",
|
|
63
|
+
"kind": "component",
|
|
64
|
+
"purpose": "Overlap authored children in one depth-aware layout while preserving source, reading, and focus order.",
|
|
65
|
+
"useWhen": [
|
|
66
|
+
"Two or more visual layers intentionally share the same region."
|
|
67
|
+
],
|
|
68
|
+
"avoidWhen": [
|
|
69
|
+
{
|
|
70
|
+
"condition": "Content follows one row or column.",
|
|
71
|
+
"useInstead": "Stack"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"condition": "Content is an ordinary image-backed card or hero.",
|
|
75
|
+
"useInstead": "Surface.Media, Surface.Scrim, and Surface.Content"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"composition": [
|
|
79
|
+
"Place natural-size layers directly in ZStack.Root and use ZStack.Item only when one layer needs its own nine-position alignment.",
|
|
80
|
+
"For a corner action over media, use ZStack.Root isolation=\"open\" and ZStack.Item layer=\"action\" with edgeSpacing instead of recreating stacking, z-index, and inset margins in local CSS."
|
|
81
|
+
],
|
|
82
|
+
"rules": [
|
|
83
|
+
{
|
|
84
|
+
"id": "z-stack-source-order",
|
|
85
|
+
"level": "must",
|
|
86
|
+
"statement": "Keep DOM order meaningful because later children paint above earlier children."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "z-stack-positioned-media-order",
|
|
90
|
+
"level": "must",
|
|
91
|
+
"statement": "Keep media before its overlay in source; ZStack preserves that order even when the media establishes a positioned layer."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "z-stack-input",
|
|
95
|
+
"level": "must",
|
|
96
|
+
"statement": "Keep decorative layers from intercepting input intended for interactive content."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "z-stack-responsive-placement",
|
|
100
|
+
"level": "must",
|
|
101
|
+
"statement": "Use responsive logical alignment only to move the same authored layer; never change source order, depth order, or focus order at a breakpoint."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "z-stack-named-depth",
|
|
105
|
+
"level": "must",
|
|
106
|
+
"statement": "Use the closed content and action layers only for authored overlay participation; do not invent arbitrary z-index values or use layer to reorder meaning."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "z-stack-edge-spacing",
|
|
110
|
+
"level": "must",
|
|
111
|
+
"statement": "Use edgeSpacing for a positioned layer that needs theme-space inset from its aligned edges; it supports the same responsive spacing vocabulary as Stack."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "z-stack-css",
|
|
115
|
+
"level": "must",
|
|
116
|
+
"statement": "Load styles.css or core.css plus z-stack.css."
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"commonMistakes": [
|
|
120
|
+
{
|
|
121
|
+
"mistake": "Replacing ordinary linear layout with overlap.",
|
|
122
|
+
"correction": "Use Stack or Grid unless layers intentionally share space."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"mistake": "Rebuilding Surface media anatomy.",
|
|
126
|
+
"correction": "Prefer Surface for standard media-backed content."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"mistake": "Adding inline isolation, z-index, or margin styles to make an overlay action clickable and inset.",
|
|
130
|
+
"correction": "Use isolation=\"open\", layer=\"action\", and edgeSpacing on ZStack's public composition API."
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"validation": [
|
|
134
|
+
"Check natural sizing, responsive logical placement, focus order, zoom, RTL, and pointer access."
|
|
135
|
+
],
|
|
136
|
+
"related": [
|
|
137
|
+
"stack",
|
|
138
|
+
"grid",
|
|
139
|
+
"surface",
|
|
140
|
+
"image"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Public document: guides/agent-knowledge
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Agent Knowledge
|
|
6
|
+
|
|
7
|
+
Brick ships public component and cross-component guidance for coding agents
|
|
8
|
+
alongside its runtime and CSS artifacts. Component guidance explains local
|
|
9
|
+
selection, composition, CSS delivery, recurring mistakes, and validation.
|
|
10
|
+
Package guides first explain layer selection and complete-interface
|
|
11
|
+
composition. Neither artifact adds a runtime dependency.
|
|
12
|
+
|
|
13
|
+
Use `@flowstack-ui/brick/agents/manifest.json` to discover guidance. Its
|
|
14
|
+
separate `guides` and `components` collections point to machine-readable JSON
|
|
15
|
+
and human-readable Markdown. Read `layer-selection` and
|
|
16
|
+
`interface-composition` before choosing individual components, for example:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
@flowstack-ui/brick/agents/field.json
|
|
20
|
+
@flowstack-ui/brick/agents/field.md
|
|
21
|
+
@flowstack-ui/brick/agents/layer-selection.json
|
|
22
|
+
@flowstack-ui/brick/agents/interface-composition.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `@flowstack-ui/brick/agents/coverage.json` to inspect the exact released
|
|
26
|
+
catalog behind that manifest. The `flowstack.agent-coverage.v1` report lists
|
|
27
|
+
every public component owner and surface, its documentation and Agent
|
|
28
|
+
Knowledge ownership, explicit source-only exclusions, and structured package
|
|
29
|
+
guide destinations. Its package version matches the installed Brick version.
|
|
30
|
+
Complete releases have equal `componentOwners` and `guidedComponentOwners`,
|
|
31
|
+
100 percent classified public surfaces, and no invalid exclusion or unresolved
|
|
32
|
+
selection destination.
|
|
33
|
+
|
|
34
|
+
Structured external references use `versionPolicy: "installed-exact"`. Release
|
|
35
|
+
verification resolves the installed dependency's Agent Knowledge manifest and
|
|
36
|
+
checks that the referenced JSON artifact declares the expected ID, package,
|
|
37
|
+
and layer. Build, check, pack, consumer, and publication verification reject a
|
|
38
|
+
missing or mismatched installed external artifact.
|
|
39
|
+
|
|
40
|
+
The source pair lives beside the component it describes. `agent.json` is the
|
|
41
|
+
structured authority and `agent.md` is generated from it. Brick guidance adds
|
|
42
|
+
finished visual and CSS decisions while referring behavioral ownership to
|
|
43
|
+
Atom. Source, types, public component docs, and tests remain authoritative when
|
|
44
|
+
a guide is incomplete.
|
|
45
|
+
|
|
46
|
+
Package-level guide sources live under `agents/guides/`. They use
|
|
47
|
+
`flowstack.agent-guide.v1`; component sources continue to use
|
|
48
|
+
`flowstack.agent-component.v1`. Manifest `guides` is additive, so consumers
|
|
49
|
+
that already read only `components` remain compatible.
|
|
50
|
+
|
|
51
|
+
Package guide selection entries also include structured component, guide,
|
|
52
|
+
package, or native/application destinations. Agents should resolve those IDs
|
|
53
|
+
instead of treating the human-readable `use` sentence as a foreign key.
|
|
54
|
+
|
|
55
|
+
For a finished Brick interface, search Brick before writing native layout,
|
|
56
|
+
typography, media, navigation, visibility, or control replacements. Ordinary
|
|
57
|
+
Brick applications do not import Atom directly. When no Brick component owns
|
|
58
|
+
the job, record the native or framework fallback and its missing capability.
|
|
59
|
+
|
|
60
|
+
After selecting a component, read `interface-composition` and follow its
|
|
61
|
+
customization order: supported props, semantic theme tokens, documented
|
|
62
|
+
component tokens, public compound parts, and only then a narrow `className` or
|
|
63
|
+
stable-hook escape hatch. The JSON artifact defines a structured gap report
|
|
64
|
+
for every fallback or direct Brick declaration that remains after this search.
|
|
65
|
+
|
|
66
|
+
Agent Knowledge is public usage guidance. It does not contain private prompts,
|
|
67
|
+
ranking policy, customer information, or application workflows.
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Public document: guides/appearance-and-tokens
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Appearance and tokens
|
|
6
|
+
|
|
7
|
+
Brick ships complete light and dark semantic tokens. With no explicit setting,
|
|
8
|
+
the default follows `prefers-color-scheme`.
|
|
9
|
+
|
|
10
|
+
Set an appearance on the document or any subtree with the DOM contract:
|
|
11
|
+
|
|
12
|
+
```html
|
|
13
|
+
<html data-brick-appearance="dark">
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<section data-brick-appearance="light">
|
|
18
|
+
<!-- This region uses light semantic values. -->
|
|
19
|
+
</section>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Remove the attribute to return to the system preference.
|
|
23
|
+
|
|
24
|
+
Brick also exports a typed, server-safe composition utility for local scopes:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { Appearance } from "@flowstack-ui/brick/appearance";
|
|
28
|
+
|
|
29
|
+
<Appearance value="dark">
|
|
30
|
+
<section>Dark region</section>
|
|
31
|
+
</Appearance>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Appearance always decorates exactly one existing host without an extra
|
|
35
|
+
wrapper. Its existing component slot remains unchanged:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<Appearance value="dark">
|
|
39
|
+
<AppBar.Root>...</AppBar.Root>
|
|
40
|
+
</Appearance>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`value="inherit"` is the default and omits the explicit appearance attribute.
|
|
44
|
+
Appearance adds no background, spacing, state, persistence, toggle, or React
|
|
45
|
+
provider. Use Surface when the region also needs neutral paint; use Appearance
|
|
46
|
+
when only the semantic-token boundary is needed or when another component
|
|
47
|
+
already owns the visual region.
|
|
48
|
+
|
|
49
|
+
The complete stylesheet and modular `core.css` apply the active semantic
|
|
50
|
+
canvas, primary text color, body family, body size, and body line height to the
|
|
51
|
+
document body through a low-specificity foundation rule. Themes normally
|
|
52
|
+
change those semantic values rather than adding another body rule. Consumer
|
|
53
|
+
CSS in a later layer can deliberately replace the document treatment.
|
|
54
|
+
|
|
55
|
+
The optional reset stylesheet also maps native text selection to the active
|
|
56
|
+
accent solid/on-solid pair, with system `Highlight` colors in forced-colors mode.
|
|
57
|
+
This makes drag selection follow the compiled theme without requiring
|
|
58
|
+
application CSS.
|
|
59
|
+
|
|
60
|
+
## Custom themes
|
|
61
|
+
|
|
62
|
+
Override public semantic variables through ordinary CSS:
|
|
63
|
+
|
|
64
|
+
```css
|
|
65
|
+
.brand-theme {
|
|
66
|
+
--brick-color-accent-solid: #5b5bd6;
|
|
67
|
+
--brick-color-accent-on-solid: #ffffff;
|
|
68
|
+
--brick-radius-control: 0.75rem;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
<section className="brand-theme">...</section>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Override foreground and background roles together, then verify contrast and
|
|
77
|
+
all supported states. Arbitrary consumer overrides are outside Brick's visual
|
|
78
|
+
accessibility guarantee.
|
|
79
|
+
|
|
80
|
+
### Complete appearance maps
|
|
81
|
+
|
|
82
|
+
A theme that supports both light and dark must assign its complete
|
|
83
|
+
appearance-dependent color and shadow contract at every explicit re-entry
|
|
84
|
+
boundary. Do not define light only at the outer theme root and assume it will
|
|
85
|
+
return after a dark nested scope.
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
@layer flowstack.theme {
|
|
89
|
+
:where([data-flowstack-theme="ocean"]),
|
|
90
|
+
:where([data-flowstack-theme="ocean"][data-brick-appearance="light"]),
|
|
91
|
+
:where([data-flowstack-theme="ocean"] [data-brick-appearance="light"]) {
|
|
92
|
+
color-scheme: light;
|
|
93
|
+
/* Complete Ocean light semantic color assignments. */
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where([data-flowstack-theme="ocean"][data-brick-appearance="dark"]),
|
|
97
|
+
:where([data-flowstack-theme="ocean"] [data-brick-appearance="dark"]) {
|
|
98
|
+
color-scheme: dark;
|
|
99
|
+
/* Complete Ocean dark semantic color assignments. */
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Appearance-independent typography, radius, density, and motion values may
|
|
105
|
+
remain on the outer theme root. Every color role claimed by an appearance must
|
|
106
|
+
be complete, including surfaces, text, borders, focus, interaction states,
|
|
107
|
+
status colors, scrim, and shadow.
|
|
108
|
+
|
|
109
|
+
Brick reserves `flowstack.theme` between its token and foundation layers. The
|
|
110
|
+
generated theme contract [source reference: theme-contract.md] publishes the exact semantic and
|
|
111
|
+
approved component-input boundary for theme tooling.
|
|
112
|
+
|
|
113
|
+
### Portalled content
|
|
114
|
+
|
|
115
|
+
A portal rendered under `body` cannot inherit a local scope from its trigger.
|
|
116
|
+
Use one of two deterministic strategies.
|
|
117
|
+
|
|
118
|
+
Portal into an element inside the desired scope:
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<Dialog.Portal container={scopedLayerElement}>...</Dialog.Portal>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Or apply the appearance to the portalled visual roots:
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
<Drawer.Portal>
|
|
128
|
+
<Appearance value="dark">
|
|
129
|
+
<Drawer.Overlay />
|
|
130
|
+
</Appearance>
|
|
131
|
+
<Appearance value="dark">
|
|
132
|
+
<Drawer.Content>...</Drawer.Content>
|
|
133
|
+
</Appearance>
|
|
134
|
+
</Drawer.Portal>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Brick does not inspect the trigger, copy computed CSS variables, or add a
|
|
138
|
+
client context. This preserves server rendering and Atom's portal ownership.
|
|
139
|
+
|
|
140
|
+
## Qualification checklist
|
|
141
|
+
|
|
142
|
+
- Test the theme's document default and every supported explicit appearance.
|
|
143
|
+
- Test light -> dark -> light and dark -> light -> dark nesting.
|
|
144
|
+
- Test hover, pressed, selected, disabled, focus, and status treatments.
|
|
145
|
+
- Test Drawer, Dialog, Menu, Popover, Tooltip, Select, and other portals used
|
|
146
|
+
by the product.
|
|
147
|
+
- Test native form controls, forced colors, reduced motion, and contrast.
|
|
148
|
+
- If a saved preference exists, apply the document attribute before paint in
|
|
149
|
+
the framework or application layer; Brick does not own persistence.
|
|
150
|
+
|
|
151
|
+
## Typography recipes
|
|
152
|
+
|
|
153
|
+
Brick exposes complete semantic typography tuples instead of asking each
|
|
154
|
+
component to independently choose a font size, weight, line height, and letter
|
|
155
|
+
spacing. Every recipe has these five variables:
|
|
156
|
+
|
|
157
|
+
```text
|
|
158
|
+
--brick-typography-<recipe>-font-family
|
|
159
|
+
--brick-typography-<recipe>-font-size
|
|
160
|
+
--brick-typography-<recipe>-font-weight
|
|
161
|
+
--brick-typography-<recipe>-line-height
|
|
162
|
+
--brick-typography-<recipe>-letter-spacing
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The public recipe names are:
|
|
166
|
+
|
|
167
|
+
- authored content: `display`, `title-lg`, `title-md`, `title-sm`, `body-lg`,
|
|
168
|
+
`body-md`, `body-sm`, and `caption`;
|
|
169
|
+
- component anatomy: `label-md`, `label-strong`, `supporting-sm`,
|
|
170
|
+
`validation-sm`, `overlay-title`, `compact-title`, `compact-title-lg`,
|
|
171
|
+
`surface-title-sm`, `surface-title-md`, `surface-title-lg`,
|
|
172
|
+
`field-value-md`, and `field-value-lg`;
|
|
173
|
+
- controls: `control-xs`, `control-sm`, `control-md`, `control-lg`, and
|
|
174
|
+
`control-xl`.
|
|
175
|
+
|
|
176
|
+
Component anatomy owns its semantic element and styling contract. It does not
|
|
177
|
+
nest `Text`; its local variables alias the same semantic recipes that `Text`
|
|
178
|
+
uses. Override a semantic recipe to change a role across Brick, or a documented
|
|
179
|
+
component variable for one component only.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Public document: guides/browser-support
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Browser support
|
|
6
|
+
|
|
7
|
+
Brick declares the pinned Browserslist query
|
|
8
|
+
`baseline 2023 with downstream`. Its JavaScript is compiled to ES2020, and its
|
|
9
|
+
published CSS is built against that query with Lightning CSS.
|
|
10
|
+
|
|
11
|
+
Author component CSS with standard syntax. The package compiler owns generated
|
|
12
|
+
vendor prefixes required by the declared target; do not add prefixes by visual
|
|
13
|
+
guess. Optional effects must retain a usable baseline presentation, while
|
|
14
|
+
required layout, state, focus, and accessibility relationships must work at
|
|
15
|
+
the floor.
|
|
16
|
+
|
|
17
|
+
Portable component behavior is release-qualified in current Chromium,
|
|
18
|
+
Firefox, and Playwright WebKit. Mobile emulation is additional engine evidence,
|
|
19
|
+
not proof of physical Safari, iOS, Android, browser chrome, permissions, or
|
|
20
|
+
assistive technology. Those claims require the component's named platform
|
|
21
|
+
evidence.
|
|
22
|
+
|
|
23
|
+
An application remains responsible for its own authored code, dependencies,
|
|
24
|
+
build target, content, and complete journeys. Installing Brick does not make an
|
|
25
|
+
application compatible by itself.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Public document: guides/control-sizing
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Control sizing
|
|
6
|
+
|
|
7
|
+
Brick uses one shared size vocabulary for controls that commonly appear in the
|
|
8
|
+
same row. A matching `size` should produce a shared outer rhythm rather than a
|
|
9
|
+
collection of unrelated component scales.
|
|
10
|
+
|
|
11
|
+
## Shared contract
|
|
12
|
+
|
|
13
|
+
| Size | Minimum block size | Control text | Typical use |
|
|
14
|
+
| --- | ---: | ---: | --- |
|
|
15
|
+
| `sm` | 36px | `control-sm` | Compact application toolbars and page headers |
|
|
16
|
+
| `md` | 44px | `control-md` | General application controls |
|
|
17
|
+
| `lg` | 52px | `control-lg` | Comfortable or prominent controls |
|
|
18
|
+
|
|
19
|
+
Button, IconButton, Select, MultiSelect, Toggle, ToggleGroup, and comparable
|
|
20
|
+
button-like controls consume these shared geometry and control-typography
|
|
21
|
+
recipes. Their internal padding may differ when required by their anatomy, but
|
|
22
|
+
their outer height, icon scale, radius family, and baseline must align when the
|
|
23
|
+
same size is used.
|
|
24
|
+
|
|
25
|
+
Tabs uses the same control typography and target scale. A line tab may keep a
|
|
26
|
+
44px target while a nested `body-sm` label creates a deliberately quieter page
|
|
27
|
+
header; the target must not be reduced just to make the text look smaller.
|
|
28
|
+
|
|
29
|
+
## Editable-control exception
|
|
30
|
+
|
|
31
|
+
Input, Textarea, and editable Combobox content retain at least 16px text even
|
|
32
|
+
at `sm` to avoid avoidable mobile focus zoom. They still consume the shared
|
|
33
|
+
36/44/52px geometry and `--brick-radius-control`, so they align with adjacent
|
|
34
|
+
button-like controls without pretending that editable and action typography
|
|
35
|
+
have identical constraints.
|
|
36
|
+
|
|
37
|
+
## Composition
|
|
38
|
+
|
|
39
|
+
Use the same named size on controls that share a row. Let Stack own row gap and
|
|
40
|
+
alignment, and let Theme own `--brick-radius-control`, control typography, and
|
|
41
|
+
control height tokens. Do not repair a mismatched row with per-component
|
|
42
|
+
heights, transforms, margins, or literal radii.
|
|
43
|
+
|
|
44
|
+
When a control is intentionally more prominent, change its supported size and
|
|
45
|
+
document that hierarchy. Do not silently customize one component so that the
|
|
46
|
+
same size means something different.
|
|
47
|
+
|
|
48
|
+
## Verification
|
|
49
|
+
|
|
50
|
+
- Compare Button, Select, Toggle, ToggleGroup, and other button-like peers in
|
|
51
|
+
one row at `sm`, `md`, and `lg`.
|
|
52
|
+
- Confirm matching minimum block size, vertical center, radius family, icon
|
|
53
|
+
scale, and control typography.
|
|
54
|
+
- Confirm editable controls remain at least 16px while preserving the same
|
|
55
|
+
outer geometry.
|
|
56
|
+
- Change the active Theme radius and typography inputs and confirm every peer
|
|
57
|
+
updates together.
|
|
58
|
+
- Check long labels, zoom, narrow widths, RTL, focus rings, and light/dark
|
|
59
|
+
appearance without introducing one-off CSS.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Public document: guides/installation
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Installation
|
|
6
|
+
|
|
7
|
+
Install Brick in an existing React application:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @flowstack-ui/brick
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Brick installs its compatible `@flowstack-ui/atom` version automatically; do
|
|
14
|
+
not install Atom separately. React and React DOM 18 or newer are peer
|
|
15
|
+
dependencies and must be provided by the consuming application.
|
|
16
|
+
|
|
17
|
+
Import the complete stylesheet once from the application root:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import "@flowstack-ui/brick/styles.css";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This stylesheet contains default tokens, foundations, released component CSS,
|
|
24
|
+
and required keyframes. Its low-specificity document foundation applies the
|
|
25
|
+
canvas, primary foreground, body family, body size, and body line height from
|
|
26
|
+
Brick's semantic tokens. A theme changes those tokens instead of repeating a
|
|
27
|
+
separate `body` rule. Importing JavaScript does not import CSS automatically.
|
|
28
|
+
|
|
29
|
+
## Optional reset
|
|
30
|
+
|
|
31
|
+
New applications may opt into Brick's small page-level reset:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import "@flowstack-ui/brick/reset.css";
|
|
35
|
+
import "@flowstack-ui/brick/styles.css";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The reset is never included by `styles.css`. It owns neutral normalization such
|
|
39
|
+
as page sizing, body margin removal, and native `figure` and `blockquote`
|
|
40
|
+
margin removal; it does not paint the document. Existing applications can omit
|
|
41
|
+
it and keep their own reset or browser defaults. Higher-level FLOWSTACK packs,
|
|
42
|
+
including Blocks, may require this complete two-import setup so copied
|
|
43
|
+
compositions begin from the same neutral browser foundation.
|
|
44
|
+
|
|
45
|
+
## Tokens without components
|
|
46
|
+
|
|
47
|
+
Applications and custom components can load only the public visual tokens:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import "@flowstack-ui/brick/tokens.css";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Do not import both `tokens.css` and `styles.css`; the complete stylesheet
|
|
54
|
+
already contains the tokens.
|
|
55
|
+
|
|
56
|
+
## Optional route-aware CSS
|
|
57
|
+
|
|
58
|
+
Applications with measured all-component CSS cost may load the shared visual
|
|
59
|
+
foundation once and select component styles by the same names as Brick's
|
|
60
|
+
JavaScript subpaths:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import "@flowstack-ui/brick/styles/core.css";
|
|
64
|
+
import "@flowstack-ui/brick/styles/button.css";
|
|
65
|
+
import "@flowstack-ui/brick/styles/card.css";
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`core.css` contains Brick's layer order, default tokens, and foundations,
|
|
69
|
+
including the same token-driven document canvas and body typography as the
|
|
70
|
+
complete stylesheet. Import it before component styles. Each component
|
|
71
|
+
stylesheet owns that component's rules and every shared visual recipe it renders internally;
|
|
72
|
+
for example, `checkbox-group.css` already includes the Checkbox artwork and
|
|
73
|
+
`toggle-group.css` already includes the Toggle item recipe. Component styles do
|
|
74
|
+
not repeat tokens or foundations.
|
|
75
|
+
|
|
76
|
+
Do not combine modular component styles with `styles.css` or `tokens.css`.
|
|
77
|
+
Choose the complete stylesheet for the simplest and safest installation.
|
|
78
|
+
Choose modular styles only when the application can reliably own every style
|
|
79
|
+
import and production measurement shows that route-level selection matters.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Public document: guides/theme-contract
|
|
2
|
+
|
|
3
|
+
Source: @flowstack-ui/brick@0.1.11
|
|
4
|
+
|
|
5
|
+
# Theme contract
|
|
6
|
+
|
|
7
|
+
Brick publishes a generated, machine-readable description of the values that
|
|
8
|
+
a FLOWSTACK theme may provide:
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import contract from "@flowstack-ui/brick/theme-contract.json" with { type: "json" };
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The artifact uses the `flowstack.brick-theme-contract.v1` schema identifier.
|
|
15
|
+
It is generated from Brick's token source, component documentation contracts,
|
|
16
|
+
and cascade declaration, so theme tooling does not need a copied token list.
|
|
17
|
+
Contract revision 2 added the required contrast declaration. Revision 3 adds
|
|
18
|
+
closed categorical component inputs and conditional contrast pairs. The
|
|
19
|
+
schema identifier remains version 1 because both revisions are additive for
|
|
20
|
+
existing contract readers. Theme accepts revision 2 and newer, while tooling
|
|
21
|
+
that needs categorical inputs and conditional validation must feature-detect
|
|
22
|
+
the revision 3 fields.
|
|
23
|
+
|
|
24
|
+
The contract records:
|
|
25
|
+
|
|
26
|
+
- every semantic variable, type, light and dark default, and appearance
|
|
27
|
+
behavior;
|
|
28
|
+
- atomic color families that must be reviewed together;
|
|
29
|
+
- semantic foreground/background pairs, their text, text-distinction, or
|
|
30
|
+
non-text kind, optional component-input condition, and minimum contrast
|
|
31
|
+
ratio Theme must validate without rounding;
|
|
32
|
+
- approved inherited component inputs, their semantic fallbacks, and any
|
|
33
|
+
closed `allowedValues` vocabulary;
|
|
34
|
+
- local component extension variables and implementation-only variables;
|
|
35
|
+
- component recipes, defaults, and state attributes used by qualification;
|
|
36
|
+
- the reserved theme and appearance attributes; and
|
|
37
|
+
- the exact cascade position for compiled theme CSS.
|
|
38
|
+
|
|
39
|
+
## Token classifications
|
|
40
|
+
|
|
41
|
+
`required` values are appearance-dependent semantic colors and shadows that a
|
|
42
|
+
complete compiled appearance must contain. `derived` values are stable
|
|
43
|
+
semantic foundations that can inherit Brick defaults. `component-input`
|
|
44
|
+
values are the small audited set that may inherit from a theme scope.
|
|
45
|
+
`optional-extension` values are public component-instance escape hatches, not
|
|
46
|
+
global theme controls. `internal` values belong to Brick implementation.
|
|
47
|
+
Deprecated values, when introduced, include their replacements.
|
|
48
|
+
|
|
49
|
+
## Contrast pairs
|
|
50
|
+
|
|
51
|
+
Brick publishes only adjacencies promised by maintained component recipes. It
|
|
52
|
+
does not ask Theme to test every theoretical combination of semantic colors.
|
|
53
|
+
Normal authored text pairs require `4.5:1`; meaningful non-text indicators
|
|
54
|
+
require `3:1`. A conditional text-distinction pair requires `3:1` when a
|
|
55
|
+
categorical theme decision removes the non-color cue that normally identifies
|
|
56
|
+
an element. Disabled text and arbitrary local component overrides remain
|
|
57
|
+
outside this static contract, while browser qualification covers opacity,
|
|
58
|
+
gradients, images, and composition-specific adjacency.
|
|
59
|
+
|
|
60
|
+
The public contract uses `wcag2-relative-luminance` over opaque sRGB values.
|
|
61
|
+
Theme owns the calculation and generated report; Brick owns the declared pair
|
|
62
|
+
semantics and thresholds.
|
|
63
|
+
|
|
64
|
+
Brick currently approves Drawer background and radius plus Link resting
|
|
65
|
+
decoration as inherited component inputs. `components.link.decoration` accepts
|
|
66
|
+
only `"underline"` or `"none"`. When `"none"` is active, Theme validates the
|
|
67
|
+
accent Link text against adjacent primary text at `3:1`; Link restores its
|
|
68
|
+
underline on hover, focus, and active interaction. An explicit
|
|
69
|
+
`variant="underline"` or `variant="plain"` remains a local exception.
|
|
70
|
+
|
|
71
|
+
Other documented component variables remain available for local instance
|
|
72
|
+
customization but are intentionally not accepted as global Theme inputs until
|
|
73
|
+
a real product proves that scope safe. Shared appearance-dependent elevation
|
|
74
|
+
uses semantic `--brick-shadow-floating` and `--brick-shadow-modal` tokens,
|
|
75
|
+
which themes may map through `brick.light.shadow` and `brick.dark.shadow`.
|
|
76
|
+
|
|
77
|
+
## Cascade and scopes
|
|
78
|
+
|
|
79
|
+
Compiled theme variables belong in `flowstack.theme`, after `brick.tokens` and
|
|
80
|
+
before `brick.foundations`. Unlayered application CSS can still deliberately
|
|
81
|
+
override the result.
|
|
82
|
+
|
|
83
|
+
Use `data-flowstack-theme` to select a named theme and
|
|
84
|
+
`data-brick-appearance="light|dark"` for the nearest appearance boundary. A
|
|
85
|
+
dual-appearance theme must re-emit its complete required map at nested light
|
|
86
|
+
and dark boundaries. See Appearance and tokens [source reference: appearance-and-tokens.md] for
|
|
87
|
+
scope and portal rules.
|
|
88
|
+
|
|
89
|
+
This artifact describes Brick's consumption boundary. Theme authoring,
|
|
90
|
+
validation, and CSS generation belong to the separate FLOWSTACK Theme package.
|