11// import figma needs to remain as figma otherwise it breaks code connect
22// eslint-disable-next-line import-x/no-named-as-default
33import figma from '@figma/code-connect' ;
4+ import { TextVariant } from '@metamask/design-system-shared' ;
45import React from 'react' ;
56
6- import { IconName } from '../Icon' ;
7-
87import { TextButton } from './TextButton' ;
98
10- import { TextButtonSize } from '.' ;
11-
129/**
1310 * -- This file was auto-generated by Code Connect --
1411 * React Native implementation of TextButton component
@@ -23,38 +20,14 @@ figma.connect(
2320 'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=1%3A398' ,
2421 {
2522 props : {
26- size : figma . enum ( 'size' , {
27- BodyMd : TextButtonSize . BodyMd ,
28- BodySm : TextButtonSize . BodySm ,
29- } ) ,
30- isDisabled : figma . boolean ( 'isDisabled' ) ,
31- isInverse : figma . boolean ( 'isInverse' ) ,
32- startIconName : figma . boolean ( 'startIcon (Figma Only)' , {
33- true : IconName . Add ,
34- false : undefined ,
35- } ) ,
36- endIconName : figma . boolean ( 'endIcon (Figma Only)' , {
37- true : IconName . Add ,
38- false : undefined ,
23+ // Map Figma "size" variant to Text variant used by RN TextButton
24+ variant : figma . enum ( 'size' , {
25+ BodyMd : TextVariant . BodyMd ,
26+ BodySm : TextVariant . BodySm ,
3927 } ) ,
4028 } ,
41- example : ( {
42- size,
43- isDisabled,
44- isInverse,
45- startIconName,
46- endIconName,
47- ...props
48- } ) => (
49- < TextButton
50- size = { size }
51- isDisabled = { isDisabled }
52- isInverse = { isInverse }
53- startIconName = { startIconName }
54- endIconName = { endIconName }
55- { ...props }
56- onPress = { ( ) => undefined }
57- >
29+ example : ( { variant, ...props } ) => (
30+ < TextButton variant = { variant } { ...props } onPress = { ( ) => undefined } >
5831 Text Button
5932 </ TextButton >
6033 ) ,
0 commit comments