fix(ui): updated input fields to match new color scheme (#3323)

* Updated input fields to match new color scheme

Added small input text fields and fixed coloring

* Added tailwind changes to viewers file
This commit is contained in:
Braden Morley 2023-04-28 01:01:53 +00:00 committed by GitHub
parent 075008c674
commit fe7fa6e5bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 8 deletions

View File

@ -4,13 +4,18 @@ import Label from '../Label';
import classnames from 'classnames'; import classnames from 'classnames';
const baseInputClasses = const baseInputClasses =
'shadow transition duration-300 appearance-none border border-primary-main hover:border-gray-500 focus:border-gray-500 focus:outline-none rounded w-full py-2 px-3 text-sm text-white leading-tight focus:outline-none'; 'shadow transition duration-300 appearance-none border border-inputfield-main focus:border-inputfield-focus focus:outline-none disabled:border-inputfield-disabled rounded w-full py-2 px-3 text-sm text-white placeholder-inputfield-placeholder leading-tight';
const transparentClasses = { const transparentClasses = {
true: 'bg-transparent', true: 'bg-transparent',
false: 'bg-black', false: 'bg-black',
}; };
const smallInputClasses = {
true: 'input-small',
false: ''
}
const Input = ({ const Input = ({
id, id,
label, label,
@ -18,6 +23,7 @@ const Input = ({
labelClassName = '', labelClassName = '',
className = '', className = '',
transparent = false, transparent = false,
smallInput = false,
type = 'text', type = 'text',
value, value,
onChange, onChange,
@ -39,6 +45,7 @@ const Input = ({
className, className,
baseInputClasses, baseInputClasses,
transparentClasses[transparent], transparentClasses[transparent],
smallInputClasses[smallInput],
{ 'cursor-not-allowed': disabled } { 'cursor-not-allowed': disabled }
)} )}
disabled={disabled} disabled={disabled}
@ -63,6 +70,7 @@ Input.propTypes = {
labelClassName: PropTypes.string, labelClassName: PropTypes.string,
className: PropTypes.string, className: PropTypes.string,
transparent: PropTypes.bool, transparent: PropTypes.bool,
smallInput: PropTypes.bool,
type: PropTypes.string, type: PropTypes.string,
value: PropTypes.any, value: PropTypes.any,
onChange: PropTypes.func, onChange: PropTypes.func,

View File

@ -53,6 +53,19 @@ Input is a component that renders the Inputs.
</Story> </Story>
</Canvas> </Canvas>
### Small Input
<Canvas>
<Story
name="Small"
args={{
smallInput: true,
}}
>
{InputTemplate.bind({})}
</Story>
</Canvas>
### Classnames ### Classnames
You can change the appearance of the container and label. You can change the appearance of the container and label.

View File

@ -2,7 +2,7 @@ input[type='text'] {
-webkit-appearance: none; -webkit-appearance: none;
} }
input[type='text']:focus { .input-number:focus {
border: none; border: none;
outline: none; outline: none;
} }
@ -15,3 +15,7 @@ input[type='text']:focus {
.up-arrowsize svg path { .up-arrowsize svg path {
fill: #726f7e; fill: #726f7e;
} }
.input-small {
height: 26px;
}

View File

@ -77,16 +77,15 @@ const InputNumber: React.FC<{
return ( return (
<div <div
className={`flex items-center bg-black border-2 px-1 overflow-hidden justify-center border-secondary-light rounded-md ${ className={`flex items-center bg-black border-2 px-1 overflow-hidden justify-center border-secondary-light rounded-md ${sizesClasses[size]
sizesClasses[size] } ${className ? className : ''}`}
} ${className ? className : ''}`}
> >
<div className="flex"> <div className="flex">
<input <input
type="text" type="text"
value={numberValue} value={numberValue}
onChange={handleChange} onChange={handleChange}
className={`bg-black text-white text-[12px] w-full text-center`} className={`bg-black text-white text-[12px] w-full text-center input-number`}
/> />
<div className="up-arrowsize flex flex-col items-center justify-around"> <div className="up-arrowsize flex flex-col items-center justify-around">

View File

@ -21,7 +21,7 @@ const InputText = ({
> >
<Input <Input
id={id} id={id}
className="border-primary-main mt-2 bg-black" className="mt-2"
type="text" type="text"
containerClassName="mr-2" containerClassName="mr-2"
value={value} value={value}
@ -36,7 +36,7 @@ const InputText = ({
InputText.defaultProps = { InputText.defaultProps = {
value: '', value: '',
isSortable: false, isSortable: false,
onLabelClick: () => {}, onLabelClick: () => { },
sortDirection: 'none', sortDirection: 'none',
}; };

View File

@ -35,6 +35,13 @@ module.exports = {
active: '#348cfd', active: '#348cfd',
}, },
inputfield: {
main: '#3a3f99',
disabled: '#2b166b',
focus: '#5acce6',
placeholder: '#39383f'
},
secondary: { secondary: {
light: '#3a3f99', light: '#3a3f99',
main: '#2b166b', main: '#2b166b',

View File

@ -46,6 +46,13 @@ module.exports = {
active: '#348cfd', active: '#348cfd',
}, },
inputfield: {
main: '#3a3f99',
disabled: '#2b166b',
focus: '#5acce6',
placeholder: '#39383f'
},
secondary: { secondary: {
light: '#3a3f99', light: '#3a3f99',
main: '#2b166b', main: '#2b166b',