UNPKG

@geezee/react-ui

Version:

Modern and minimalist React UI library.

29 lines (26 loc) 3.44 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _JSXStyle from "styled-jsx/style"; import React from 'react'; import useTheme from '../styles/use-theme'; import withDefaults from '../utils/with-defaults'; var defaultProps = { variant: 'line' }; var InputLabel = function InputLabel(_ref) { var children = _ref.children, variant = _ref.variant, isRight = _ref.isRight, fontSize = _ref.fontSize, props = _objectWithoutProperties(_ref, ["children", "variant", "isRight", "fontSize"]); var theme = useTheme(); var isSolid = variant === 'solid'; return /*#__PURE__*/React.createElement("label", _extends({}, props, { className: _JSXStyle.dynamic([["4066644323", [theme.layout.gapHalf, theme.palette.cNeutral5, theme.palette.cNeutral0, theme.expressiveness.R2, theme.expressiveness.R2, isSolid ? 'none' : '1px solid ' + theme.palette.border, isSolid ? 'none' : '1px solid ' + theme.palette.border, isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', isSolid ? 'none' : '1px solid ' + theme.palette.border, fontSize, theme.expressiveness.R2, theme.expressiveness.R2, isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', isSolid ? 'none' : '1px solid ' + theme.palette.border]]]) + " " + (props && props.className != null && props.className || (isRight ? 'right' : '') || "") }), children, /*#__PURE__*/React.createElement(_JSXStyle, { id: "4066644323", dynamic: [theme.layout.gapHalf, theme.palette.cNeutral5, theme.palette.cNeutral0, theme.expressiveness.R2, theme.expressiveness.R2, isSolid ? 'none' : '1px solid ' + theme.palette.border, isSolid ? 'none' : '1px solid ' + theme.palette.border, isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', isSolid ? 'none' : '1px solid ' + theme.palette.border, fontSize, theme.expressiveness.R2, theme.expressiveness.R2, isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', isSolid ? 'none' : '1px solid ' + theme.palette.border] }, "label.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:initial;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:0;padding:0 ".concat(theme.layout.gapHalf, ";color:").concat(theme.palette.cNeutral5, ";background-color:").concat(theme.palette.cNeutral0, ";border-top-left-radius:").concat(theme.expressiveness.R2, ";border-bottom-left-radius:").concat(theme.expressiveness.R2, ";border-top:").concat(isSolid ? 'none' : '1px solid ' + theme.palette.border, ";border-left:").concat(isSolid ? 'none' : '1px solid ' + theme.palette.border, ";border-right:").concat(isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', ";border-bottom:").concat(isSolid ? 'none' : '1px solid ' + theme.palette.border, ";font-size:").concat(fontSize, ";}label.right.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:").concat(theme.expressiveness.R2, ";border-bottom-right-radius:").concat(theme.expressiveness.R2, ";border-left:").concat(isSolid ? '1px solid ' + theme.palette.cNeutral8 : 'none', ";border-right:").concat(isSolid ? 'none' : '1px solid ' + theme.palette.border, ";}"))); }; var MemoInputLabel = withDefaults(React.memo(InputLabel), defaultProps); export default MemoInputLabel;