Skip to content

Commit

Permalink
feat(code connect): cleanup and publish generated files to figma
Browse files Browse the repository at this point in the history
  • Loading branch information
tylermorrisford committed Dec 17, 2024
1 parent 5b5bf19 commit cce888e
Show file tree
Hide file tree
Showing 18 changed files with 277 additions and 9 deletions.
9 changes: 8 additions & 1 deletion get-figma-ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ async function fetchFigmaComponentIds() {
.filter((component) =>
component.containing_frame.hasOwnProperty('containingStateGroup')
)
.reduce((acc, component) => {
// Dedupe components with the same name
if (!acc.some((item) => item.name === component.name)) {
acc.push(component);
}
return acc;
}, [])
// create a new array with a normalized name of the component
// and the encoded node id of the component
.map((component) => {
Expand All @@ -47,7 +54,7 @@ async function fetchFigmaComponentIds() {
),
};
});
// Use a Map arranged by name for lookups TODO: needs to be deduped
// Use a Map arranged by name for lookups
return new Map(
componentListArray.map((component) => [component.name, component])
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// @ts-nocheck
import { AccessibleButton } from '@commercetools-frontend/ui-kit';
import { CollapsiblePanel } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
AccessibleButton,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=<placeholder>',
CollapsiblePanel,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=118%3A17915',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <AccessibleButton>{props.children}</AccessibleButton>,
example: (props) => <CollapsiblePanel>{props.children}</CollapsiblePanel>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { DataTableManager } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
DataTableManager,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=5602%3A26092',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <DataTableManager>{props.children}</DataTableManager>,
}
);
17 changes: 17 additions & 0 deletions packages/components/data-table/src/footer.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { Footer } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
Footer,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=3208%3A769',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <Footer>{props.children}</Footer>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { DropdownMenu } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
DropdownMenu,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=5322%3A3674',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <DropdownMenu>{props.children}</DropdownMenu>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { Footer } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
Footer,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=3208%3A769',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <Footer>{props.children}</Footer>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { Header } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
Header,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=645%3A38178',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <Header>{props.children}</Header>,
}
);
17 changes: 17 additions & 0 deletions packages/components/inputs/checkbox-input/src/checkbox.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { Checkbox } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
Checkbox,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=161%3A18694',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <Checkbox>{props.children}</Checkbox>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { TimeInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
TimeInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=307%3A23474',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <TimeInput>{props.children}</TimeInput>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-nocheck
import { LocalizedTextInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
LocalizedTextInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=453%3A26870',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => (
<LocalizedTextInput>{props.children}</LocalizedTextInput>
),
}
);
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// @ts-nocheck
import { LinkButton } from '@commercetools-frontend/ui-kit';
import { MoneyInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
LinkButton,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=<placeholder>',
MoneyInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=453%3A26481',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <LinkButton>{props.children}</LinkButton>,
example: (props) => <MoneyInput>{props.children}</MoneyInput>,
}
);
17 changes: 17 additions & 0 deletions packages/components/inputs/select-input/src/select-input.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { SelectInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
SelectInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=120%3A17426',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <SelectInput>{props.children}</SelectInput>,
}
);
17 changes: 17 additions & 0 deletions packages/components/inputs/text-input/src/text-input.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { TextInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
TextInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=107%3A18819',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <TextInput>{props.children}</TextInput>,
}
);
17 changes: 17 additions & 0 deletions packages/components/inputs/time-input/src/time-input.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { TimeInput } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
TimeInput,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=307%3A23474',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <TimeInput>{props.children}</TimeInput>,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-nocheck
import { ContentNotification } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
ContentNotification,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=212%3A20449',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => (
<ContentNotification>{props.children}</ContentNotification>
),
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-nocheck
import { PrimaryActionDropdown } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
PrimaryActionDropdown,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=1040%3A35979',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => (
<PrimaryActionDropdown>{props.children}</PrimaryActionDropdown>
),
}
);
17 changes: 17 additions & 0 deletions packages/components/progress-bar/src/progress-bar.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { ProgressBar } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
ProgressBar,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=4834%3A44677',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <ProgressBar>{props.children}</ProgressBar>,
}
);
17 changes: 17 additions & 0 deletions packages/components/stamp/src/stamp.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-nocheck
import { Stamp } from '@commercetools-frontend/ui-kit';
import figma from '@figma/code-connect';

// REQUIRED: supply node id for the figma component
figma.connect(
Stamp,
'https://www.figma.com/design/UoqmtHSHwxvEZRcbsM4A3Z/CT-product-design-system?node-id=123%3A18613',
{
props: {
// *This file was generated from a script*
// TODO: manually map props here, see https://www.figma.com/code-connect-docs/react/#figmaconnect
children: figma.children('*'),
},
example: (props) => <Stamp>{props.children}</Stamp>,
}
);

0 comments on commit cce888e

Please sign in to comment.