@seed-design/figma 1.1.9 → 1.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-design/figma",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/daangn/seed-design.git",
@@ -39,14 +39,14 @@
39
39
  "sync-entities": "rm -rf src/entities/data/__generated__ && bun figma-extractor src/entities/data/__generated__"
40
40
  },
41
41
  "dependencies": {
42
- "@seed-design/css": "1.1.9",
42
+ "@seed-design/css": "1.1.10",
43
43
  "change-case": "^5.4.4",
44
44
  "ts-pattern": "^5.7.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@figma/plugin-typings": "^1.110.0",
48
48
  "@figma/rest-api-spec": "^0.34.0",
49
- "@karrotmarket/icon-data": "^1.6.0",
49
+ "@karrotmarket/icon-data": "^1.13.0",
50
50
  "@seed-design/figma-extractor": "^1.0.0",
51
51
  "typescript": "^5.9.2"
52
52
  },
@@ -76,10 +76,6 @@ export type DividerProperties = InferComponentDefinition<
76
76
  typeof sets.divider.componentPropertyDefinitions
77
77
  >;
78
78
 
79
- export type ErrorStateProperties = InferComponentDefinition<
80
- typeof sets.templateErrorState.componentPropertyDefinitions
81
- >;
82
-
83
79
  export type FieldHeaderProperties = InferComponentDefinition<{
84
80
  "Label#34796:0": {
85
81
  type: "TEXT";
@@ -321,6 +317,10 @@ export type ReactionButtonProperties = InferComponentDefinition<
321
317
  typeof sets.reactionButton.componentPropertyDefinitions
322
318
  >;
323
319
 
320
+ export type ResultSectionProperties = InferComponentDefinition<
321
+ typeof sets.templateResultSection.componentPropertyDefinitions
322
+ >;
323
+
324
324
  export type SegmentedControlProperties = InferComponentDefinition<
325
325
  typeof sets.segmentedControl.componentPropertyDefinitions
326
326
  >;
@@ -141,7 +141,7 @@ export const createListItemHandler = (ctx: ComponentHandlerDeps) =>
141
141
  tag === "ListSwitchItem") && {
142
142
  disabled: true,
143
143
  }),
144
- ...(props.State.value === "Highlighted" && {
144
+ ...(props.Highlighted.value === "True" && {
145
145
  highlighted: true,
146
146
  }),
147
147
  };
@@ -79,14 +79,14 @@ export const createMenuSheetHandler = (ctx: ComponentHandlerDeps) => {
79
79
  // TODO: React 구현체에 description 추가 이후
80
80
  // const description = props["Description Text#21827:0"].value;
81
81
 
82
- const { labelAlignment } = match(props.Layout.value)
83
- .with("Text with Icon", () => ({ labelAlignment: undefined }))
84
- .with("Text Only", () => ({ labelAlignment: "center" }))
82
+ const { labelAlign } = match(props.Layout.value)
83
+ .with("Text with Icon", "Text with Subtext", () => ({ labelAlign: "left" }))
84
+ .with("Text Only", () => ({ labelAlign: "center" }))
85
85
  .exhaustive();
86
86
 
87
87
  const content = createLocalSnippetElement(
88
88
  "MenuSheetContent",
89
- { title, labelAlignment },
89
+ { title, labelAlign },
90
90
  contentChildren,
91
91
  {
92
92
  comment: title
@@ -0,0 +1,67 @@
1
+ import type {
2
+ ActionButtonGhostProperties,
3
+ ActionButtonProperties,
4
+ ResultSectionProperties,
5
+ } from "@/codegen/component-properties";
6
+ import { createElement, defineComponentHandler } from "@/codegen/core";
7
+ import * as metadata from "@/entities/data/__generated__/component-sets";
8
+ import { findAllInstances } from "@/utils/figma-node";
9
+ import { createLocalSnippetHelper, createSeedReactElement } from "../../element-factories";
10
+ import type { ComponentHandlerDeps } from "../deps.interface";
11
+ import { createActionButtonGhostHandler, createActionButtonHandler } from "./action-button";
12
+ import { handleSizeProp } from "@/codegen/targets/react/component/size";
13
+
14
+ const { createLocalSnippetElement } = createLocalSnippetHelper("result-section");
15
+
16
+ export const createResultSectionHandler = (ctx: ComponentHandlerDeps) => {
17
+ const actionButtonHandler = createActionButtonHandler(ctx);
18
+ const ghostButtonHandler = createActionButtonGhostHandler(ctx);
19
+
20
+ return defineComponentHandler<ResultSectionProperties>(
21
+ metadata.templateResultSection.key,
22
+ (node, traverse) => {
23
+ const props = node.componentProperties;
24
+
25
+ const [actionButton] =
26
+ props["Show Buttons#53435:0"].value && props["ㄴShow First Button#53766:0"].value
27
+ ? findAllInstances<ActionButtonProperties>({
28
+ node,
29
+ key: actionButtonHandler.key,
30
+ })
31
+ : [undefined];
32
+
33
+ const [ghostButton] =
34
+ props["Show Buttons#53435:0"].value && props["ㄴShow Second Button#53766:3"].value
35
+ ? findAllInstances<ActionButtonGhostProperties>({
36
+ node,
37
+ key: ghostButtonHandler.key,
38
+ })
39
+ : [undefined];
40
+
41
+ const commonProps = {
42
+ size: handleSizeProp(props.Size.value),
43
+ ...(props["Show Asset#45154:14"].value && {
44
+ asset: createSeedReactElement(
45
+ "Box",
46
+ undefined,
47
+ createElement("div", undefined, undefined, { comment: "Asset Placeholder" }),
48
+ ),
49
+ }),
50
+ title: props["Title#16237:0"].value,
51
+ description: props["Description#16237:5"].value,
52
+ ...(actionButton && {
53
+ primaryActionProps: {
54
+ children: actionButtonHandler.transform(actionButton, traverse).children[0],
55
+ },
56
+ }),
57
+ ...(ghostButton && {
58
+ secondaryActionProps: {
59
+ children: ghostButtonHandler.transform(ghostButton, traverse).children[0],
60
+ },
61
+ }),
62
+ };
63
+
64
+ return createLocalSnippetElement("ResultSection", commonProps);
65
+ },
66
+ );
67
+ };
@@ -18,7 +18,6 @@ import { createCheckmarkHandler } from "@/codegen/targets/react/component/handle
18
18
  import { createChipHandler } from "./handlers/chip";
19
19
  import { createContextualFloatingButtonHandler } from "./handlers/contextual-floating-button";
20
20
  import { createDividerHandler } from "./handlers/divider";
21
- import { createErrorStateHandler } from "./handlers/error-state";
22
21
  import {
23
22
  createFieldButtonHandler,
24
23
  createAddressFieldHandler,
@@ -39,6 +38,7 @@ import { createProgressCircleHandler } from "./handlers/progress-circle";
39
38
  import { createRadioGroupItemHandler } from "@/codegen/targets/react/component/handlers/radio-group";
40
39
  import { createRadioMarkHandler } from "@/codegen/targets/react/component/handlers/radio-mark";
41
40
  import { createReactionButtonHandler } from "./handlers/reaction-button";
41
+ import { createResultSectionHandler } from "./handlers/result-section";
42
42
  import { createSegmentedControlHandler } from "./handlers/segmented-control";
43
43
  import { createSelectBoxGroupHandler, createSelectBoxHandler } from "./handlers/select-box";
44
44
  import { createSkeletonHandler } from "./handlers/skeleton";
@@ -112,7 +112,7 @@ export const unboundSeedComponentHandlers: Array<UnboundComponentHandler<any>> =
112
112
  createDatePickerFieldHandler,
113
113
  createSelectFieldHandler,
114
114
  createTimePickerFieldHandler,
115
- createErrorStateHandler,
115
+ createResultSectionHandler,
116
116
  createContextualFloatingButtonHandler,
117
117
  createFloatingActionButtonHandler,
118
118
  createHelpBubbleHandler,
@@ -79,35 +79,6 @@ export declare const templateChipGroup: {
79
79
  }
80
80
  };
81
81
 
82
- export declare const templateCompletion: {
83
- "name": "templateCompletion",
84
- "key": "d91c789c66c2da665d820318f1a4d8671946eb79",
85
- "componentPropertyDefinitions": {
86
- "Description#28427:4": {
87
- "type": "TEXT"
88
- },
89
- "Title#28427:5": {
90
- "type": "TEXT"
91
- },
92
- "Show Description#28427:6": {
93
- "type": "BOOLEAN"
94
- },
95
- "Show Button#28427:7": {
96
- "type": "BOOLEAN"
97
- },
98
- "Show Top Navigation#28427:8": {
99
- "type": "BOOLEAN"
100
- },
101
- "Variant": {
102
- "type": "VARIANT",
103
- "variantOptions": [
104
- "Screen",
105
- "Dialog"
106
- ]
107
- }
108
- }
109
- };
110
-
111
82
  export declare const templateCustomPickerField: {
112
83
  "name": "templateCustomPickerField",
113
84
  "key": "91d73dfc297a467d78dc91ade6ff9be9a152619e",
@@ -121,7 +92,7 @@ export declare const templateCustomPickerField: {
121
92
  "State": {
122
93
  "type": "VARIANT",
123
94
  "variantOptions": [
124
- "Default",
95
+ "Enabled",
125
96
  "Error",
126
97
  "Disabled",
127
98
  "Read Only"
@@ -137,31 +108,70 @@ export declare const templateCustomPickerField: {
137
108
  }
138
109
  };
139
110
 
140
- export declare const templateErrorState: {
141
- "name": "templateErrorState",
142
- "key": "39b4ecd0b5b4d35f4dc5791765ca04aa062a5172",
111
+ export declare const templateResultSection: {
112
+ "name": "templateResultSection",
113
+ "key": "fabd52c41c63d921e37e0a1de373e4df2b496f30",
143
114
  "componentPropertyDefinitions": {
144
- "Show Action Button#9080:5": {
145
- "type": "BOOLEAN"
146
- },
147
115
  "Title#16237:0": {
148
116
  "type": "TEXT"
149
117
  },
150
118
  "Description#16237:5": {
151
119
  "type": "TEXT"
152
120
  },
153
- "Variant": {
154
- "type": "VARIANT",
155
- "variantOptions": [
156
- "Default",
157
- "Basement"
121
+ "Asset Type#45154:9": {
122
+ "type": "INSTANCE_SWAP",
123
+ "preferredValues": [
124
+ {
125
+ "type": "COMPONENT",
126
+ "key": "3f2ed06bd34fbaf24d371cefa973e09e2c2572bf"
127
+ },
128
+ {
129
+ "type": "COMPONENT",
130
+ "key": "bf1ad3ad5c45a2e94fd800f7f6ecbe52ba0667ab"
131
+ },
132
+ {
133
+ "type": "COMPONENT",
134
+ "key": "d357dcf0fbff80f3bfa70fe4fd5d48a9bddd1b49"
135
+ },
136
+ {
137
+ "type": "COMPONENT",
138
+ "key": "a53df434b562c1eeb04dab9abd88431989c5fc33"
139
+ },
140
+ {
141
+ "type": "COMPONENT",
142
+ "key": "5e53811a1e1444deccb5147b6a57196a3be467c9"
143
+ },
144
+ {
145
+ "type": "COMPONENT",
146
+ "key": "3ff3999d2d2bbed2c7656210793d4f083901f73b"
147
+ },
148
+ {
149
+ "type": "COMPONENT",
150
+ "key": "56fcf964b7784ca83eaf6c9b1531de6150d23a0d"
151
+ },
152
+ {
153
+ "type": "COMPONENT",
154
+ "key": "5652618ddd66c844ab977d083d0dc41cb98f98ae"
155
+ }
158
156
  ]
159
157
  },
160
- "Layout": {
158
+ "Show Asset#45154:14": {
159
+ "type": "BOOLEAN"
160
+ },
161
+ "Show Buttons#53435:0": {
162
+ "type": "BOOLEAN"
163
+ },
164
+ "ㄴShow First Button#53766:0": {
165
+ "type": "BOOLEAN"
166
+ },
167
+ "ㄴShow Second Button#53766:3": {
168
+ "type": "BOOLEAN"
169
+ },
170
+ "Size": {
161
171
  "type": "VARIANT",
162
172
  "variantOptions": [
163
- "With Title",
164
- "Description Only"
173
+ "Large",
174
+ "Medium"
165
175
  ]
166
176
  }
167
177
  }
@@ -205,11 +215,11 @@ export declare const templateSliderField: {
205
215
  "State": {
206
216
  "type": "VARIANT",
207
217
  "variantOptions": [
208
- "Default",
218
+ "Enabled",
219
+ "Pressed",
209
220
  "Error",
210
221
  "Disabled",
211
- "Read Only",
212
- "Pressed"
222
+ "Read Only"
213
223
  ]
214
224
  }
215
225
  }
@@ -235,7 +245,7 @@ export declare const templateTextField: {
235
245
  "State": {
236
246
  "type": "VARIANT",
237
247
  "variantOptions": [
238
- "Default",
248
+ "Enabled",
239
249
  "Focused",
240
250
  "Error",
241
251
  "Error Focused",
@@ -260,7 +270,7 @@ export declare const templateTextareaField: {
260
270
  "State": {
261
271
  "type": "VARIANT",
262
272
  "variantOptions": [
263
- "Default",
273
+ "Enabled",
264
274
  "Focused",
265
275
  "Error",
266
276
  "Error Focused",
@@ -291,7 +301,8 @@ export declare const templateTopNavigation: {
291
301
  "Variants": {
292
302
  "type": "VARIANT",
293
303
  "variantOptions": [
294
- "Main Tab",
304
+ "Root",
305
+ "Root Preset",
295
306
  "Standard",
296
307
  "Standard Transparent",
297
308
  "Large Title"
@@ -572,6 +583,9 @@ export declare const bottomSheet: {
572
583
  "Show Handle#49774:6": {
573
584
  "type": "BOOLEAN"
574
585
  },
586
+ "Show Scroll Fog(Figma Only)#53171:3": {
587
+ "type": "BOOLEAN"
588
+ },
575
589
  "Header Layout": {
576
590
  "type": "VARIANT",
577
591
  "variantOptions": [
@@ -1114,8 +1128,7 @@ export declare const listItem: {
1114
1128
  "variantOptions": [
1115
1129
  "Enabled",
1116
1130
  "Pressed",
1117
- "Disabled",
1118
- "Highlighted"
1131
+ "Disabled"
1119
1132
  ]
1120
1133
  },
1121
1134
  "Variants": {
@@ -1124,56 +1137,12 @@ export declare const listItem: {
1124
1137
  "Single Line",
1125
1138
  "Multi Line"
1126
1139
  ]
1127
- }
1128
- }
1129
- };
1130
-
1131
- export declare const mainTabNavigationGlobal: {
1132
- "name": "mainTabNavigationGlobal",
1133
- "key": "a694a1da14a5c1d7d5c66bc78218c0c61fb388ab",
1134
- "componentPropertyDefinitions": {
1135
- "Title#6406:6": {
1136
- "type": "TEXT"
1137
- },
1138
- "Button Label#6409:18": {
1139
- "type": "TEXT"
1140
- },
1141
- "Title Type": {
1142
- "type": "VARIANT",
1143
- "variantOptions": [
1144
- "Text",
1145
- "Text + Button"
1146
- ]
1147
1140
  },
1148
- "Variant": {
1141
+ "Highlighted": {
1149
1142
  "type": "VARIANT",
1150
1143
  "variantOptions": [
1151
- "Layer Default",
1152
- "Transparent"
1153
- ]
1154
- }
1155
- }
1156
- };
1157
-
1158
- export declare const mainTabNavigationKr: {
1159
- "name": "mainTabNavigationKr",
1160
- "key": "41d3601e6b4c632a56cdc8fad485a76c026fdd8e",
1161
- "componentPropertyDefinitions": {
1162
- "Title#6406:6": {
1163
- "type": "TEXT"
1164
- },
1165
- "Title Type": {
1166
- "type": "VARIANT",
1167
- "variantOptions": [
1168
- "Text",
1169
- "Button"
1170
- ]
1171
- },
1172
- "Variant": {
1173
- "type": "VARIANT",
1174
- "variantOptions": [
1175
- "Layer Default",
1176
- "Transparent"
1144
+ "True",
1145
+ "False"
1177
1146
  ]
1178
1147
  }
1179
1148
  }
@@ -1239,7 +1208,7 @@ export declare const menuSheet: {
1239
1208
  "Show Safe Area#25531:15": {
1240
1209
  "type": "BOOLEAN"
1241
1210
  },
1242
- "Show Description#32984:0": {
1211
+ "Show Header Description#32984:0": {
1243
1212
  "type": "BOOLEAN"
1244
1213
  },
1245
1214
  "Menu Group Count": {
@@ -1254,7 +1223,8 @@ export declare const menuSheet: {
1254
1223
  "type": "VARIANT",
1255
1224
  "variantOptions": [
1256
1225
  "Text Only",
1257
- "Text with Icon"
1226
+ "Text with Icon",
1227
+ "Text with Subtext"
1258
1228
  ]
1259
1229
  }
1260
1230
  }
@@ -1507,24 +1477,46 @@ export declare const resizableChild: {
1507
1477
  }
1508
1478
  };
1509
1479
 
1510
- export declare const scrollFog: {
1511
- "name": "scrollFog",
1512
- "key": "0a06ea65fe164e0245fde6ac6c97135990a4de3c",
1480
+ export declare const rootTopNavigationGlobal: {
1481
+ "name": "rootTopNavigationGlobal",
1482
+ "key": "a694a1da14a5c1d7d5c66bc78218c0c61fb388ab",
1513
1483
  "componentPropertyDefinitions": {
1514
- "Orientation": {
1484
+ "Title#6406:6": {
1485
+ "type": "TEXT"
1486
+ },
1487
+ "Button Label#6409:18": {
1488
+ "type": "TEXT"
1489
+ },
1490
+ "Show Button#52619:0": {
1491
+ "type": "BOOLEAN"
1492
+ },
1493
+ "Title Type": {
1515
1494
  "type": "VARIANT",
1516
1495
  "variantOptions": [
1517
- "Top ⬇️",
1518
- "Bottom ⬆️",
1519
- "Right ➡️",
1520
- "Left ⬅️"
1496
+ "Text"
1521
1497
  ]
1522
1498
  },
1523
- "Layer": {
1499
+ "Variant": {
1524
1500
  "type": "VARIANT",
1525
1501
  "variantOptions": [
1526
- "Default",
1527
- "Floating"
1502
+ "Layer Default"
1503
+ ]
1504
+ }
1505
+ }
1506
+ };
1507
+
1508
+ export declare const rootTopNavigationKr: {
1509
+ "name": "rootTopNavigationKr",
1510
+ "key": "41d3601e6b4c632a56cdc8fad485a76c026fdd8e",
1511
+ "componentPropertyDefinitions": {
1512
+ "Title#6406:6": {
1513
+ "type": "TEXT"
1514
+ },
1515
+ "Title Type": {
1516
+ "type": "VARIANT",
1517
+ "variantOptions": [
1518
+ "Text",
1519
+ "Button"
1528
1520
  ]
1529
1521
  }
1530
1522
  }
@@ -1607,7 +1599,7 @@ export declare const skeleton: {
1607
1599
 
1608
1600
  export declare const slider: {
1609
1601
  "name": "slider",
1610
- "key": "c748f314f790eb804138bd105bfb0bd0584c9aa1",
1602
+ "key": "14b3278452f03fa01ecc8012a07f124766714566",
1611
1603
  "componentPropertyDefinitions": {
1612
1604
  "Has Tick Mark#47921:0": {
1613
1605
  "type": "BOOLEAN"