UNPKG

@itsjonq/controls

Version:

A control panel to develop React UI

39 lines (36 loc) 1.74 kB
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } import React from 'react'; import { View } from 'styled-view'; export function BaseInputField(props) { return React.createElement(View, Object.assign({ as: "input", autoComplete: "off", backgroundColor: "transparent", border: "1px solid var(--controlPanelBorderColor)", color: "inherit", display: "block", fontFamily: "inherit", fontSize: "inherit", padding: 2, type: "text", width: "100%" }, props)); } export function Label(props) { var children = props.children, label = props.label, restProps = _objectWithoutProperties(props, ["children", "label"]); return React.createElement(View, Object.assign({ as: "label" }, restProps), React.createElement(View, { fontSize: "0.9em", marginBottom: 2, opacity: 0.6 }, label), children); } export function FieldGroup(props) { return React.createElement(View, Object.assign({ marginBottom: 8 }, props)); }