Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import figma from '@figma/code-connect';
import {
DescriptionList,
DescriptionListItem,
DescriptionTerm,
DescriptionDetails
} from '../../index';

const FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=240-4209&m=dev';

figma.connect(DescriptionList, FIGMA_URL, {
props: {
collapsed: figma.enum('Collapsed', { True: true })
},
example: ({ collapsed }) => (
<DescriptionList collapsed={collapsed}>
<DescriptionListItem>
<DescriptionTerm>Term 1</DescriptionTerm>
<DescriptionDetails>Details 1</DescriptionDetails>
</DescriptionListItem>
<DescriptionListItem>
<DescriptionTerm>Term 2</DescriptionTerm>
<DescriptionDetails>Details 2</DescriptionDetails>
</DescriptionListItem>
</DescriptionList>
)
});
16 changes: 16 additions & 0 deletions packages/react/src/components/NavBar/NavBar.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import figma from '@figma/code-connect';
import { NavBar, NavItem } from '../../index';

const FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=82-137&m=dev';

figma.connect(NavBar, FIGMA_URL, {
example: () => (
<NavBar>
<NavItem active>Home</NavItem>
<NavItem active={false}>About</NavItem>
<NavItem active={false}>Contact</NavItem>
</NavBar>
)
});
15 changes: 15 additions & 0 deletions packages/react/src/components/RadioGroup/RadioGroup.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import figma from '@figma/code-connect';
import { RadioGroup } from '../../index';

const FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=231-2042&m=dev';

figma.connect(RadioGroup, FIGMA_URL, {
example: () => (
<RadioGroup
name="example"
radios={[{ id: 'option-a', value: 'a', label: 'Option A' }]}
/>
)
});
43 changes: 43 additions & 0 deletions packages/react/src/components/Tabs/Tabs.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useRef } from 'react';
import figma from '@figma/code-connect';
import { Tabs, Tab, TabPanel } from '../../index';

const TAB_FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=259-6525&m=dev';

const TAB_PANEL_FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=3409-1057&m=dev';

figma.connect(Tab, TAB_FIGMA_URL, {
example: () => {
const panelOneRef = useRef<HTMLDivElement>(null);
const panelTwoRef = useRef<HTMLDivElement>(null);
return (
<>
<Tabs aria-label="Example tabs">
<Tab target={panelOneRef}>Tab 1</Tab>
<Tab target={panelTwoRef}>Tab 2</Tab>
</Tabs>
<TabPanel ref={panelOneRef}>Panel 1 content</TabPanel>
<TabPanel ref={panelTwoRef}>Panel 2 content</TabPanel>
</>
);
}
});

figma.connect(TabPanel, TAB_PANEL_FIGMA_URL, {
example: () => {
const panelOneRef = useRef<HTMLDivElement>(null);
const panelTwoRef = useRef<HTMLDivElement>(null);
return (
<>
<Tabs aria-label="Example tabs">
<Tab target={panelOneRef}>Tab 1</Tab>
<Tab target={panelTwoRef}>Tab 2</Tab>
</Tabs>
<TabPanel ref={panelOneRef}>Panel 1 content</TabPanel>
<TabPanel ref={panelTwoRef}>Panel 2 content</TabPanel>
</>
);
}
});
16 changes: 16 additions & 0 deletions packages/react/src/components/TopBar/TopBar.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import figma from '@figma/code-connect';
import { TopBar, TopBarItem, TopBarTrigger } from '../../index';

const FIGMA_URL =
'https://www.figma.com/design/CEFVdiecqDjLSjhorjHUzI/Product-Foundations--Cauldron--Library?node-id=515-2774&m=dev';

figma.connect(TopBar, FIGMA_URL, {
example: () => (
<TopBar>
<TopBarItem>Home</TopBarItem>
<TopBarItem>About</TopBarItem>
<TopBarTrigger>Menu</TopBarTrigger>
</TopBar>
)
});
Loading