Skip to content
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
45 changes: 25 additions & 20 deletions components/DesignSystem/Inputs/Radio.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
import { figma } from '@figma/code-connect';
import { Radio } from '@mantine/core';
import { Radio } from './Radio';

figma.connect(
Radio,
'https://www.figma.com/design/rXvD5jPC1i02ZIma87Qcbl/ADDS-Admin-Mantine-Core?node-id=1205-372&t=y0IJ175mkJJcYKZp-4',
'https://www.figma.com/design/rXvD5jPC1i02ZIma87Qcbl/ADDS-Admin-Mantine-Core?node-id=5422-950&t=1LrRB2fT0aSOV74o-11',


{
props: {
// TODO: Restore bindings once the Figma radio exposes matching props
// size: figma.enum('size', {
// xs: 'xs',
// sm: 'sm',
// md: 'md',
// lg: 'lg',
// xl: 'xl',
// }),
// label: figma.string('label'),
// description: figma.string('description'),
// error: figma.string('error'),
// required: figma.boolean('required'),
// disabled: figma.boolean('disabled'),
// checked: figma.boolean('checked'),
// value: figma.string('value'),
// name: figma.string('name'),
size: figma.enum('size', {
xs: 'xs',
sm: 'sm',
md: 'md',
lg: 'lg',
xl: 'xl',
}),
label: figma.string('label'),
required: figma.boolean('required'),
disabled: figma.boolean('disabled'),
checked: figma.boolean('checked'),
},
example: () => (
<Radio size="md" label="Option" value="option" name="radio" />
example: (props) => (
<Radio
size={props.size}
label={props.label}
required={props.required}
disabled={props.disabled}
checked={props.checked}
value="option"
name="radio"
/>
),
}
);
Expand Down
39 changes: 19 additions & 20 deletions components/DesignSystem/Inputs/Switch.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import { figma } from '@figma/code-connect';
import { Switch } from '@mantine/core';
import { Switch } from './Switch';

figma.connect(
Switch,
'https://www.figma.com/design/rXvD5jPC1i02ZIma87Qcbl/ADDS-Admin-Mantine-Core?node-id=710-2351&t=F9hLR9eQ6A8lxsBi-4',
'https://www.figma.com/design/rXvD5jPC1i02ZIma87Qcbl/ADDS-Admin-Mantine-Core?node-id=5449-1439&t=kmCY8PcaF7gXHN6Z-11',
{
props: {
// TODO: Restore bindings once the Figma switch exposes matching props
// size: figma.enum('size', {
// sm: 'sm',
// md: 'md',
// lg: 'lg',
// }),
// state: figma.enum('state', {
// on: true,
// off: false,
// }),
// showLabel: figma.boolean('show label'),
size: figma.enum('size', {
xs: 'xs',
sm: 'sm',
md: 'md',
lg: 'lg',
xl: 'xl',
}),
label: figma.string('label'),
checked: figma.boolean('checked'),
onLabel: figma.string('onLabel'),
offLabel: figma.string('offLabel'),
},
example: () => (
example: (props) => (
<Switch
size="md"
label="Enable notifications"
description="Receive updates by email"
checked
onLabel="ON"
offLabel="OFF"
size={props.size}
label={props.label}
checked={props.checked}
{...(props.onLabel && { onLabel: props.onLabel })}
{...(props.offLabel && { offLabel: props.offLabel })}
/>
),
}
Expand Down
5 changes: 3 additions & 2 deletions figma.config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"codeConnect": {
"include": [
"components/DesignSystem/**/*.{figma.ts,figma.tsx}"
"components/DesignSystem/**/*.{ts,tsx}"
],
"exclude": [
"node_modules/**",
".next/**",
"storybook-static/**",
"**/*.test.*",
"**/*.spec.*"
"**/*.spec.*",
"**/*.stories.*"
],
"parser": "react",
"fallback": false
Expand Down
Loading