UNPKG

1.09 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const react_1 = __importDefault(require("react"));
7/**
8 * Transform a string representation of React components before they are written to output.
9 * For example, you might want to apply a gradient to text, add a clickable link or create some text effects.
10 * These use cases can't accept React nodes as input, they are expecting a string.
11 * That's what <Transform> component does, it gives you an output string of its child components and lets you transform it in any way.
12 */
13const Transform = ({ children, transform }) => {
14 if (children === undefined || children === null) {
15 return null;
16 }
17 return (react_1.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: 'row' }, internal_transform: transform }, children));
18};
19Transform.displayName = 'Transform';
20exports.default = Transform;
21//# sourceMappingURL=Transform.js.map
\No newline at end of file