11import { TitleLink } from '@braid-design-system/docs-ui' ;
2- import { Stack , Badge , Heading , Bleed } from 'braid-src/lib/components' ;
2+ import {
3+ Stack ,
4+ Badge ,
5+ Heading ,
6+ Bleed ,
7+ HiddenVisually ,
8+ } from 'braid-src/lib/components' ;
39import type { ResponsiveSpace } from 'braid-src/lib/css/atoms/atoms' ;
410import { PlayroomStateProvider } from 'braid-src/lib/playroom/playroomState' ;
511
@@ -13,53 +19,42 @@ export const DocSection = ({
1319} : {
1420 section : ComponentExample ;
1521 headingSpacing ?: ResponsiveSpace ;
16- } ) => (
17- < Stack space = "small" >
18- { section . deprecated ? (
19- < Bleed left = "xsmall" >
20- < Badge
21- tone = "caution"
22- id = { section . label ? `deprecated-${ section . label } ` : undefined }
23- aria-hidden
24- >
25- Deprecated
26- </ Badge >
27- </ Bleed >
28- ) : undefined }
29- < Stack space = { headingSpacing } >
30- { section . label ? (
31- < Heading
32- level = "3"
33- aria-describedby = {
34- section . deprecated ? `deprecated-${ section . label } ` : undefined
35- }
36- >
37- < TitleLink label = { section . label } copyable >
38- < span
39- aria-describedby = {
40- section . deprecated ? `deprecated-${ section . label } ` : undefined
41- }
42- >
22+ } ) => {
23+ const { deprecated } = section ;
24+ return (
25+ < Stack space = "small" >
26+ { deprecated ? (
27+ < Bleed left = "xsmall" >
28+ < Badge tone = "caution" > Deprecated</ Badge >
29+ </ Bleed >
30+ ) : undefined }
31+ < Stack space = { headingSpacing } >
32+ { section . label ? (
33+ < Heading level = "3" >
34+ < TitleLink label = { section . label } copyable >
4335 { section . label }
44- </ span >
45- </ TitleLink >
46- </ Heading >
47- ) : null }
48- { section . description ?? null }
49- { section . code || section . Example ? (
50- < PlayroomStateProvider >
51- < DocExample
52- code = { section . code }
53- Example = { section . Example }
54- Container = { section . Container }
55- background = { section . background }
56- showCodeByDefault = {
57- section . showCodeByDefault || section . Example === undefined
58- }
59- playroom = { section . playroom }
60- />
61- </ PlayroomStateProvider >
62- ) : null }
36+ { deprecated ? (
37+ < HiddenVisually > , deprecated</ HiddenVisually >
38+ ) : null }
39+ </ TitleLink >
40+ </ Heading >
41+ ) : null }
42+ { section . description ?? null }
43+ { section . code || section . Example ? (
44+ < PlayroomStateProvider >
45+ < DocExample
46+ code = { section . code }
47+ Example = { section . Example }
48+ Container = { section . Container }
49+ background = { section . background }
50+ showCodeByDefault = {
51+ section . showCodeByDefault || section . Example === undefined
52+ }
53+ playroom = { section . playroom }
54+ />
55+ </ PlayroomStateProvider >
56+ ) : null }
57+ </ Stack >
6358 </ Stack >
64- </ Stack >
65- ) ;
59+ ) ;
60+ } ;
0 commit comments