Skip to content

Code connect - Variant restrictions not being rendered on Figma after publish #357

@gverav

Description

@gverav

Hello there,

in my organization we are having problems to map some properties from a component (in our case a checkbox) in our Design system using code connect using Variant restrictions to present different uses cases depending if those properties match.

For example, In our project we have a .figma.tsx file for that specific component It looks like this:

figma.connect(
  Checkbox,
  "FIGMA_NODE_URL",
  {
    variant: { "Text": true, "Description Text": false },
    imports: [
      "import { Checkbox } from 'OUR_IMPORT_ROUTE'",
      "import { Label } from 'OUR_IMPORT_ROUTE'",
    ],
    props: {
      label: figma.string("↳ Label"),
    },
    example: ({ label }) => (
      <div className="am-flex am-items-center am-gap-2">
        <Checkbox id="checkbox1" />
        <Label htmlFor="checkbox1">{label}</Label>
      </div>
    ),
  },
)

if you look closely where are mapping Text and Description Text as a variant to show our use case of the use of the component.

We have no issues to publish this, but when we check the component behavior in Figma, this use case in never shown as the example snippet.

behavior of the component:

Image

As you can see, i have Text un true and Description Text properties in false, but the example above is not rendered.

This was working fine until last Friday, and suddenly stopped matching the variants.

Please provide:

  • Code Connect CLI version : 1.3.13
  • Operating system : MacOs Sequoia
  • Code Connect file, Figma design and/or relevant code snippet that could help us get more context

code connect publish logs : https://gist.github.com/gverav/81f086a9311e0cc8fb4170358627346d

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions