diff --git a/components/field/src/field.module.scss b/components/field/src/field.module.scss index 4fe00b8b6..35828a8d3 100644 --- a/components/field/src/field.module.scss +++ b/components/field/src/field.module.scss @@ -5,9 +5,10 @@ align-items: center; justify-content: space-between; width: 100%; - margin: size('1x') size('0'); + margin: size('0') size('1x'); @include typography('caption-revamp'); + color: color('background-70'); } .required { @@ -20,6 +21,11 @@ margin-top: margin-top('small'); margin-bottom: negative(margin-bottom('field') - 1); overflow: hidden; + + &-icon { + padding-right: size('1x'); + margin-top: calc(size('1x')/4); + } } .meta:hover { @@ -53,7 +59,7 @@ color: color('input.error'); } .success { - color: color('success-base-new'); + color: color('success-100'); } .icon { color: color('primary-base-new'); diff --git a/components/field/src/field.tsx b/components/field/src/field.tsx index 37f4b637b..36064683b 100644 --- a/components/field/src/field.tsx +++ b/components/field/src/field.tsx @@ -4,6 +4,9 @@ import React, { Children, isValidElement, } from 'react' +import Icon from '@applique-ui/icon' +import TimesSolid from "uikit-icons/svgs/TimesSolid" +import CheckSolid from "uikit-icons/svgs/CheckSolid" import classnames from './field.module.scss' @@ -103,6 +106,7 @@ export default function Field({ role="alert" className={classnames({ error: !!error })} > + {Array.isArray(error) ? error.join(' ') : error} ) : success ? ( @@ -110,6 +114,7 @@ export default function Field({ id={htmlFor ? htmlFor + '__success' : null} className={classnames('success')} > + {success} ) : ( diff --git a/components/input-text-area/src/input-text-area.module.scss b/components/input-text-area/src/input-text-area.module.scss deleted file mode 100644 index f3709ed58..000000000 --- a/components/input-text-area/src/input-text-area.module.scss +++ /dev/null @@ -1,46 +0,0 @@ -@import '@accoutrement'; -@import '@applique-ui/input/style.scss'; - -.container { - position: relative; - display: flex; - overflow: scroll; - resize: vertical; - &.standard { - @include mixin-input-text-revamp( - 'border-bottom', - padding('input-text-standard') - ); - } - &.bordered { - @include mixin-input-text-revamp('border', padding('input.textarea')); - } - textarea { - color: text-color('input.text'); - resize: none; - } - &.disable { - resize: none; - } - &.disable textarea { - background-color: transparent; - } - &.noResize { - resize: none; - } -} -.icon { - margin-top: size('1x'); - margin-right: size('2x'); -} -.input { - width: 100%; - vertical-align: baseline; - border: none; - outline: none; - - &:disabled, - &[disabled] { - resize: none; - } -} diff --git a/components/input-text-area/src/input-text-area.tsx b/components/input-text-area/src/input-text-area.tsx index ee97b3a6f..38d72d92e 100644 --- a/components/input-text-area/src/input-text-area.tsx +++ b/components/input-text-area/src/input-text-area.tsx @@ -1,6 +1,6 @@ import React from 'react' -import classnames from './input-text-area.module.scss' -import Icon, { IconName } from '@applique-ui/icon' +import { IconName } from '@applique-ui/icon' +import Input from '@applique-ui/input' export interface Props extends BaseProps { /** @private */ @@ -32,9 +32,6 @@ type FieldContext = { error?: boolean disabled?: boolean } -function isEmptyValue(value) { - return typeof value !== 'string' || !value -} /** * A large text input component. @@ -44,44 +41,14 @@ function isEmptyValue(value) { * @category input * @see http://uikit.myntra.com/components/input-text-area */ -export default function InputTextArea({ - className, - noResize, - value, - onChange, - variant = 'bordered', - error = false, - disabled, - __fieldContext = {}, - adornmentPosition = 'start', - icon, - ...props -}: Props) { - error = !!(error || __fieldContext.error) - disabled = !!(disabled || __fieldContext.disabled) +export default function InputTextArea({onChange, value, ...props}: Props) { return ( -
- {icon && } - -