Skip to content

Added a few fixes to Code Connect after adjusting Figma property names #6110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
96 changes: 36 additions & 60 deletions packages/react/src/Blankslate/Blankslate.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
import {Blankslate} from '../Blankslate'
import figma from '@figma/code-connect'

const props = {
leadingVisual: figma.nestedProps('_BlankslateVisual', {
item: figma.children('leadingVisual'),
}),
size: figma.enum('size', {
small: 'small',
medium: 'medium',
large: 'large',
}),
spacious: figma.boolean('spacious'),
border: figma.boolean('border'),
heading: figma.textContent('Text: Heading'),
description: figma.textContent('Text: Description'),
primaryAction: figma.nestedProps('Primary action', {
text: figma.textContent('Button'),
}),
secondaryAction: figma.textContent('Secondary action link'),
'primaryAction?': figma.boolean('primaryAction?'),
}

figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
props: {
leadingVisual: figma.nestedProps('_BlankslateVisual', {
item: figma.children('leadingVisual'),
}),
narrow: figma.boolean('narrow?'),
spacious: figma.boolean('spacious?'),
border: figma.boolean('border?'),
heading: figma.textContent('Text: Heading'),
description: figma.textContent('Text: Description'),
},
variant: {primaryAction: 'false', secondaryAction: 'false'},
example: ({leadingVisual, border, spacious, narrow, description, heading}) => (
<Blankslate border={border} spacious={spacious} narrow={narrow}>
props,
variant: {'primaryAction?': false, 'secondaryAction?': false},
example: ({leadingVisual, border, spacious, size, description, heading}) => (
<Blankslate border={border} spacious={spacious} size={size}>
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
<Blankslate.Heading>{heading}</Blankslate.Heading>
<Blankslate.Description>{description}</Blankslate.Description>
</Blankslate>
),
})
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
props: {
leadingVisual: figma.nestedProps('_BlankslateVisual', {
item: figma.children('leadingVisual'),
}),
narrow: figma.boolean('narrow?'),
spacious: figma.boolean('spacious?'),
border: figma.boolean('border?'),
heading: figma.textContent('Text: Heading'),
description: figma.textContent('Text: Description'),
primaryAction: figma.nestedProps('Primary action', {
text: figma.textContent('Button'),
}),
},
variant: {primaryAction: 'true', secondaryAction: 'false'},
example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction}) => (
<Blankslate border={border} spacious={spacious} narrow={narrow}>
props,
variant: {'primaryAction?': true, 'secondaryAction?': false},
example: ({leadingVisual, border, spacious, size, description, heading, primaryAction}) => (
<Blankslate border={border} spacious={spacious} size={size}>
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
<Blankslate.Heading>{heading}</Blankslate.Heading>
<Blankslate.Description>{description}</Blankslate.Description>
Expand All @@ -46,23 +45,10 @@ figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/P
),
})
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
props: {
leadingVisual: figma.nestedProps('_BlankslateVisual', {
item: figma.children('leadingVisual'),
}),
narrow: figma.boolean('narrow?'),
spacious: figma.boolean('spacious?'),
border: figma.boolean('border?'),
heading: figma.textContent('Text: Heading'),
description: figma.textContent('Text: Description'),
primaryAction: figma.nestedProps('Primary action', {
text: figma.textContent('Button'),
}),
secondaryAction: figma.textContent('Secondary action link'),
},
variant: {primaryAction: 'true', secondaryAction: 'true'},
example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction, secondaryAction}) => (
<Blankslate border={border} spacious={spacious} narrow={narrow}>
props,
variant: {'primaryAction?': true, 'secondaryAction?': true},
example: ({leadingVisual, border, spacious, size, description, heading, primaryAction, secondaryAction}) => (
<Blankslate border={border} spacious={spacious} size={size}>
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
<Blankslate.Heading>{heading}</Blankslate.Heading>
<Blankslate.Description>{description}</Blankslate.Description>
Expand All @@ -72,20 +58,10 @@ figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/P
),
})
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
props: {
leadingVisual: figma.nestedProps('_BlankslateVisual', {
item: figma.children('leadingVisual'),
}),
narrow: figma.boolean('narrow?'),
spacious: figma.boolean('spacious?'),
border: figma.boolean('border?'),
heading: figma.textContent('Text: Heading'),
description: figma.textContent('Text: Description'),
secondaryAction: figma.textContent('Secondary action link'),
},
variant: {primaryAction: 'false', secondaryAction: 'true'},
example: ({leadingVisual, border, spacious, narrow, description, heading, secondaryAction}) => (
<Blankslate border={border} spacious={spacious} narrow={narrow}>
props,
variant: {'primaryAction?': false, 'secondaryAction?': true},
example: ({leadingVisual, border, spacious, size, description, heading, secondaryAction}) => (
<Blankslate border={border} spacious={spacious} size={size}>
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
<Blankslate.Heading>{heading}</Blankslate.Heading>
<Blankslate.Description>{description}</Blankslate.Description>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/BranchName/BranchName.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ figma.connect(
{
props: {
label: figma.textContent('branch_name'),
as: figma.enum('type', {
as: figma.enum('as', {
text: 'span',
link: undefined,
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Checkbox/Checkbox.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ figma.connect(
disabled: figma.enum('state', {
disabled: true,
}),
checked: figma.boolean('checked?'),
indeterminate: figma.boolean('indeterminate?'),
checked: figma.boolean('checked'),
indeterminate: figma.boolean('indeterminate'),
},
example: ({disabled, label, caption, checked, indeterminate, labelProps}) => (
<FormControl disabled={disabled} required={labelProps.required}>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Radio/Radio.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ figma.connect(Radio, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer
disabled: figma.enum('state', {
disabled: true,
}),
checked: figma.boolean('checked?'),
checked: figma.boolean('checked'),
},
example: ({disabled, label, caption, checked, labelProps}) => (
<FormControl disabled={disabled} required={labelProps.required}>
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/ToggleSwitch/ToggleSwitch.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ figma.connect(
loading: true,
}),
checked: figma.boolean('checked'),
labelposition: figma.enum('label position', {
statusLabelPosition: figma.enum('status label position', {
start: 'start',
end: 'end',
}),
},
example: ({size, checked, labelposition, loading}) => (
<ToggleSwitch size={size} checked={checked} statusLabelPosition={labelposition} loading={loading} />
example: ({size, checked, statusLabelPosition, loading}) => (
<ToggleSwitch size={size} checked={checked} statusLabelPosition={statusLabelPosition} loading={loading} />
),
},
)
2 changes: 1 addition & 1 deletion packages/react/src/UnderlineNav/UnderlineNav.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ figma.connect(
counter: figma.nestedProps('CounterLabel', {
count: figma.textContent('text'),
}),
leadingVisual: figma.boolean('leadingIcon?', {
leadingVisual: figma.boolean('leadingVisual?', {
false: undefined,
true: figma.children('Icon'),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ figma.connect(UnderlinePanels, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG

const UnderlinePanelsTabProps = {
selected: figma.boolean('selected'),
leadingIcon: figma.boolean('leadingIcon?', {
leadingIcon: figma.boolean('leadingVisual?', {
true: figma.instance('icon').getProps<{name: string; fn: React.FC<IconProps>}>(),
false: undefined,
}),
Expand All @@ -39,7 +39,7 @@ figma.connect(
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=39456-2213&t=Ruhmu4yrZlzn11My-4',
{
props: UnderlinePanelsTabProps,
variant: {'leadingIcon?': true},
variant: {'leadingVisual?': true},
example: ({label, selected, leadingIcon}) => (
<UnderlinePanels.Tab aria-selected={selected} icon={leadingIcon.fn}>
{label}
Expand All @@ -53,7 +53,7 @@ figma.connect(
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=39456-2213&t=Ruhmu4yrZlzn11My-4',
{
props: UnderlinePanelsTabProps,
variant: {'leadingIcon?': true, 'counter?': true},
variant: {'leadingVisual?': true, 'counter?': true},
example: ({label, selected, leadingIcon, counterProps}) => (
<UnderlinePanels.Tab aria-selected={selected} icon={leadingIcon.fn} counter={counterProps.value}>
{label}
Expand All @@ -67,7 +67,7 @@ figma.connect(
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=39456-2213&t=Ruhmu4yrZlzn11My-4',
{
props: UnderlinePanelsTabProps,
variant: {'leadingIcon?': false, 'counter?': true},
variant: {'leadingVisual?': false, 'counter?': true},
example: ({label, selected, counterProps}) => (
<UnderlinePanels.Tab aria-selected={selected} counter={counterProps.value}>
{label}
Expand Down
Loading