@seed-design/figma 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/codegen/index.cjs +366 -286
- package/lib/codegen/index.d.ts +508 -233
- package/lib/codegen/index.d.ts.map +1 -1
- package/lib/codegen/index.js +366 -286
- package/lib/codegen/targets/react/index.cjs +1012 -510
- package/lib/codegen/targets/react/index.d.ts.map +1 -1
- package/lib/codegen/targets/react/index.js +1012 -510
- package/lib/index.cjs +394 -286
- package/lib/index.js +394 -286
- package/package.json +1 -1
- package/src/codegen/component-properties.ts +362 -103
- package/src/codegen/targets/react/component/handlers/bottom-sheet.ts +2 -3
- package/src/codegen/targets/react/component/handlers/error-state.ts +18 -6
- package/src/codegen/targets/react/component/handlers/field-button.ts +197 -0
- package/src/codegen/targets/react/component/handlers/field.ts +167 -0
- package/src/codegen/targets/react/component/handlers/slider.ts +114 -0
- package/src/codegen/targets/react/component/handlers/text-field.ts +245 -92
- package/src/codegen/targets/react/component/index.ts +40 -23
- package/src/codegen/targets/react/element-factories.ts +1 -1
- package/src/codegen/targets/react/instance.ts +23 -2
- package/src/entities/data/__generated__/component-sets/index.d.ts +225 -222
- package/src/entities/data/__generated__/component-sets/index.mjs +225 -222
- package/src/entities/data/__generated__/components/index.d.ts +121 -0
- package/src/entities/data/__generated__/components/index.mjs +121 -0
- package/src/entities/data/__generated__/icons/index.mjs +28 -0
- package/src/entities/data/__generated__/styles/index.mjs +0 -56
- package/src/entities/data/__generated__/variable-collections/index.mjs +11 -8
- package/src/entities/data/__generated__/variables/index.mjs +130 -0
- package/src/codegen/targets/react/component/handlers/multiline-text-field.ts +0 -84
package/package.json
CHANGED
|
@@ -1,71 +1,16 @@
|
|
|
1
1
|
import type { InferComponentDefinition } from "@/codegen/core";
|
|
2
|
-
import type * as
|
|
2
|
+
import type * as sets from "@/entities/data/__generated__/component-sets";
|
|
3
3
|
|
|
4
4
|
export type ActionButtonProperties = InferComponentDefinition<
|
|
5
|
-
typeof
|
|
5
|
+
typeof sets.actionButton.componentPropertyDefinitions
|
|
6
6
|
>;
|
|
7
7
|
|
|
8
|
-
export type ActionButtonGhostProperties = InferComponentDefinition<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
defaultValue: "라벨";
|
|
12
|
-
};
|
|
13
|
-
"Prefix Icon#30511:3": {
|
|
14
|
-
type: "INSTANCE_SWAP";
|
|
15
|
-
defaultValue: "26621:24682";
|
|
16
|
-
preferredValues: [];
|
|
17
|
-
};
|
|
18
|
-
"Suffix Icon#30525:0": {
|
|
19
|
-
type: "INSTANCE_SWAP";
|
|
20
|
-
defaultValue: "26621:23545";
|
|
21
|
-
preferredValues: [
|
|
22
|
-
{
|
|
23
|
-
type: "COMPONENT_SET";
|
|
24
|
-
key: "c8415f85843e5aea5a1d3620d03d16b643bf86cd";
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
type: "COMPONENT_SET";
|
|
28
|
-
key: "0d0a2bc648a2c4e1f06a56a30ef16299b6e91037";
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "COMPONENT_SET";
|
|
32
|
-
key: "8f28ae559baf8f388d84ccc3ad65a282966e1b05";
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "COMPONENT_SET";
|
|
36
|
-
key: "57341e8a9961bf31590240dd288e57c76969098d";
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
};
|
|
40
|
-
"Icon#30525:15": {
|
|
41
|
-
type: "INSTANCE_SWAP";
|
|
42
|
-
defaultValue: "34885:102336";
|
|
43
|
-
preferredValues: [];
|
|
44
|
-
};
|
|
45
|
-
Bleed: {
|
|
46
|
-
type: "VARIANT";
|
|
47
|
-
defaultValue: "true";
|
|
48
|
-
variantOptions: ["true", "false"];
|
|
49
|
-
};
|
|
50
|
-
Size: {
|
|
51
|
-
type: "VARIANT";
|
|
52
|
-
defaultValue: "Medium";
|
|
53
|
-
variantOptions: ["Xsmall", "Small", "Medium", "Large"];
|
|
54
|
-
};
|
|
55
|
-
Layout: {
|
|
56
|
-
type: "VARIANT";
|
|
57
|
-
defaultValue: "Icon First";
|
|
58
|
-
variantOptions: ["Text Only", "Icon First", "Icon Last", "Icon Only"];
|
|
59
|
-
};
|
|
60
|
-
State: {
|
|
61
|
-
type: "VARIANT";
|
|
62
|
-
defaultValue: "Enabled";
|
|
63
|
-
variantOptions: ["Enabled", "Pressed", "Loading", "Disabled"];
|
|
64
|
-
};
|
|
65
|
-
}>;
|
|
8
|
+
export type ActionButtonGhostProperties = InferComponentDefinition<
|
|
9
|
+
typeof sets.actionButtonGhostButton.componentPropertyDefinitions
|
|
10
|
+
>;
|
|
66
11
|
|
|
67
12
|
export type AlertDialogProperties = InferComponentDefinition<
|
|
68
|
-
typeof
|
|
13
|
+
typeof sets.alertDialog.componentPropertyDefinitions
|
|
69
14
|
>;
|
|
70
15
|
|
|
71
16
|
export type AlertDialogFooterProperties = InferComponentDefinition<{
|
|
@@ -84,35 +29,35 @@ export type AlertDialogFooterProperties = InferComponentDefinition<{
|
|
|
84
29
|
}>;
|
|
85
30
|
|
|
86
31
|
export type AvatarProperties = InferComponentDefinition<
|
|
87
|
-
typeof
|
|
32
|
+
typeof sets.avatar.componentPropertyDefinitions
|
|
88
33
|
>;
|
|
89
34
|
|
|
90
35
|
export type AvatarStackProperties = InferComponentDefinition<
|
|
91
|
-
typeof
|
|
36
|
+
typeof sets.avatarStack.componentPropertyDefinitions
|
|
92
37
|
>;
|
|
93
38
|
|
|
94
39
|
export type BadgeProperties = InferComponentDefinition<
|
|
95
|
-
typeof
|
|
40
|
+
typeof sets.badge.componentPropertyDefinitions
|
|
96
41
|
>;
|
|
97
42
|
|
|
98
43
|
export type BottomSheetProperties = InferComponentDefinition<
|
|
99
|
-
typeof
|
|
44
|
+
typeof sets.bottomSheet.componentPropertyDefinitions
|
|
100
45
|
>;
|
|
101
46
|
|
|
102
47
|
export type CalloutProperties = InferComponentDefinition<
|
|
103
|
-
typeof
|
|
48
|
+
typeof sets.callout.componentPropertyDefinitions
|
|
104
49
|
>;
|
|
105
50
|
|
|
106
51
|
export type CheckboxProperties = InferComponentDefinition<
|
|
107
|
-
typeof
|
|
52
|
+
typeof sets.checkbox.componentPropertyDefinitions
|
|
108
53
|
>;
|
|
109
54
|
|
|
110
55
|
export type CheckmarkProperties = InferComponentDefinition<
|
|
111
|
-
typeof
|
|
56
|
+
typeof sets.checkmark.componentPropertyDefinitions
|
|
112
57
|
>;
|
|
113
58
|
|
|
114
59
|
export type ChipProperties = InferComponentDefinition<
|
|
115
|
-
typeof
|
|
60
|
+
typeof sets.chip.componentPropertyDefinitions
|
|
116
61
|
>;
|
|
117
62
|
|
|
118
63
|
export type ChipIconSuffixProperties = InferComponentDefinition<{
|
|
@@ -124,19 +69,92 @@ export type ChipIconSuffixProperties = InferComponentDefinition<{
|
|
|
124
69
|
}>;
|
|
125
70
|
|
|
126
71
|
export type ContextualFloatingButtonProperties = InferComponentDefinition<
|
|
127
|
-
typeof
|
|
72
|
+
typeof sets.contextualFloatingButton.componentPropertyDefinitions
|
|
128
73
|
>;
|
|
129
74
|
|
|
130
75
|
export type DividerProperties = InferComponentDefinition<
|
|
131
|
-
typeof
|
|
76
|
+
typeof sets.divider.componentPropertyDefinitions
|
|
132
77
|
>;
|
|
133
78
|
|
|
134
79
|
export type ErrorStateProperties = InferComponentDefinition<
|
|
135
|
-
typeof
|
|
80
|
+
typeof sets.templateErrorState.componentPropertyDefinitions
|
|
136
81
|
>;
|
|
137
82
|
|
|
83
|
+
export type FieldHeaderProperties = InferComponentDefinition<{
|
|
84
|
+
"Label#34796:0": {
|
|
85
|
+
type: "TEXT";
|
|
86
|
+
defaultValue: "라벨";
|
|
87
|
+
};
|
|
88
|
+
"Has Indicator#34796:1": {
|
|
89
|
+
type: "BOOLEAN";
|
|
90
|
+
defaultValue: false;
|
|
91
|
+
};
|
|
92
|
+
"Has Suffix#34796:2": {
|
|
93
|
+
type: "BOOLEAN";
|
|
94
|
+
defaultValue: false;
|
|
95
|
+
};
|
|
96
|
+
Weight: {
|
|
97
|
+
type: "VARIANT";
|
|
98
|
+
defaultValue: "Medium";
|
|
99
|
+
variantOptions: ["Medium", "Bold"];
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
102
|
+
|
|
103
|
+
export type FieldIndicatorProperties = InferComponentDefinition<{
|
|
104
|
+
"Required Label#40606:3": {
|
|
105
|
+
type: "TEXT";
|
|
106
|
+
defaultValue: "선택";
|
|
107
|
+
};
|
|
108
|
+
Type: {
|
|
109
|
+
type: "VARIANT";
|
|
110
|
+
defaultValue: "Required Mark";
|
|
111
|
+
variantOptions: ["Required Mark", "Text"];
|
|
112
|
+
};
|
|
113
|
+
}>;
|
|
114
|
+
|
|
115
|
+
export type FieldFooterProperties = InferComponentDefinition<{
|
|
116
|
+
"Text#2770:0": {
|
|
117
|
+
type: "TEXT";
|
|
118
|
+
defaultValue: "도움말 텍스트 입력";
|
|
119
|
+
};
|
|
120
|
+
"Has Prefix#2778:13": {
|
|
121
|
+
type: "BOOLEAN";
|
|
122
|
+
defaultValue: false;
|
|
123
|
+
};
|
|
124
|
+
"Error Text#32821:0": {
|
|
125
|
+
type: "TEXT";
|
|
126
|
+
defaultValue: "에러 메시지 입력";
|
|
127
|
+
};
|
|
128
|
+
Type: {
|
|
129
|
+
type: "VARIANT";
|
|
130
|
+
defaultValue: "Description With Character Count";
|
|
131
|
+
variantOptions: ["Description", "Description With Character Count", "Character Count"];
|
|
132
|
+
};
|
|
133
|
+
Error: {
|
|
134
|
+
type: "VARIANT";
|
|
135
|
+
defaultValue: "false";
|
|
136
|
+
variantOptions: ["true", "false"];
|
|
137
|
+
};
|
|
138
|
+
}>;
|
|
139
|
+
|
|
140
|
+
export type FieldCharacterCountProperties = InferComponentDefinition<{
|
|
141
|
+
"Counter#40960:0": {
|
|
142
|
+
type: "TEXT";
|
|
143
|
+
defaultValue: "10";
|
|
144
|
+
};
|
|
145
|
+
"Max Count#40960:4": {
|
|
146
|
+
type: "TEXT";
|
|
147
|
+
defaultValue: "500";
|
|
148
|
+
};
|
|
149
|
+
State: {
|
|
150
|
+
type: "VARIANT";
|
|
151
|
+
defaultValue: "Null";
|
|
152
|
+
variantOptions: ["Null", "Has Value", "Error"];
|
|
153
|
+
};
|
|
154
|
+
}>;
|
|
155
|
+
|
|
138
156
|
export type MenuSheetProperties = InferComponentDefinition<
|
|
139
|
-
typeof
|
|
157
|
+
typeof sets.menuSheet.componentPropertyDefinitions
|
|
140
158
|
>;
|
|
141
159
|
|
|
142
160
|
export type MenuSheetGroupProperties = InferComponentDefinition<{
|
|
@@ -179,7 +197,7 @@ export type MenuSheetItemProperties = InferComponentDefinition<{
|
|
|
179
197
|
}>;
|
|
180
198
|
|
|
181
199
|
export type FloatingActionButtonProperties = InferComponentDefinition<
|
|
182
|
-
typeof
|
|
200
|
+
typeof sets.floatingActionButton.componentPropertyDefinitions
|
|
183
201
|
>;
|
|
184
202
|
|
|
185
203
|
export type FloatingActionButtonButtonItemProperties = InferComponentDefinition<{
|
|
@@ -232,9 +250,10 @@ export type FloatingActionButtonMenuItemProperties = InferComponentDefinition<{
|
|
|
232
250
|
}>;
|
|
233
251
|
|
|
234
252
|
export type HelpBubbleProperties = InferComponentDefinition<
|
|
235
|
-
typeof
|
|
253
|
+
typeof sets.helpBubble.componentPropertyDefinitions
|
|
236
254
|
>;
|
|
237
255
|
|
|
256
|
+
// lives in a different file
|
|
238
257
|
export type IdentityPlaceholderProperties = InferComponentDefinition<{
|
|
239
258
|
Identity: {
|
|
240
259
|
type: "VARIANT";
|
|
@@ -244,7 +263,7 @@ export type IdentityPlaceholderProperties = InferComponentDefinition<{
|
|
|
244
263
|
}>;
|
|
245
264
|
|
|
246
265
|
export type PageBannerProperties = InferComponentDefinition<
|
|
247
|
-
typeof
|
|
266
|
+
typeof sets.pageBanner.componentPropertyDefinitions
|
|
248
267
|
>;
|
|
249
268
|
|
|
250
269
|
export type PageBannerButtonProperties = InferComponentDefinition<{
|
|
@@ -255,11 +274,11 @@ export type PageBannerButtonProperties = InferComponentDefinition<{
|
|
|
255
274
|
}>;
|
|
256
275
|
|
|
257
276
|
export type ListHeaderProperties = InferComponentDefinition<
|
|
258
|
-
typeof
|
|
277
|
+
typeof sets.listHeader.componentPropertyDefinitions
|
|
259
278
|
>;
|
|
260
279
|
|
|
261
280
|
export type ListItemProperties = InferComponentDefinition<
|
|
262
|
-
typeof
|
|
281
|
+
typeof sets.listItem.componentPropertyDefinitions
|
|
263
282
|
>;
|
|
264
283
|
|
|
265
284
|
export type ListItemPrefixIconProperties = InferComponentDefinition<{
|
|
@@ -279,35 +298,31 @@ export type ListItemSuffixIconProperties = InferComponentDefinition<{
|
|
|
279
298
|
}>;
|
|
280
299
|
|
|
281
300
|
export type MannerTempProperties = InferComponentDefinition<
|
|
282
|
-
typeof
|
|
301
|
+
typeof sets.mannerTemp.componentPropertyDefinitions
|
|
283
302
|
>;
|
|
284
303
|
|
|
285
304
|
export type MannerTempBadgeProperties = InferComponentDefinition<
|
|
286
|
-
typeof
|
|
287
|
-
>;
|
|
288
|
-
|
|
289
|
-
export type MultilineTextFieldProperties = InferComponentDefinition<
|
|
290
|
-
typeof metadata.multilineTextField.componentPropertyDefinitions
|
|
305
|
+
typeof sets.mannerTempBadge.componentPropertyDefinitions
|
|
291
306
|
>;
|
|
292
307
|
|
|
293
308
|
export type ProgressCircleProperties = InferComponentDefinition<
|
|
294
|
-
typeof
|
|
309
|
+
typeof sets.progressCircle.componentPropertyDefinitions
|
|
295
310
|
>;
|
|
296
311
|
|
|
297
312
|
export type RadioProperties = InferComponentDefinition<
|
|
298
|
-
typeof
|
|
313
|
+
typeof sets.radio.componentPropertyDefinitions
|
|
299
314
|
>;
|
|
300
315
|
|
|
301
316
|
export type RadioMarkProperties = InferComponentDefinition<
|
|
302
|
-
typeof
|
|
317
|
+
typeof sets.radioMark.componentPropertyDefinitions
|
|
303
318
|
>;
|
|
304
319
|
|
|
305
320
|
export type ReactionButtonProperties = InferComponentDefinition<
|
|
306
|
-
typeof
|
|
321
|
+
typeof sets.reactionButton.componentPropertyDefinitions
|
|
307
322
|
>;
|
|
308
323
|
|
|
309
324
|
export type SegmentedControlProperties = InferComponentDefinition<
|
|
310
|
-
typeof
|
|
325
|
+
typeof sets.segmentedControl.componentPropertyDefinitions
|
|
311
326
|
>;
|
|
312
327
|
|
|
313
328
|
export type SegmentedControlItemProperties = InferComponentDefinition<{
|
|
@@ -323,39 +338,56 @@ export type SegmentedControlItemProperties = InferComponentDefinition<{
|
|
|
323
338
|
}>;
|
|
324
339
|
|
|
325
340
|
export type SkeletonProperties = InferComponentDefinition<
|
|
326
|
-
typeof
|
|
341
|
+
typeof sets.skeleton.componentPropertyDefinitions
|
|
342
|
+
>;
|
|
343
|
+
|
|
344
|
+
export type SliderProperties = InferComponentDefinition<
|
|
345
|
+
typeof sets.slider.componentPropertyDefinitions
|
|
346
|
+
>;
|
|
347
|
+
|
|
348
|
+
export type SliderTicksProperties = InferComponentDefinition<{
|
|
349
|
+
Type: {
|
|
350
|
+
type: "VARIANT";
|
|
351
|
+
defaultValue: "Continuous";
|
|
352
|
+
variantOptions: ["Continuous", "Discrete"];
|
|
353
|
+
};
|
|
354
|
+
Step: {
|
|
355
|
+
type: "VARIANT";
|
|
356
|
+
defaultValue: "2";
|
|
357
|
+
variantOptions: ["2", "3", "4", "5"];
|
|
358
|
+
};
|
|
359
|
+
}>;
|
|
360
|
+
|
|
361
|
+
export type SliderFieldProperties = InferComponentDefinition<
|
|
362
|
+
typeof sets.templateSliderField.componentPropertyDefinitions
|
|
327
363
|
>;
|
|
328
364
|
|
|
329
365
|
export type SnackbarProperties = InferComponentDefinition<
|
|
330
|
-
typeof
|
|
366
|
+
typeof sets.snackbar.componentPropertyDefinitions
|
|
331
367
|
>;
|
|
332
368
|
|
|
333
369
|
export type SwitchProperties = InferComponentDefinition<
|
|
334
|
-
typeof
|
|
370
|
+
typeof sets._switch.componentPropertyDefinitions
|
|
335
371
|
>;
|
|
336
372
|
|
|
337
373
|
export type SwitchMarkProperties = InferComponentDefinition<
|
|
338
|
-
typeof
|
|
374
|
+
typeof sets.switchMark.componentPropertyDefinitions
|
|
339
375
|
>;
|
|
340
376
|
|
|
341
377
|
export type ToggleButtonProperties = InferComponentDefinition<
|
|
342
|
-
typeof
|
|
378
|
+
typeof sets.toggleButton.componentPropertyDefinitions
|
|
343
379
|
>;
|
|
344
380
|
|
|
345
381
|
export type SelectBoxGroupProperties = InferComponentDefinition<
|
|
346
|
-
typeof
|
|
382
|
+
typeof sets.templateSelectBoxGroup.componentPropertyDefinitions
|
|
347
383
|
>;
|
|
348
384
|
|
|
349
385
|
export type SelectBoxProperties = InferComponentDefinition<
|
|
350
|
-
typeof
|
|
351
|
-
>;
|
|
352
|
-
|
|
353
|
-
export type TextFieldProperties = InferComponentDefinition<
|
|
354
|
-
typeof metadata.textField.componentPropertyDefinitions
|
|
386
|
+
typeof sets.selectBox.componentPropertyDefinitions
|
|
355
387
|
>;
|
|
356
388
|
|
|
357
389
|
export type AppBarProperties = InferComponentDefinition<
|
|
358
|
-
typeof
|
|
390
|
+
typeof sets.topNavigation.componentPropertyDefinitions
|
|
359
391
|
>;
|
|
360
392
|
|
|
361
393
|
export type AppBarMainProperties = InferComponentDefinition<{
|
|
@@ -455,7 +487,7 @@ export type AppBarRightIconButtonProperties = InferComponentDefinition<{
|
|
|
455
487
|
}>;
|
|
456
488
|
|
|
457
489
|
export type TabsProperties = InferComponentDefinition<
|
|
458
|
-
typeof
|
|
490
|
+
typeof sets.tabs.componentPropertyDefinitions
|
|
459
491
|
>;
|
|
460
492
|
|
|
461
493
|
export type TabsLineWrapperProperties = InferComponentDefinition<{
|
|
@@ -550,7 +582,7 @@ export type ChipTabsTriggerProperties = InferComponentDefinition<{
|
|
|
550
582
|
}>;
|
|
551
583
|
|
|
552
584
|
export type TagGroupProperties = InferComponentDefinition<
|
|
553
|
-
typeof
|
|
585
|
+
typeof sets.tagGroup.componentPropertyDefinitions
|
|
554
586
|
>;
|
|
555
587
|
|
|
556
588
|
export type TagGroupItemProperties = InferComponentDefinition<{
|
|
@@ -589,3 +621,230 @@ export type TagGroupItemProperties = InferComponentDefinition<{
|
|
|
589
621
|
variantOptions: ["Regular", "Bold"];
|
|
590
622
|
};
|
|
591
623
|
}>;
|
|
624
|
+
|
|
625
|
+
export type TextInputFieldProperties = InferComponentDefinition<
|
|
626
|
+
typeof sets.templateTextField.componentPropertyDefinitions
|
|
627
|
+
>;
|
|
628
|
+
|
|
629
|
+
export type TextInputOutlineProperties = InferComponentDefinition<{
|
|
630
|
+
"Has Prefix#32514:10": {
|
|
631
|
+
type: "BOOLEAN";
|
|
632
|
+
defaultValue: false;
|
|
633
|
+
};
|
|
634
|
+
"Loading Text#32734:0": {
|
|
635
|
+
type: "TEXT";
|
|
636
|
+
defaultValue: "단서를 모아서 추리 중...";
|
|
637
|
+
};
|
|
638
|
+
"Has Suffix#32865:68": {
|
|
639
|
+
type: "BOOLEAN";
|
|
640
|
+
defaultValue: false;
|
|
641
|
+
};
|
|
642
|
+
State: {
|
|
643
|
+
type: "VARIANT";
|
|
644
|
+
defaultValue: "Enabled";
|
|
645
|
+
variantOptions: [
|
|
646
|
+
"Enabled",
|
|
647
|
+
"Focused",
|
|
648
|
+
"Error",
|
|
649
|
+
"Error Focused",
|
|
650
|
+
"Disabled",
|
|
651
|
+
"Read Only",
|
|
652
|
+
"AI Loading (Figma Only)",
|
|
653
|
+
];
|
|
654
|
+
};
|
|
655
|
+
}>;
|
|
656
|
+
|
|
657
|
+
export type TextInputOutlinePrefixProperties = InferComponentDefinition<{
|
|
658
|
+
"Icon#34021:2": {
|
|
659
|
+
type: "INSTANCE_SWAP";
|
|
660
|
+
defaultValue: "32633:80013";
|
|
661
|
+
preferredValues: [];
|
|
662
|
+
};
|
|
663
|
+
Type: {
|
|
664
|
+
type: "VARIANT";
|
|
665
|
+
defaultValue: "Icon";
|
|
666
|
+
variantOptions: ["Icon", "Custom (Figma Only)"];
|
|
667
|
+
};
|
|
668
|
+
}>;
|
|
669
|
+
|
|
670
|
+
export type TextInputOutlineSuffixProperties = InferComponentDefinition<{
|
|
671
|
+
"Suffix Text#34021:4": {
|
|
672
|
+
type: "TEXT";
|
|
673
|
+
defaultValue: "원";
|
|
674
|
+
};
|
|
675
|
+
"Icon#45391:0": {
|
|
676
|
+
type: "INSTANCE_SWAP";
|
|
677
|
+
defaultValue: "34885:102331";
|
|
678
|
+
preferredValues: [];
|
|
679
|
+
};
|
|
680
|
+
"Type (Figma Only)": {
|
|
681
|
+
type: "VARIANT";
|
|
682
|
+
defaultValue: "Text";
|
|
683
|
+
variantOptions: ["Text", "Icon", "Icon Button (Ghost Button)", "Custom"];
|
|
684
|
+
};
|
|
685
|
+
}>;
|
|
686
|
+
|
|
687
|
+
export type TextInputUnderlinePrefixProperties = InferComponentDefinition<{
|
|
688
|
+
"Icon#34021:2": {
|
|
689
|
+
type: "INSTANCE_SWAP";
|
|
690
|
+
defaultValue: "32633:80013";
|
|
691
|
+
preferredValues: [];
|
|
692
|
+
};
|
|
693
|
+
Type: {
|
|
694
|
+
type: "VARIANT";
|
|
695
|
+
defaultValue: "Icon";
|
|
696
|
+
variantOptions: ["Icon", "Custom (Figma Only)"];
|
|
697
|
+
};
|
|
698
|
+
}>;
|
|
699
|
+
|
|
700
|
+
export type TextInputUnderlineSuffixProperties = InferComponentDefinition<{
|
|
701
|
+
"Suffix Text#34021:4": {
|
|
702
|
+
type: "TEXT";
|
|
703
|
+
defaultValue: "원";
|
|
704
|
+
};
|
|
705
|
+
"Icon#45391:5": {
|
|
706
|
+
type: "INSTANCE_SWAP";
|
|
707
|
+
defaultValue: "34885:102331";
|
|
708
|
+
preferredValues: [];
|
|
709
|
+
};
|
|
710
|
+
"Type (Figma Only)": {
|
|
711
|
+
type: "VARIANT";
|
|
712
|
+
defaultValue: "Text";
|
|
713
|
+
variantOptions: ["Text", "Icon", "Icon Button (Ghost Button)", "Custom"];
|
|
714
|
+
};
|
|
715
|
+
}>;
|
|
716
|
+
|
|
717
|
+
export type TextInputUnderlineProperties = InferComponentDefinition<{
|
|
718
|
+
"Show Footer#33213:14": {
|
|
719
|
+
type: "BOOLEAN";
|
|
720
|
+
defaultValue: true;
|
|
721
|
+
};
|
|
722
|
+
"Has Prefix#34125:0": {
|
|
723
|
+
type: "BOOLEAN";
|
|
724
|
+
defaultValue: false;
|
|
725
|
+
};
|
|
726
|
+
"Has Suffix#34125:8": {
|
|
727
|
+
type: "BOOLEAN";
|
|
728
|
+
defaultValue: false;
|
|
729
|
+
};
|
|
730
|
+
"Show Header#34125:16": {
|
|
731
|
+
type: "BOOLEAN";
|
|
732
|
+
defaultValue: false;
|
|
733
|
+
};
|
|
734
|
+
State: {
|
|
735
|
+
type: "VARIANT";
|
|
736
|
+
defaultValue: "Enabled";
|
|
737
|
+
variantOptions: [
|
|
738
|
+
"Enabled",
|
|
739
|
+
"Focused",
|
|
740
|
+
"Error",
|
|
741
|
+
"Error Focused",
|
|
742
|
+
"Disabled",
|
|
743
|
+
"Read Only",
|
|
744
|
+
"AI Loading (Figma Only)",
|
|
745
|
+
];
|
|
746
|
+
};
|
|
747
|
+
}>;
|
|
748
|
+
|
|
749
|
+
export type TextareaFieldProperties = InferComponentDefinition<
|
|
750
|
+
typeof sets.templateTextareaField.componentPropertyDefinitions
|
|
751
|
+
>;
|
|
752
|
+
|
|
753
|
+
export type TextareaProperties = InferComponentDefinition<{
|
|
754
|
+
"Auto Size (Figma Only)": {
|
|
755
|
+
type: "VARIANT";
|
|
756
|
+
defaultValue: "true";
|
|
757
|
+
variantOptions: ["true", "false"];
|
|
758
|
+
};
|
|
759
|
+
State: {
|
|
760
|
+
type: "VARIANT";
|
|
761
|
+
defaultValue: "Enabled";
|
|
762
|
+
variantOptions: [
|
|
763
|
+
"Enabled",
|
|
764
|
+
"Focused",
|
|
765
|
+
"Error",
|
|
766
|
+
"Error Focused",
|
|
767
|
+
"Disabled",
|
|
768
|
+
"Read Only",
|
|
769
|
+
"AI Loading (Figma Only)",
|
|
770
|
+
];
|
|
771
|
+
};
|
|
772
|
+
}>;
|
|
773
|
+
|
|
774
|
+
export type FieldButtonProperties = InferComponentDefinition<
|
|
775
|
+
typeof sets.templateCustomPickerField.componentPropertyDefinitions
|
|
776
|
+
>;
|
|
777
|
+
|
|
778
|
+
export type InputButtonProperties = InferComponentDefinition<{
|
|
779
|
+
"Has Prefix#32514:10": {
|
|
780
|
+
type: "BOOLEAN";
|
|
781
|
+
defaultValue: false;
|
|
782
|
+
};
|
|
783
|
+
"Has Suffix#32865:68": {
|
|
784
|
+
type: "BOOLEAN";
|
|
785
|
+
defaultValue: false;
|
|
786
|
+
};
|
|
787
|
+
State: {
|
|
788
|
+
type: "VARIANT";
|
|
789
|
+
defaultValue: "Enabled";
|
|
790
|
+
variantOptions: ["Enabled", "Error", "Disabled", "Read Only", "Pressed", "Error Pressed"];
|
|
791
|
+
};
|
|
792
|
+
}>;
|
|
793
|
+
|
|
794
|
+
export type InputButtonPrefixProperties = InferComponentDefinition<{
|
|
795
|
+
"Icon#34021:2": {
|
|
796
|
+
type: "INSTANCE_SWAP";
|
|
797
|
+
defaultValue: "34885:102321";
|
|
798
|
+
preferredValues: [
|
|
799
|
+
{
|
|
800
|
+
type: "COMPONENT_SET";
|
|
801
|
+
key: "e6ff71538e21f2e117c72727e5e5cc526d2328ba";
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
type: "COMPONENT_SET";
|
|
805
|
+
key: "b4cad90025daa85c417154f8f61e09fbddb34fa7";
|
|
806
|
+
},
|
|
807
|
+
];
|
|
808
|
+
};
|
|
809
|
+
Type: {
|
|
810
|
+
type: "VARIANT";
|
|
811
|
+
defaultValue: "Icon";
|
|
812
|
+
variantOptions: ["Icon", "Custom (Figma Only)"];
|
|
813
|
+
};
|
|
814
|
+
}>;
|
|
815
|
+
|
|
816
|
+
export type InputButtonSuffixProperties = InferComponentDefinition<{
|
|
817
|
+
"Suffix Text#34021:4": {
|
|
818
|
+
type: "TEXT";
|
|
819
|
+
defaultValue: "원";
|
|
820
|
+
};
|
|
821
|
+
"Icon#37963:0": {
|
|
822
|
+
type: "INSTANCE_SWAP";
|
|
823
|
+
defaultValue: "43573:11862";
|
|
824
|
+
preferredValues: [
|
|
825
|
+
{
|
|
826
|
+
type: "COMPONENT_SET";
|
|
827
|
+
key: "422f4be7a88e2c41c079de9202e0b8e7da429971";
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
type: "COMPONENT_SET";
|
|
831
|
+
key: "5c704613ff444e38fe356e3991738965bd43fcec";
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
type: "COMPONENT_SET";
|
|
835
|
+
key: "29314e598cfae33d3b325feaaa39cb71449d521a";
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
type: "COMPONENT_SET";
|
|
839
|
+
key: "ffe429c229000d814017f87a62ff9746639e3bbb";
|
|
840
|
+
},
|
|
841
|
+
];
|
|
842
|
+
};
|
|
843
|
+
"Type (Figma Only)": {
|
|
844
|
+
type: "VARIANT";
|
|
845
|
+
defaultValue: "Icon";
|
|
846
|
+
variantOptions: ["Icon", "Text", "Custom"];
|
|
847
|
+
};
|
|
848
|
+
}>;
|
|
849
|
+
|
|
850
|
+
export type GenericFieldButtonProps = InferComponentDefinition<{}>;
|
|
@@ -28,9 +28,8 @@ export const createBottomSheetHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
28
28
|
...(props["Show Description#25192:0"].value === true && {
|
|
29
29
|
description: props["Description#19787:7"].value,
|
|
30
30
|
}),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}),
|
|
31
|
+
showHandle: props["Show Handle#49774:6"].value,
|
|
32
|
+
showCloseButton: props["Show Close Button#19787:11"].value,
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
const bodyNodes = findAllInstances({
|
|
@@ -1,39 +1,51 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ActionButtonGhostProperties,
|
|
3
|
+
ActionButtonProperties,
|
|
4
|
+
ErrorStateProperties,
|
|
5
|
+
} from "@/codegen/component-properties";
|
|
2
6
|
import { defineComponentHandler } from "@/codegen/core";
|
|
3
7
|
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
4
8
|
import { findAllInstances } from "@/utils/figma-node";
|
|
5
9
|
import { camelCase } from "change-case";
|
|
6
10
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
7
11
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
8
|
-
import { createActionButtonHandler } from "./action-button";
|
|
12
|
+
import { createActionButtonGhostHandler, createActionButtonHandler } from "./action-button";
|
|
9
13
|
|
|
10
14
|
const { createLocalSnippetElement } = createLocalSnippetHelper("error-state");
|
|
11
15
|
|
|
12
16
|
export const createErrorStateHandler = (ctx: ComponentHandlerDeps) => {
|
|
13
17
|
const actionButtonHandler = createActionButtonHandler(ctx);
|
|
18
|
+
const ghostButtonHandler = createActionButtonGhostHandler(ctx);
|
|
14
19
|
|
|
15
20
|
return defineComponentHandler<ErrorStateProperties>(
|
|
16
21
|
metadata.templateErrorState.key,
|
|
17
22
|
(node, traverse) => {
|
|
18
23
|
const props = node.componentProperties;
|
|
19
24
|
|
|
20
|
-
const [
|
|
25
|
+
const [actionButton] = findAllInstances<ActionButtonProperties>({
|
|
21
26
|
node,
|
|
22
27
|
key: actionButtonHandler.key,
|
|
23
28
|
});
|
|
24
29
|
|
|
30
|
+
const [ghostButton] = findAllInstances<ActionButtonGhostProperties>({
|
|
31
|
+
node,
|
|
32
|
+
key: ghostButtonHandler.key,
|
|
33
|
+
});
|
|
34
|
+
|
|
25
35
|
const commonProps = {
|
|
26
36
|
variant: camelCase(props.Variant.value),
|
|
27
37
|
...(props.Layout.value === "With Title" && {
|
|
28
38
|
title: props["Title#16237:0"].value,
|
|
29
39
|
}),
|
|
30
40
|
description: props["Description#16237:5"].value,
|
|
31
|
-
...(
|
|
41
|
+
...(actionButton && {
|
|
32
42
|
primaryActionProps: {
|
|
33
|
-
children: actionButtonHandler.transform(
|
|
43
|
+
children: actionButtonHandler.transform(actionButton, traverse).children[0],
|
|
34
44
|
},
|
|
45
|
+
}),
|
|
46
|
+
...(ghostButton && {
|
|
35
47
|
secondaryActionProps: {
|
|
36
|
-
children:
|
|
48
|
+
children: ghostButtonHandler.transform(ghostButton, traverse).children[0],
|
|
37
49
|
},
|
|
38
50
|
}),
|
|
39
51
|
};
|