|
1 | 1 | import {Blankslate} from '../Blankslate'
|
2 | 2 | import figma from '@figma/code-connect'
|
3 | 3 |
|
| 4 | +const props = { |
| 5 | + leadingVisual: figma.nestedProps('_BlankslateVisual', { |
| 6 | + item: figma.children('leadingVisual'), |
| 7 | + }), |
| 8 | + size: figma.enum('size', { |
| 9 | + small: 'small', |
| 10 | + medium: 'medium', |
| 11 | + large: 'large', |
| 12 | + }), |
| 13 | + spacious: figma.boolean('spacious'), |
| 14 | + border: figma.boolean('border'), |
| 15 | + heading: figma.textContent('Text: Heading'), |
| 16 | + description: figma.textContent('Text: Description'), |
| 17 | + PrimaryAction: figma.children('_BlankSlate.PrimaryAction'), |
| 18 | + SecondaryActionText: figma.boolean('SecondaryAction?', { |
| 19 | + true: figma.textContent('Secondary action link'), |
| 20 | + false: undefined, |
| 21 | + }), |
| 22 | +} |
| 23 | + |
4 | 24 | figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
|
5 |
| - props: { |
6 |
| - leadingVisual: figma.nestedProps('_BlankslateVisual', { |
7 |
| - item: figma.children('leadingVisual'), |
8 |
| - }), |
9 |
| - narrow: figma.boolean('narrow?'), |
10 |
| - spacious: figma.boolean('spacious?'), |
11 |
| - border: figma.boolean('border?'), |
12 |
| - heading: figma.textContent('Text: Heading'), |
13 |
| - description: figma.textContent('Text: Description'), |
14 |
| - }, |
15 |
| - variant: {primaryAction: 'false', secondaryAction: 'false'}, |
16 |
| - example: ({leadingVisual, border, spacious, narrow, description, heading}) => ( |
17 |
| - <Blankslate border={border} spacious={spacious} narrow={narrow}> |
| 25 | + props, |
| 26 | + variant: {'SecondaryAction?': 'true'}, |
| 27 | + example: ({leadingVisual, border, spacious, size, description, heading, SecondaryActionText, PrimaryAction}) => ( |
| 28 | + <Blankslate border={border} spacious={spacious} size={size}> |
18 | 29 | <Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
|
19 | 30 | <Blankslate.Heading>{heading}</Blankslate.Heading>
|
20 | 31 | <Blankslate.Description>{description}</Blankslate.Description>
|
| 32 | + <Blankslate.SecondaryAction href="">{SecondaryActionText}</Blankslate.SecondaryAction> |
| 33 | + {PrimaryAction} |
21 | 34 | </Blankslate>
|
22 | 35 | ),
|
23 | 36 | })
|
24 | 37 | figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', {
|
25 |
| - props: { |
26 |
| - leadingVisual: figma.nestedProps('_BlankslateVisual', { |
27 |
| - item: figma.children('leadingVisual'), |
28 |
| - }), |
29 |
| - narrow: figma.boolean('narrow?'), |
30 |
| - spacious: figma.boolean('spacious?'), |
31 |
| - border: figma.boolean('border?'), |
32 |
| - heading: figma.textContent('Text: Heading'), |
33 |
| - description: figma.textContent('Text: Description'), |
34 |
| - primaryAction: figma.nestedProps('Primary action', { |
35 |
| - text: figma.textContent('Button'), |
36 |
| - }), |
37 |
| - }, |
38 |
| - variant: {primaryAction: 'true', secondaryAction: 'false'}, |
39 |
| - example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction}) => ( |
40 |
| - <Blankslate border={border} spacious={spacious} narrow={narrow}> |
| 38 | + props, |
| 39 | + variant: {'SecondaryAction?': 'false'}, |
| 40 | + example: ({leadingVisual, border, spacious, size, description, heading, PrimaryAction}) => ( |
| 41 | + <Blankslate border={border} spacious={spacious} size={size}> |
41 | 42 | <Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual>
|
42 | 43 | <Blankslate.Heading>{heading}</Blankslate.Heading>
|
43 | 44 | <Blankslate.Description>{description}</Blankslate.Description>
|
44 |
| - <Blankslate.PrimaryAction href="">{primaryAction.text}</Blankslate.PrimaryAction> |
| 45 | + {PrimaryAction} |
45 | 46 | </Blankslate>
|
46 | 47 | ),
|
47 | 48 | })
|
48 |
| -figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { |
49 |
| - props: { |
50 |
| - leadingVisual: figma.nestedProps('_BlankslateVisual', { |
51 |
| - item: figma.children('leadingVisual'), |
52 |
| - }), |
53 |
| - narrow: figma.boolean('narrow?'), |
54 |
| - spacious: figma.boolean('spacious?'), |
55 |
| - border: figma.boolean('border?'), |
56 |
| - heading: figma.textContent('Text: Heading'), |
57 |
| - description: figma.textContent('Text: Description'), |
58 |
| - primaryAction: figma.nestedProps('Primary action', { |
59 |
| - text: figma.textContent('Button'), |
60 |
| - }), |
61 |
| - secondaryAction: figma.textContent('Secondary action link'), |
62 |
| - }, |
63 |
| - variant: {primaryAction: 'true', secondaryAction: 'true'}, |
64 |
| - example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction, secondaryAction}) => ( |
65 |
| - <Blankslate border={border} spacious={spacious} narrow={narrow}> |
66 |
| - <Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> |
67 |
| - <Blankslate.Heading>{heading}</Blankslate.Heading> |
68 |
| - <Blankslate.Description>{description}</Blankslate.Description> |
69 |
| - <Blankslate.PrimaryAction href="">{primaryAction.text}</Blankslate.PrimaryAction> |
70 |
| - <Blankslate.SecondaryAction href="">{secondaryAction}</Blankslate.SecondaryAction> |
71 |
| - </Blankslate> |
72 |
| - ), |
73 |
| -}) |
74 |
| -figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { |
75 |
| - props: { |
76 |
| - leadingVisual: figma.nestedProps('_BlankslateVisual', { |
77 |
| - item: figma.children('leadingVisual'), |
78 |
| - }), |
79 |
| - narrow: figma.boolean('narrow?'), |
80 |
| - spacious: figma.boolean('spacious?'), |
81 |
| - border: figma.boolean('border?'), |
82 |
| - heading: figma.textContent('Text: Heading'), |
83 |
| - description: figma.textContent('Text: Description'), |
84 |
| - secondaryAction: figma.textContent('Secondary action link'), |
| 49 | + |
| 50 | +figma.connect( |
| 51 | + Blankslate, |
| 52 | + 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=40491-3841&t=5mMfBZbhHgyouYtk-4', |
| 53 | + { |
| 54 | + props: { |
| 55 | + PrimaryAction: figma.nestedProps('Primary action', { |
| 56 | + text: figma.textContent('Button'), |
| 57 | + icon: figma.children('icon'), |
| 58 | + variant: figma.enum('variant', { |
| 59 | + primary: 'primary', |
| 60 | + secondary: 'secondary', |
| 61 | + danger: 'danger', |
| 62 | + invisible: 'invisible', |
| 63 | + }), |
| 64 | + }), |
| 65 | + }, |
| 66 | + example: ({PrimaryAction}) => ( |
| 67 | + <Blankslate.PrimaryAction href=""> |
| 68 | + {PrimaryAction.icon} |
| 69 | + {PrimaryAction.text} |
| 70 | + </Blankslate.PrimaryAction> |
| 71 | + ), |
85 | 72 | },
|
86 |
| - variant: {primaryAction: 'false', secondaryAction: 'true'}, |
87 |
| - example: ({leadingVisual, border, spacious, narrow, description, heading, secondaryAction}) => ( |
88 |
| - <Blankslate border={border} spacious={spacious} narrow={narrow}> |
89 |
| - <Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> |
90 |
| - <Blankslate.Heading>{heading}</Blankslate.Heading> |
91 |
| - <Blankslate.Description>{description}</Blankslate.Description> |
92 |
| - <Blankslate.SecondaryAction href="">{secondaryAction}</Blankslate.SecondaryAction> |
93 |
| - </Blankslate> |
94 |
| - ), |
95 |
| -}) |
| 73 | +) |
0 commit comments