diff --git a/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx b/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx new file mode 100644 index 000000000000..893b032d074e --- /dev/null +++ b/packages/react/src/SegmentedControl/SegmentedControl.figma.tsx @@ -0,0 +1,58 @@ +import React from 'react' +import {SegmentedControl} from './SegmentedControl' +import figma from '@figma/code-connect' + +/** + * -- This file was auto-generated by `figma connect create` -- + * `props` includes a mapping from Figma properties and variants to + * suggested values. You should update this to match the props of your + * code component, and update the `example` function to return the + * code example you'd like to see in Figma + */ + +figma.connect( + SegmentedControl, + 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16122-79604&t=LhKEppN9LJfzQQ49-4', + { + props: { + items: figma.children(['SegmentedControl.Button']), + size: figma.enum('size', { + medium: 'medium', + small: 'small', + }), + }, + example: ({size, items}) => {items}, + }, +) + +figma.connect( + SegmentedControl.Button, + 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16121-61223&m=dev', + { + props: { + label: figma.string('label'), + selected: figma.enum('state', {selected: true}), + leadingIcon: figma.boolean('leadingIcon?', { + true: figma.instance('icon'), + false: undefined, + }), + }, + example: ({selected, label, leadingIcon}) => ( + + {label} + + ), + }, +) + +figma.connect( + SegmentedControl.IconButton, + 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=16231-63571&m=dev', + { + props: { + selected: figma.enum('state', {selected: true}), + leadingIcon: figma.instance('icon'), + }, + example: ({selected, leadingIcon}) => , + }, +)