@seed-design/figma 0.1.8 → 0.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/lib/codegen/index.cjs +192 -141
- package/lib/codegen/index.d.ts +75 -36
- package/lib/codegen/index.d.ts.map +1 -1
- package/lib/codegen/index.js +192 -141
- package/lib/codegen/targets/react/index.cjs +301 -232
- package/lib/codegen/targets/react/index.d.ts +3 -2
- package/lib/codegen/targets/react/index.d.ts.map +1 -1
- package/lib/codegen/targets/react/index.js +301 -232
- package/lib/index.cjs +193 -141
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +193 -141
- package/package.json +2 -2
- package/src/codegen/component-properties.ts +8 -0
- package/src/codegen/targets/figma/props.ts +1 -1
- package/src/codegen/targets/react/component/handlers/avatar-stack.ts +17 -12
- package/src/codegen/targets/react/component/handlers/checkbox.ts +3 -5
- package/src/codegen/targets/react/component/handlers/chip.ts +35 -14
- package/src/codegen/targets/react/component/handlers/identity-placeholder.ts +4 -2
- package/src/codegen/targets/react/component/handlers/manner-temp.ts +1 -1
- package/src/codegen/targets/react/component/handlers/progress-circle.ts +1 -1
- package/src/codegen/targets/react/component/handlers/reaction-button.ts +3 -5
- package/src/codegen/targets/react/component/handlers/select-box.ts +6 -8
- package/src/codegen/targets/react/component/handlers/switch.ts +4 -11
- package/src/codegen/targets/react/component/handlers/toggle-button.ts +3 -5
- package/src/codegen/targets/react/instance.ts +15 -1
- package/src/codegen/targets/react/props.ts +6 -5
- package/src/entities/data/__generated__/component-sets/checkbox.d.ts +9 -7
- package/src/entities/data/__generated__/component-sets/checkbox.mjs +9 -7
- package/src/entities/data/__generated__/component-sets/checkmark.d.ts +9 -7
- package/src/entities/data/__generated__/component-sets/checkmark.mjs +9 -7
- package/src/entities/data/__generated__/component-sets/chip.d.ts +11 -7
- package/src/entities/data/__generated__/component-sets/chip.mjs +11 -7
- package/src/entities/data/__generated__/component-sets/index.d.ts +1 -0
- package/src/entities/data/__generated__/component-sets/index.mjs +1 -0
- package/src/entities/data/__generated__/component-sets/progress-circle.d.ts +1 -1
- package/src/entities/data/__generated__/component-sets/progress-circle.mjs +1 -1
- package/src/entities/data/__generated__/component-sets/radio-mark.d.ts +4 -10
- package/src/entities/data/__generated__/component-sets/radio-mark.mjs +4 -10
- package/src/entities/data/__generated__/component-sets/radio.d.ts +8 -4
- package/src/entities/data/__generated__/component-sets/radio.mjs +8 -4
- package/src/entities/data/__generated__/component-sets/reaction-button.d.ts +8 -5
- package/src/entities/data/__generated__/component-sets/reaction-button.mjs +8 -5
- package/src/entities/data/__generated__/component-sets/select-box.d.ts +8 -3
- package/src/entities/data/__generated__/component-sets/select-box.mjs +8 -3
- package/src/entities/data/__generated__/component-sets/superscript-child.d.ts +18 -0
- package/src/entities/data/__generated__/component-sets/superscript-child.mjs +18 -0
- package/src/entities/data/__generated__/component-sets/switch.d.ts +21 -7
- package/src/entities/data/__generated__/component-sets/switch.mjs +21 -7
- package/src/entities/data/__generated__/component-sets/toggle-button.d.ts +8 -5
- package/src/entities/data/__generated__/component-sets/toggle-button.mjs +8 -5
- package/src/normalizer/from-plugin.ts +1 -0
- package/src/normalizer/types.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/figma",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint:publish": "bun publint"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@seed-design/css": "0.1.
|
|
41
|
+
"@seed-design/css": "0.1.10",
|
|
42
42
|
"change-case": "^5.4.4",
|
|
43
43
|
"ts-pattern": "^5.7.0"
|
|
44
44
|
},
|
|
@@ -111,6 +111,14 @@ export type ChipProperties = InferComponentDefinition<
|
|
|
111
111
|
typeof metadata.chip.componentPropertyDefinitions
|
|
112
112
|
>;
|
|
113
113
|
|
|
114
|
+
export type ChipIconSuffixProperties = InferComponentDefinition<{
|
|
115
|
+
"Icon#33203:0": {
|
|
116
|
+
type: "INSTANCE_SWAP";
|
|
117
|
+
defaultValue: "26621:23250";
|
|
118
|
+
preferredValues: [];
|
|
119
|
+
};
|
|
120
|
+
}>;
|
|
121
|
+
|
|
114
122
|
export type ContextualFloatingButtonProperties = InferComponentDefinition<
|
|
115
123
|
typeof metadata.contextualFloatingButton.componentPropertyDefinitions
|
|
116
124
|
>;
|
|
@@ -59,7 +59,7 @@ export function createContainerLayoutPropsConverter(
|
|
|
59
59
|
props: {} as ContainerLayoutProps,
|
|
60
60
|
},
|
|
61
61
|
handlers: {
|
|
62
|
-
layoutMode: ({ layoutMode }) => layoutMode
|
|
62
|
+
layoutMode: ({ layoutMode }) => (!layoutMode || layoutMode === "GRID" ? "NONE" : layoutMode),
|
|
63
63
|
primaryAxisAlignItems: ({ primaryAxisAlignItems }) => primaryAxisAlignItems,
|
|
64
64
|
counterAxisAlignItems: ({ counterAxisAlignItems }) => counterAxisAlignItems,
|
|
65
65
|
layoutWrap: ({ layoutWrap }) => layoutWrap,
|
|
@@ -11,20 +11,25 @@ const { createLocalSnippetElement } = createLocalSnippetHelper("avatar");
|
|
|
11
11
|
export const createAvatarStackHandler = (ctx: ComponentHandlerDeps) => {
|
|
12
12
|
const avatarHandler = createAvatarHandler(ctx);
|
|
13
13
|
|
|
14
|
-
return defineComponentHandler<AvatarStackProperties>(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return defineComponentHandler<AvatarStackProperties>(
|
|
15
|
+
metadata.avatarStack.key,
|
|
16
|
+
(node, traverse) => {
|
|
17
|
+
const avatarNodes = findAllInstances<AvatarProperties>({
|
|
18
|
+
node,
|
|
19
|
+
key: avatarHandler.key,
|
|
20
|
+
});
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
const { componentProperties: props } = node;
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const commonProps = {
|
|
25
|
+
size: props.Size.value,
|
|
26
|
+
};
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const avatarStackChildren = avatarNodes.map((avatarNode) =>
|
|
29
|
+
avatarHandler.transform(avatarNode, traverse),
|
|
30
|
+
);
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
return createLocalSnippetElement("AvatarStack", commonProps, avatarStackChildren);
|
|
33
|
+
},
|
|
34
|
+
);
|
|
30
35
|
};
|
|
@@ -12,21 +12,19 @@ export const createCheckboxHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
12
12
|
defineComponentHandler<CheckboxProperties>(
|
|
13
13
|
metadata.checkbox.key,
|
|
14
14
|
({ componentProperties: props }) => {
|
|
15
|
-
const states = props.State.value.split("-");
|
|
16
|
-
|
|
17
15
|
const commonProps = {
|
|
18
16
|
label: props["Label#49990:0"].value,
|
|
19
17
|
weight: camelCase(props.Weight.value),
|
|
20
18
|
variant: camelCase(props.Shape.value),
|
|
21
19
|
size: handleSizeProp(props.Size.value),
|
|
22
|
-
...(
|
|
20
|
+
...(props.Selected.value === "True" && {
|
|
23
21
|
defaultChecked: true,
|
|
24
22
|
}),
|
|
25
|
-
...(
|
|
23
|
+
...(props.Selected.value === "Indeterminate" && {
|
|
26
24
|
defaultChecked: true,
|
|
27
25
|
indeterminate: true,
|
|
28
26
|
}),
|
|
29
|
-
...(
|
|
27
|
+
...(props.State.value === "Disabled" && {
|
|
30
28
|
disabled: true,
|
|
31
29
|
}),
|
|
32
30
|
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AvatarProperties,
|
|
3
|
+
ChipIconSuffixProperties,
|
|
4
|
+
ChipProperties,
|
|
5
|
+
} from "@/codegen/component-properties";
|
|
2
6
|
import { defineComponentHandler } from "@/codegen/core";
|
|
3
7
|
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
4
8
|
import { match } from "ts-pattern";
|
|
5
|
-
import { createLocalSnippetHelper } from "../../element-factories";
|
|
9
|
+
import { createLocalSnippetHelper, createSeedReactElement } from "../../element-factories";
|
|
6
10
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
7
11
|
import { handleSizeProp } from "../size";
|
|
8
12
|
import { camelCase } from "change-case";
|
|
@@ -11,12 +15,28 @@ import { createAvatarHandler } from "@/codegen/targets/react/component/handlers/
|
|
|
11
15
|
|
|
12
16
|
const { createLocalSnippetElement } = createLocalSnippetHelper("chip");
|
|
13
17
|
|
|
18
|
+
const CHIP_ICON_SUFFIX_KEY = "27343e0e5ab2c66948e9b10fde03d58b5e037212";
|
|
19
|
+
const createChipIconSuffixHandler = (ctx: ComponentHandlerDeps) => {
|
|
20
|
+
return defineComponentHandler<ChipIconSuffixProperties>(
|
|
21
|
+
CHIP_ICON_SUFFIX_KEY,
|
|
22
|
+
({ componentProperties }) => {
|
|
23
|
+
return createLocalSnippetElement(
|
|
24
|
+
"Chip.SuffixIcon",
|
|
25
|
+
undefined,
|
|
26
|
+
createSeedReactElement("Icon", {
|
|
27
|
+
svg: ctx.iconHandler.transform(componentProperties["Icon#33203:0"]),
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
14
34
|
export const createChipHandler = (ctx: ComponentHandlerDeps) => {
|
|
15
35
|
const avatarHandler = createAvatarHandler(ctx);
|
|
36
|
+
const iconSuffixHandler = createChipIconSuffixHandler(ctx);
|
|
16
37
|
|
|
17
38
|
return defineComponentHandler<ChipProperties>(metadata.chip.key, (node, traverse) => {
|
|
18
39
|
const props = node.componentProperties;
|
|
19
|
-
const states = props.State.value.split("-");
|
|
20
40
|
|
|
21
41
|
const prefix = match(props["Prefix Type"].value)
|
|
22
42
|
.with("None", "Image", () => undefined)
|
|
@@ -24,7 +44,9 @@ export const createChipHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
24
44
|
createLocalSnippetElement(
|
|
25
45
|
"Chip.PrefixIcon",
|
|
26
46
|
undefined,
|
|
27
|
-
|
|
47
|
+
createSeedReactElement("Icon", {
|
|
48
|
+
svg: ctx.iconHandler.transform(props["Prefix Icon#8722:0"]),
|
|
49
|
+
}),
|
|
28
50
|
),
|
|
29
51
|
)
|
|
30
52
|
.with("Avatar", () => {
|
|
@@ -39,19 +61,18 @@ export const createChipHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
39
61
|
})
|
|
40
62
|
.exhaustive();
|
|
41
63
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
: undefined;
|
|
64
|
+
const label = createLocalSnippetElement("Chip.Label", undefined, props["Label#7185:0"].value);
|
|
65
|
+
|
|
66
|
+
const [suffixIcon] = findAllInstances<ChipIconSuffixProperties>({
|
|
67
|
+
node,
|
|
68
|
+
key: CHIP_ICON_SUFFIX_KEY,
|
|
69
|
+
});
|
|
49
70
|
|
|
50
71
|
const commonProps = {
|
|
51
72
|
variant: camelCase(props.Variant.value),
|
|
52
73
|
size: handleSizeProp(props.Size.value),
|
|
53
74
|
layout: props["Label#7185:0"].value ? "withText" : "iconOnly",
|
|
54
|
-
...(
|
|
75
|
+
...(props.State.value === "Disabled" && {
|
|
55
76
|
disabled: true,
|
|
56
77
|
}),
|
|
57
78
|
};
|
|
@@ -59,8 +80,8 @@ export const createChipHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
59
80
|
return createLocalSnippetElement(
|
|
60
81
|
"Chip.Button",
|
|
61
82
|
commonProps,
|
|
62
|
-
[prefix,
|
|
63
|
-
{ comment: "목적에 따라 Chip.Toggle, Chip.RadioItem
|
|
83
|
+
[prefix, label, suffixIcon ? iconSuffixHandler.transform(suffixIcon, traverse) : undefined],
|
|
84
|
+
{ comment: "목적에 따라 Chip.Toggle, Chip.RadioItem 등으로 바꿔 사용하세요." },
|
|
64
85
|
);
|
|
65
86
|
});
|
|
66
87
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IdentityPlaceholderProperties } from "@/codegen/component-properties";
|
|
2
2
|
import { defineComponentHandler } from "@/codegen/core";
|
|
3
3
|
import { camelCase } from "change-case";
|
|
4
|
-
import {
|
|
4
|
+
import { createLocalSnippetHelper } from "../../element-factories";
|
|
5
5
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
6
6
|
|
|
7
7
|
const IDENTITY_PLACEHOLDER_KEY = "b3563b6f16ba4cfe4240c9b33eef7edad4c304eb";
|
|
8
8
|
|
|
9
|
+
const { createLocalSnippetElement } = createLocalSnippetHelper("identity-placeholder");
|
|
10
|
+
|
|
9
11
|
export const createIdentityPlaceholderHandler = (_ctx: ComponentHandlerDeps) =>
|
|
10
12
|
defineComponentHandler<IdentityPlaceholderProperties>(
|
|
11
13
|
IDENTITY_PLACEHOLDER_KEY,
|
|
@@ -14,6 +16,6 @@ export const createIdentityPlaceholderHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
14
16
|
identity: camelCase(props.Identity.value),
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
return
|
|
19
|
+
return createLocalSnippetElement("IdentityPlaceholder", commonProps);
|
|
18
20
|
},
|
|
19
21
|
);
|
|
@@ -4,7 +4,7 @@ import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
|
4
4
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
5
5
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
6
6
|
|
|
7
|
-
const { createLocalSnippetElement } = createLocalSnippetHelper("manner-temp
|
|
7
|
+
const { createLocalSnippetElement } = createLocalSnippetHelper("manner-temp");
|
|
8
8
|
|
|
9
9
|
export const createMannerTempHandler = (_ctx: ComponentHandlerDeps) =>
|
|
10
10
|
defineComponentHandler<MannerTempProperties>(metadata.mannerTemp.key, ({ children }) => {
|
|
@@ -45,7 +45,7 @@ export const createProgressCircleHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
45
45
|
minValue,
|
|
46
46
|
maxValue,
|
|
47
47
|
size: props.Size.value,
|
|
48
|
-
...(props.Tone.value !== "Custom" && {
|
|
48
|
+
...(props.Tone.value !== "Custom(inherit)" && {
|
|
49
49
|
tone: camelCase(props.Tone.value),
|
|
50
50
|
}),
|
|
51
51
|
};
|
|
@@ -11,17 +11,15 @@ export const createReactionButtonHandler = (ctx: ComponentHandlerDeps) =>
|
|
|
11
11
|
defineComponentHandler<ReactionButtonProperties>(
|
|
12
12
|
metadata.reactionButton.key,
|
|
13
13
|
({ componentProperties: props }) => {
|
|
14
|
-
const states = props.State.value.split("-");
|
|
15
|
-
|
|
16
14
|
const commonProps = {
|
|
17
15
|
size: handleSizeProp(props.Size.value),
|
|
18
|
-
...(
|
|
16
|
+
...(props.State.value === "Loading" && {
|
|
19
17
|
loading: true,
|
|
20
18
|
}),
|
|
21
|
-
...(
|
|
19
|
+
...(props.State.value === "Disabled" && {
|
|
22
20
|
disabled: true,
|
|
23
21
|
}),
|
|
24
|
-
...(
|
|
22
|
+
...(props.Selected.value === "True" && {
|
|
25
23
|
defaultPressed: true,
|
|
26
24
|
}),
|
|
27
25
|
};
|
|
@@ -14,21 +14,19 @@ export const createSelectBoxHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
14
14
|
({ componentProperties: props }) => {
|
|
15
15
|
const tag = match(props.Control.value)
|
|
16
16
|
.with("Checkbox", () => "CheckSelectBox")
|
|
17
|
-
.with("Radio", () => "
|
|
17
|
+
.with("Radio", () => "RadioSelectBoxItem")
|
|
18
18
|
.exhaustive();
|
|
19
19
|
|
|
20
|
-
const states = props.State.value.split("-");
|
|
21
|
-
|
|
22
20
|
const commonProps = {
|
|
23
21
|
label: props["Label#3635:0"].value,
|
|
24
22
|
...(props["Show Description#3033:0"].value && {
|
|
25
23
|
description: props["Description #3033:5"].value,
|
|
26
24
|
}),
|
|
27
|
-
...(tag === "
|
|
25
|
+
...(tag === "RadioSelectBoxItem" && {
|
|
28
26
|
value: props["Label#3635:0"].value,
|
|
29
27
|
}),
|
|
30
28
|
...(tag === "CheckSelectBox" &&
|
|
31
|
-
|
|
29
|
+
props.Selected.value === "True" && {
|
|
32
30
|
defaultChecked: true,
|
|
33
31
|
}),
|
|
34
32
|
};
|
|
@@ -47,7 +45,7 @@ export const createSelectBoxGroupHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
47
45
|
|
|
48
46
|
const tag = match(props.Control.value)
|
|
49
47
|
.with("Checkbox", () => "CheckSelectBoxGroup")
|
|
50
|
-
.with("Radio", () => "
|
|
48
|
+
.with("Radio", () => "RadioSelectBoxRoot")
|
|
51
49
|
.exhaustive();
|
|
52
50
|
|
|
53
51
|
const selectBoxes = findAllInstances<SelectBoxProperties>({
|
|
@@ -56,7 +54,7 @@ export const createSelectBoxGroupHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
const selectedSelectBox = selectBoxes.find((selectBox) =>
|
|
59
|
-
selectBox.componentProperties.
|
|
57
|
+
selectBox.componentProperties.Selected.value === "True",
|
|
60
58
|
);
|
|
61
59
|
|
|
62
60
|
// traverse the container like it's a frame
|
|
@@ -69,7 +67,7 @@ export const createSelectBoxGroupHandler = (ctx: ComponentHandlerDeps) => {
|
|
|
69
67
|
);
|
|
70
68
|
|
|
71
69
|
const commonProps = {
|
|
72
|
-
...(tag === "
|
|
70
|
+
...(tag === "RadioSelectBoxRoot" && {
|
|
73
71
|
defaultValue: selectedSelectBox?.componentProperties["Label#3635:0"].value,
|
|
74
72
|
}),
|
|
75
73
|
};
|
|
@@ -3,7 +3,6 @@ import { defineComponentHandler } from "@/codegen/core";
|
|
|
3
3
|
import * as metadata from "@/entities/data/__generated__/component-sets";
|
|
4
4
|
import { createLocalSnippetHelper } from "../../element-factories";
|
|
5
5
|
import type { ComponentHandlerDeps } from "../deps.interface";
|
|
6
|
-
import { handleSizeProp } from "../size";
|
|
7
6
|
|
|
8
7
|
const { createLocalSnippetElement } = createLocalSnippetHelper("switch");
|
|
9
8
|
|
|
@@ -11,19 +10,13 @@ export const createSwitchHandler = (_ctx: ComponentHandlerDeps) =>
|
|
|
11
10
|
defineComponentHandler<SwitchProperties>(
|
|
12
11
|
metadata.switch.key,
|
|
13
12
|
({ componentProperties: props }) => {
|
|
14
|
-
const states = props.State.value.split("-");
|
|
15
|
-
|
|
16
|
-
const size = handleSizeProp(props.Size.value);
|
|
17
|
-
|
|
18
13
|
const commonProps = {
|
|
19
|
-
size,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
...(states.includes("Selected") && {
|
|
14
|
+
size: props.Size.value,
|
|
15
|
+
label: props["Label#36578:0"].value,
|
|
16
|
+
...(props.Selected.value === "True" && {
|
|
24
17
|
defaultChecked: true,
|
|
25
18
|
}),
|
|
26
|
-
...(
|
|
19
|
+
...(props.State.value === "Disabled" && {
|
|
27
20
|
disabled: true,
|
|
28
21
|
}),
|
|
29
22
|
};
|
|
@@ -12,18 +12,16 @@ export const createToggleButtonHandler = (ctx: ComponentHandlerDeps) =>
|
|
|
12
12
|
defineComponentHandler<ToggleButtonProperties>(
|
|
13
13
|
metadata.toggleButton.key,
|
|
14
14
|
({ componentProperties: props }) => {
|
|
15
|
-
const states = props.State.value.split("-");
|
|
16
|
-
|
|
17
15
|
const commonProps = {
|
|
18
16
|
variant: camelCase(props.Variant.value),
|
|
19
17
|
size: handleSizeProp(props.Size.value),
|
|
20
|
-
...(
|
|
18
|
+
...(props.Selected.value === "True" && {
|
|
21
19
|
defaultPressed: true,
|
|
22
20
|
}),
|
|
23
|
-
...(
|
|
21
|
+
...(props.State.value === "Disabled" && {
|
|
24
22
|
disabled: true,
|
|
25
23
|
}),
|
|
26
|
-
...(
|
|
24
|
+
...(props.State.value === "Loading" && {
|
|
27
25
|
loading: true,
|
|
28
26
|
}),
|
|
29
27
|
};
|
|
@@ -37,7 +37,21 @@ export function createInstanceTransformer({
|
|
|
37
37
|
: componentHandlers[componentKey];
|
|
38
38
|
|
|
39
39
|
if (componentHandler) {
|
|
40
|
-
|
|
40
|
+
const handled = componentHandler.transform(node, traverse);
|
|
41
|
+
|
|
42
|
+
if (node.overrides && node.overrides.length > 0) {
|
|
43
|
+
const overriddenFields = node.overrides.flatMap(({ overriddenFields }) => overriddenFields);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
...handled,
|
|
47
|
+
meta: {
|
|
48
|
+
...handled.meta,
|
|
49
|
+
comment: `${handled.meta.comment ? `${handled.meta.comment} ` : ""}오버라이드된 필드: ${overriddenFields.join(", ")}`,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return handled;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
57
|
return frameTransformer(node, traverse);
|
|
@@ -67,6 +67,7 @@ export function createContainerLayoutPropsConverter(
|
|
|
67
67
|
match(layoutMode)
|
|
68
68
|
.with("HORIZONTAL", () => "row" as const)
|
|
69
69
|
.with("VERTICAL", () => "column" as const)
|
|
70
|
+
.with("GRID", () => undefined)
|
|
70
71
|
.with("NONE", () => undefined)
|
|
71
72
|
.with(undefined, () => undefined)
|
|
72
73
|
.exhaustive(),
|
|
@@ -143,7 +144,7 @@ export function createContainerLayoutPropsConverter(
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
export interface SelfLayoutProps {
|
|
146
|
-
|
|
147
|
+
flexGrow?: 0 | 1 | true;
|
|
147
148
|
alignSelf?: "stretch";
|
|
148
149
|
width?: string | number;
|
|
149
150
|
height?: string | number;
|
|
@@ -162,7 +163,7 @@ export function createSelfLayoutPropsConverter(
|
|
|
162
163
|
props: {} as SelfLayoutProps,
|
|
163
164
|
},
|
|
164
165
|
handlers: {
|
|
165
|
-
|
|
166
|
+
flexGrow: ({ layoutGrow }) => (layoutGrow === 1 ? true : layoutGrow),
|
|
166
167
|
alignSelf: ({ layoutAlign }) =>
|
|
167
168
|
match(layoutAlign)
|
|
168
169
|
.with("STRETCH", () => "stretch" as const)
|
|
@@ -198,7 +199,7 @@ export function createSelfLayoutPropsConverter(
|
|
|
198
199
|
: undefined,
|
|
199
200
|
},
|
|
200
201
|
defaults: {
|
|
201
|
-
|
|
202
|
+
flexGrow: 0,
|
|
202
203
|
},
|
|
203
204
|
});
|
|
204
205
|
}
|
|
@@ -371,7 +372,7 @@ export function createVectorChildrenFillPropsConverter(valueResolver: ReactValue
|
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
export interface StrokeProps {
|
|
374
|
-
borderWidth?:
|
|
375
|
+
borderWidth?: string;
|
|
375
376
|
borderColor?: string;
|
|
376
377
|
}
|
|
377
378
|
|
|
@@ -380,7 +381,7 @@ export function createStrokePropsConverter(
|
|
|
380
381
|
): PropsConverter<StrokeTrait, StrokeProps> {
|
|
381
382
|
return definePropsConverter((node) => {
|
|
382
383
|
const borderColor = valueResolver.getFormattedValue.stroke(node);
|
|
383
|
-
const borderWidth = borderColor ? node.strokeWeight : undefined;
|
|
384
|
+
const borderWidth = borderColor && node.strokeWeight ? `${node.strokeWeight}` : undefined;
|
|
384
385
|
|
|
385
386
|
return {
|
|
386
387
|
borderColor,
|
|
@@ -26,18 +26,20 @@ export declare const metadata: {
|
|
|
26
26
|
"Stronger"
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
|
+
"Selected": {
|
|
30
|
+
"type": "VARIANT",
|
|
31
|
+
"variantOptions": [
|
|
32
|
+
"True",
|
|
33
|
+
"False",
|
|
34
|
+
"Indeterminate"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
29
37
|
"State": {
|
|
30
38
|
"type": "VARIANT",
|
|
31
39
|
"variantOptions": [
|
|
32
40
|
"Enabled",
|
|
33
41
|
"Pressed",
|
|
34
|
-
"Disabled"
|
|
35
|
-
"Selected",
|
|
36
|
-
"Selected-Pressed",
|
|
37
|
-
"Selected-Disabled",
|
|
38
|
-
"Indeterminate",
|
|
39
|
-
"Indeterminate-Pressed",
|
|
40
|
-
"Indeterminate-Disabled"
|
|
42
|
+
"Disabled"
|
|
41
43
|
]
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -26,18 +26,20 @@ export const metadata = {
|
|
|
26
26
|
"Stronger"
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
|
+
"Selected": {
|
|
30
|
+
"type": "VARIANT",
|
|
31
|
+
"variantOptions": [
|
|
32
|
+
"True",
|
|
33
|
+
"False",
|
|
34
|
+
"Indeterminate"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
29
37
|
"State": {
|
|
30
38
|
"type": "VARIANT",
|
|
31
39
|
"variantOptions": [
|
|
32
40
|
"Enabled",
|
|
33
41
|
"Pressed",
|
|
34
|
-
"Disabled"
|
|
35
|
-
"Selected",
|
|
36
|
-
"Selected-Pressed",
|
|
37
|
-
"Selected-Disabled",
|
|
38
|
-
"Indeterminate",
|
|
39
|
-
"Indeterminate-Pressed",
|
|
40
|
-
"Indeterminate-Disabled"
|
|
42
|
+
"Disabled"
|
|
41
43
|
]
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -16,18 +16,20 @@ export declare const metadata: {
|
|
|
16
16
|
"Large"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
+
"Selected": {
|
|
20
|
+
"type": "VARIANT",
|
|
21
|
+
"variantOptions": [
|
|
22
|
+
"True",
|
|
23
|
+
"False",
|
|
24
|
+
"Indeterminate"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
19
27
|
"State": {
|
|
20
28
|
"type": "VARIANT",
|
|
21
29
|
"variantOptions": [
|
|
22
30
|
"Enabled",
|
|
23
31
|
"Pressed",
|
|
24
|
-
"
|
|
25
|
-
"Selected-Pressed",
|
|
26
|
-
"Indeterminate",
|
|
27
|
-
"Indeterminate-Pressed",
|
|
28
|
-
"Disabled",
|
|
29
|
-
"Disabled-Selected",
|
|
30
|
-
"Disabled-Indeterminate"
|
|
32
|
+
"Disabled"
|
|
31
33
|
]
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -16,18 +16,20 @@ export const metadata = {
|
|
|
16
16
|
"Large"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
+
"Selected": {
|
|
20
|
+
"type": "VARIANT",
|
|
21
|
+
"variantOptions": [
|
|
22
|
+
"True",
|
|
23
|
+
"False",
|
|
24
|
+
"Indeterminate"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
19
27
|
"State": {
|
|
20
28
|
"type": "VARIANT",
|
|
21
29
|
"variantOptions": [
|
|
22
30
|
"Enabled",
|
|
23
31
|
"Pressed",
|
|
24
|
-
"
|
|
25
|
-
"Selected-Pressed",
|
|
26
|
-
"Indeterminate",
|
|
27
|
-
"Indeterminate-Pressed",
|
|
28
|
-
"Disabled",
|
|
29
|
-
"Disabled-Selected",
|
|
30
|
-
"Disabled-Indeterminate"
|
|
32
|
+
"Disabled"
|
|
31
33
|
]
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -36,6 +36,10 @@ export declare const metadata: {
|
|
|
36
36
|
{
|
|
37
37
|
"type": "COMPONENT_SET",
|
|
38
38
|
"key": "df43b92004c850e7c6d2869e7a4ba1ef9a2d7db6"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "COMPONENT_SET",
|
|
42
|
+
"key": "19923052d4152393ecdc6e2f5853ea0359849127"
|
|
39
43
|
}
|
|
40
44
|
]
|
|
41
45
|
},
|
|
@@ -58,19 +62,19 @@ export declare const metadata: {
|
|
|
58
62
|
"Small"
|
|
59
63
|
]
|
|
60
64
|
},
|
|
61
|
-
"
|
|
65
|
+
"Selected": {
|
|
62
66
|
"type": "VARIANT",
|
|
63
67
|
"variantOptions": [
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"Disabled"
|
|
68
|
+
"False",
|
|
69
|
+
"True"
|
|
67
70
|
]
|
|
68
71
|
},
|
|
69
|
-
"
|
|
72
|
+
"State": {
|
|
70
73
|
"type": "VARIANT",
|
|
71
74
|
"variantOptions": [
|
|
72
|
-
"
|
|
73
|
-
"
|
|
75
|
+
"Enabled",
|
|
76
|
+
"Pressed",
|
|
77
|
+
"Disabled"
|
|
74
78
|
]
|
|
75
79
|
},
|
|
76
80
|
"Prefix Type": {
|
|
@@ -36,6 +36,10 @@ export const metadata = {
|
|
|
36
36
|
{
|
|
37
37
|
"type": "COMPONENT_SET",
|
|
38
38
|
"key": "df43b92004c850e7c6d2869e7a4ba1ef9a2d7db6"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "COMPONENT_SET",
|
|
42
|
+
"key": "19923052d4152393ecdc6e2f5853ea0359849127"
|
|
39
43
|
}
|
|
40
44
|
]
|
|
41
45
|
},
|
|
@@ -58,19 +62,19 @@ export const metadata = {
|
|
|
58
62
|
"Small"
|
|
59
63
|
]
|
|
60
64
|
},
|
|
61
|
-
"
|
|
65
|
+
"Selected": {
|
|
62
66
|
"type": "VARIANT",
|
|
63
67
|
"variantOptions": [
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"Disabled"
|
|
68
|
+
"False",
|
|
69
|
+
"True"
|
|
67
70
|
]
|
|
68
71
|
},
|
|
69
|
-
"
|
|
72
|
+
"State": {
|
|
70
73
|
"type": "VARIANT",
|
|
71
74
|
"variantOptions": [
|
|
72
|
-
"
|
|
73
|
-
"
|
|
75
|
+
"Enabled",
|
|
76
|
+
"Pressed",
|
|
77
|
+
"Disabled"
|
|
74
78
|
]
|
|
75
79
|
},
|
|
76
80
|
"Prefix Type": {
|
|
@@ -40,6 +40,7 @@ export { metadata as selectBox } from "./select-box";
|
|
|
40
40
|
export { metadata as skeleton } from "./skeleton";
|
|
41
41
|
export { metadata as slider } from "./slider";
|
|
42
42
|
export { metadata as snackbar } from "./snackbar";
|
|
43
|
+
export { metadata as superscriptChild } from "./superscript-child";
|
|
43
44
|
export { metadata as switch } from "./switch";
|
|
44
45
|
export { metadata as tabs } from "./tabs";
|
|
45
46
|
export { metadata as textField } from "./text-field";
|
|
@@ -40,6 +40,7 @@ export { metadata as selectBox } from "./select-box.mjs";
|
|
|
40
40
|
export { metadata as skeleton } from "./skeleton.mjs";
|
|
41
41
|
export { metadata as slider } from "./slider.mjs";
|
|
42
42
|
export { metadata as snackbar } from "./snackbar.mjs";
|
|
43
|
+
export { metadata as superscriptChild } from "./superscript-child.mjs";
|
|
43
44
|
export { metadata as switch } from "./switch.mjs";
|
|
44
45
|
export { metadata as tabs } from "./tabs.mjs";
|
|
45
46
|
export { metadata as textField } from "./text-field.mjs";
|