@seed-design/figma 0.0.24 → 0.0.25
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 +32 -9
- package/lib/codegen/index.d.ts +19 -7
- package/lib/codegen/index.js +32 -9
- package/lib/codegen/targets/react/index.cjs +224 -116
- package/lib/codegen/targets/react/index.d.ts +9 -3
- package/lib/codegen/targets/react/index.js +224 -116
- package/package.json +2 -2
- package/src/codegen/core/codegen.ts +6 -3
- package/src/codegen/core/jsx.ts +38 -7
- package/src/codegen/targets/figma/shape.ts +3 -1
- package/src/codegen/targets/figma/text.ts +4 -7
- package/src/codegen/targets/react/component/handlers/action-button.ts +8 -5
- package/src/codegen/targets/react/component/handlers/action-chip.ts +9 -8
- package/src/codegen/targets/react/component/handlers/action-sheet.ts +17 -15
- package/src/codegen/targets/react/component/handlers/app-bar.ts +31 -24
- package/src/codegen/targets/react/component/handlers/avatar-stack.ts +6 -5
- package/src/codegen/targets/react/component/handlers/avatar.ts +12 -7
- package/src/codegen/targets/react/component/handlers/badge.ts +4 -3
- package/src/codegen/targets/react/component/handlers/callout.ts +9 -4
- package/src/codegen/targets/react/component/handlers/checkbox.ts +6 -3
- package/src/codegen/targets/react/component/handlers/chip-tabs.ts +8 -5
- package/src/codegen/targets/react/component/handlers/control-chip.ts +14 -8
- package/src/codegen/targets/react/component/handlers/error-state.ts +6 -3
- package/src/codegen/targets/react/component/handlers/extended-action-sheet.ts +22 -20
- package/src/codegen/targets/react/component/handlers/extended-fab.ts +5 -4
- package/src/codegen/targets/react/component/handlers/fab.ts +9 -5
- package/src/codegen/targets/react/component/handlers/help-bubble.ts +9 -5
- package/src/codegen/targets/react/component/handlers/identity-placeholder.ts +4 -4
- package/src/codegen/targets/react/component/handlers/inline-banner.ts +8 -3
- package/src/codegen/targets/react/component/handlers/manner-temp-badge.ts +6 -3
- package/src/codegen/targets/react/component/handlers/multiline-text-field.ts +7 -4
- package/src/codegen/targets/react/component/handlers/progress-circle.ts +6 -3
- package/src/codegen/targets/react/component/handlers/reaction-button.ts +7 -4
- package/src/codegen/targets/react/component/handlers/segmented-control.ts +15 -11
- package/src/codegen/targets/react/component/handlers/select-box.ts +17 -21
- package/src/codegen/targets/react/component/handlers/skeleton.ts +5 -4
- package/src/codegen/targets/react/component/handlers/snackbar.ts +6 -3
- package/src/codegen/targets/react/component/handlers/switch.ts +6 -3
- package/src/codegen/targets/react/component/handlers/tabs.ts +13 -10
- package/src/codegen/targets/react/component/handlers/text-button.ts +3 -2
- package/src/codegen/targets/react/component/handlers/text-field.ts +7 -4
- package/src/codegen/targets/react/component/handlers/toggle-button.ts +8 -5
- package/src/codegen/targets/react/element-factories.ts +59 -0
- package/src/codegen/targets/react/frame.ts +5 -9
- package/src/codegen/targets/react/icon.ts +7 -2
- package/src/codegen/targets/react/instance.ts +2 -2
- package/src/codegen/targets/react/shape.ts +11 -4
- package/src/codegen/targets/react/text.ts +6 -8
|
@@ -28,13 +28,13 @@ function objectEntries(obj) {
|
|
|
28
28
|
}).replaceAll(/(\D)_(\d)/g, "$1$2").replaceAll(/(\d)_(\D)/g, "$1$2");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function createElement(tag, props = {}, children,
|
|
31
|
+
function createElement(tag, props = {}, children, meta) {
|
|
32
32
|
return {
|
|
33
33
|
__IS_JSX_ELEMENT_NODE: true,
|
|
34
34
|
tag,
|
|
35
35
|
props,
|
|
36
36
|
children: ensureArray(children).filter(exists),
|
|
37
|
-
|
|
37
|
+
meta: meta ?? {}
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function cloneElement(element, props = {}, children) {
|
|
@@ -57,14 +57,25 @@ function isElement(node) {
|
|
|
57
57
|
return typeof node === "object" && node != null && "__IS_JSX_ELEMENT_NODE" in node && node.__IS_JSX_ELEMENT_NODE === true;
|
|
58
58
|
}
|
|
59
59
|
function stringifyElement(element, options = {}) {
|
|
60
|
+
const importMap = new Map();
|
|
60
61
|
function recursive(node, depth) {
|
|
61
62
|
if (typeof node === "string") {
|
|
62
63
|
return node;
|
|
63
64
|
}
|
|
64
|
-
const { tag, props, children, comment } = node;
|
|
65
|
+
const { tag, props, children, meta: { comment, source, importPath } } = node;
|
|
66
|
+
if (importPath) {
|
|
67
|
+
const existing = importMap.get(importPath);
|
|
68
|
+
if (existing) {
|
|
69
|
+
existing.add(tag);
|
|
70
|
+
} else {
|
|
71
|
+
importMap.set(importPath, new Set([
|
|
72
|
+
tag
|
|
73
|
+
]));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
65
76
|
const propEntries = Object.entries(options.printSource ? {
|
|
66
77
|
...props,
|
|
67
|
-
"data-figma-node-id":
|
|
78
|
+
"data-figma-node-id": source
|
|
68
79
|
} : props);
|
|
69
80
|
const propFragments = propEntries.map(([key, value])=>{
|
|
70
81
|
if (typeof value === "string") {
|
|
@@ -101,7 +112,12 @@ function stringifyElement(element, options = {}) {
|
|
|
101
112
|
].join("\n");
|
|
102
113
|
return result;
|
|
103
114
|
}
|
|
104
|
-
|
|
115
|
+
const jsx = recursive(element, 0);
|
|
116
|
+
const imports = Array.from(importMap.entries()).sort((a, b)=>a[0].localeCompare(b[0])).map(([importPath, tags])=>`import { ${Array.from(tags).join(", ")} } from "${importPath}";`).join("\n");
|
|
117
|
+
return {
|
|
118
|
+
imports,
|
|
119
|
+
jsx
|
|
120
|
+
};
|
|
105
121
|
}
|
|
106
122
|
|
|
107
123
|
// --- Helper Functions ---
|
|
@@ -444,9 +460,12 @@ function createCodeGenerator({ frameTransformer, textTransformer, rectangleTrans
|
|
|
444
460
|
}
|
|
445
461
|
function generateCode(node, options) {
|
|
446
462
|
const jsxTree = generateJsxTree(node);
|
|
447
|
-
|
|
463
|
+
if (!jsxTree) {
|
|
464
|
+
return undefined;
|
|
465
|
+
}
|
|
466
|
+
return stringifyElement(jsxTree, {
|
|
448
467
|
printSource: options.shouldPrintSource
|
|
449
|
-
})
|
|
468
|
+
});
|
|
450
469
|
}
|
|
451
470
|
return {
|
|
452
471
|
generateJsxTree,
|
|
@@ -841,22 +860,62 @@ function createStrokePropsConverter(valueResolver) {
|
|
|
841
860
|
});
|
|
842
861
|
}
|
|
843
862
|
|
|
863
|
+
const SEED_REACT_IMPORT_PATH = "@seed-design/react";
|
|
864
|
+
const LOCAL_SNIPPET_BASE_PATH = "@/seed-design/ui";
|
|
865
|
+
const MONOCHROME_ICON_IMPORT_PATH = "@karrotmarket/react-monochrome-icon";
|
|
866
|
+
const MULTICOLOR_ICON_IMPORT_PATH = "@karrotmarket/react-multicolor-icon";
|
|
867
|
+
function createSeedReactElement(tag, props, children, meta) {
|
|
868
|
+
return createElement(tag, props, children, {
|
|
869
|
+
importPath: SEED_REACT_IMPORT_PATH,
|
|
870
|
+
...meta
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
function createMonochromeIconElement(tag, props, children, meta) {
|
|
874
|
+
return createElement(tag, props, children, {
|
|
875
|
+
...meta,
|
|
876
|
+
importPath: MONOCHROME_ICON_IMPORT_PATH
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
function createMulticolorIconElement(tag, props, children, meta) {
|
|
880
|
+
return createElement(tag, props, children, {
|
|
881
|
+
...meta,
|
|
882
|
+
importPath: MULTICOLOR_ICON_IMPORT_PATH
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
function createLocalSnippetHelper(moduleName) {
|
|
886
|
+
function createLocalSnippetElement(tag, props, children, meta) {
|
|
887
|
+
return createElement(tag, props, children, {
|
|
888
|
+
importPath: `${LOCAL_SNIPPET_BASE_PATH}/${moduleName}`,
|
|
889
|
+
...meta
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
createLocalSnippetElement
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
|
|
844
897
|
function createRectangleTransformer({ propsConverters }) {
|
|
845
898
|
return defineElementTransformer((node)=>{
|
|
846
|
-
return
|
|
899
|
+
return createSeedReactElement("Box", {
|
|
847
900
|
...propsConverters.selfLayout(node),
|
|
848
901
|
background: "palette.gray200"
|
|
849
|
-
}, undefined,
|
|
902
|
+
}, undefined, {
|
|
903
|
+
comment: "Rectangle Node Placeholder"
|
|
904
|
+
});
|
|
850
905
|
});
|
|
851
906
|
}
|
|
852
907
|
function createVectorTransformer() {
|
|
853
908
|
return defineElementTransformer(()=>{
|
|
854
|
-
return createElement("svg", {}, [],
|
|
909
|
+
return createElement("svg", {}, [], {
|
|
910
|
+
comment: "Vector Node Placeholder"
|
|
911
|
+
});
|
|
855
912
|
});
|
|
856
913
|
}
|
|
857
914
|
function createBooleanOperationTransformer() {
|
|
858
915
|
return defineElementTransformer(()=>{
|
|
859
|
-
return createElement("svg", {}, [],
|
|
916
|
+
return createElement("svg", {}, [], {
|
|
917
|
+
comment: "Boolean Operation Node Placeholder"
|
|
918
|
+
});
|
|
860
919
|
});
|
|
861
920
|
}
|
|
862
921
|
|
|
@@ -888,14 +947,14 @@ function createFrameTransformer({ propsConverters }) {
|
|
|
888
947
|
const layoutComponent = inferLayoutComponent(props, isFlex);
|
|
889
948
|
if (layoutComponent === "VStack") {
|
|
890
949
|
const { direction, ...rest } = props;
|
|
891
|
-
return
|
|
950
|
+
return createSeedReactElement("VStack", rest, processedChildren);
|
|
892
951
|
}
|
|
893
952
|
if (layoutComponent === "HStack") {
|
|
894
953
|
const { direction, ...rest } = props;
|
|
895
|
-
return
|
|
954
|
+
return createSeedReactElement("HStack", rest, processedChildren);
|
|
896
955
|
}
|
|
897
956
|
if (layoutComponent === "Box") {
|
|
898
|
-
return
|
|
957
|
+
return createSeedReactElement("Box", props, processedChildren);
|
|
899
958
|
}
|
|
900
959
|
});
|
|
901
960
|
}
|
|
@@ -908,7 +967,7 @@ function createInstanceTransformer({ iconHandler, propsConverters, componentHand
|
|
|
908
967
|
...propsConverters.iconSelfLayout(node),
|
|
909
968
|
...propsConverters.vectorChildrenFill(node)
|
|
910
969
|
};
|
|
911
|
-
return
|
|
970
|
+
return createSeedReactElement("Icon", {
|
|
912
971
|
svg: iconHandler.transform(node),
|
|
913
972
|
...props
|
|
914
973
|
});
|
|
@@ -931,7 +990,9 @@ function createTextTransformer({ propsConverters }) {
|
|
|
931
990
|
...typeStyleProps,
|
|
932
991
|
...fillProps
|
|
933
992
|
});
|
|
934
|
-
return
|
|
993
|
+
return createSeedReactElement("Text", props, node.characters.replace(/\n/g, "<br />"), {
|
|
994
|
+
comment: hasMultipleFills ? "Multiple fills in Text node encountered, only the first fill is used." : undefined
|
|
995
|
+
});
|
|
935
996
|
});
|
|
936
997
|
}
|
|
937
998
|
|
|
@@ -1049,19 +1110,20 @@ function handleSizeProp(size) {
|
|
|
1049
1110
|
}
|
|
1050
1111
|
}
|
|
1051
1112
|
|
|
1113
|
+
const { createLocalSnippetElement: createLocalSnippetElement$n } = createLocalSnippetHelper("action-button");
|
|
1052
1114
|
const createActionButtonHandler = (ctx)=>defineComponentHandler(metadata$u.key, ({ componentProperties: props })=>{
|
|
1053
1115
|
const states = props.State.value.split("-");
|
|
1054
1116
|
const { layout, children } = match(props.Layout.value).with("Icon Only", ()=>({
|
|
1055
1117
|
layout: "iconOnly",
|
|
1056
1118
|
children: [
|
|
1057
|
-
|
|
1119
|
+
createLocalSnippetElement$n("Icon", {
|
|
1058
1120
|
svg: ctx.iconHandler.transform(props["Icon#7574:0"])
|
|
1059
1121
|
})
|
|
1060
1122
|
]
|
|
1061
1123
|
})).with("Icon First", ()=>({
|
|
1062
1124
|
layout: "withText",
|
|
1063
1125
|
children: [
|
|
1064
|
-
|
|
1126
|
+
createLocalSnippetElement$n("PrefixIcon", {
|
|
1065
1127
|
svg: ctx.iconHandler.transform(props["Prefix Icon#5987:305"])
|
|
1066
1128
|
}),
|
|
1067
1129
|
props["Label#5987:61"].value
|
|
@@ -1070,7 +1132,7 @@ const createActionButtonHandler = (ctx)=>defineComponentHandler(metadata$u.key,
|
|
|
1070
1132
|
layout: "withText",
|
|
1071
1133
|
children: [
|
|
1072
1134
|
props["Label#5987:61"].value,
|
|
1073
|
-
|
|
1135
|
+
createLocalSnippetElement$n("SuffixIcon", {
|
|
1074
1136
|
svg: ctx.iconHandler.transform(props["Suffix Icon#5987:244"])
|
|
1075
1137
|
})
|
|
1076
1138
|
]
|
|
@@ -1089,7 +1151,7 @@ const createActionButtonHandler = (ctx)=>defineComponentHandler(metadata$u.key,
|
|
|
1089
1151
|
variant: camelCase(props.Variant.value),
|
|
1090
1152
|
layout
|
|
1091
1153
|
};
|
|
1092
|
-
return
|
|
1154
|
+
return createLocalSnippetElement$n("ActionButton", commonProps, children);
|
|
1093
1155
|
});
|
|
1094
1156
|
|
|
1095
1157
|
const createActionChipHandler = (ctx)=>defineComponentHandler(metadata$t.key, ({ componentProperties: props })=>{
|
|
@@ -1097,14 +1159,14 @@ const createActionChipHandler = (ctx)=>defineComponentHandler(metadata$t.key, ({
|
|
|
1097
1159
|
const { layout, children } = match(props.Layout.value).with("Icon Only", ()=>({
|
|
1098
1160
|
layout: "iconOnly",
|
|
1099
1161
|
children: [
|
|
1100
|
-
|
|
1162
|
+
createSeedReactElement("Icon", {
|
|
1101
1163
|
svg: ctx.iconHandler.transform(props["Icon#8714:0"])
|
|
1102
1164
|
})
|
|
1103
1165
|
]
|
|
1104
1166
|
})).with("Icon First", ()=>({
|
|
1105
1167
|
layout: "withText",
|
|
1106
1168
|
children: [
|
|
1107
|
-
|
|
1169
|
+
createSeedReactElement("PrefixIcon", {
|
|
1108
1170
|
svg: ctx.iconHandler.transform(props["Prefix Icon#8711:0"])
|
|
1109
1171
|
}),
|
|
1110
1172
|
props["Label#7185:0"].value
|
|
@@ -1113,18 +1175,18 @@ const createActionChipHandler = (ctx)=>defineComponentHandler(metadata$t.key, ({
|
|
|
1113
1175
|
layout: "withText",
|
|
1114
1176
|
children: [
|
|
1115
1177
|
props["Label#7185:0"].value,
|
|
1116
|
-
|
|
1178
|
+
createSeedReactElement("SuffixIcon", {
|
|
1117
1179
|
svg: ctx.iconHandler.transform(props["Suffix Icon#8711:3"])
|
|
1118
1180
|
})
|
|
1119
1181
|
]
|
|
1120
1182
|
})).with("Icon Both", ()=>({
|
|
1121
1183
|
layout: "withText",
|
|
1122
1184
|
children: [
|
|
1123
|
-
|
|
1185
|
+
createSeedReactElement("PrefixIcon", {
|
|
1124
1186
|
svg: ctx.iconHandler.transform(props["Prefix Icon#8711:0"])
|
|
1125
1187
|
}),
|
|
1126
1188
|
props["Label#7185:0"].value,
|
|
1127
|
-
|
|
1189
|
+
createSeedReactElement("SuffixIcon", {
|
|
1128
1190
|
svg: ctx.iconHandler.transform(props["Suffix Icon#8711:3"])
|
|
1129
1191
|
})
|
|
1130
1192
|
]
|
|
@@ -1142,9 +1204,10 @@ const createActionChipHandler = (ctx)=>defineComponentHandler(metadata$t.key, ({
|
|
|
1142
1204
|
count: Number(props["Count#7185:21"].value)
|
|
1143
1205
|
}
|
|
1144
1206
|
};
|
|
1145
|
-
return
|
|
1207
|
+
return createSeedReactElement("ActionChip", commonProps, children);
|
|
1146
1208
|
});
|
|
1147
1209
|
|
|
1210
|
+
const { createLocalSnippetElement: createLocalSnippetElement$m } = createLocalSnippetHelper("action-sheet");
|
|
1148
1211
|
const ACTION_SHEET_ITEM_KEY = "c3cafd3a3fdcd45fecb6971019d88eaf39a2e381";
|
|
1149
1212
|
const createActionSheetItemHandler = (_ctx)=>defineComponentHandler(ACTION_SHEET_ITEM_KEY, ({ componentProperties: props })=>{
|
|
1150
1213
|
const states = props.State.value.split("-");
|
|
@@ -1155,7 +1218,7 @@ const createActionSheetItemHandler = (_ctx)=>defineComponentHandler(ACTION_SHEET
|
|
|
1155
1218
|
disabled: true
|
|
1156
1219
|
}
|
|
1157
1220
|
};
|
|
1158
|
-
return
|
|
1221
|
+
return createLocalSnippetElement$m("ActionSheetItem", commonProps);
|
|
1159
1222
|
});
|
|
1160
1223
|
const createActionSheetHandler = (ctx)=>{
|
|
1161
1224
|
const actionSheetItemHandler = createActionSheetItemHandler();
|
|
@@ -1179,17 +1242,22 @@ const createActionSheetHandler = (ctx)=>{
|
|
|
1179
1242
|
key: actionSheetItemHandler.key
|
|
1180
1243
|
});
|
|
1181
1244
|
const contentChildren = items.map(actionSheetItemHandler.transform);
|
|
1182
|
-
const content =
|
|
1183
|
-
|
|
1245
|
+
const content = createLocalSnippetElement$m("ActionSheetContent", contentProps, contentChildren, {
|
|
1246
|
+
comment: contentProps.title ? undefined : "title을 제공하지 않는 경우 aria-label이나 aria-labelledby 중 하나를 제공해야 합니다."
|
|
1247
|
+
});
|
|
1248
|
+
const trigger = createLocalSnippetElement$m("ActionSheetTrigger", {
|
|
1184
1249
|
asChild: true
|
|
1185
|
-
}, createElement("
|
|
1186
|
-
|
|
1250
|
+
}, createElement("button", undefined, "열기", {
|
|
1251
|
+
comment: "ActionSheet을 여는 요소를 제공해주세요."
|
|
1252
|
+
}));
|
|
1253
|
+
return createLocalSnippetElement$m("ActionSheet", undefined, [
|
|
1187
1254
|
trigger,
|
|
1188
1255
|
content
|
|
1189
1256
|
]);
|
|
1190
1257
|
});
|
|
1191
1258
|
};
|
|
1192
1259
|
|
|
1260
|
+
const { createLocalSnippetElement: createLocalSnippetElement$l } = createLocalSnippetHelper("app-bar");
|
|
1193
1261
|
const APP_BAR_MAIN_KEY = "336b49b26c3933485d87cc460b06c390976ea58e";
|
|
1194
1262
|
const createAppBarMainHandler = (_ctx)=>defineComponentHandler(APP_BAR_MAIN_KEY, ({ componentProperties: props })=>{
|
|
1195
1263
|
const { title, subtitle, layout } = match(props.Type.value).with("Title", ()=>({
|
|
@@ -1210,7 +1278,9 @@ const createAppBarMainHandler = (_ctx)=>defineComponentHandler(APP_BAR_MAIN_KEY,
|
|
|
1210
1278
|
subtitle,
|
|
1211
1279
|
layout
|
|
1212
1280
|
};
|
|
1213
|
-
return
|
|
1281
|
+
return createLocalSnippetElement$l("AppBarMain", commonProps, undefined, {
|
|
1282
|
+
comment: title === undefined ? "Title을 제공해주세요." : undefined
|
|
1283
|
+
});
|
|
1214
1284
|
});
|
|
1215
1285
|
const APP_BAR_LEFT_KEY = "e5d2e47052a22395db79f195a0991a570dc1b6c9";
|
|
1216
1286
|
const createAppBarLeftHandler = (ctx)=>defineComponentHandler(APP_BAR_LEFT_KEY, (node)=>{
|
|
@@ -1218,20 +1288,22 @@ const createAppBarLeftHandler = (ctx)=>defineComponentHandler(APP_BAR_LEFT_KEY,
|
|
|
1218
1288
|
const children = (()=>{
|
|
1219
1289
|
switch(props.Action.value){
|
|
1220
1290
|
case "Back":
|
|
1221
|
-
return
|
|
1291
|
+
return createLocalSnippetElement$l("AppBarBackButton");
|
|
1222
1292
|
case "Close":
|
|
1223
|
-
return
|
|
1293
|
+
return createLocalSnippetElement$l("AppBarCloseButton");
|
|
1224
1294
|
case "Other":
|
|
1225
1295
|
{
|
|
1226
1296
|
const iconNode = findOne(node, (child)=>child.type === "INSTANCE" && child.name === "Icon");
|
|
1227
1297
|
if (!iconNode) {
|
|
1228
1298
|
return undefined;
|
|
1229
1299
|
}
|
|
1230
|
-
return
|
|
1300
|
+
return createLocalSnippetElement$l("AppBarIconButton", undefined, ctx.iconHandler.transform(iconNode), {
|
|
1301
|
+
comment: "aria-label 또는 aria-labelledby를 제공해주세요."
|
|
1302
|
+
});
|
|
1231
1303
|
}
|
|
1232
1304
|
}
|
|
1233
1305
|
})();
|
|
1234
|
-
return
|
|
1306
|
+
return createLocalSnippetElement$l("AppBarLeft", undefined, children);
|
|
1235
1307
|
});
|
|
1236
1308
|
const APP_BAR_RIGHT_KEY = "9e157fc2d1f89ffee938a5bc62f4a58064fec44e";
|
|
1237
1309
|
const createAppBarRightHandler = (ctx)=>defineComponentHandler(APP_BAR_RIGHT_KEY, (node)=>{
|
|
@@ -1246,11 +1318,13 @@ const createAppBarRightHandler = (ctx)=>defineComponentHandler(APP_BAR_RIGHT_KEY
|
|
|
1246
1318
|
default:
|
|
1247
1319
|
{
|
|
1248
1320
|
const iconNodes = findAll(node, (child)=>child.type === "INSTANCE" && child.name === "Icon");
|
|
1249
|
-
return iconNodes.map((iconNode)=>
|
|
1321
|
+
return iconNodes.map((iconNode)=>createLocalSnippetElement$l("AppBarIconButton", undefined, ctx.iconHandler.transform(iconNode), {
|
|
1322
|
+
comment: "aria-label 또는 aria-labelledby를 제공해주세요."
|
|
1323
|
+
}));
|
|
1250
1324
|
}
|
|
1251
1325
|
}
|
|
1252
1326
|
})();
|
|
1253
|
-
return
|
|
1327
|
+
return createLocalSnippetElement$l("AppBarRight", undefined, children);
|
|
1254
1328
|
});
|
|
1255
1329
|
const createAppBarHandler = (ctx)=>{
|
|
1256
1330
|
const appBarMainHandler = createAppBarMainHandler();
|
|
@@ -1292,14 +1366,16 @@ const createAppBarHandler = (ctx)=>{
|
|
|
1292
1366
|
});
|
|
1293
1367
|
const onlyRightNode = rightNode.length === 1 ? rightNode[0] : undefined;
|
|
1294
1368
|
const right = onlyRightNode ? appBarRightHandler.transform(onlyRightNode) : undefined;
|
|
1295
|
-
return
|
|
1369
|
+
return createLocalSnippetElement$l("AppBar", {
|
|
1296
1370
|
theme,
|
|
1297
1371
|
tone
|
|
1298
1372
|
}, [
|
|
1299
1373
|
left,
|
|
1300
1374
|
main,
|
|
1301
1375
|
right
|
|
1302
|
-
].filter(Boolean),
|
|
1376
|
+
].filter(Boolean), {
|
|
1377
|
+
comment: tone === "transparent" ? '<AppScreen layerOffsetTop="none">으로 상단 패딩을 제거할 수 있습니다.' : undefined
|
|
1378
|
+
});
|
|
1303
1379
|
});
|
|
1304
1380
|
};
|
|
1305
1381
|
|
|
@@ -1307,9 +1383,10 @@ const createIdentityPlaceholderHandler = (_ctx)=>defineComponentHandler(metadata
|
|
|
1307
1383
|
const commonProps = {
|
|
1308
1384
|
identity: camelCase(props.Identity.value)
|
|
1309
1385
|
};
|
|
1310
|
-
return
|
|
1386
|
+
return createSeedReactElement("IdentityPlaceholder", commonProps);
|
|
1311
1387
|
});
|
|
1312
1388
|
|
|
1389
|
+
const { createLocalSnippetElement: createLocalSnippetElement$k } = createLocalSnippetHelper("avatar");
|
|
1313
1390
|
const createAvatarHandler = (ctx)=>{
|
|
1314
1391
|
const identityPlaceholderHandler = createIdentityPlaceholderHandler();
|
|
1315
1392
|
return defineComponentHandler(metadata$r.key, (node)=>{
|
|
@@ -1329,10 +1406,13 @@ const createAvatarHandler = (ctx)=>{
|
|
|
1329
1406
|
},
|
|
1330
1407
|
size: props.Size.value
|
|
1331
1408
|
};
|
|
1332
|
-
return
|
|
1409
|
+
return createLocalSnippetElement$k("Avatar", commonProps, props["Show Badge#1398:26"].value ? createLocalSnippetElement$k("AvatarBadge", {}) : undefined, {
|
|
1410
|
+
comment: avatarHasSrc ? "alt 텍스트를 제공해야 합니다." : undefined
|
|
1411
|
+
});
|
|
1333
1412
|
});
|
|
1334
1413
|
};
|
|
1335
1414
|
|
|
1415
|
+
const { createLocalSnippetElement: createLocalSnippetElement$j } = createLocalSnippetHelper("avatar");
|
|
1336
1416
|
const createAvatarStackHandler = (ctx)=>{
|
|
1337
1417
|
const avatarHandler = createAvatarHandler();
|
|
1338
1418
|
return defineComponentHandler(metadata$q.key, (node)=>{
|
|
@@ -1345,7 +1425,7 @@ const createAvatarStackHandler = (ctx)=>{
|
|
|
1345
1425
|
size: props.Size.value
|
|
1346
1426
|
};
|
|
1347
1427
|
const avatarStackChildren = avatarNodes.map(avatarHandler.transform);
|
|
1348
|
-
return
|
|
1428
|
+
return createLocalSnippetElement$j("AvatarStack", commonProps, avatarStackChildren);
|
|
1349
1429
|
});
|
|
1350
1430
|
};
|
|
1351
1431
|
|
|
@@ -1356,9 +1436,10 @@ const createBadgeHandler = (_ctx)=>defineComponentHandler(metadata$p.key, ({ com
|
|
|
1356
1436
|
variant: camelCase(props.Variant.value),
|
|
1357
1437
|
shape: camelCase(props.Shape.value)
|
|
1358
1438
|
};
|
|
1359
|
-
return
|
|
1439
|
+
return createSeedReactElement("Badge", commonProps, props["Label#1584:0"].value);
|
|
1360
1440
|
});
|
|
1361
1441
|
|
|
1442
|
+
const { createLocalSnippetElement: createLocalSnippetElement$i } = createLocalSnippetHelper("callout");
|
|
1362
1443
|
const createCalloutHandler = (ctx)=>defineComponentHandler(metadata$o.key, ({ componentProperties: props, children })=>{
|
|
1363
1444
|
const tag = (()=>{
|
|
1364
1445
|
switch(props.Interaction.value){
|
|
@@ -1374,7 +1455,9 @@ const createCalloutHandler = (ctx)=>defineComponentHandler(metadata$o.key, ({ co
|
|
|
1374
1455
|
})();
|
|
1375
1456
|
const textNode = children.find((child)=>child.type === "TEXT");
|
|
1376
1457
|
if (!textNode) {
|
|
1377
|
-
return
|
|
1458
|
+
return createLocalSnippetElement$i(tag, undefined, undefined, {
|
|
1459
|
+
comment: "내용을 제공해주세요."
|
|
1460
|
+
});
|
|
1378
1461
|
}
|
|
1379
1462
|
const slices = textNode.segments;
|
|
1380
1463
|
let title;
|
|
@@ -1422,9 +1505,10 @@ const createCalloutHandler = (ctx)=>defineComponentHandler(metadata$o.key, ({ co
|
|
|
1422
1505
|
prefixIcon: ctx.iconHandler.transform(props["Icon#12598:210"])
|
|
1423
1506
|
}
|
|
1424
1507
|
};
|
|
1425
|
-
return
|
|
1508
|
+
return createLocalSnippetElement$i(tag, commonProps);
|
|
1426
1509
|
});
|
|
1427
1510
|
|
|
1511
|
+
const { createLocalSnippetElement: createLocalSnippetElement$h } = createLocalSnippetHelper("checkbox");
|
|
1428
1512
|
const createCheckboxHandler = (_ctx)=>defineComponentHandler(metadata$n.key, ({ componentProperties: props })=>{
|
|
1429
1513
|
const states = props.State.value.split("-");
|
|
1430
1514
|
const commonProps = {
|
|
@@ -1443,9 +1527,10 @@ const createCheckboxHandler = (_ctx)=>defineComponentHandler(metadata$n.key, ({
|
|
|
1443
1527
|
disabled: true
|
|
1444
1528
|
}
|
|
1445
1529
|
};
|
|
1446
|
-
return
|
|
1530
|
+
return createLocalSnippetElement$h("Checkbox", commonProps);
|
|
1447
1531
|
});
|
|
1448
1532
|
|
|
1533
|
+
const { createLocalSnippetElement: createLocalSnippetElement$g } = createLocalSnippetHelper("chip-tabs");
|
|
1449
1534
|
const CHIP_TABS_ITEM_KEY = "fa80168b02051fbb0ba032238bd76d840dbe2e15";
|
|
1450
1535
|
const createChipTabsItemHandler = (_ctx)=>defineComponentHandler(CHIP_TABS_ITEM_KEY, ({ componentProperties: props })=>{
|
|
1451
1536
|
const states = props.State.value.split("-");
|
|
@@ -1455,7 +1540,7 @@ const createChipTabsItemHandler = (_ctx)=>defineComponentHandler(CHIP_TABS_ITEM_
|
|
|
1455
1540
|
disabled: true
|
|
1456
1541
|
}
|
|
1457
1542
|
};
|
|
1458
|
-
return
|
|
1543
|
+
return createLocalSnippetElement$g("ChipTabsTrigger", commonProps, props["Label#8876:0"].value);
|
|
1459
1544
|
});
|
|
1460
1545
|
const createChipTabsHandler = (ctx)=>{
|
|
1461
1546
|
const chipTabsItemHandler = createChipTabsItemHandler();
|
|
@@ -1465,50 +1550,55 @@ const createChipTabsHandler = (ctx)=>{
|
|
|
1465
1550
|
key: chipTabsItemHandler.key
|
|
1466
1551
|
});
|
|
1467
1552
|
const selectedChipTabsItem = chipTabsItems.find((chipTabsItem)=>chipTabsItem.componentProperties.State.value.split("-").includes("Selected"));
|
|
1468
|
-
const chipTabsList =
|
|
1553
|
+
const chipTabsList = createLocalSnippetElement$g("ChipTabsList", undefined, chipTabsItems.map(chipTabsItemHandler.transform));
|
|
1469
1554
|
const commonProps = {
|
|
1470
1555
|
variant: camelCase(node.componentProperties.Variant.value),
|
|
1471
1556
|
...selectedChipTabsItem && {
|
|
1472
1557
|
defaultValue: selectedChipTabsItem.componentProperties["Label#8876:0"].value
|
|
1473
1558
|
}
|
|
1474
1559
|
};
|
|
1475
|
-
return
|
|
1560
|
+
return createLocalSnippetElement$g("ChipTabs", commonProps, chipTabsList);
|
|
1476
1561
|
});
|
|
1477
1562
|
};
|
|
1478
1563
|
|
|
1564
|
+
const { createLocalSnippetElement: createLocalSnippetElement$f } = createLocalSnippetHelper("control-chip");
|
|
1479
1565
|
const createControlChipHandler = (ctx)=>defineComponentHandler(metadata$l.key, ({ componentProperties: props })=>{
|
|
1480
1566
|
const states = props.State.value.split("-");
|
|
1567
|
+
const count = props["Show Count#7185:42"].value ? props["Count#7185:21"].value : undefined;
|
|
1481
1568
|
const { layout, children } = match(props.Layout.value).with("Icon Only", ()=>({
|
|
1482
1569
|
layout: "iconOnly",
|
|
1483
1570
|
children: [
|
|
1484
|
-
|
|
1571
|
+
createSeedReactElement("Icon", {
|
|
1485
1572
|
svg: ctx.iconHandler.transform(props["Icon#8722:41"])
|
|
1486
1573
|
})
|
|
1487
1574
|
]
|
|
1488
1575
|
})).with("Icon First", ()=>({
|
|
1489
1576
|
layout: "withText",
|
|
1490
1577
|
children: [
|
|
1491
|
-
|
|
1578
|
+
createSeedReactElement("PrefixIcon", {
|
|
1492
1579
|
svg: ctx.iconHandler.transform(props["Prefix Icon#8722:0"])
|
|
1493
1580
|
}),
|
|
1494
|
-
props["Label#7185:0"].value
|
|
1581
|
+
props["Label#7185:0"].value,
|
|
1582
|
+
count ? createSeedReactElement("Count", undefined, [
|
|
1583
|
+
count
|
|
1584
|
+
]) : undefined
|
|
1495
1585
|
]
|
|
1496
1586
|
})).with("Icon Last", ()=>({
|
|
1497
1587
|
layout: "withText",
|
|
1498
1588
|
children: [
|
|
1499
1589
|
props["Label#7185:0"].value,
|
|
1500
|
-
|
|
1590
|
+
createSeedReactElement("SuffixIcon", {
|
|
1501
1591
|
svg: ctx.iconHandler.transform(props["Suffix Icon#8722:82"])
|
|
1502
1592
|
})
|
|
1503
1593
|
]
|
|
1504
1594
|
})).with("Icon Both", ()=>({
|
|
1505
1595
|
layout: "withText",
|
|
1506
1596
|
children: [
|
|
1507
|
-
|
|
1597
|
+
createSeedReactElement("PrefixIcon", {
|
|
1508
1598
|
svg: ctx.iconHandler.transform(props["Prefix Icon#8722:0"])
|
|
1509
1599
|
}),
|
|
1510
1600
|
props["Label#7185:0"].value,
|
|
1511
|
-
|
|
1601
|
+
createSeedReactElement("SuffixIcon", {
|
|
1512
1602
|
svg: ctx.iconHandler.transform(props["Suffix Icon#8722:82"])
|
|
1513
1603
|
})
|
|
1514
1604
|
]
|
|
@@ -1529,9 +1619,10 @@ const createControlChipHandler = (ctx)=>defineComponentHandler(metadata$l.key, (
|
|
|
1529
1619
|
count: Number(props["Count#7185:21"].value)
|
|
1530
1620
|
}
|
|
1531
1621
|
};
|
|
1532
|
-
return
|
|
1622
|
+
return createLocalSnippetElement$f("ControlChip.Toggle", commonProps, children);
|
|
1533
1623
|
});
|
|
1534
1624
|
|
|
1625
|
+
const { createLocalSnippetElement: createLocalSnippetElement$e } = createLocalSnippetHelper("error-state");
|
|
1535
1626
|
const createErrorStateHandler = (ctx)=>{
|
|
1536
1627
|
const actionButtonHandler = createActionButtonHandler(ctx);
|
|
1537
1628
|
return defineComponentHandler(metadata$k.key, (node)=>{
|
|
@@ -1555,10 +1646,11 @@ const createErrorStateHandler = (ctx)=>{
|
|
|
1555
1646
|
}
|
|
1556
1647
|
}
|
|
1557
1648
|
};
|
|
1558
|
-
return
|
|
1649
|
+
return createLocalSnippetElement$e("ErrorState", commonProps);
|
|
1559
1650
|
});
|
|
1560
1651
|
};
|
|
1561
1652
|
|
|
1653
|
+
const { createLocalSnippetElement: createLocalSnippetElement$d } = createLocalSnippetHelper("extended-action-sheet");
|
|
1562
1654
|
const EXTENDED_ACTION_SHEET_ITEM_KEY = "057083e95466da59051119eec0b41d4ad5a07f8f";
|
|
1563
1655
|
const createExtendedActionSheetItemHandler = (ctx)=>defineComponentHandler(EXTENDED_ACTION_SHEET_ITEM_KEY, ({ componentProperties: props })=>{
|
|
1564
1656
|
const states = props.State.value.split("-");
|
|
@@ -1568,8 +1660,8 @@ const createExtendedActionSheetItemHandler = (ctx)=>defineComponentHandler(EXTEN
|
|
|
1568
1660
|
disabled: true
|
|
1569
1661
|
}
|
|
1570
1662
|
};
|
|
1571
|
-
return
|
|
1572
|
-
props["Show Prefix Icon#17043:5"].value ?
|
|
1663
|
+
return createLocalSnippetElement$d("ExtendedActionSheetItem", commonProps, [
|
|
1664
|
+
props["Show Prefix Icon#17043:5"].value ? createSeedReactElement("PrefixIcon", {
|
|
1573
1665
|
svg: ctx.iconHandler.transform(props["Prefix Icon#55948:0"])
|
|
1574
1666
|
}) : undefined,
|
|
1575
1667
|
props["Label#55905:8"].value
|
|
@@ -1584,7 +1676,7 @@ const createExtendedActionSheetGroupHandler = (ctx)=>{
|
|
|
1584
1676
|
key: extendedActionSheetItemHandler.key
|
|
1585
1677
|
});
|
|
1586
1678
|
const contentChildren = items.map(extendedActionSheetItemHandler.transform);
|
|
1587
|
-
return
|
|
1679
|
+
return createLocalSnippetElement$d("ExtendedActionSheetGroup", undefined, contentChildren);
|
|
1588
1680
|
});
|
|
1589
1681
|
};
|
|
1590
1682
|
const createExtendedActionSheetHandler = (ctx)=>{
|
|
@@ -1597,13 +1689,17 @@ const createExtendedActionSheetHandler = (ctx)=>{
|
|
|
1597
1689
|
});
|
|
1598
1690
|
const contentChildren = groups.map(extendedActionSheetGroupHandler.transform);
|
|
1599
1691
|
const title = props["Show Title#17043:12"].value ? props["Title#14599:0"].value : undefined;
|
|
1600
|
-
const content =
|
|
1692
|
+
const content = createLocalSnippetElement$d("ExtendedActionSheetContent", {
|
|
1601
1693
|
title
|
|
1602
|
-
}, contentChildren,
|
|
1603
|
-
|
|
1694
|
+
}, contentChildren, {
|
|
1695
|
+
comment: title ? undefined : "title을 제공하지 않는 경우 aria-label이나 aria-labelledby 중 하나를 제공해야 합니다."
|
|
1696
|
+
});
|
|
1697
|
+
const trigger = createLocalSnippetElement$d("ExtendedActionSheetTrigger", {
|
|
1604
1698
|
asChild: true
|
|
1605
|
-
}, createElement("
|
|
1606
|
-
|
|
1699
|
+
}, createElement("button", undefined, "열기", {
|
|
1700
|
+
comment: "ExtendedActionSheet을 여는 요소를 제공해주세요."
|
|
1701
|
+
}));
|
|
1702
|
+
return createLocalSnippetElement$d("ExtendedActionSheet", undefined, [
|
|
1607
1703
|
trigger,
|
|
1608
1704
|
content
|
|
1609
1705
|
]);
|
|
@@ -1615,8 +1711,8 @@ const createExtendedFabHandler = (ctx)=>defineComponentHandler(metadata$i.key, (
|
|
|
1615
1711
|
size: handleSizeProp(props.Size.value),
|
|
1616
1712
|
variant: camelCase(props.Variant.value)
|
|
1617
1713
|
};
|
|
1618
|
-
return
|
|
1619
|
-
|
|
1714
|
+
return createSeedReactElement("ExtendedFab", commonProps, [
|
|
1715
|
+
createSeedReactElement("PrefixIcon", {
|
|
1620
1716
|
svg: ctx.iconHandler.transform(props["Icon#28796:0"])
|
|
1621
1717
|
}),
|
|
1622
1718
|
props["Label#28936:0"].value
|
|
@@ -1624,9 +1720,14 @@ const createExtendedFabHandler = (ctx)=>defineComponentHandler(metadata$i.key, (
|
|
|
1624
1720
|
});
|
|
1625
1721
|
|
|
1626
1722
|
const createFabHandler = (ctx)=>defineComponentHandler(metadata$h.key, ({ componentProperties: props })=>{
|
|
1627
|
-
return
|
|
1723
|
+
return createSeedReactElement("Fab", undefined, createSeedReactElement("Icon", {
|
|
1724
|
+
svg: ctx.iconHandler.transform(props["Icon#28796:0"])
|
|
1725
|
+
}), {
|
|
1726
|
+
comment: "aria-label이나 aria-labelledby 중 하나를 제공해야 합니다."
|
|
1727
|
+
});
|
|
1628
1728
|
});
|
|
1629
1729
|
|
|
1730
|
+
const { createLocalSnippetElement: createLocalSnippetElement$c } = createLocalSnippetHelper("help-bubble");
|
|
1630
1731
|
const createHelpBubbleHandler = (_ctx)=>defineComponentHandler(metadata$g.key, ({ componentProperties: props })=>{
|
|
1631
1732
|
const placement = (()=>{
|
|
1632
1733
|
switch(props.Placement.value){
|
|
@@ -1665,9 +1766,12 @@ const createHelpBubbleHandler = (_ctx)=>defineComponentHandler(metadata$g.key, (
|
|
|
1665
1766
|
defaultOpen: true,
|
|
1666
1767
|
placement
|
|
1667
1768
|
};
|
|
1668
|
-
return
|
|
1769
|
+
return createLocalSnippetElement$c("HelpBubbleTrigger", commonProps, createElement("button", undefined, "열기", {
|
|
1770
|
+
comment: "HelpBubble을 여는 요소를 제공해주세요."
|
|
1771
|
+
}));
|
|
1669
1772
|
});
|
|
1670
1773
|
|
|
1774
|
+
const { createLocalSnippetElement: createLocalSnippetElement$b } = createLocalSnippetHelper("inline-banner");
|
|
1671
1775
|
const createInlineBannerHandler = (ctx)=>defineComponentHandler(metadata$e.key, (node)=>{
|
|
1672
1776
|
const { componentProperties: props } = node;
|
|
1673
1777
|
const tag = (()=>{
|
|
@@ -1686,7 +1790,9 @@ const createInlineBannerHandler = (ctx)=>defineComponentHandler(metadata$e.key,
|
|
|
1686
1790
|
})();
|
|
1687
1791
|
const textNode = findOne(node, (child)=>child.type === "TEXT" && child.name === "Label");
|
|
1688
1792
|
if (!textNode) {
|
|
1689
|
-
return
|
|
1793
|
+
return createLocalSnippetElement$b(tag, undefined, undefined, {
|
|
1794
|
+
comment: "내용을 제공해주세요."
|
|
1795
|
+
});
|
|
1690
1796
|
}
|
|
1691
1797
|
const slices = textNode.segments;
|
|
1692
1798
|
let title;
|
|
@@ -1718,17 +1824,19 @@ const createInlineBannerHandler = (ctx)=>defineComponentHandler(metadata$e.key,
|
|
|
1718
1824
|
},
|
|
1719
1825
|
prefixIcon
|
|
1720
1826
|
};
|
|
1721
|
-
return
|
|
1827
|
+
return createLocalSnippetElement$b(tag, commonProps);
|
|
1722
1828
|
});
|
|
1723
1829
|
|
|
1830
|
+
const { createLocalSnippetElement: createLocalSnippetElement$a } = createLocalSnippetHelper("manner-temp-badge");
|
|
1724
1831
|
const createMannerTempBadgeHandler = (_ctx)=>defineComponentHandler(metadata$d.key, ({ children })=>{
|
|
1725
1832
|
const textNode = children.find((child)=>child.type === "TEXT");
|
|
1726
1833
|
const commonProps = {
|
|
1727
1834
|
temperature: Number(textNode?.characters.replace(/[^\d.-]/g, "") ?? "-1")
|
|
1728
1835
|
};
|
|
1729
|
-
return
|
|
1836
|
+
return createLocalSnippetElement$a("MannerTempBadge", commonProps);
|
|
1730
1837
|
});
|
|
1731
1838
|
|
|
1839
|
+
const { createLocalSnippetElement: createLocalSnippetElement$9 } = createLocalSnippetHelper("multiline-text-field");
|
|
1732
1840
|
const createMultilineTextFieldHandler = (_ctx)=>defineComponentHandler(metadata$c.key, ({ componentProperties: props })=>{
|
|
1733
1841
|
const { Size: { value: size }, State: { value: state }, Filled: { value: filled }, "Show Header#870:0": { value: showHeader }, "Label#15327:323": { value: label }, "Show Indicator#1259:0": { value: showIndicator }, "Indicator#15327:286": { value: indicator }, "Placeholder#958:0": { value: placeholder }, "Filled Text#1304:0": { value: defaultValue }, "Show Footer#958:25": { value: showFooter }, "Show Description#958:50": { value: showDescription }, "Description#15327:212": { value: description }, "Show Character count#958:75": { value: showCharacterCount }, "Character Count#15327:360": { value: _characterCount }, "Max Character Count#15327:175": { value: maxCharacterCount } } = props;
|
|
1734
1842
|
const states = state.split("-");
|
|
@@ -1770,10 +1878,11 @@ const createMultilineTextFieldHandler = (_ctx)=>defineComponentHandler(metadata$
|
|
|
1770
1878
|
const inputProps = {
|
|
1771
1879
|
placeholder
|
|
1772
1880
|
};
|
|
1773
|
-
const TextFieldChildren =
|
|
1774
|
-
return
|
|
1881
|
+
const TextFieldChildren = createLocalSnippetElement$9("TextFieldTextarea", inputProps);
|
|
1882
|
+
return createLocalSnippetElement$9("TextField", commonProps, TextFieldChildren);
|
|
1775
1883
|
});
|
|
1776
1884
|
|
|
1885
|
+
const { createLocalSnippetElement: createLocalSnippetElement$8 } = createLocalSnippetHelper("progress-circle");
|
|
1777
1886
|
const createProgressCircleHandler = (_ctx)=>defineComponentHandler(metadata$b.key, ({ componentProperties: props })=>{
|
|
1778
1887
|
const { value, minValue, maxValue } = match(props.Value.value).with("Indeterminate", ()=>({
|
|
1779
1888
|
value: undefined,
|
|
@@ -1803,9 +1912,10 @@ const createProgressCircleHandler = (_ctx)=>defineComponentHandler(metadata$b.ke
|
|
|
1803
1912
|
size: props.Size.value,
|
|
1804
1913
|
tone: camelCase(props.Tone.value)
|
|
1805
1914
|
};
|
|
1806
|
-
return
|
|
1915
|
+
return createLocalSnippetElement$8("ProgressCircle", commonProps);
|
|
1807
1916
|
});
|
|
1808
1917
|
|
|
1918
|
+
const { createLocalSnippetElement: createLocalSnippetElement$7 } = createLocalSnippetHelper("reaction-button");
|
|
1809
1919
|
const createReactionButtonHandler = (ctx)=>defineComponentHandler(metadata$a.key, ({ componentProperties: props })=>{
|
|
1810
1920
|
const states = props.State.value.split("-");
|
|
1811
1921
|
const commonProps = {
|
|
@@ -1820,15 +1930,16 @@ const createReactionButtonHandler = (ctx)=>defineComponentHandler(metadata$a.key
|
|
|
1820
1930
|
defaultPressed: true
|
|
1821
1931
|
}
|
|
1822
1932
|
};
|
|
1823
|
-
return
|
|
1824
|
-
|
|
1933
|
+
return createLocalSnippetElement$7("ReactionButton", commonProps, [
|
|
1934
|
+
createSeedReactElement("PrefixIcon", {
|
|
1825
1935
|
svg: ctx.iconHandler.transform(props["Icon#12379:0"])
|
|
1826
1936
|
}),
|
|
1827
1937
|
props["Label#6397:0"].value,
|
|
1828
|
-
props["Show Count#6397:33"].value ?
|
|
1938
|
+
props["Show Count#6397:33"].value ? createSeedReactElement("Count", {}, props["Count#15816:0"].value) : undefined
|
|
1829
1939
|
]);
|
|
1830
1940
|
});
|
|
1831
1941
|
|
|
1942
|
+
const { createLocalSnippetElement: createLocalSnippetElement$6 } = createLocalSnippetHelper("segmented-control");
|
|
1832
1943
|
const SEGMENTED_CONTROL_ITEM_KEY = "9a7ba0d4c041ddbce84ee48881788434fd6bccc8";
|
|
1833
1944
|
const createSegmentedControlItemHandler = (_ctx)=>defineComponentHandler(SEGMENTED_CONTROL_ITEM_KEY, ({ componentProperties: props })=>{
|
|
1834
1945
|
const states = props.State.value.split("-");
|
|
@@ -1838,7 +1949,7 @@ const createSegmentedControlItemHandler = (_ctx)=>defineComponentHandler(SEGMENT
|
|
|
1838
1949
|
disabled: true
|
|
1839
1950
|
}
|
|
1840
1951
|
};
|
|
1841
|
-
return
|
|
1952
|
+
return createLocalSnippetElement$6("SegmentedControlItem", commonProps, props["Label#11366:15"].value);
|
|
1842
1953
|
});
|
|
1843
1954
|
const createSegmentedControlHandler = (ctx)=>{
|
|
1844
1955
|
const segmentedControlItemHandler = createSegmentedControlItemHandler();
|
|
@@ -1854,19 +1965,15 @@ const createSegmentedControlHandler = (ctx)=>{
|
|
|
1854
1965
|
defaultValue: selectedSegment.componentProperties["Label#11366:15"].value
|
|
1855
1966
|
}
|
|
1856
1967
|
};
|
|
1857
|
-
return
|
|
1968
|
+
return createLocalSnippetElement$6("SegmentedControl", commonProps, segmentedControlChildren, {
|
|
1969
|
+
comment: "aria-label이나 aria-labelledby 중 하나를 제공해야 합니다."
|
|
1970
|
+
});
|
|
1858
1971
|
});
|
|
1859
1972
|
};
|
|
1860
1973
|
|
|
1974
|
+
const { createLocalSnippetElement: createLocalSnippetElement$5 } = createLocalSnippetHelper("select-box");
|
|
1861
1975
|
const createSelectBoxHandler = (_ctx)=>defineComponentHandler(metadata$8.key, ({ componentProperties: props })=>{
|
|
1862
|
-
const tag = (()=>
|
|
1863
|
-
switch(props.Control.value){
|
|
1864
|
-
case "Checkbox":
|
|
1865
|
-
return "CheckSelectBox";
|
|
1866
|
-
case "Radio":
|
|
1867
|
-
return "RadioSelectBox";
|
|
1868
|
-
}
|
|
1869
|
-
})();
|
|
1976
|
+
const tag = match(props.Control.value).with("Checkbox", ()=>"CheckSelectBox").with("Radio", ()=>"RadioSelectBox").exhaustive();
|
|
1870
1977
|
const states = props.State.value.split("-");
|
|
1871
1978
|
const commonProps = {
|
|
1872
1979
|
label: props["Label#3635:0"].value,
|
|
@@ -1880,26 +1987,19 @@ const createSelectBoxHandler = (_ctx)=>defineComponentHandler(metadata$8.key, ({
|
|
|
1880
1987
|
defaultChecked: true
|
|
1881
1988
|
}
|
|
1882
1989
|
};
|
|
1883
|
-
return
|
|
1990
|
+
return createLocalSnippetElement$5(tag, commonProps);
|
|
1884
1991
|
});
|
|
1885
1992
|
const createSelectBoxGroupHandler = (ctx)=>{
|
|
1886
1993
|
const selectBoxHandler = createSelectBoxHandler();
|
|
1887
1994
|
return defineComponentHandler(metadata$v.key, (node)=>{
|
|
1888
1995
|
const props = node.componentProperties;
|
|
1889
|
-
const tag = (()=>
|
|
1890
|
-
switch(props.Control.value){
|
|
1891
|
-
case "Checkbox":
|
|
1892
|
-
return "CheckSelectBoxGroup";
|
|
1893
|
-
case "Radio":
|
|
1894
|
-
return "RadioSelectBoxGroup";
|
|
1895
|
-
}
|
|
1896
|
-
})();
|
|
1996
|
+
const tag = match(props.Control.value).with("Checkbox", ()=>"CheckSelectBoxGroup").with("Radio", ()=>"RadioSelectBoxGroup").exhaustive();
|
|
1897
1997
|
const selectBoxes = findAllInstances({
|
|
1898
1998
|
node,
|
|
1899
1999
|
key: selectBoxHandler.key
|
|
1900
2000
|
});
|
|
1901
2001
|
const selectedSelectBox = selectBoxes.find((selectBox)=>selectBox.componentProperties.State.value.split("-").includes("Selected"));
|
|
1902
|
-
const stack =
|
|
2002
|
+
const stack = createSeedReactElement("Stack", {
|
|
1903
2003
|
gap: "spacingY.componentDefault"
|
|
1904
2004
|
}, selectBoxes.map(selectBoxHandler.transform));
|
|
1905
2005
|
const commonProps = {
|
|
@@ -1907,7 +2007,7 @@ const createSelectBoxGroupHandler = (ctx)=>{
|
|
|
1907
2007
|
defaultValue: selectedSelectBox?.componentProperties["Label#3635:0"].value
|
|
1908
2008
|
}
|
|
1909
2009
|
};
|
|
1910
|
-
return
|
|
2010
|
+
return createLocalSnippetElement$5(tag, commonProps, stack);
|
|
1911
2011
|
});
|
|
1912
2012
|
};
|
|
1913
2013
|
|
|
@@ -1918,9 +2018,10 @@ const createSkeletonHandler = (ctx)=>defineComponentHandler(metadata$7.key, (nod
|
|
|
1918
2018
|
width: match(layoutSizingHorizontal).with("FIXED", ()=>ctx.valueResolver.getFormattedValue.width(node)).with("FILL", ()=>"full").otherwise(()=>"full"),
|
|
1919
2019
|
height: match(layoutSizingVertical).with("FIXED", ()=>ctx.valueResolver.getFormattedValue.height(node)).with("FILL", ()=>"full").otherwise(()=>"full")
|
|
1920
2020
|
};
|
|
1921
|
-
return
|
|
2021
|
+
return createSeedReactElement("Skeleton", commonProps);
|
|
1922
2022
|
});
|
|
1923
2023
|
|
|
2024
|
+
const { createLocalSnippetElement: createLocalSnippetElement$4 } = createLocalSnippetHelper("snackbar");
|
|
1924
2025
|
const createSnackbarHandler = (_ctx)=>defineComponentHandler(metadata$6.key, ({ componentProperties: props })=>{
|
|
1925
2026
|
const commonProps = {
|
|
1926
2027
|
message: props["Message#1528:4"].value,
|
|
@@ -1930,9 +2031,10 @@ const createSnackbarHandler = (_ctx)=>defineComponentHandler(metadata$6.key, ({
|
|
|
1930
2031
|
}
|
|
1931
2032
|
};
|
|
1932
2033
|
// TODO: adapter.create({ render })
|
|
1933
|
-
return
|
|
2034
|
+
return createLocalSnippetElement$4("Snackbar", commonProps);
|
|
1934
2035
|
});
|
|
1935
2036
|
|
|
2037
|
+
const { createLocalSnippetElement: createLocalSnippetElement$3 } = createLocalSnippetHelper("switch");
|
|
1936
2038
|
const createSwitchHandler = (_ctx)=>defineComponentHandler(metadata$4.key, ({ componentProperties: props })=>{
|
|
1937
2039
|
const states = props.State.value.split("-");
|
|
1938
2040
|
const size = handleSizeProp(props.Size.value);
|
|
@@ -1948,9 +2050,10 @@ const createSwitchHandler = (_ctx)=>defineComponentHandler(metadata$4.key, ({ co
|
|
|
1948
2050
|
disabled: true
|
|
1949
2051
|
}
|
|
1950
2052
|
};
|
|
1951
|
-
return
|
|
2053
|
+
return createLocalSnippetElement$3("Switch", commonProps);
|
|
1952
2054
|
});
|
|
1953
2055
|
|
|
2056
|
+
const { createLocalSnippetElement: createLocalSnippetElement$2 } = createLocalSnippetHelper("tabs");
|
|
1954
2057
|
const TABS_HUG_ITEM_KEY = "c242492543b327ceb84fa9933841512fc62a898c";
|
|
1955
2058
|
const createTabsHugItemHandler = (_ctx)=>defineComponentHandler(TABS_HUG_ITEM_KEY, ({ componentProperties: props })=>{
|
|
1956
2059
|
const states = props.State.value.split("-");
|
|
@@ -1963,7 +2066,7 @@ const createTabsHugItemHandler = (_ctx)=>defineComponentHandler(TABS_HUG_ITEM_KE
|
|
|
1963
2066
|
disabled: true
|
|
1964
2067
|
}
|
|
1965
2068
|
};
|
|
1966
|
-
return
|
|
2069
|
+
return createLocalSnippetElement$2("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
1967
2070
|
});
|
|
1968
2071
|
const TABS_FILL_ITEM_KEY = "7275293344efb40ee9a3f5248ba2659b94a0b305";
|
|
1969
2072
|
const createTabsFillItemHandler = (_ctx)=>defineComponentHandler(TABS_FILL_ITEM_KEY, ({ componentProperties: props })=>{
|
|
@@ -1977,7 +2080,7 @@ const createTabsFillItemHandler = (_ctx)=>defineComponentHandler(TABS_FILL_ITEM_
|
|
|
1977
2080
|
disabled: true
|
|
1978
2081
|
}
|
|
1979
2082
|
};
|
|
1980
|
-
return
|
|
2083
|
+
return createLocalSnippetElement$2("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
1981
2084
|
});
|
|
1982
2085
|
const createTabsHandler = (ctx)=>{
|
|
1983
2086
|
const tabsHugItemHandler = createTabsHugItemHandler();
|
|
@@ -1999,7 +2102,7 @@ const createTabsHandler = (ctx)=>{
|
|
|
1999
2102
|
});
|
|
2000
2103
|
const tabsItems = mappedItems.filter((item)=>item !== null);
|
|
2001
2104
|
const selectedTabsItem = tabsItems.find(({ node: { componentProperties } })=>componentProperties.State.value.split("-").includes("Selected"))?.node;
|
|
2002
|
-
const tabTriggerList =
|
|
2105
|
+
const tabTriggerList = createLocalSnippetElement$2("TabsList", undefined, tabsItems.map(({ triggerLayout, node })=>{
|
|
2003
2106
|
switch(triggerLayout){
|
|
2004
2107
|
case "hug":
|
|
2005
2108
|
return tabsHugItemHandler.transform(node);
|
|
@@ -2009,7 +2112,7 @@ const createTabsHandler = (ctx)=>{
|
|
|
2009
2112
|
}));
|
|
2010
2113
|
const tabContents = tabsItems.map(({ node })=>{
|
|
2011
2114
|
const value = node.componentProperties["Label#4478:2"].value;
|
|
2012
|
-
return
|
|
2115
|
+
return createLocalSnippetElement$2("TabsContent", {
|
|
2013
2116
|
value
|
|
2014
2117
|
}, "{/* TODO: 컨텐츠 추가 */}");
|
|
2015
2118
|
});
|
|
@@ -2020,7 +2123,7 @@ const createTabsHandler = (ctx)=>{
|
|
|
2020
2123
|
defaultValue: selectedTabsItem.componentProperties["Label#4478:2"].value
|
|
2021
2124
|
}
|
|
2022
2125
|
};
|
|
2023
|
-
return
|
|
2126
|
+
return createLocalSnippetElement$2("TabsRoot", commonProps, [
|
|
2024
2127
|
tabTriggerList,
|
|
2025
2128
|
...tabContents
|
|
2026
2129
|
]);
|
|
@@ -2051,9 +2154,10 @@ const createTextButtonHandler = (ctx)=>defineComponentHandler(metadata$2.key, (n
|
|
|
2051
2154
|
disabled: true
|
|
2052
2155
|
}
|
|
2053
2156
|
};
|
|
2054
|
-
return
|
|
2157
|
+
return createSeedReactElement("TextButton", commonProps, children);
|
|
2055
2158
|
});
|
|
2056
2159
|
|
|
2160
|
+
const { createLocalSnippetElement: createLocalSnippetElement$1 } = createLocalSnippetHelper("text-field");
|
|
2057
2161
|
const createTextFieldHandler = (ctx)=>defineComponentHandler(metadata$1.key, ({ componentProperties: props })=>{
|
|
2058
2162
|
const { Size: { value: size }, State: { value: state }, Filled: { value: filled }, "Show Header#870:0": { value: showHeader }, "Label#14964:0": { value: label }, "Show Indicator#1259:0": { value: showIndicator }, "Indicator#15327:249": { value: indicator }, "Show Prefix#958:125": { value: showPrefix }, "Show Prefix Icon#1267:50": { value: showPrefixIcon }, "Prefix Icon#1267:25": prefixIcon, "Show Prefix Text#1267:0": { value: showPrefixText }, "Prefix Text#15327:101": { value: prefix }, "Placeholder#958:0": { value: placeholder }, "Filled Text#1304:0": { value: defaultValue }, "Show Suffix#958:100": { value: showSuffix }, "Show Suffix Icon#1267:75": { value: showSuffixIcon }, "Suffix Icon #1267:100": suffixIcon, "Show Suffix Text#1267:125": { value: showSuffixText }, "Suffix Text#15327:138": { value: suffix }, "Show Footer#958:25": { value: showFooter }, "Show Description#958:50": { value: showDescription }, "Description#12626:5": { value: description }, "Show Character Count#958:75": { value: showCharacterCount }, "Character Count#15327:64": { value: _characterCount }, "Max Character Count#15327:27": { value: maxCharacterCount } } = props;
|
|
2059
2163
|
const states = state.split("-");
|
|
@@ -2108,10 +2212,11 @@ const createTextFieldHandler = (ctx)=>defineComponentHandler(metadata$1.key, ({
|
|
|
2108
2212
|
const inputProps = {
|
|
2109
2213
|
placeholder
|
|
2110
2214
|
};
|
|
2111
|
-
const TextFieldChildren =
|
|
2112
|
-
return
|
|
2215
|
+
const TextFieldChildren = createLocalSnippetElement$1("TextFieldInput", inputProps);
|
|
2216
|
+
return createLocalSnippetElement$1("TextField", commonProps, TextFieldChildren);
|
|
2113
2217
|
});
|
|
2114
2218
|
|
|
2219
|
+
const { createLocalSnippetElement } = createLocalSnippetHelper("toggle-button");
|
|
2115
2220
|
const createToggleButtonHandler = (ctx)=>defineComponentHandler(metadata.key, ({ componentProperties: props })=>{
|
|
2116
2221
|
const states = props.State.value.split("-");
|
|
2117
2222
|
const commonProps = {
|
|
@@ -2127,12 +2232,12 @@ const createToggleButtonHandler = (ctx)=>defineComponentHandler(metadata.key, ({
|
|
|
2127
2232
|
loading: true
|
|
2128
2233
|
}
|
|
2129
2234
|
};
|
|
2130
|
-
return
|
|
2131
|
-
props["Show Prefix Icon#6122:392"].value ?
|
|
2235
|
+
return createLocalSnippetElement("ToggleButton", commonProps, [
|
|
2236
|
+
props["Show Prefix Icon#6122:392"].value ? createSeedReactElement("PrefixIcon", {
|
|
2132
2237
|
svg: ctx.iconHandler.transform(props["Prefix Icon#6122:98"])
|
|
2133
2238
|
}) : undefined,
|
|
2134
2239
|
props["Label#6122:49"].value,
|
|
2135
|
-
props["Show Suffix Icon#6122:147"].value ?
|
|
2240
|
+
props["Show Suffix Icon#6122:147"].value ? createSeedReactElement("SuffixIcon", {
|
|
2136
2241
|
svg: ctx.iconHandler.transform(props["Suffix Icon#6122:343"])
|
|
2137
2242
|
}) : undefined
|
|
2138
2243
|
]);
|
|
@@ -12067,12 +12172,15 @@ function createIconHandler({ iconService, iconNameFormatter = defaultIconNameFor
|
|
|
12067
12172
|
if (!iconData) {
|
|
12068
12173
|
return createElement("UnknownIcon");
|
|
12069
12174
|
}
|
|
12070
|
-
const { name, weight } = iconData;
|
|
12175
|
+
const { name, weight, type } = iconData;
|
|
12071
12176
|
const tagName = iconNameFormatter({
|
|
12072
12177
|
name,
|
|
12073
12178
|
weight
|
|
12074
12179
|
});
|
|
12075
|
-
|
|
12180
|
+
if (type === "multicolor") {
|
|
12181
|
+
return createMulticolorIconElement(tagName);
|
|
12182
|
+
}
|
|
12183
|
+
return createMonochromeIconElement(tagName);
|
|
12076
12184
|
}
|
|
12077
12185
|
return {
|
|
12078
12186
|
isIconInstance,
|