json-joy
Version:
Collection of libraries for building collaborative editing apps.
41 lines (40 loc) • 1.23 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebugLabel = void 0;
const tslib_1 = require("tslib");
// biome-ignore lint: React is used for JSX
const React = tslib_1.__importStar(require("react"));
const nano_theme_1 = require("nano-theme");
const labelClass = (0, nano_theme_1.rule)({
...nano_theme_1.theme.font.mono.bold,
d: 'flex',
ai: 'center',
fz: '9px',
pd: '0 4px',
mr: '-1px',
bdrad: '10px',
bg: 'rgba(0,0,0)',
lh: '14px',
h: '14px',
col: 'white',
bd: '1px solid #fff',
});
const labelSecondClass = (0, nano_theme_1.rule)({
...nano_theme_1.theme.font.mono.bold,
d: 'flex',
fz: '8px',
mr: '2px -2px 2px 4px',
pd: '0 4px',
bdrad: '10px',
bg: 'rgba(255,255,255)',
lh: '10px',
h: '10px',
col: '#000',
});
const DebugLabel = ({ right, small, children }) => {
const style = small ? { fontSize: '7px', lineHeight: '10px', height: '10px', padding: '0 2px' } : void 0;
return (React.createElement("span", { className: labelClass, style: style },
children,
!!right && React.createElement("span", { className: labelSecondClass }, right)));
};
exports.DebugLabel = DebugLabel;
;