//url=?node-id=18787-39323 //source=./index.tsx //component=Combobox import figma from 'figma' const instance = figma.selectedInstance const state = instance.getEnum('State', { Normal: undefined, Error: 'error', Warning: 'warning', }) const variant = instance.getEnum('Variant', { 'Single select': undefined, 'Multi select': true, }) const withLabel = instance.getBoolean('Label', { true: 'With label', false: undefined, }) let errorMessage = undefined let label if (withLabel) { const labelInstance = instance.findInstance('Form label') if (labelInstance.type !== 'ERROR') { const labelText = labelInstance.findText('Label') if (labelText.type === 'TEXT') { label = labelText.textContent } } } if (state === 'error') { const errorInstance = instance.findInstance('Form inline message') if (errorInstance.type !== 'ERROR') { const errorText = errorInstance.findText('Label') if (errorText.type === 'TEXT') { errorMessage = errorText.textContent } } } export default { example: figma.code``, imports: ['import { Combobox } from "@planview/pv-form"'], id: 'FormCombobox', metadata: { nestable: true, }, }