@flowstack-ui/brick 0.1.11 → 0.1.12
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/README.md +1 -1
- package/dist/agents/blockquote.json +68 -0
- package/dist/agents/blockquote.md +42 -0
- package/dist/agents/code-block.json +20 -4
- package/dist/agents/code-block.md +9 -4
- package/dist/agents/coverage.json +1211 -199
- package/dist/agents/em.json +57 -0
- package/dist/agents/em.md +39 -0
- package/dist/agents/highlight.json +73 -0
- package/dist/agents/highlight.md +43 -0
- package/dist/agents/interface-composition.json +14 -7
- package/dist/agents/interface-composition.md +5 -2
- package/dist/agents/kbd.json +62 -0
- package/dist/agents/kbd.md +40 -0
- package/dist/agents/layer-selection.json +125 -5
- package/dist/agents/layer-selection.md +12 -2
- package/dist/agents/manifest.json +37 -1
- package/dist/agents/mark.json +56 -0
- package/dist/agents/mark.md +38 -0
- package/dist/agents/prose.json +82 -0
- package/dist/agents/prose.md +50 -0
- package/dist/blockquote.d.ts +2 -0
- package/dist/blockquote.d.ts.map +1 -0
- package/dist/blockquote.js +2 -0
- package/dist/blockquote.js.map +1 -0
- package/dist/components/blockquote/Blockquote.d.ts +33 -0
- package/dist/components/blockquote/Blockquote.d.ts.map +1 -0
- package/dist/components/blockquote/Blockquote.js +36 -0
- package/dist/components/blockquote/Blockquote.js.map +1 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.d.ts.map +1 -0
- package/dist/components/blockquote/index.js +2 -0
- package/dist/components/blockquote/index.js.map +1 -0
- package/dist/components/code-block/CodeBlock.d.ts +33 -0
- package/dist/components/code-block/CodeBlock.d.ts.map +1 -1
- package/dist/components/code-block/CodeBlock.js +60 -6
- package/dist/components/code-block/CodeBlock.js.map +1 -1
- package/dist/components/code-block/context.d.ts +2 -0
- package/dist/components/code-block/context.d.ts.map +1 -1
- package/dist/components/code-block/context.js.map +1 -1
- package/dist/components/code-block/index.d.ts +1 -1
- package/dist/components/code-block/index.d.ts.map +1 -1
- package/dist/components/code-block/index.js +1 -1
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/em/Em.d.ts +9 -0
- package/dist/components/em/Em.d.ts.map +1 -0
- package/dist/components/em/Em.js +10 -0
- package/dist/components/em/Em.js.map +1 -0
- package/dist/components/em/index.d.ts +2 -0
- package/dist/components/em/index.d.ts.map +1 -0
- package/dist/components/em/index.js +2 -0
- package/dist/components/em/index.js.map +1 -0
- package/dist/components/highlight/Highlight.d.ts +9 -0
- package/dist/components/highlight/Highlight.d.ts.map +1 -0
- package/dist/components/highlight/Highlight.js +10 -0
- package/dist/components/highlight/Highlight.js.map +1 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.d.ts.map +1 -0
- package/dist/components/highlight/index.js +2 -0
- package/dist/components/highlight/index.js.map +1 -0
- package/dist/components/kbd/Kbd.d.ts +13 -0
- package/dist/components/kbd/Kbd.d.ts.map +1 -0
- package/dist/components/kbd/Kbd.js +8 -0
- package/dist/components/kbd/Kbd.js.map +1 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/kbd/index.d.ts.map +1 -0
- package/dist/components/kbd/index.js +2 -0
- package/dist/components/kbd/index.js.map +1 -0
- package/dist/components/mark/Mark.d.ts +13 -0
- package/dist/components/mark/Mark.d.ts.map +1 -0
- package/dist/components/mark/Mark.js +8 -0
- package/dist/components/mark/Mark.js.map +1 -0
- package/dist/components/mark/index.d.ts +2 -0
- package/dist/components/mark/index.d.ts.map +1 -0
- package/dist/components/mark/index.js +2 -0
- package/dist/components/mark/index.js.map +1 -0
- package/dist/components/prose/Prose.d.ts +12 -0
- package/dist/components/prose/Prose.d.ts.map +1 -0
- package/dist/components/prose/Prose.js +19 -0
- package/dist/components/prose/Prose.js.map +1 -0
- package/dist/components/prose/index.d.ts +2 -0
- package/dist/components/prose/index.d.ts.map +1 -0
- package/dist/components/prose/index.js +2 -0
- package/dist/components/prose/index.js.map +1 -0
- package/dist/em.d.ts +2 -0
- package/dist/em.d.ts.map +1 -0
- package/dist/em.js +2 -0
- package/dist/em.js.map +1 -0
- package/dist/highlight.d.ts +2 -0
- package/dist/highlight.d.ts.map +1 -0
- package/dist/highlight.js +2 -0
- package/dist/highlight.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/kbd.d.ts +2 -0
- package/dist/kbd.d.ts.map +1 -0
- package/dist/kbd.js +2 -0
- package/dist/kbd.js.map +1 -0
- package/dist/mark.d.ts +2 -0
- package/dist/mark.d.ts.map +1 -0
- package/dist/mark.js +2 -0
- package/dist/mark.js.map +1 -0
- package/dist/prose.d.ts +2 -0
- package/dist/prose.d.ts.map +1 -0
- package/dist/prose.js +2 -0
- package/dist/prose.js.map +1 -0
- package/dist/styles/blockquote.css +2 -0
- package/dist/styles/blockquote.css.map +1 -0
- package/dist/styles/code-block.css +1 -1
- package/dist/styles/code-block.css.map +1 -1
- package/dist/styles/dropdown-menu.css.map +1 -1
- package/dist/styles/em.css +2 -0
- package/dist/styles/em.css.map +1 -0
- package/dist/styles/highlight.css +2 -0
- package/dist/styles/highlight.css.map +1 -0
- package/dist/styles/kbd.css +2 -0
- package/dist/styles/kbd.css.map +1 -0
- package/dist/styles/mark.css +2 -0
- package/dist/styles/mark.css.map +1 -0
- package/dist/styles/menubar.css.map +1 -1
- package/dist/styles/prose.css +2 -0
- package/dist/styles/prose.css.map +1 -0
- package/dist/styles/slider.css.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/theme-contract.json +1418 -100
- package/package.json +36 -3
package/README.md
CHANGED
|
@@ -160,7 +160,7 @@ The complete component guides live with the source repository:
|
|
|
160
160
|
| Accessibility | [Skip Link](https://github.com/flowstack-ui/brick/blob/main/docs/components/skip-link/README.md), [Visually Hidden](https://github.com/flowstack-ui/brick/blob/main/docs/components/visually-hidden/README.md) |
|
|
161
161
|
| Data display | [Aspect Ratio](https://github.com/flowstack-ui/brick/blob/main/docs/components/aspect-ratio/README.md), [Data List](https://github.com/flowstack-ui/brick/blob/main/docs/components/data-list/README.md), [Data Grid](https://github.com/flowstack-ui/brick/blob/main/docs/components/data-grid/README.md), [Tree Grid](https://github.com/flowstack-ui/brick/blob/main/docs/components/tree-grid/README.md), [Tree](https://github.com/flowstack-ui/brick/blob/main/docs/components/tree/README.md), [Feed](https://github.com/flowstack-ui/brick/blob/main/docs/components/feed/README.md), [Swipeable Item](https://github.com/flowstack-ui/brick/blob/main/docs/components/swipeable-item/README.md), [Carousel](https://github.com/flowstack-ui/brick/blob/main/docs/components/carousel/README.md) |
|
|
162
162
|
| Forms and choices | [Color Picker](https://github.com/flowstack-ui/brick/blob/main/docs/components/color-picker/README.md), [Form](https://github.com/flowstack-ui/brick/blob/main/docs/components/form/README.md), [Field](https://github.com/flowstack-ui/brick/blob/main/docs/components/field/README.md), [Fieldset](https://github.com/flowstack-ui/brick/blob/main/docs/components/fieldset/README.md), [Input](https://github.com/flowstack-ui/brick/blob/main/docs/components/input/README.md), [Number Input](https://github.com/flowstack-ui/brick/blob/main/docs/components/number-input/README.md), [OTP Field](https://github.com/flowstack-ui/brick/blob/main/docs/components/otp-field/README.md), [Password Toggle Field](https://github.com/flowstack-ui/brick/blob/main/docs/components/password-toggle-field/README.md), [Textarea](https://github.com/flowstack-ui/brick/blob/main/docs/components/textarea/README.md), [Select](https://github.com/flowstack-ui/brick/blob/main/docs/components/select/README.md), [Combobox](https://github.com/flowstack-ui/brick/blob/main/docs/components/combobox/README.md), [Multi Select](https://github.com/flowstack-ui/brick/blob/main/docs/components/multi-select/README.md), [File Upload](https://github.com/flowstack-ui/brick/blob/main/docs/components/file-upload/README.md), [Checkbox](https://github.com/flowstack-ui/brick/blob/main/docs/components/checkbox/README.md), [Checkbox Group](https://github.com/flowstack-ui/brick/blob/main/docs/components/checkbox-group/README.md), [Radio Group](https://github.com/flowstack-ui/brick/blob/main/docs/components/radio-group/README.md), [Switch](https://github.com/flowstack-ui/brick/blob/main/docs/components/switch/README.md), [Slider](https://github.com/flowstack-ui/brick/blob/main/docs/components/slider/README.md), [Rating](https://github.com/flowstack-ui/brick/blob/main/docs/components/rating/README.md) |
|
|
163
|
-
| Content and status | [Text](https://github.com/flowstack-ui/brick/blob/main/docs/components/text/README.md), [Icon](https://github.com/flowstack-ui/brick/blob/main/docs/components/icon/README.md), [Image](https://github.com/flowstack-ui/brick/blob/main/docs/components/image/README.md), [Code](https://github.com/flowstack-ui/brick/blob/main/docs/components/code/README.md), [Code Block](https://github.com/flowstack-ui/brick/blob/main/docs/components/code-block/README.md), [Avatar](https://github.com/flowstack-ui/brick/blob/main/docs/components/avatar/README.md), [Badge](https://github.com/flowstack-ui/brick/blob/main/docs/components/badge/README.md), [Chip](https://github.com/flowstack-ui/brick/blob/main/docs/components/chip/README.md), [Notification Badge](https://github.com/flowstack-ui/brick/blob/main/docs/components/notification-badge/README.md), [Status](https://github.com/flowstack-ui/brick/blob/main/docs/components/status/README.md), [Color Swatch](https://github.com/flowstack-ui/brick/blob/main/docs/components/color-swatch/README.md), [Card](https://github.com/flowstack-ui/brick/blob/main/docs/components/card/README.md), [List](https://github.com/flowstack-ui/brick/blob/main/docs/components/list/README.md), [Table](https://github.com/flowstack-ui/brick/blob/main/docs/components/table/README.md), [Divider](https://github.com/flowstack-ui/brick/blob/main/docs/components/divider/README.md), [Collapsible](https://github.com/flowstack-ui/brick/blob/main/docs/components/collapsible/README.md), [Accordion](https://github.com/flowstack-ui/brick/blob/main/docs/components/accordion/README.md), [Skeleton](https://github.com/flowstack-ui/brick/blob/main/docs/components/skeleton/README.md), [Progress](https://github.com/flowstack-ui/brick/blob/main/docs/components/progress/README.md), [Progress Circle](https://github.com/flowstack-ui/brick/blob/main/docs/components/progress-circle/README.md), [Toast](https://github.com/flowstack-ui/brick/blob/main/docs/components/toast/README.md) |
|
|
163
|
+
| Content and status | [Text](https://github.com/flowstack-ui/brick/blob/main/docs/components/text/README.md), [Em](https://github.com/flowstack-ui/brick/blob/main/docs/components/em/README.md), [Mark](https://github.com/flowstack-ui/brick/blob/main/docs/components/mark/README.md), [Highlight](https://github.com/flowstack-ui/brick/blob/main/docs/components/highlight/README.md), [Prose](https://github.com/flowstack-ui/brick/blob/main/docs/components/prose/README.md), [Kbd](https://github.com/flowstack-ui/brick/blob/main/docs/components/kbd/README.md), [Blockquote](https://github.com/flowstack-ui/brick/blob/main/docs/components/blockquote/README.md), [Icon](https://github.com/flowstack-ui/brick/blob/main/docs/components/icon/README.md), [Image](https://github.com/flowstack-ui/brick/blob/main/docs/components/image/README.md), [Code](https://github.com/flowstack-ui/brick/blob/main/docs/components/code/README.md), [Code Block](https://github.com/flowstack-ui/brick/blob/main/docs/components/code-block/README.md), [Avatar](https://github.com/flowstack-ui/brick/blob/main/docs/components/avatar/README.md), [Badge](https://github.com/flowstack-ui/brick/blob/main/docs/components/badge/README.md), [Chip](https://github.com/flowstack-ui/brick/blob/main/docs/components/chip/README.md), [Notification Badge](https://github.com/flowstack-ui/brick/blob/main/docs/components/notification-badge/README.md), [Status](https://github.com/flowstack-ui/brick/blob/main/docs/components/status/README.md), [Color Swatch](https://github.com/flowstack-ui/brick/blob/main/docs/components/color-swatch/README.md), [Card](https://github.com/flowstack-ui/brick/blob/main/docs/components/card/README.md), [List](https://github.com/flowstack-ui/brick/blob/main/docs/components/list/README.md), [Table](https://github.com/flowstack-ui/brick/blob/main/docs/components/table/README.md), [Divider](https://github.com/flowstack-ui/brick/blob/main/docs/components/divider/README.md), [Collapsible](https://github.com/flowstack-ui/brick/blob/main/docs/components/collapsible/README.md), [Accordion](https://github.com/flowstack-ui/brick/blob/main/docs/components/accordion/README.md), [Skeleton](https://github.com/flowstack-ui/brick/blob/main/docs/components/skeleton/README.md), [Progress](https://github.com/flowstack-ui/brick/blob/main/docs/components/progress/README.md), [Progress Circle](https://github.com/flowstack-ui/brick/blob/main/docs/components/progress-circle/README.md), [Toast](https://github.com/flowstack-ui/brick/blob/main/docs/components/toast/README.md) |
|
|
164
164
|
| Contextual overlays | [Tooltip](https://github.com/flowstack-ui/brick/blob/main/docs/components/tooltip/README.md), [Hover Card](https://github.com/flowstack-ui/brick/blob/main/docs/components/hover-card/README.md), [Popover](https://github.com/flowstack-ui/brick/blob/main/docs/components/popover/README.md), [Dropdown Menu](https://github.com/flowstack-ui/brick/blob/main/docs/components/dropdown-menu/README.md), [Context Menu](https://github.com/flowstack-ui/brick/blob/main/docs/components/context-menu/README.md), [Menubar](https://github.com/flowstack-ui/brick/blob/main/docs/components/menubar/README.md) |
|
|
165
165
|
| Modal surfaces | [Dialog](https://github.com/flowstack-ui/brick/blob/main/docs/components/dialog/README.md), [Alert Dialog](https://github.com/flowstack-ui/brick/blob/main/docs/components/alert-dialog/README.md), [Drawer](https://github.com/flowstack-ui/brick/blob/main/docs/components/drawer/README.md) |
|
|
166
166
|
| Navigation and layout | [Appearance](https://github.com/flowstack-ui/brick/blob/main/docs/components/appearance/README.md), [Breadcrumb](https://github.com/flowstack-ui/brick/blob/main/docs/components/breadcrumb/README.md), [Tabs](https://github.com/flowstack-ui/brick/blob/main/docs/components/tabs/README.md), [Navigation Menu](https://github.com/flowstack-ui/brick/blob/main/docs/components/navigation-menu/README.md), [Bottom Navigation](https://github.com/flowstack-ui/brick/blob/main/docs/components/bottom-navigation/README.md), [Link](https://github.com/flowstack-ui/brick/blob/main/docs/components/link/README.md), [Link Box](https://github.com/flowstack-ui/brick/blob/main/docs/components/link-box/README.md), [Nav List](https://github.com/flowstack-ui/brick/blob/main/docs/components/nav-list/README.md), [Sidebar](https://github.com/flowstack-ui/brick/blob/main/docs/components/sidebar/README.md), [App Bar](https://github.com/flowstack-ui/brick/blob/main/docs/components/app-bar/README.md), [Stack](https://github.com/flowstack-ui/brick/blob/main/docs/components/stack/README.md), [Group](https://github.com/flowstack-ui/brick/blob/main/docs/components/group/README.md), [Grid](https://github.com/flowstack-ui/brick/blob/main/docs/components/grid/README.md), [Container](https://github.com/flowstack-ui/brick/blob/main/docs/components/container/README.md), [Section](https://github.com/flowstack-ui/brick/blob/main/docs/components/section/README.md), [Frame](https://github.com/flowstack-ui/brick/blob/main/docs/components/frame/README.md), [Bleed](https://github.com/flowstack-ui/brick/blob/main/docs/components/bleed/README.md), [Show](https://github.com/flowstack-ui/brick/blob/main/docs/components/show/README.md), [Hide](https://github.com/flowstack-ui/brick/blob/main/docs/components/hide/README.md), [Surface](https://github.com/flowstack-ui/brick/blob/main/docs/components/surface/README.md), [Scroll Area](https://github.com/flowstack-ui/brick/blob/main/docs/components/scroll-area/README.md) |
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "flowstack.agent-component.v1",
|
|
3
|
+
"id": "blockquote",
|
|
4
|
+
"name": "Blockquote",
|
|
5
|
+
"package": "@flowstack-ui/brick",
|
|
6
|
+
"layer": "brick",
|
|
7
|
+
"kind": "component",
|
|
8
|
+
"purpose": "Compose an extended quotation, source URL, and optional attribution with correct native structure and finished Brick styling.",
|
|
9
|
+
"useWhen": [
|
|
10
|
+
"An extended quotation and optional attribution form one self-contained content unit."
|
|
11
|
+
],
|
|
12
|
+
"avoidWhen": [
|
|
13
|
+
{
|
|
14
|
+
"condition": "The quotation is inline within a sentence.",
|
|
15
|
+
"useInstead": "native q inside the surrounding content owner"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"condition": "The interface is a testimonial card with media, ratings, or actions.",
|
|
19
|
+
"useInstead": "Card or a product Block composed with Blockquote"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"composition": [
|
|
23
|
+
"Place Blockquote.Content and optional Blockquote.Caption as siblings inside Blockquote.Root; put the source URL on Content through cite.",
|
|
24
|
+
"Use Blockquote.Cite inside Caption only for a referenced work or source, not merely for the person quoted."
|
|
25
|
+
],
|
|
26
|
+
"rules": [
|
|
27
|
+
{
|
|
28
|
+
"id": "blockquote-native",
|
|
29
|
+
"level": "must",
|
|
30
|
+
"statement": "Preserve figure Root, blockquote Content, sibling figcaption Caption, and native cite Cite."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "blockquote-attribution",
|
|
34
|
+
"level": "must",
|
|
35
|
+
"statement": "Keep attribution outside Content so it is not represented as part of the quotation."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "blockquote-recipes",
|
|
39
|
+
"level": "must",
|
|
40
|
+
"statement": "Select only the documented accent, surface, or plain variant and start, center, or end alignment."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "blockquote-icon",
|
|
44
|
+
"level": "must",
|
|
45
|
+
"statement": "Keep Icon decorative unless a consumer intentionally overrides aria-hidden for meaningful custom content."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "blockquote-css",
|
|
49
|
+
"level": "must",
|
|
50
|
+
"statement": "Load styles.css or core.css plus blockquote.css."
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"commonMistakes": [
|
|
54
|
+
{
|
|
55
|
+
"mistake": "Putting the author or source inside Blockquote.Content.",
|
|
56
|
+
"correction": "Render attribution in sibling Blockquote.Caption and use Cite only for a work or source title."
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"validation": [
|
|
60
|
+
"Confirm native figure, blockquote, figcaption, and cite mapping; source URL forwarding; logical alignment; selection and copy; forced colors; zoom; text spacing; localization; RTL; and CSS delivery.",
|
|
61
|
+
"Confirm Blockquote adds no tab stop, role, interaction, or application provenance policy."
|
|
62
|
+
],
|
|
63
|
+
"related": [
|
|
64
|
+
"text",
|
|
65
|
+
"mark",
|
|
66
|
+
"interface-composition"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Blockquote agent guide
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Compose an extended quotation, source URL, and optional attribution with correct native structure and finished Brick styling.
|
|
6
|
+
|
|
7
|
+
## Use when
|
|
8
|
+
|
|
9
|
+
- An extended quotation and optional attribution form one self-contained content unit.
|
|
10
|
+
|
|
11
|
+
## Choose something else when
|
|
12
|
+
|
|
13
|
+
- The quotation is inline within a sentence. Use native q inside the surrounding content owner.
|
|
14
|
+
- The interface is a testimonial card with media, ratings, or actions. Use Card or a product Block composed with Blockquote.
|
|
15
|
+
|
|
16
|
+
## Required composition
|
|
17
|
+
|
|
18
|
+
- Place Blockquote.Content and optional Blockquote.Caption as siblings inside Blockquote.Root; put the source URL on Content through cite.
|
|
19
|
+
- Use Blockquote.Cite inside Caption only for a referenced work or source, not merely for the person quoted.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- **MUST:** Preserve figure Root, blockquote Content, sibling figcaption Caption, and native cite Cite.
|
|
24
|
+
- **MUST:** Keep attribution outside Content so it is not represented as part of the quotation.
|
|
25
|
+
- **MUST:** Select only the documented accent, surface, or plain variant and start, center, or end alignment.
|
|
26
|
+
- **MUST:** Keep Icon decorative unless a consumer intentionally overrides aria-hidden for meaningful custom content.
|
|
27
|
+
- **MUST:** Load styles.css or core.css plus blockquote.css.
|
|
28
|
+
|
|
29
|
+
## Common mistakes
|
|
30
|
+
|
|
31
|
+
- **Avoid:** Putting the author or source inside Blockquote.Content. **Instead:** Render attribution in sibling Blockquote.Caption and use Cite only for a work or source title.
|
|
32
|
+
|
|
33
|
+
## Validation checklist
|
|
34
|
+
|
|
35
|
+
- Confirm native figure, blockquote, figcaption, and cite mapping; source URL forwarding; logical alignment; selection and copy; forced colors; zoom; text spacing; localization; RTL; and CSS delivery.
|
|
36
|
+
- Confirm Blockquote adds no tab stop, role, interaction, or application provenance policy.
|
|
37
|
+
|
|
38
|
+
## Related guidance
|
|
39
|
+
|
|
40
|
+
- `text`
|
|
41
|
+
- `mark`
|
|
42
|
+
- `interface-composition`
|
|
@@ -22,8 +22,9 @@
|
|
|
22
22
|
"composition": [
|
|
23
23
|
"Pass the exact plain-text source to Root value, then place Content inside Root and give focusable Content a specific accessible label.",
|
|
24
24
|
"Author Header, Title, Language, Actions, CopyTrigger, CopyStatus, and CopyIndicator only when the interface needs those optional parts.",
|
|
25
|
-
"For syntax highlighting,
|
|
26
|
-
"
|
|
25
|
+
"For syntax highlighting, pass a synchronous adapter or trusted React token nodes to Content while keeping Root value identical to the plain text that must be copied.",
|
|
26
|
+
"Use Line for authored line numbers, highlighting, focus, additions, and removals; metadata remains independent so one line can carry more than one relevant state.",
|
|
27
|
+
"Use Content maxLines for a bounded scroll region. For expansion, put bounded Content in CollapsePreview, unbounded Content in CollapseContent, and author CollapseTrigger so Brick Collapsible owns the real disclosure relationship and lifecycle."
|
|
27
28
|
],
|
|
28
29
|
"rules": [
|
|
29
30
|
{
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
{
|
|
35
36
|
"id": "code-block-highlighting-owner",
|
|
36
37
|
"level": "must",
|
|
37
|
-
"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."
|
|
38
|
+
"statement": "Keep tokenization, language loading, and syntax palettes in a pure synchronous consumer adapter; Brick accepts trusted React nodes and does not bundle a highlighter or unsafe HTML path."
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
"id": "code-block-scroll-owner",
|
|
@@ -46,6 +47,16 @@
|
|
|
46
47
|
"level": "must",
|
|
47
48
|
"statement": "Give every focusable Content region a specific aria-label or aria-labelledby, especially when several examples share one page."
|
|
48
49
|
},
|
|
50
|
+
{
|
|
51
|
+
"id": "code-block-line-metadata",
|
|
52
|
+
"level": "must",
|
|
53
|
+
"statement": "Author Line metadata from the authoritative source or trusted adapter output; do not infer diffs, focus, or highlighting from visual tokens."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "code-block-bounded-access",
|
|
57
|
+
"level": "must",
|
|
58
|
+
"statement": "Keep standalone maxLines content reachable through its focusable viewport; for expansion, pair CollapsePreview and CollapseContent with an accessible CollapseTrigger so only the current source view is exposed."
|
|
59
|
+
},
|
|
49
60
|
{
|
|
50
61
|
"id": "code-block-css",
|
|
51
62
|
"level": "must",
|
|
@@ -60,16 +71,21 @@
|
|
|
60
71
|
{
|
|
61
72
|
"mistake": "Adding a header, language label, copy action, or status region merely because those parts exist.",
|
|
62
73
|
"correction": "Author only the optional anatomy required by the surrounding interface."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"mistake": "Clipping a long code block with application CSS and no reachable overflow or expansion control.",
|
|
77
|
+
"correction": "Use Content maxLines for bounded scrolling or compose CollapsePreview, CollapseContent, and CollapseTrigger for an accessible full-source path."
|
|
63
78
|
}
|
|
64
79
|
],
|
|
65
80
|
"validation": [
|
|
66
81
|
"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.",
|
|
67
|
-
"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."
|
|
82
|
+
"Check keyboard focus, uniquely named overflow landmarks, line metadata, bounded scrolling or collapse expansion, long-line scrolling or wrapping, mobile text sizing, zoom, selection, RTL/LTR, light and dark syntax contrast, and CSS delivery."
|
|
68
83
|
],
|
|
69
84
|
"related": [
|
|
70
85
|
"code",
|
|
71
86
|
"scroll-area",
|
|
72
87
|
"button",
|
|
88
|
+
"collapsible",
|
|
73
89
|
"tabs",
|
|
74
90
|
"interface-composition"
|
|
75
91
|
]
|
|
@@ -17,31 +17,36 @@ Present preserved multi-line technical source with native scrolling, explicit me
|
|
|
17
17
|
|
|
18
18
|
- Pass the exact plain-text source to Root value, then place Content inside Root and give focusable Content a specific accessible label.
|
|
19
19
|
- Author Header, Title, Language, Actions, CopyTrigger, CopyStatus, and CopyIndicator only when the interface needs those optional parts.
|
|
20
|
-
- For syntax highlighting,
|
|
21
|
-
-
|
|
20
|
+
- For syntax highlighting, pass a synchronous adapter or trusted React token nodes to Content while keeping Root value identical to the plain text that must be copied.
|
|
21
|
+
- Use Line for authored line numbers, highlighting, focus, additions, and removals; metadata remains independent so one line can carry more than one relevant state.
|
|
22
|
+
- Use Content maxLines for a bounded scroll region. For expansion, put bounded Content in CollapsePreview, unbounded Content in CollapseContent, and author CollapseTrigger so Brick Collapsible owns the real disclosure relationship and lifecycle.
|
|
22
23
|
|
|
23
24
|
## Rules
|
|
24
25
|
|
|
25
26
|
- **MUST:** Keep Root value authoritative and exactly aligned with rendered highlighted content so copy behavior never depends on rendered textContent.
|
|
26
|
-
- **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.
|
|
27
|
+
- **MUST:** Keep tokenization, language loading, and syntax palettes in a pure synchronous consumer adapter; Brick accepts trusted React nodes and does not bundle a highlighter or unsafe HTML path.
|
|
27
28
|
- **MUST:** Let Content own canonical pre, code, focus, and horizontal scrolling instead of rebuilding them with a separate ScrollArea or native pre element.
|
|
28
29
|
- **MUST:** Give every focusable Content region a specific aria-label or aria-labelledby, especially when several examples share one page.
|
|
30
|
+
- **MUST:** Author Line metadata from the authoritative source or trusted adapter output; do not infer diffs, focus, or highlighting from visual tokens.
|
|
31
|
+
- **MUST:** Keep standalone maxLines content reachable through its focusable viewport; for expansion, pair CollapsePreview and CollapseContent with an accessible CollapseTrigger so only the current source view is exposed.
|
|
29
32
|
- **MUST:** Load styles.css or core.css plus code-block.css and its documented component dependencies.
|
|
30
33
|
|
|
31
34
|
## Common mistakes
|
|
32
35
|
|
|
33
36
|
- **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.
|
|
34
37
|
- **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.
|
|
38
|
+
- **Avoid:** Clipping a long code block with application CSS and no reachable overflow or expansion control. **Instead:** Use Content maxLines for bounded scrolling or compose CollapsePreview, CollapseContent, and CollapseTrigger for an accessible full-source path.
|
|
35
39
|
|
|
36
40
|
## Validation checklist
|
|
37
41
|
|
|
38
42
|
- 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.
|
|
39
|
-
- 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.
|
|
43
|
+
- Check keyboard focus, uniquely named overflow landmarks, line metadata, bounded scrolling or collapse expansion, long-line scrolling or wrapping, mobile text sizing, zoom, selection, RTL/LTR, light and dark syntax contrast, and CSS delivery.
|
|
40
44
|
|
|
41
45
|
## Related guidance
|
|
42
46
|
|
|
43
47
|
- `code`
|
|
44
48
|
- `scroll-area`
|
|
45
49
|
- `button`
|
|
50
|
+
- `collapsible`
|
|
46
51
|
- `tabs`
|
|
47
52
|
- `interface-composition`
|