@carrier-dpx/air-react-library 0.7.28 → 0.7.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrier-dpx/air-react-library",
3
- "version": "0.7.28",
3
+ "version": "0.7.30",
4
4
  "description": "Air web React component library for Figma Make",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -74,25 +74,39 @@ figma.connect(
74
74
 
75
75
  /**
76
76
  * LABEL TEXT CONTENT
77
- * Maps text property "✏️ Label" from the nested "Label" Typography component
77
+ * Maps text content from the nested "Label" Typography component
78
78
  * The Label is an instance of the Typography component
79
- * The text property must be surfaced from the "Label" layer
80
- * Only used when showLabel is true
79
+ * Uses nestedProps to access the Label component's children (text content)
80
+ * Similar to how Tooltip accesses nested TooltipContent properties
81
81
  */
82
- label: figma.string("✏️ Label"),
82
+ label: figma.nestedProps("Label", {
83
+ children: figma.children("Label"),
84
+ }),
83
85
  },
84
86
 
85
87
  /**
86
88
  * EXAMPLE CODE TEMPLATE
87
89
  * Shows how StatusLed should be used with optional label
88
90
  */
89
- example: ({ severity, size, labelPosition, showLabel, label }) => (
90
- <StatusLed
91
- severity={severity}
92
- size={size}
93
- labelPosition={labelPosition}
94
- label={showLabel ? label : undefined}
95
- />
96
- ),
91
+ example: ({ severity, size, labelPosition, showLabel, label }) => {
92
+ if (showLabel && label) {
93
+ return (
94
+ <StatusLed
95
+ severity={severity}
96
+ size={size}
97
+ labelPosition={labelPosition}
98
+ label={label.children}
99
+ />
100
+ );
101
+ }
102
+
103
+ return (
104
+ <StatusLed
105
+ severity={severity}
106
+ size={size}
107
+ labelPosition={labelPosition}
108
+ />
109
+ );
110
+ },
97
111
  }
98
112
  );