Skip to content

Commit f29dde6

Browse files
committed
feat(CC-batch-5): verification complete
1 parent 04bf24a commit f29dde6

10 files changed

+180
-187
lines changed

packages/code-connect/components/EmptyState/EmptyState.figma.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import figma from '@figma/code-connect';
22
import { EmptyState, EmptyStateBody, EmptyStateFooter, EmptyStateActions } from '@patternfly/react-core';
3+
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
34

45
// TODO: FIGMA: Add Empty state footer
56
// TODO: FIGMA: Consolodate empty state examples
@@ -24,10 +25,6 @@ figma.connect(
2425
title: figma.string('Header text'),
2526

2627
// enum
27-
icon: figma.enum('Type', {
28-
Default: 'CubesIcon', // placeholder icon
29-
Loading: 'Spinner'
30-
}),
3128
status: figma.enum('Type', {
3229
Custom: 'custom',
3330
Warning: 'warning',
@@ -43,14 +40,12 @@ figma.connect(
4340
'Extra large': 'xl'
4441
}),
4542

46-
// children
47-
actions: figma.children(['Button', 'Link Button'])
43+
actions: figma.children('Empty state footer')
4844
},
4945
example: (props) => (
50-
// Documentation for EmptyState can be found at https://www.patternfly.org/components/empty-state
5146
<EmptyState
5247
headingLevel="h4"
53-
icon={props.icon as any}
48+
icon={<PlusCircleIcon />}
5449
variant={props.variant}
5550
status={props.status}
5651
titleText={props.title}

packages/code-connect/components/ExpandableSection/ExandableSectionTruncate.figma.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import figma from '@figma/code-connect';
22
import { ExpandableSection } from '@patternfly/react-core';
33

44
// TODO: FIGMA: Create toggle component
5+
// onToggle={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
6+
// isExpanded={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
7+
8+
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
9+
510
const toggleContent = `
611
<div>
712
<span>You can also use icons </span>
@@ -33,10 +38,7 @@ figma.connect(
3338
children: figma.children('*')
3439
},
3540
example: (props) => (
36-
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
3741
<ExpandableSection
38-
// onToggle={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
39-
// isExpanded={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
4042
isIndented={props.isIndented}
4143
toggleContent={props.toggleContent}
4244
toggleTextCollapsed={props.toggleTextCollapsed}

packages/code-connect/components/ExpandableSection/ExpandableSection.figma.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { ExpandableSection } from '@patternfly/react-core';
33

44
// TODO: FIGMA: This component needs to be overhauled. Using the base component approach present in
55
// other components would significantly reduce complexity.
6+
// TODO: FIGMA: Create toggle component
7+
// onToggle={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
8+
// isExpanded={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
69

7-
// TODO: FIGMA:
10+
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
811

9-
// TODO: FIGMA: Create toggle component
1012
const toggleContent = `
1113
<div>
1214
<span>You can also use icons </span>
@@ -23,7 +25,7 @@ figma.connect(
2325
{
2426
props: {
2527
// enum
26-
isIndented: figma.enum('State', { 'Expanded Indent': true }),
28+
expandedContentSectionText: figma.string('Expanded Text'),
2729
isDetached: figma.enum('State', { 'Expand Detached': true }),
2830
isExpanded: figma.enum('State', {
2931
'Expanded Basic': true,
@@ -32,41 +34,33 @@ figma.connect(
3234
'Expanded Custom Content': true,
3335
'Expanded Custom with Component swap': true
3436
}),
37+
isIndented: figma.enum('State', { 'Expanded Indent': true }),
3538
toggleContent: figma.enum('State', {
3639
'Default Custom Content': toggleContent,
3740
'Expanded Custom Content': toggleContent,
3841
'Expanded Custom with Component swap': toggleContent
3942
}),
43+
toggleTextCollapsed: figma.enum('State', {
44+
Default: figma.string('Toggle Text More'),
45+
Hover: figma.string('Toggle Text More'),
46+
'Default Custom Content': figma.string('Toggle Text More')
47+
}),
4048
toggleTextExpanded: figma.enum('State', {
4149
'Expanded Basic': figma.string('Toggle Text Less'),
4250
'Expand Detached': figma.string('Toggle Text Less'),
4351
'Expanded Indent': figma.string('Toggle Text Less'),
4452
'Expanded Custom Content': figma.string('Toggle Text Less'),
4553
'Expanded Custom with Component swap': figma.string('Toggle Text Less')
46-
}),
47-
expandedContentSectionText: figma.enum('State', {
48-
'Expanded Basic': figma.string('Expanded Text'),
49-
'Expand Detached': figma.string('Expanded Text'),
50-
'Expanded Indent': figma.string('Expanded Text'),
51-
'Expanded Custom Content': figma.string('Expanded Text'),
52-
'Expanded Custom with Component swap': figma.string('Expanded Text')
53-
}),
54-
toggleTextCollapsed: figma.enum('State', {
55-
Default: figma.string('Toggle Text More'),
56-
Hover: figma.string('Toggle Text More'),
57-
'Default Custom Content': figma.string('Toggle Text More')
5854
})
5955
},
6056
example: (props) => (
61-
// Documentation for ExpandableSection can be found at https://www.patternfly.org/components/expandable-section
6257
<ExpandableSection
63-
// onToggle={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
64-
// isExpanded={() => {}} // only required if the user wants to be able to have other side effects when opening/closing
58+
isDetached={props.isDetached}
59+
isExpanded={props.isExpanded}
6560
isIndented={props.isIndented}
6661
toggleContent={props.toggleContent}
67-
toggleTextCollapsed={props.toggleTextCollapsed}
62+
toggleText={props.toggleTextCollapsed}
6863
toggleTextExpanded={props.toggleTextExpanded}
69-
variant="truncate"
7064
>
7165
{props.expandedContentSectionText}
7266
</ExpandableSection>

packages/code-connect/components/ExpandableSection/ExpandableSectionDisclosure.figma.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ figma.connect(
1212
toggleTextExpanded: figma.string('Toggle Text Less'),
1313

1414
// boolean
15-
isIndented: figma.enum('State', {
16-
'Expanded Indent': true
17-
}),
1815
isExpanded: figma.enum('State', {
1916
Expanded: true,
2017
'Expand Uncontrolled': true,
2118
'Expanded Indent': true,
2219
'Expanded Custom Content': true
2320
}),
21+
isIndented: figma.enum('State', { 'Expanded Indent': true }),
2422

2523
children: figma.children('*')
2624
},

packages/code-connect/components/FileUpload/MultipleFileUpload.figma.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
1717

1818
figma.connect(
1919
FileUpload,
20-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=8949-96128&m=dev',
20+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=8949-96128',
2121
{
2222
props: {
23-
isHorizontal: figma.enum('Layout', { Horizontal: true }),
23+
// static
2424
titleText: 'Drag and drop files here',
2525
titleTextSeparator: 'or',
2626
infoText: 'Accepted file types: JPEG, Doc, PDF, PNG',
27+
28+
// enum
29+
isHorizontal: figma.enum('Layout', { Horizontal: true }),
30+
2731
children: figma.children('*')
2832
},
2933
example: (props) => (
3034
// Documentation for FileUpload can be found at https://www.patternfly.org/components/file-upload
3135
<MultipleFileUpload
32-
isHorizontal={props.isHorizontal}
33-
onFileDrop={() => {}}
3436
dropzoneProps={{
3537
accept: {
3638
'image/jpeg': ['.jpg', '.jpeg'],
@@ -39,18 +41,20 @@ figma.connect(
3941
'image/png': ['.png']
4042
}
4143
}}
44+
isHorizontal={props.isHorizontal}
45+
onFileDrop={() => {}}
4246
>
4347
<MultipleFileUploadMain
48+
infoText={props.infoText}
4449
titleIcon={<UploadIcon />}
4550
titleText={props.titleText}
4651
titleTextSeparator={props.titleTextSeparator}
47-
infoText={props.infoText}
4852
/>
4953

5054
<MultipleFileUploadStatus
51-
statusToggleText="Status toggle text"
52-
statusToggleIcon="StatusToggleIcon"
5355
aria-label="Current uploads"
56+
statusToggleIcon="StatusToggleIcon"
57+
statusToggleText="Status toggle text"
5458
>
5559
<MultipleFileUploadStatusItem
5660
file="file-upload-file"

packages/code-connect/components/FileUpload/SimpleFileUpload.figma.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FileUpload, FileUploadHelperText, HelperText, HelperTextItem } from '@p
77

88
figma.connect(
99
FileUpload,
10-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=8949-96043&m=dev',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=8949-96043',
1111
{
1212
props: {
1313
// boolean

packages/code-connect/components/Hint/Hint.figma.tsx

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
DropdownItem,
1010
Divider
1111
} from '@patternfly/react-core';
12+
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
13+
import MenuToggle from '@patternfly/react-core/dist/js/components/MenuToggle/MenuToggle';
1214

1315
// TODO: FIGMA: Use dropdown from figma for actions
1416
// TODO: FIGMA: Create hint title
@@ -17,68 +19,72 @@ import {
1719

1820
// Note: Figma will not render conditional props within React components.
1921
// This means that the <HintTitle>, <HintBody>, and <HintFooter> tags will not be properly render figma.string()
20-
21-
const actions = (
22-
<Dropdown
23-
isOpen={false} // should use an 'isOpen' state variable
24-
onSelect={() => {}} // need to define an onSelect handler
25-
onOpenChange={() => {}}
26-
toggle={() => {}}
27-
>
28-
<DropdownList>
29-
<DropdownItem value={0} key="action">
30-
Action
31-
</DropdownItem>
32-
<DropdownItem
33-
value={1}
34-
key="link"
35-
to="#default-link2"
36-
// Prevent the default onClick functionality for example purposes
37-
onClick={(ev: any) => ev.preventDefault()}
38-
>
39-
Link
40-
</DropdownItem>
41-
<DropdownItem value={2} isDisabled key="disabled action">
42-
Disabled Action
43-
</DropdownItem>
44-
<DropdownItem value={3} isDisabled key="disabled link" to="#default-link4">
45-
Disabled Link
46-
</DropdownItem>
47-
<Divider component="li" key="separator" />
48-
<DropdownItem value={4} key="separated action">
49-
Separated Action
50-
</DropdownItem>
51-
<DropdownItem value={5} key="separated link" to="#default-link6" onClick={(ev) => ev.preventDefault()}>
52-
Separated Link
53-
</DropdownItem>
54-
</DropdownList>
55-
</Dropdown>
56-
);
22+
// Documentation for Hint can be found at https://www.patternfly.org/components/hint
5723

5824
figma.connect(
5925
Hint,
60-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1118-3329&t=IzSunfrnw18ti37Y-11',
26+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1118-3329',
6127
{
6228
props: {
63-
// string
64-
hintTitle: figma.boolean('Show Title', {
65-
true: <HintTitle>{figma.string('✏️ Title')}</HintTitle>,
66-
false: undefined
29+
// Pre-defined title options (enum works, boolean with JSX doesn't)
30+
hintTitle: figma.enum('Show Title', {
31+
false: undefined,
32+
true: <HintTitle>Hint title</HintTitle>
6733
}),
68-
hintBody: figma.boolean('Show Body', {
69-
true: <HintBody>{figma.string('✏️ Body')}</HintBody>,
70-
false: undefined
71-
}),
72-
hintFooter: figma.boolean('Show Footer', {
73-
true: <HintFooter>{figma.instance('Inline link')}</HintFooter>,
74-
false: undefined
34+
35+
// Pre-defined body options
36+
hintBody: figma.enum('Show Body', {
37+
false: undefined,
38+
true: <HintBody>This is hint body text that provides helpful information.</HintBody>
7539
}),
7640

77-
actions: figma.instance('Swap button')
41+
// Pre-defined footer options
42+
hintFooter: figma.enum('Show Footer', {
43+
false: undefined,
44+
true: <HintFooter>Footer content or link</HintFooter>
45+
})
7846
},
7947
example: (props) => (
80-
// Documentation for Hint can be found at https://www.patternfly.org/components/hint
81-
<Hint actions={actions}>
48+
<Hint
49+
actions={
50+
<Dropdown
51+
isOpen={false}
52+
onSelect={() => {}}
53+
onOpenChange={() => {}}
54+
toggle={() => (
55+
<MenuToggle
56+
aria-label="With title example kebab toggle"
57+
variant="plain"
58+
onClick={() => {}}
59+
isExpanded={false}
60+
icon={<EllipsisVIcon />}
61+
/>
62+
)}
63+
>
64+
<DropdownList>
65+
<DropdownItem value={0} key="action">
66+
Action
67+
</DropdownItem>
68+
<DropdownItem value={1} key="link" to="#default-link2" onClick={() => {}}>
69+
Link
70+
</DropdownItem>
71+
<DropdownItem value={2} isDisabled key="disabled action">
72+
Disabled Action
73+
</DropdownItem>
74+
<DropdownItem value={3} isDisabled key="disabled link" to="#default-link4">
75+
Disabled Link
76+
</DropdownItem>
77+
<Divider component="li" key="separator" />
78+
<DropdownItem value={4} key="separated action">
79+
Separated Action
80+
</DropdownItem>
81+
<DropdownItem value={5} key="separated link" to="#default-link6" onClick={() => {}}>
82+
Separated Link
83+
</DropdownItem>
84+
</DropdownList>
85+
</Dropdown>
86+
}
87+
>
8288
{props.hintTitle}
8389
{props.hintBody}
8490
{props.hintFooter}

0 commit comments

Comments
 (0)