1+ import Kbd from '@radui/ui/Kbd' ;
2+ import Text from '@radui/ui/Text' ;
3+ import { getSourceCodeFromPath } from '@/utils/parseSourceCode' ;
4+
5+ const example_1_SourceCode = await getSourceCodeFromPath ( 'docs/app/docs/components/accordion/docs/example_1.tsx' ) ;
6+ // console.log(example_1_SourceCode);
7+
8+
9+ const scss_SourceCode = await getSourceCodeFromPath ( 'styles/themes/components/accordion.scss' ) ;
10+ const anatomy_SourceCode = await getSourceCodeFromPath ( 'docs/app/docs/components/accordion/docs/accordion_anatomy.tsx' ) ;
11+
12+ export const code = {
13+ javascript : {
14+ code : example_1_SourceCode
15+ } ,
16+ scss : {
17+ code : scss_SourceCode
18+ }
19+ } ;
20+
21+ export const anatomy = {
22+ code : anatomy_SourceCode
23+ }
24+
25+ export const keyboardShortcuts = {
26+ columns : [
27+ {
28+ name : 'Shortcut' ,
29+ id : 'shortcut'
30+ } ,
31+ {
32+ name : 'Description' ,
33+ id : 'description'
34+ }
35+ ] ,
36+ data : [
37+ {
38+ shortcut : < Kbd > Space</ Kbd > ,
39+ description : < Text >
40+ When focus is on an Accordion.Trigger of a collapsed section, expands the section.
41+ </ Text > ,
42+ id : "space"
43+ } ,
44+ {
45+ shortcut : < Kbd > Enter</ Kbd > ,
46+ description : < Text >
47+ When focus is on an Accordion.Trigger of an expanded section, collapses the section.
48+ </ Text > ,
49+ id : "enter"
50+ } ,
51+ {
52+ shortcut : < Kbd > Tab</ Kbd > ,
53+ description : < Text >
54+ When focus is on an Accordion.Trigger of a collapsed section, focuses the next Accordion.Trigger.
55+ </ Text > ,
56+ id : "tab"
57+ } ,
58+ {
59+ shortcut : < Kbd > Shift + Tab</ Kbd > ,
60+ description : < Text >
61+ When focus is on an Accordion.Trigger of an expanded section, focuses the previous Accordion.Trigger.
62+ </ Text > ,
63+ id : "shift-tab"
64+ } ,
65+ {
66+ shortcut : < Kbd > ArrowDown</ Kbd > ,
67+ description : < Text >
68+ When focus is on an Accordion.Trigger of a collapsed section, focuses the next Accordion.Trigger.
69+ </ Text > ,
70+ id : "arrow-down"
71+ } ,
72+ {
73+ shortcut : < Kbd > ArrowUp</ Kbd > ,
74+ description : < Text >
75+ When focus is on an Accordion.Trigger of an expanded section, focuses the previous Accordion.Trigger.
76+ </ Text > ,
77+ id : "arrow-up"
78+ } ,
79+ // {
80+ // shortcut: <Kbd>ArrowRight</Kbd>,
81+ // description: <Text>
82+ // When focus is on an Accordion.Trigger of a collapsed section, focuses the next Accordion.Trigger.
83+ // </Text>
84+ // },
85+ // {
86+ // shortcut: <Kbd>ArrowLeft</Kbd>,
87+ // description: <Text>
88+ // When focus is on an Accordion.Trigger of an expanded section, focuses the previous Accordion.Trigger.
89+ // </Text>
90+ // }
91+ {
92+ shortcut : < Kbd > Home</ Kbd > ,
93+ description : < Text >
94+ When focus is on an Accordion.Trigger, focuses the first Accordion.Trigger. [TODO]
95+ </ Text > ,
96+ id : "home"
97+ } ,
98+ {
99+ shortcut : < Kbd > End</ Kbd > ,
100+ description : < Text >
101+ When focus is on an Accordion.Trigger, focuses the last Accordion.Trigger. [TODO]
102+ </ Text > ,
103+ id : "end"
104+ }
105+ ]
106+ }
107+
108+ export default code
0 commit comments