UNPKG

clickable-json

Version:

Interactive JSON and JSON CRDT viewer and editor

18 lines 865 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TypeSwitch = void 0; const React = require("react"); const nano_theme_1 = require("nano-theme"); const blockClass = (0, nano_theme_1.drule)(Object.assign(Object.assign({}, nano_theme_1.theme.font.mono), { fz: '10px', lh: '9px', col: nano_theme_1.theme.color.sem.blue[0], d: 'inline-block', pd: '2px 2px', mr: '0', bxz: 'border-box', // bg: 'transparent', bd: 0, bdrad: '1em' })); exports.TypeSwitch = React.memo(({ value, onKeyDown, onClick }) => { const theme = (0, nano_theme_1.useTheme)(); return (React.createElement("button", { className: blockClass({ bg: theme.g(0.96), '&:hover': { bg: theme.g(0.88), }, }), onClick: onClick, onKeyDown: onKeyDown }, value)); }); //# sourceMappingURL=index.js.map