Skip to content

Commit ec3dd5c

Browse files
committed
feat(CC-table): init table
1 parent fe63802 commit ec3dd5c

20 files changed

Lines changed: 377 additions & 8 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import figma from '@figma/code-connect';
2+
import { Tr } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Tr, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=2930-36939', {
7+
props: {
8+
// boolean
9+
isExpanded: figma.boolean('Expanded'),
10+
isRowSelected: figma.boolean('Selected'),
11+
12+
// enum
13+
children: figma.children('*')
14+
},
15+
example: (props) => (
16+
<Tr isExpanded={props.isExpanded} isRowSelected={props.isRowSelected}>
17+
{props.children}
18+
</Tr>
19+
)
20+
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import figma from '@figma/code-connect';
2+
import { Tr } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Tr, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=2930-40632', {
7+
props: {
8+
isExpanded: figma.boolean('Expanded'),
9+
isRowSelected: figma.enum('State', {
10+
Clicked: true
11+
}),
12+
13+
children: figma.children('*')
14+
},
15+
example: (props) => (
16+
<Tr
17+
onRowClick={() => {}}
18+
isSelectable
19+
isExpanded={props.isExpanded}
20+
isClickable
21+
isRowSelected={props.isRowSelected}
22+
>
23+
{props.children}
24+
</Tr>
25+
)
26+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import figma from '@figma/code-connect';
2+
import { Table } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(
7+
Table,
8+
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=6482-49461',
9+
{
10+
props: {
11+
// enum
12+
variant: figma.enum('Size', { Compact: 'compact' }),
13+
14+
children: figma.children('*')
15+
},
16+
example: (props) => (
17+
<Table variant={props.variant} aria-label="Column based table">
18+
{props.children}test
19+
</Table>
20+
)
21+
}
22+
);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import figma from '@figma/code-connect';
2+
import { Th } from '@patternfly/react-table';
3+
4+
// Documentation for header cell can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Th, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=14-623', {
7+
props: {
8+
info: figma.boolean('Show help icon', {
9+
true: { tooltip: 'More information ' },
10+
false: undefined
11+
}),
12+
sort: figma.boolean('Sortable', {
13+
true: `getSortParams(<row-index>)`,
14+
false: undefined
15+
})
16+
},
17+
example: (props) => (
18+
<Th sort={props.sort} info={props.info}>
19+
Header
20+
</Th>
21+
)
22+
});
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import figma from '@figma/code-connect';
2+
import { Th } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Th, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=6241-29618', {
7+
props: {
8+
selectAll: figma.boolean('Select all', {
9+
true: (
10+
<Th
11+
select={{
12+
onSelect: () => {},
13+
isSelected: false
14+
}}
15+
aria-label="Row select"
16+
/>
17+
),
18+
false: undefined
19+
}),
20+
expandableAll: figma.boolean('Expandable all', {
21+
true: (
22+
<Th
23+
expand={{
24+
onToggle: () => {}
25+
}}
26+
aria-label="Row expand"
27+
/>
28+
),
29+
false: undefined
30+
}),
31+
isDraggable: figma.boolean('Is draggable', {
32+
true: <Th draggableRow={{ id: `draggable-row-id` }} />,
33+
false: undefined
34+
})
35+
},
36+
example: (props) => (
37+
<>
38+
{props.selectAll}
39+
{props.expandableAll}
40+
{props.isDraggable}
41+
</>
42+
)
43+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import figma from '@figma/code-connect';
2+
import { Th } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Th, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=6241-29627', {
7+
props: {
8+
children: figma.children('*')
9+
},
10+
example: (props) => <Th>{props.children}</Th>
11+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import figma from '@figma/code-connect';
2+
import { Tr } from '@patternfly/react-table';
3+
4+
// Documentation for BasicRow can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Tr, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=2945-48504', {
7+
props: {
8+
showActions: figma.boolean('Show actions'),
9+
children: figma.children('*')
10+
},
11+
example: (props) => <Tr>{props.children}</Tr>
12+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import figma from '@figma/code-connect';
2+
import { Table } from '@patternfly/react-table';
3+
4+
// Documentation for Table can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(
7+
Table,
8+
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=6482-55919',
9+
{
10+
props: {
11+
children: figma.children('*')
12+
},
13+
example: (props) => (
14+
<Table isExpandable aria-label="Compound expandable table">
15+
{props.children}
16+
</Table>
17+
)
18+
}
19+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import figma from '@figma/code-connect';
2+
import { Tr } from '@patternfly/react-table';
3+
4+
// Documentation for Table can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Tr, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=21288-130668', {
7+
props: {
8+
children: figma.children('*')
9+
},
10+
example: (props) => (
11+
<Tr id="draggable-row-id" draggable onDrop={() => {}} onDragEnd={() => {}} onDragStart={() => {}}>
12+
{props.children}
13+
</Tr>
14+
)
15+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import figma from '@figma/code-connect';
2+
import { ActionsColumn, Td, Th } from '@patternfly/react-table';
3+
4+
// Documentation for Table can be found at https://www.patternfly.org/components/table
5+
6+
figma.connect(Td, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=6441-38440', {
7+
props: {
8+
tableCell: figma.boolean('Column header', {
9+
true: <Th screenReaderText="Action cell" />,
10+
false: (
11+
<Td isActionCell>
12+
<ActionsColumn items={[]} />
13+
</Td>
14+
)
15+
})
16+
},
17+
example: (props) => <>{props.tableCell}</>
18+
});

0 commit comments

Comments
 (0)