0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 21:53:27 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotBool.ts
Alex Sánchez 36afc6da55
Boolean Groups (#115)
* wip

* wip

* fixes

* changeset

* fixes

* fixes

* fixes

* fixes

* minor fixes

* minor fixes
2024-05-27 10:05:23 +02:00

22 lines
688 B
TypeScript

import { createPenpotItem } from '@ui/converters/createPenpotItem';
import { PenpotFile } from '@ui/lib/types/penpotFile';
import { BoolShape } from '@ui/lib/types/shapes/boolShape';
import { translateFillGradients, translateUiBlendMode, translateUiBoolType } from '@ui/translators';
export const createPenpotBool = (
file: PenpotFile,
{ type, fills, boolType, blendMode, children = [], ...rest }: BoolShape
) => {
file.addBool({
fills: translateFillGradients(fills),
blendMode: translateUiBlendMode(blendMode),
boolType: translateUiBoolType(boolType),
...rest
});
for (const child of children) {
createPenpotItem(file, child);
}
file.closeBool();
};