@seed-design/figma 1.3.4 → 1.3.6
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 +40 -1
- package/lib/codegen/index.d.ts.map +1 -1
- package/lib/codegen/index.js +41 -2
- package/lib/codegen/targets/react/index.cjs +48 -14
- package/lib/codegen/targets/react/index.d.ts.map +1 -1
- package/lib/codegen/targets/react/index.js +48 -14
- package/lib/index.cjs +39 -0
- package/lib/index.js +39 -0
- package/package.json +2 -2
- package/src/codegen/component-properties.ts +4 -0
- package/src/codegen/core/codegen.ts +5 -2
- package/src/codegen/targets/react/component/handlers/avatar.ts +5 -5
- package/src/codegen/targets/react/component/handlers/bottom-sheet.ts +1 -2
- package/src/codegen/targets/react/component/handlers/identity-placeholder.ts +4 -13
- package/src/codegen/targets/react/component/handlers/menu-sheet.ts +1 -1
- package/src/codegen/targets/react/component/handlers/tabs.ts +7 -3
- package/src/entities/data/__generated__/component-sets/index.d.ts +15 -1
- package/src/entities/data/__generated__/component-sets/index.mjs +15 -1
- package/src/entities/data/__generated__/components/index.d.ts +1 -1
- package/src/entities/data/__generated__/components/index.mjs +1 -1
- package/src/entities/data/__generated__/variable-collections/index.mjs +1 -0
- package/src/entities/data/__generated__/variables/index.mjs +24 -0
|
@@ -467,7 +467,7 @@ function createCodeGenerator({ frameTransformer, textTransformer, rectangleTrans
|
|
|
467
467
|
type: "BOOLEAN_OPERATION"
|
|
468
468
|
}, (node)=>booleanOperationTransformer(node, traverse)).with({
|
|
469
469
|
type: "UNHANDLED"
|
|
470
|
-
}, ()=>createElement(
|
|
470
|
+
}, (node)=>createElement(`Unhandled${pascalCase(node.original.type)}Node`)).exhaustive();
|
|
471
471
|
if (result) {
|
|
472
472
|
return appendSource(result, node.id);
|
|
473
473
|
}
|
|
@@ -3464,9 +3464,9 @@ const createAppBarHandler$1 = (ctx)=>{
|
|
|
3464
3464
|
});
|
|
3465
3465
|
};
|
|
3466
3466
|
|
|
3467
|
-
const IDENTITY_PLACEHOLDER_KEY
|
|
3467
|
+
const IDENTITY_PLACEHOLDER_KEY = "b3563b6f16ba4cfe4240c9b33eef7edad4c304eb";
|
|
3468
3468
|
const { createLocalSnippetElement: createLocalSnippetElement$15 } = createLocalSnippetHelper("identity-placeholder");
|
|
3469
|
-
const createIdentityPlaceholderHandler$1 = (_ctx)=>defineComponentHandler(IDENTITY_PLACEHOLDER_KEY
|
|
3469
|
+
const createIdentityPlaceholderHandler$1 = (_ctx)=>defineComponentHandler(IDENTITY_PLACEHOLDER_KEY, ({ componentProperties: props })=>{
|
|
3470
3470
|
const commonProps = {
|
|
3471
3471
|
identity: camelCase(props.Identity.value)
|
|
3472
3472
|
};
|
|
@@ -5525,6 +5525,19 @@ const privateComponentFieldHeaderSuffix = {
|
|
|
5525
5525
|
}
|
|
5526
5526
|
}
|
|
5527
5527
|
};
|
|
5528
|
+
const privateComponentIdentityPlaceholder = {
|
|
5529
|
+
"name": "privateComponentIdentityPlaceholder",
|
|
5530
|
+
"key": "7d7ae18cabac6ebad19934516de8e7e256854eba",
|
|
5531
|
+
"componentPropertyDefinitions": {
|
|
5532
|
+
"Identity": {
|
|
5533
|
+
"type": "VARIANT",
|
|
5534
|
+
"variantOptions": [
|
|
5535
|
+
"Person",
|
|
5536
|
+
"Business"
|
|
5537
|
+
]
|
|
5538
|
+
}
|
|
5539
|
+
}
|
|
5540
|
+
};
|
|
5528
5541
|
const privateComponentInputButtonPrefix = {
|
|
5529
5542
|
"name": "privateComponentInputButtonPrefix",
|
|
5530
5543
|
"key": "c7d12be4056a8171f6857ec4ef15d81bd18d8cae",
|
|
@@ -9497,6 +9510,7 @@ var FIGMA_COMPONENTS = {
|
|
|
9497
9510
|
privateComponentFieldFooterCharacterCount: privateComponentFieldFooterCharacterCount,
|
|
9498
9511
|
privateComponentFieldHeaderIndicator: privateComponentFieldHeaderIndicator,
|
|
9499
9512
|
privateComponentFieldHeaderSuffix: privateComponentFieldHeaderSuffix,
|
|
9513
|
+
privateComponentIdentityPlaceholder: privateComponentIdentityPlaceholder,
|
|
9500
9514
|
privateComponentInputButtonPrefix: privateComponentInputButtonPrefix,
|
|
9501
9515
|
privateComponentInputButtonSuffix: privateComponentInputButtonSuffix,
|
|
9502
9516
|
privateComponentInputButtonValue: privateComponentInputButtonValue,
|
|
@@ -9747,9 +9761,6 @@ const privateTemplateSelectField = {
|
|
|
9747
9761
|
const privateTemplateTimePickerField = {
|
|
9748
9762
|
"key": "e38df17cf1e0f96e09774b015739dfde30d46115"
|
|
9749
9763
|
};
|
|
9750
|
-
const privateComponentBottomSheetContentsPlaceholder = {
|
|
9751
|
-
"key": "e68b006d572300d3c987776192c8ab387fa45e05"
|
|
9752
|
-
};
|
|
9753
9764
|
const privateComponentTopNavigationLeftIconButton = {
|
|
9754
9765
|
"key": "c3e708bab11d8ea90a909b4539b6ba6b2a4e7b9c"};
|
|
9755
9766
|
const componentChipSuffixIcon = {
|
|
@@ -9911,10 +9922,8 @@ const createAppBarPresetHandler = (ctx)=>{
|
|
|
9911
9922
|
});
|
|
9912
9923
|
};
|
|
9913
9924
|
|
|
9914
|
-
// hardcoded since this lives in a different figma file
|
|
9915
|
-
const IDENTITY_PLACEHOLDER_KEY = "b3563b6f16ba4cfe4240c9b33eef7edad4c304eb";
|
|
9916
9925
|
const { createLocalSnippetElement: createLocalSnippetElement$x } = createLocalSnippetHelper("identity-placeholder");
|
|
9917
|
-
const createIdentityPlaceholderHandler = (_ctx)=>defineComponentHandler(
|
|
9926
|
+
const createIdentityPlaceholderHandler = (_ctx)=>defineComponentHandler(privateComponentIdentityPlaceholder.key, ({ componentProperties: props })=>{
|
|
9918
9927
|
const commonProps = {
|
|
9919
9928
|
identity: camelCase(props.Identity.value)
|
|
9920
9929
|
};
|
|
@@ -9997,7 +10006,7 @@ const createBottomSheetHandler = (_ctx)=>defineComponentHandler(componentBottomS
|
|
|
9997
10006
|
};
|
|
9998
10007
|
const bodyNodes = findAllInstances({
|
|
9999
10008
|
node,
|
|
10000
|
-
key:
|
|
10009
|
+
key: props["Contents#25320:0"].componentKey
|
|
10001
10010
|
});
|
|
10002
10011
|
const bottomSheetBody = bodyNodes.length === 1 ? createLocalSnippetElement$u("BottomSheetBody", {}, bodyNodes[0].children.map(traverse)) : createLocalSnippetElement$u("BottomSheetBody", {}, createElement("div", undefined, "No content available"));
|
|
10003
10012
|
const footerNodes = findAllInstances({
|
|
@@ -10968,7 +10977,7 @@ const createMenuSheetHandler = (ctx)=>{
|
|
|
10968
10977
|
const trigger = createLocalSnippetElement$f("MenuSheetTrigger", {
|
|
10969
10978
|
asChild: true
|
|
10970
10979
|
}, createLocalSnippetElementTrigger("ActionButton", {}, "MenuSheet 열기"));
|
|
10971
|
-
return createLocalSnippetElement$f("
|
|
10980
|
+
return createLocalSnippetElement$f("MenuSheetRoot", undefined, [
|
|
10972
10981
|
trigger,
|
|
10973
10982
|
content
|
|
10974
10983
|
]);
|
|
@@ -11713,7 +11722,7 @@ const createLineTriggerHugHandler = (_ctx)=>defineComponentHandler(privateCompon
|
|
|
11713
11722
|
notification: true
|
|
11714
11723
|
}
|
|
11715
11724
|
};
|
|
11716
|
-
return createTabsLocalSnippetElement("TabsTrigger", commonProps);
|
|
11725
|
+
return createTabsLocalSnippetElement("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
11717
11726
|
});
|
|
11718
11727
|
const createLineTriggerFillHandler = (_ctx)=>defineComponentHandler(privateComponentTabItemLineFill.key, ({ componentProperties: props })=>{
|
|
11719
11728
|
const commonProps = {
|
|
@@ -11725,7 +11734,7 @@ const createLineTriggerFillHandler = (_ctx)=>defineComponentHandler(privateCompo
|
|
|
11725
11734
|
notification: true
|
|
11726
11735
|
}
|
|
11727
11736
|
};
|
|
11728
|
-
return createTabsLocalSnippetElement("TabsTrigger", commonProps);
|
|
11737
|
+
return createTabsLocalSnippetElement("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
11729
11738
|
});
|
|
11730
11739
|
/*
|
|
11731
11740
|
<ChipTabsRoot
|
|
@@ -11813,7 +11822,7 @@ const createChipTabsTriggerHandler = (_ctx)=>defineComponentHandler(privateCompo
|
|
|
11813
11822
|
notification: true
|
|
11814
11823
|
}
|
|
11815
11824
|
};
|
|
11816
|
-
return createChipTabsLocalSnippetElement("ChipTabsTrigger", commonProps);
|
|
11825
|
+
return createChipTabsLocalSnippetElement("ChipTabsTrigger", commonProps, chipProps["Label#7185:0"].value);
|
|
11817
11826
|
});
|
|
11818
11827
|
|
|
11819
11828
|
const { createLocalSnippetElement: createLocalSnippetElement$2 } = createLocalSnippetHelper("tag-group");
|
|
@@ -24332,6 +24341,7 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
24332
24341
|
"VariableID:576:22878",
|
|
24333
24342
|
"VariableID:59176:2",
|
|
24334
24343
|
"VariableID:59176:3",
|
|
24344
|
+
"VariableID:61337:3",
|
|
24335
24345
|
"VariableID:654:20851",
|
|
24336
24346
|
"VariableID:670:2700",
|
|
24337
24347
|
"VariableID:6782:76317",
|
|
@@ -31165,6 +31175,30 @@ const FIGMA_VARIABLES = {
|
|
|
31165
31175
|
],
|
|
31166
31176
|
"codeSyntax": {}
|
|
31167
31177
|
},
|
|
31178
|
+
"VariableID:61337:3": {
|
|
31179
|
+
"name": "stroke/focus-ring",
|
|
31180
|
+
"id": "VariableID:61337:3",
|
|
31181
|
+
"remote": false,
|
|
31182
|
+
"key": "ca937a0bb83fda59d06959cfb5d960f00b5e9add",
|
|
31183
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
31184
|
+
"resolvedType": "COLOR",
|
|
31185
|
+
"description": "",
|
|
31186
|
+
"hiddenFromPublishing": false,
|
|
31187
|
+
"valuesByMode": {
|
|
31188
|
+
"1928:7": {
|
|
31189
|
+
"type": "VARIABLE_ALIAS",
|
|
31190
|
+
"id": "VariableID:1883:92938"
|
|
31191
|
+
},
|
|
31192
|
+
"1928:8": {
|
|
31193
|
+
"type": "VARIABLE_ALIAS",
|
|
31194
|
+
"id": "VariableID:1883:92938"
|
|
31195
|
+
}
|
|
31196
|
+
},
|
|
31197
|
+
"scopes": [
|
|
31198
|
+
"ALL_SCOPES"
|
|
31199
|
+
],
|
|
31200
|
+
"codeSyntax": {}
|
|
31201
|
+
},
|
|
31168
31202
|
"VariableID:41338:806": {
|
|
31169
31203
|
"name": "stroke/informative-solid",
|
|
31170
31204
|
"id": "VariableID:41338:806",
|
package/lib/index.cjs
CHANGED
|
@@ -15217,6 +15217,7 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
15217
15217
|
"VariableID:576:22878",
|
|
15218
15218
|
"VariableID:59176:2",
|
|
15219
15219
|
"VariableID:59176:3",
|
|
15220
|
+
"VariableID:61337:3",
|
|
15220
15221
|
"VariableID:654:20851",
|
|
15221
15222
|
"VariableID:670:2700",
|
|
15222
15223
|
"VariableID:6782:76317",
|
|
@@ -22050,6 +22051,30 @@ const FIGMA_VARIABLES = {
|
|
|
22050
22051
|
],
|
|
22051
22052
|
"codeSyntax": {}
|
|
22052
22053
|
},
|
|
22054
|
+
"VariableID:61337:3": {
|
|
22055
|
+
"name": "stroke/focus-ring",
|
|
22056
|
+
"id": "VariableID:61337:3",
|
|
22057
|
+
"remote": false,
|
|
22058
|
+
"key": "ca937a0bb83fda59d06959cfb5d960f00b5e9add",
|
|
22059
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
22060
|
+
"resolvedType": "COLOR",
|
|
22061
|
+
"description": "",
|
|
22062
|
+
"hiddenFromPublishing": false,
|
|
22063
|
+
"valuesByMode": {
|
|
22064
|
+
"1928:7": {
|
|
22065
|
+
"type": "VARIABLE_ALIAS",
|
|
22066
|
+
"id": "VariableID:1883:92938"
|
|
22067
|
+
},
|
|
22068
|
+
"1928:8": {
|
|
22069
|
+
"type": "VARIABLE_ALIAS",
|
|
22070
|
+
"id": "VariableID:1883:92938"
|
|
22071
|
+
}
|
|
22072
|
+
},
|
|
22073
|
+
"scopes": [
|
|
22074
|
+
"ALL_SCOPES"
|
|
22075
|
+
],
|
|
22076
|
+
"codeSyntax": {}
|
|
22077
|
+
},
|
|
22053
22078
|
"VariableID:41338:806": {
|
|
22054
22079
|
"name": "stroke/informative-solid",
|
|
22055
22080
|
"id": "VariableID:41338:806",
|
|
@@ -22565,6 +22590,19 @@ const privateComponentFieldHeaderSuffix = {
|
|
|
22565
22590
|
}
|
|
22566
22591
|
}
|
|
22567
22592
|
};
|
|
22593
|
+
const privateComponentIdentityPlaceholder = {
|
|
22594
|
+
"name": "privateComponentIdentityPlaceholder",
|
|
22595
|
+
"key": "7d7ae18cabac6ebad19934516de8e7e256854eba",
|
|
22596
|
+
"componentPropertyDefinitions": {
|
|
22597
|
+
"Identity": {
|
|
22598
|
+
"type": "VARIANT",
|
|
22599
|
+
"variantOptions": [
|
|
22600
|
+
"Person",
|
|
22601
|
+
"Business"
|
|
22602
|
+
]
|
|
22603
|
+
}
|
|
22604
|
+
}
|
|
22605
|
+
};
|
|
22568
22606
|
const privateComponentInputButtonPrefix = {
|
|
22569
22607
|
"name": "privateComponentInputButtonPrefix",
|
|
22570
22608
|
"key": "c7d12be4056a8171f6857ec4ef15d81bd18d8cae",
|
|
@@ -26537,6 +26575,7 @@ var FIGMA_COMPONENTS = {
|
|
|
26537
26575
|
privateComponentFieldFooterCharacterCount: privateComponentFieldFooterCharacterCount,
|
|
26538
26576
|
privateComponentFieldHeaderIndicator: privateComponentFieldHeaderIndicator,
|
|
26539
26577
|
privateComponentFieldHeaderSuffix: privateComponentFieldHeaderSuffix,
|
|
26578
|
+
privateComponentIdentityPlaceholder: privateComponentIdentityPlaceholder,
|
|
26540
26579
|
privateComponentInputButtonPrefix: privateComponentInputButtonPrefix,
|
|
26541
26580
|
privateComponentInputButtonSuffix: privateComponentInputButtonSuffix,
|
|
26542
26581
|
privateComponentInputButtonValue: privateComponentInputButtonValue,
|
package/lib/index.js
CHANGED
|
@@ -15217,6 +15217,7 @@ const FIGMA_VARIABLE_COLLECTIONS = {
|
|
|
15217
15217
|
"VariableID:576:22878",
|
|
15218
15218
|
"VariableID:59176:2",
|
|
15219
15219
|
"VariableID:59176:3",
|
|
15220
|
+
"VariableID:61337:3",
|
|
15220
15221
|
"VariableID:654:20851",
|
|
15221
15222
|
"VariableID:670:2700",
|
|
15222
15223
|
"VariableID:6782:76317",
|
|
@@ -22050,6 +22051,30 @@ const FIGMA_VARIABLES = {
|
|
|
22050
22051
|
],
|
|
22051
22052
|
"codeSyntax": {}
|
|
22052
22053
|
},
|
|
22054
|
+
"VariableID:61337:3": {
|
|
22055
|
+
"name": "stroke/focus-ring",
|
|
22056
|
+
"id": "VariableID:61337:3",
|
|
22057
|
+
"remote": false,
|
|
22058
|
+
"key": "ca937a0bb83fda59d06959cfb5d960f00b5e9add",
|
|
22059
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
22060
|
+
"resolvedType": "COLOR",
|
|
22061
|
+
"description": "",
|
|
22062
|
+
"hiddenFromPublishing": false,
|
|
22063
|
+
"valuesByMode": {
|
|
22064
|
+
"1928:7": {
|
|
22065
|
+
"type": "VARIABLE_ALIAS",
|
|
22066
|
+
"id": "VariableID:1883:92938"
|
|
22067
|
+
},
|
|
22068
|
+
"1928:8": {
|
|
22069
|
+
"type": "VARIABLE_ALIAS",
|
|
22070
|
+
"id": "VariableID:1883:92938"
|
|
22071
|
+
}
|
|
22072
|
+
},
|
|
22073
|
+
"scopes": [
|
|
22074
|
+
"ALL_SCOPES"
|
|
22075
|
+
],
|
|
22076
|
+
"codeSyntax": {}
|
|
22077
|
+
},
|
|
22053
22078
|
"VariableID:41338:806": {
|
|
22054
22079
|
"name": "stroke/informative-solid",
|
|
22055
22080
|
"id": "VariableID:41338:806",
|
|
@@ -22565,6 +22590,19 @@ const privateComponentFieldHeaderSuffix = {
|
|
|
22565
22590
|
}
|
|
22566
22591
|
}
|
|
22567
22592
|
};
|
|
22593
|
+
const privateComponentIdentityPlaceholder = {
|
|
22594
|
+
"name": "privateComponentIdentityPlaceholder",
|
|
22595
|
+
"key": "7d7ae18cabac6ebad19934516de8e7e256854eba",
|
|
22596
|
+
"componentPropertyDefinitions": {
|
|
22597
|
+
"Identity": {
|
|
22598
|
+
"type": "VARIANT",
|
|
22599
|
+
"variantOptions": [
|
|
22600
|
+
"Person",
|
|
22601
|
+
"Business"
|
|
22602
|
+
]
|
|
22603
|
+
}
|
|
22604
|
+
}
|
|
22605
|
+
};
|
|
22568
22606
|
const privateComponentInputButtonPrefix = {
|
|
22569
22607
|
"name": "privateComponentInputButtonPrefix",
|
|
22570
22608
|
"key": "c7d12be4056a8171f6857ec4ef15d81bd18d8cae",
|
|
@@ -26537,6 +26575,7 @@ var FIGMA_COMPONENTS = {
|
|
|
26537
26575
|
privateComponentFieldFooterCharacterCount: privateComponentFieldFooterCharacterCount,
|
|
26538
26576
|
privateComponentFieldHeaderIndicator: privateComponentFieldHeaderIndicator,
|
|
26539
26577
|
privateComponentFieldHeaderSuffix: privateComponentFieldHeaderSuffix,
|
|
26578
|
+
privateComponentIdentityPlaceholder: privateComponentIdentityPlaceholder,
|
|
26540
26579
|
privateComponentInputButtonPrefix: privateComponentInputButtonPrefix,
|
|
26541
26580
|
privateComponentInputButtonSuffix: privateComponentInputButtonSuffix,
|
|
26542
26581
|
privateComponentInputButtonValue: privateComponentInputButtonValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/figma",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"sync-entities": "find src/entities/data/__generated__ -mindepth 1 -maxdepth 1 ! -name 'archive' -exec rm -rf {} + 2>/dev/null; bun figma-extractor src/entities/data/__generated__"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@seed-design/css": "1.2.
|
|
42
|
+
"@seed-design/css": "1.2.5",
|
|
43
43
|
"change-case": "^5.4.4",
|
|
44
44
|
"ts-pattern": "^5.7.0"
|
|
45
45
|
},
|
|
@@ -110,6 +110,10 @@ export type HelpBubbleProperties = InferComponentDefinition<
|
|
|
110
110
|
typeof sets.componentHelpBubble.componentPropertyDefinitions
|
|
111
111
|
>;
|
|
112
112
|
|
|
113
|
+
export type IdentityPlaceholderProperties = InferComponentDefinition<
|
|
114
|
+
typeof sets.privateComponentIdentityPlaceholder.componentPropertyDefinitions
|
|
115
|
+
>;
|
|
116
|
+
|
|
113
117
|
export type ImageFrameProperties = InferComponentDefinition<
|
|
114
118
|
typeof sets.componentImageFrame.componentPropertyDefinitions
|
|
115
119
|
>;
|
|
@@ -12,6 +12,7 @@ import { match } from "ts-pattern";
|
|
|
12
12
|
import { appendSource, createElement, stringifyElement, type ElementNode } from "../core/jsx";
|
|
13
13
|
import type { ElementTransformer } from "./element-transformer";
|
|
14
14
|
import { applyInferredLayout, inferLayout } from "./infer-layout";
|
|
15
|
+
import { pascalCase } from "change-case";
|
|
15
16
|
|
|
16
17
|
export interface CodeGeneratorDeps {
|
|
17
18
|
frameTransformer: ElementTransformer<
|
|
@@ -77,7 +78,9 @@ export function createCodeGenerator({
|
|
|
77
78
|
.with({ type: "INSTANCE" }, (node) => instanceTransformer(node, traverse))
|
|
78
79
|
.with({ type: "VECTOR" }, (node) => vectorTransformer(node, traverse))
|
|
79
80
|
.with({ type: "BOOLEAN_OPERATION" }, (node) => booleanOperationTransformer(node, traverse))
|
|
80
|
-
.with({ type: "UNHANDLED" }, () =>
|
|
81
|
+
.with({ type: "UNHANDLED" }, (node) =>
|
|
82
|
+
createElement(`Unhandled${pascalCase(node.original.type)}Node`),
|
|
83
|
+
)
|
|
81
84
|
.exhaustive();
|
|
82
85
|
|
|
83
86
|
if (result) {
|
|
@@ -94,7 +97,7 @@ export function createCodeGenerator({
|
|
|
94
97
|
function generateCode(node: NormalizedSceneNode, options: { shouldPrintSource: boolean }) {
|
|
95
98
|
if (isSkippedInstance(node)) {
|
|
96
99
|
return { imports: "", jsx: "// This component is intentionally excluded from codegen" };
|
|
97
|
-
|
|
100
|
+
}
|
|
98
101
|
|
|
99
102
|
const jsxTree = generateJsxTree(node);
|
|
100
103
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AvatarProperties,
|
|
3
|
+
IdentityPlaceholderProperties,
|
|
4
|
+
} from "@/codegen/component-properties";
|
|
2
5
|
import { createElement, defineComponentHandler } from "@/codegen/core";
|
|
3
6
|
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
4
7
|
import { findAllInstances } from "@/utils/figma-node";
|
|
5
8
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
6
9
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
7
|
-
import {
|
|
8
|
-
createIdentityPlaceholderHandler,
|
|
9
|
-
type IdentityPlaceholderProperties,
|
|
10
|
-
} from "./identity-placeholder";
|
|
10
|
+
import { createIdentityPlaceholderHandler } from "./identity-placeholder";
|
|
11
11
|
import { camelCase } from "change-case";
|
|
12
12
|
|
|
13
13
|
const { createLocalSnippetElement } = createLocalSnippetHelper("avatar");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BottomSheetProperties } from "@/codegen/component-properties";
|
|
2
2
|
import { createElement, defineComponentHandler } from "@/codegen/core";
|
|
3
3
|
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
4
|
-
import * as components from "@/entities/data/__generated__/components";
|
|
5
4
|
import { match } from "ts-pattern";
|
|
6
5
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
7
6
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
@@ -33,7 +32,7 @@ export const createBottomSheetHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
33
32
|
|
|
34
33
|
const bodyNodes = findAllInstances({
|
|
35
34
|
node,
|
|
36
|
-
key:
|
|
35
|
+
key: props["Contents#25320:0"].componentKey,
|
|
37
36
|
});
|
|
38
37
|
|
|
39
38
|
const bottomSheetBody =
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { defineComponentHandler
|
|
1
|
+
import { defineComponentHandler } from "@/codegen/core";
|
|
2
2
|
import { camelCase } from "change-case";
|
|
3
3
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
4
4
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const IDENTITY_PLACEHOLDER_KEY = "b3563b6f16ba4cfe4240c9b33eef7edad4c304eb";
|
|
8
|
-
|
|
9
|
-
export type IdentityPlaceholderProperties = InferComponentDefinition<{
|
|
10
|
-
Identity: {
|
|
11
|
-
type: "VARIANT";
|
|
12
|
-
defaultValue: "Person";
|
|
13
|
-
variantOptions: ["Person", "Business"];
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
5
|
+
import type { IdentityPlaceholderProperties } from "@/codegen/component-properties";
|
|
6
|
+
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
16
7
|
|
|
17
8
|
const { createLocalSnippetElement } = createLocalSnippetHelper("identity-placeholder");
|
|
18
9
|
|
|
19
10
|
export const createIdentityPlaceholderHandler = (_ctx: ComponentHandlerDeps) =>
|
|
20
11
|
defineComponentHandler<IdentityPlaceholderProperties>(
|
|
21
|
-
|
|
12
|
+
metadata.privateComponentIdentityPlaceholder.key,
|
|
22
13
|
({ componentProperties: props }) => {
|
|
23
14
|
const commonProps = {
|
|
24
15
|
identity: camelCase(props.Identity.value),
|
|
@@ -105,7 +105,7 @@ export const createMenuSheetHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
105
105
|
createLocalSnippetElementTrigger("ActionButton", {}, "MenuSheet 열기"),
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
return createLocalSnippetElement("
|
|
108
|
+
return createLocalSnippetElement("MenuSheetRoot", undefined, [trigger, content]);
|
|
109
109
|
},
|
|
110
110
|
);
|
|
111
111
|
};
|
|
@@ -156,7 +156,7 @@ const createLineTriggerHugHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
156
156
|
}),
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
return createTabsLocalSnippetElement("TabsTrigger", commonProps);
|
|
159
|
+
return createTabsLocalSnippetElement("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
160
160
|
},
|
|
161
161
|
);
|
|
162
162
|
|
|
@@ -174,7 +174,7 @@ const createLineTriggerFillHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
174
174
|
}),
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
return createTabsLocalSnippetElement("TabsTrigger", commonProps);
|
|
177
|
+
return createTabsLocalSnippetElement("TabsTrigger", commonProps, props["Label#4478:2"].value);
|
|
178
178
|
},
|
|
179
179
|
);
|
|
180
180
|
|
|
@@ -289,6 +289,10 @@ const createChipTabsTriggerHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
289
289
|
}),
|
|
290
290
|
};
|
|
291
291
|
|
|
292
|
-
return createChipTabsLocalSnippetElement(
|
|
292
|
+
return createChipTabsLocalSnippetElement(
|
|
293
|
+
"ChipTabsTrigger",
|
|
294
|
+
commonProps,
|
|
295
|
+
chipProps["Label#7185:0"].value,
|
|
296
|
+
);
|
|
293
297
|
},
|
|
294
298
|
);
|
|
@@ -223,6 +223,20 @@ export declare const privateComponentFieldHeaderSuffix: {
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
+
export declare const privateComponentIdentityPlaceholder: {
|
|
227
|
+
"name": "privateComponentIdentityPlaceholder",
|
|
228
|
+
"key": "7d7ae18cabac6ebad19934516de8e7e256854eba",
|
|
229
|
+
"componentPropertyDefinitions": {
|
|
230
|
+
"Identity": {
|
|
231
|
+
"type": "VARIANT",
|
|
232
|
+
"variantOptions": [
|
|
233
|
+
"Person",
|
|
234
|
+
"Business"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
226
240
|
export declare const privateComponentInputButtonPrefix: {
|
|
227
241
|
"name": "privateComponentInputButtonPrefix",
|
|
228
242
|
"key": "c7d12be4056a8171f6857ec4ef15d81bd18d8cae",
|
|
@@ -4244,4 +4258,4 @@ export declare const componentSelectBoxItemVertical: {
|
|
|
4244
4258
|
]
|
|
4245
4259
|
}
|
|
4246
4260
|
}
|
|
4247
|
-
};
|
|
4261
|
+
};
|
|
@@ -223,6 +223,20 @@ export const privateComponentFieldHeaderSuffix = {
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
+
export const privateComponentIdentityPlaceholder = {
|
|
227
|
+
"name": "privateComponentIdentityPlaceholder",
|
|
228
|
+
"key": "7d7ae18cabac6ebad19934516de8e7e256854eba",
|
|
229
|
+
"componentPropertyDefinitions": {
|
|
230
|
+
"Identity": {
|
|
231
|
+
"type": "VARIANT",
|
|
232
|
+
"variantOptions": [
|
|
233
|
+
"Person",
|
|
234
|
+
"Business"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
226
240
|
export const privateComponentInputButtonPrefix = {
|
|
227
241
|
"name": "privateComponentInputButtonPrefix",
|
|
228
242
|
"key": "c7d12be4056a8171f6857ec4ef15d81bd18d8cae",
|
|
@@ -4244,4 +4258,4 @@ export const componentSelectBoxItemVertical = {
|
|
|
4244
4258
|
]
|
|
4245
4259
|
}
|
|
4246
4260
|
}
|
|
4247
|
-
};
|
|
4261
|
+
};
|
|
@@ -6643,6 +6643,30 @@ export const FIGMA_VARIABLES = {
|
|
|
6643
6643
|
],
|
|
6644
6644
|
"codeSyntax": {}
|
|
6645
6645
|
},
|
|
6646
|
+
"VariableID:61337:3": {
|
|
6647
|
+
"name": "stroke/focus-ring",
|
|
6648
|
+
"id": "VariableID:61337:3",
|
|
6649
|
+
"remote": false,
|
|
6650
|
+
"key": "ca937a0bb83fda59d06959cfb5d960f00b5e9add",
|
|
6651
|
+
"variableCollectionId": "VariableCollectionId:1:3",
|
|
6652
|
+
"resolvedType": "COLOR",
|
|
6653
|
+
"description": "",
|
|
6654
|
+
"hiddenFromPublishing": false,
|
|
6655
|
+
"valuesByMode": {
|
|
6656
|
+
"1928:7": {
|
|
6657
|
+
"type": "VARIABLE_ALIAS",
|
|
6658
|
+
"id": "VariableID:1883:92938"
|
|
6659
|
+
},
|
|
6660
|
+
"1928:8": {
|
|
6661
|
+
"type": "VARIABLE_ALIAS",
|
|
6662
|
+
"id": "VariableID:1883:92938"
|
|
6663
|
+
}
|
|
6664
|
+
},
|
|
6665
|
+
"scopes": [
|
|
6666
|
+
"ALL_SCOPES"
|
|
6667
|
+
],
|
|
6668
|
+
"codeSyntax": {}
|
|
6669
|
+
},
|
|
6646
6670
|
"VariableID:41338:806": {
|
|
6647
6671
|
"name": "stroke/informative-solid",
|
|
6648
6672
|
"id": "VariableID:41338:806",
|