@seed-design/figma 0.1.8 → 0.1.9

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.
@@ -14,7 +14,7 @@ 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", () => "RadioSelectBox")
17
+ .with("Radio", () => "RadioSelectBoxItem")
18
18
  .exhaustive();
19
19
 
20
20
  const states = props.State.value.split("-");
@@ -24,7 +24,7 @@ export const createSelectBoxHandler = (_ctx: ComponentHandlerDeps) =>
24
24
  ...(props["Show Description#3033:0"].value && {
25
25
  description: props["Description #3033:5"].value,
26
26
  }),
27
- ...(tag === "RadioSelectBox" && {
27
+ ...(tag === "RadioSelectBoxItem" && {
28
28
  value: props["Label#3635:0"].value,
29
29
  }),
30
30
  ...(tag === "CheckSelectBox" &&
@@ -47,7 +47,7 @@ export const createSelectBoxGroupHandler = (ctx: ComponentHandlerDeps) => {
47
47
 
48
48
  const tag = match(props.Control.value)
49
49
  .with("Checkbox", () => "CheckSelectBoxGroup")
50
- .with("Radio", () => "RadioSelectBoxGroup")
50
+ .with("Radio", () => "RadioSelectBoxRoot")
51
51
  .exhaustive();
52
52
 
53
53
  const selectBoxes = findAllInstances<SelectBoxProperties>({
@@ -69,7 +69,7 @@ export const createSelectBoxGroupHandler = (ctx: ComponentHandlerDeps) => {
69
69
  );
70
70
 
71
71
  const commonProps = {
72
- ...(tag === "RadioSelectBoxGroup" && {
72
+ ...(tag === "RadioSelectBoxRoot" && {
73
73
  defaultValue: selectedSelectBox?.componentProperties["Label#3635:0"].value,
74
74
  }),
75
75
  };
@@ -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
 
@@ -13,13 +12,9 @@ export const createSwitchHandler = (_ctx: ComponentHandlerDeps) =>
13
12
  ({ componentProperties: props }) => {
14
13
  const states = props.State.value.split("-");
15
14
 
16
- const size = handleSizeProp(props.Size.value);
17
-
18
15
  const commonProps = {
19
- size,
20
- ...(size === "small" && {
21
- label: props["Label#15191:2"].value,
22
- }),
16
+ size: props.Size.value,
17
+ label: props["Label#36578:0"].value,
23
18
  ...(states.includes("Selected") && {
24
19
  defaultChecked: true,
25
20
  }),
@@ -143,7 +143,7 @@ export function createContainerLayoutPropsConverter(
143
143
  }
144
144
 
145
145
  export interface SelfLayoutProps {
146
- grow?: 0 | 1 | true;
146
+ flexGrow?: 0 | 1 | true;
147
147
  alignSelf?: "stretch";
148
148
  width?: string | number;
149
149
  height?: string | number;
@@ -162,7 +162,7 @@ export function createSelfLayoutPropsConverter(
162
162
  props: {} as SelfLayoutProps,
163
163
  },
164
164
  handlers: {
165
- grow: ({ layoutGrow }) => (layoutGrow === 1 ? true : layoutGrow),
165
+ flexGrow: ({ layoutGrow }) => (layoutGrow === 1 ? true : layoutGrow),
166
166
  alignSelf: ({ layoutAlign }) =>
167
167
  match(layoutAlign)
168
168
  .with("STRETCH", () => "stretch" as const)
@@ -198,7 +198,7 @@ export function createSelfLayoutPropsConverter(
198
198
  : undefined,
199
199
  },
200
200
  defaults: {
201
- grow: 0,
201
+ flexGrow: 0,
202
202
  },
203
203
  });
204
204
  }
@@ -371,7 +371,7 @@ export function createVectorChildrenFillPropsConverter(valueResolver: ReactValue
371
371
  }
372
372
 
373
373
  export interface StrokeProps {
374
- borderWidth?: number;
374
+ borderWidth?: string;
375
375
  borderColor?: string;
376
376
  }
377
377
 
@@ -380,7 +380,7 @@ export function createStrokePropsConverter(
380
380
  ): PropsConverter<StrokeTrait, StrokeProps> {
381
381
  return definePropsConverter((node) => {
382
382
  const borderColor = valueResolver.getFormattedValue.stroke(node);
383
- const borderWidth = borderColor ? node.strokeWeight : undefined;
383
+ const borderWidth = borderColor && node.strokeWeight ? `${node.strokeWeight}` : undefined;
384
384
 
385
385
  return {
386
386
  borderColor,
@@ -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
  },
@@ -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
  },
@@ -15,7 +15,7 @@ export declare const metadata: {
15
15
  "Neutral",
16
16
  "Brand",
17
17
  "Static White",
18
- "Custom"
18
+ "Custom(inherit)"
19
19
  ]
20
20
  },
21
21
  "Value": {
@@ -15,7 +15,7 @@ export const metadata = {
15
15
  "Neutral",
16
16
  "Brand",
17
17
  "Static White",
18
- "Custom"
18
+ "Custom(inherit)"
19
19
  ]
20
20
  },
21
21
  "Value": {
@@ -1,25 +1,34 @@
1
1
  export declare const metadata: {
2
2
  "name": "🟢 Switch",
3
- "key": "80ce5a33b5ab713ab3bd2449472e2fb13d78c7f3",
3
+ "key": "65e0e7ba1a0c13b42e5fd0ceb17d5f756128dd6b",
4
4
  "componentPropertyDefinitions": {
5
- "Label#15191:2": {
5
+ "Label#36578:0": {
6
6
  "type": "TEXT"
7
7
  },
8
8
  "Size": {
9
9
  "type": "VARIANT",
10
10
  "variantOptions": [
11
- "Small",
12
- "Medium"
11
+ "16",
12
+ "24",
13
+ "32"
13
14
  ]
14
15
  },
15
16
  "State": {
16
17
  "type": "VARIANT",
17
18
  "variantOptions": [
18
19
  "Enabled",
19
- "Selected",
20
20
  "Disabled",
21
+ "Selected",
21
22
  "Selected-Disabled"
22
23
  ]
24
+ },
25
+ "Label Layout(Figma Only)": {
26
+ "type": "VARIANT",
27
+ "variantOptions": [
28
+ "None",
29
+ "Right",
30
+ "Left"
31
+ ]
23
32
  }
24
33
  }
25
34
  };
@@ -1,25 +1,34 @@
1
1
  export const metadata = {
2
2
  "name": "🟢 Switch",
3
- "key": "80ce5a33b5ab713ab3bd2449472e2fb13d78c7f3",
3
+ "key": "65e0e7ba1a0c13b42e5fd0ceb17d5f756128dd6b",
4
4
  "componentPropertyDefinitions": {
5
- "Label#15191:2": {
5
+ "Label#36578:0": {
6
6
  "type": "TEXT"
7
7
  },
8
8
  "Size": {
9
9
  "type": "VARIANT",
10
10
  "variantOptions": [
11
- "Small",
12
- "Medium"
11
+ "16",
12
+ "24",
13
+ "32"
13
14
  ]
14
15
  },
15
16
  "State": {
16
17
  "type": "VARIANT",
17
18
  "variantOptions": [
18
19
  "Enabled",
19
- "Selected",
20
20
  "Disabled",
21
+ "Selected",
21
22
  "Selected-Disabled"
22
23
  ]
24
+ },
25
+ "Label Layout(Figma Only)": {
26
+ "type": "VARIANT",
27
+ "variantOptions": [
28
+ "None",
29
+ "Right",
30
+ "Left"
31
+ ]
23
32
  }
24
33
  }
25
34
  };