@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
42 lines • 1.21 kB
JavaScript
import { Node } from '../../programmatic/node.js';
import { NumberSchema, StringSchema } from '../../schemas/index.js';
export default class NodeDefinition extends Node {
static title = 'CSS Box';
static type = 'studio.tokens.css.box';
static description = 'CSS Box node allows you to generate a CSS box from 4 values';
constructor(props) {
super(props);
this.addInput('top', {
type: {
...NumberSchema,
default: 0
}
});
this.addInput('right', {
type: {
...NumberSchema,
default: 0
}
});
this.addInput('bottom', {
type: {
...NumberSchema,
default: 0
}
});
this.addInput('left', {
type: {
...NumberSchema,
default: 0
}
});
this.addOutput('value', {
type: StringSchema
});
}
execute() {
const { top, right, bottom, left } = this.getAllInputs();
this.outputs.value.set(`${top} ${right} ${bottom} ${left}`);
}
}
//# sourceMappingURL=box.js.map