Skip to content

Commit afafa7d

Browse files
Code Connect for NavList (#5755)
1 parent 9c135c4 commit afafa7d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

packages/react/src/NavList/NavList.figma.tsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,70 @@ figma.connect(
1212
example: ({children}) => <NavList>{children}</NavList>,
1313
},
1414
)
15+
16+
figma.connect(
17+
NavList.Item,
18+
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=40009-6314&t=3Scp7X8EXitkqgLF-4',
19+
{
20+
props: {
21+
actionList: figma.nestedProps('label and description', {
22+
text: figma.textContent('label'),
23+
}),
24+
},
25+
example: ({actionList}) => <NavList.Item href="#">{actionList.text}</NavList.Item>,
26+
},
27+
)
28+
/** Subitem **/
29+
figma.connect(
30+
NavList.Item,
31+
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15175-71561&m=dev',
32+
{
33+
props: {
34+
actionList: figma.nestedProps('label and description', {
35+
text: figma.textContent('label'),
36+
}),
37+
},
38+
example: ({actionList}) => <NavList.Item href="#">{actionList.text}</NavList.Item>,
39+
},
40+
)
41+
/** Collapsable item **/
42+
figma.connect(
43+
NavList.Item,
44+
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16716-62586&m=dev',
45+
{
46+
props: {
47+
actionList: figma.nestedProps('label and description', {
48+
text: figma.textContent('label'),
49+
}),
50+
children: figma.children('NavList.Item/SubItem'),
51+
},
52+
example: ({actionList, children}) => (
53+
<NavList.Item>
54+
{actionList.text}
55+
<NavList.SubNav>{children}</NavList.SubNav>
56+
</NavList.Item>
57+
),
58+
},
59+
)
60+
61+
figma.connect(
62+
NavList.GroupHeading,
63+
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=40065-84253&t=3Scp7X8EXitkqgLF-4',
64+
{
65+
props: {
66+
actionList: figma.nestedProps('ActionList.GroupHeading', {
67+
title: figma.string('title'),
68+
}),
69+
},
70+
example: ({actionList}) => <NavList.GroupHeading>{actionList.title}</NavList.GroupHeading>,
71+
},
72+
)
73+
74+
figma.connect(
75+
NavList.Divider,
76+
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=40065-83912&t=3Scp7X8EXitkqgLF-4',
77+
{
78+
props: {},
79+
example: () => <NavList.Divider />,
80+
},
81+
)

0 commit comments

Comments
 (0)