UNPKG

clickable-json

Version:

Interactive JSON and JSON CRDT viewer and editor

16 lines 886 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', bdrad: '1em' })); exports.TypeSwitch = React.memo(({ value, onKeyDown, onClick }) => { const theme = (0, nano_theme_1.useTheme)(); return (React.createElement("button", { className: blockClass({ bd: `1px solid ${theme.blue(0.25)}`, '&:hover': { bd: `1px solid ${theme.blue(0.7)}`, }, }), onClick: onClick, onKeyDown: onKeyDown }, value)); }); //# sourceMappingURL=TypeSwitch.js.map