diff --git a/src/client/components/types/number.raw.scss b/src/client/components/types/number.raw.scss new file mode 100644 index 0000000..aa670aa --- /dev/null +++ b/src/client/components/types/number.raw.scss @@ -0,0 +1,20 @@ +:scope { + display: flex; +} + +input { + max-width: 5em; +} + +.controls { + display: flex; + flex-direction: column; +} + +button { + border-left: none; + + &:first-child { + border-bottom: none; + } +} diff --git a/src/client/components/types/number.type-renderer.jsx b/src/client/components/types/number.type-renderer.jsx index 003a9d7..cd2a21c 100644 --- a/src/client/components/types/number.type-renderer.jsx +++ b/src/client/components/types/number.type-renderer.jsx @@ -1,8 +1,14 @@ +import {compose} from '@avocado/core'; +import contempo from 'contempo'; import PropTypes from 'prop-types'; import React from 'react'; import propertyPropTypes from './property-prop-types'; +const decorate = compose( + contempo(require('./number.raw.scss')), +); + const Number = ({ options, value, @@ -17,7 +23,19 @@ const Number = ({ ))} ) - : + : ( + <> + (e.preventDefault(), false)} + type="text" + value={value} + /> +