/**
* Sample Figma API response payloads for testing.
*/
export const sampleFrameNode = {
id: '1:2',
name: 'Card',
type: 'FRAME',
visible: true,
opacity: 1,
layoutMode: 'VERTICAL',
primaryAxisAlignItems: 'MIN',
counterAxisAlignItems: 'CENTER',
itemSpacing: 16,
paddingTop: 24,
paddingRight: 24,
paddingBottom: 24,
paddingLeft: 24,
layoutSizingHorizontal: 'FIXED',
layoutSizingVertical: 'HUG',
absoluteBoundingBox: {x: 0, y: 0, width: 320, height: 400},
cornerRadius: 12,
fills: [{type: 'SOLID', visible: true, color: {r: 1, g: 1, b: 1, a: 1}}],
effects: [
{
type: 'DROP_SHADOW',
visible: true,
radius: 8,
color: {r: 0, g: 0, b: 0, a: 0.1},
offset: {x: 0, y: 4},
spread: 0,
},
],
children: [
{
id: '1:3',
name: 'Title',
type: 'TEXT',
visible: true,
characters: 'Hello World',
style: {
fontFamily: 'Inter',
fontWeight: 600,
fontSize: 24,
lineHeightPx: 32,
textAlignHorizontal: 'LEFT',
letterSpacing: 0,
},
fills: [{type: 'SOLID', visible: true, color: {r: 0.1, g: 0.1, b: 0.1, a: 1}}],
absoluteBoundingBox: {x: 24, y: 24, width: 272, height: 32},
},
{
id: '1:4',
name: 'Hidden Element',
type: 'RECTANGLE',
visible: false,
},
],
pluginData: {somePlugin: 'data'},
sharedPluginData: {shared: 'data'},
exportSettings: [{format: 'PNG'}],
};
export const sampleTextNode = {
id: '2:1',
name: 'Body Text',
type: 'TEXT',
visible: true,
characters: 'Lorem ipsum dolor sit amet',
style: {
fontFamily: 'Inter',
fontWeight: 400,
fontSize: 16,
lineHeightPx: 24,
textAlignHorizontal: 'LEFT',
letterSpacing: 0.5,
},
fills: [
{type: 'SOLID', visible: false, color: {r: 1, g: 0, b: 0, a: 1}},
{type: 'SOLID', visible: true, color: {r: 0.2, g: 0.2, b: 0.2, a: 1}},
],
absoluteBoundingBox: {x: 0, y: 0, width: 200, height: 24},
};
export const sampleInvisibleNode = {
id: '3:1',
name: 'Invisible',
type: 'RECTANGLE',
visible: false,
};
export const sampleSliceNode = {
id: '3:2',
name: 'Export Slice',
type: 'SLICE',
};
export const sampleFileNodesResponse = {
name: 'Test File',
nodes: {
'1:2': {
document: sampleFrameNode,
},
},
};
export const sampleFileResponse = {
name: 'Test File',
document: {
id: '0:0',
name: 'Document',
type: 'DOCUMENT',
children: [
{
id: '0:1',
name: 'Page 1',
type: 'CANVAS',
children: [sampleFrameNode],
},
],
},
};
export const sampleImageResponse = {
err: null,
images: {
'1:2': 'https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/abc123',
},
};
export const sampleGradientFill = {
type: 'GRADIENT_LINEAR',
visible: true,
gradientStops: [
{position: 0, color: {r: 1, g: 0, b: 0, a: 1}},
{position: 1, color: {r: 0, g: 0, b: 1, a: 1}},
],
};
export const sampleEffects = [
{
type: 'DROP_SHADOW',
visible: true,
radius: 10,
color: {r: 0, g: 0, b: 0, a: 0.25},
offset: {x: 0, y: 4},
spread: 0,
},
{
type: 'INNER_SHADOW',
visible: true,
radius: 4,
color: {r: 0, g: 0, b: 0, a: 0.1},
offset: {x: 0, y: 2},
spread: 0,
},
{
type: 'LAYER_BLUR',
visible: true,
radius: 8,
},
{
type: 'BACKGROUND_BLUR',
visible: true,
radius: 20,
},
{
type: 'DROP_SHADOW',
visible: false,
radius: 10,
color: {r: 0, g: 0, b: 0, a: 0.5},
offset: {x: 0, y: 0},
spread: 0,
},
];