-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added color and leftover changes in Text input component (#1701)
* added color and leftover changes * Update TextInput.constants.tsx
- Loading branch information
1 parent
bc7d660
commit 7c83c07
Showing
7 changed files
with
132 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { FC } from 'react'; | ||
import { IconWrapper } from '../IconWrapper'; | ||
import { IconProps } from '../Icons.types'; | ||
|
||
const Asterisk: FC<IconProps> = (allProps) => { | ||
const { svgProps: props, ...restProps } = allProps; | ||
return ( | ||
<IconWrapper | ||
componentName="Asterisk" | ||
icon={ | ||
<svg | ||
width="inherit" | ||
height="inherit" | ||
viewBox="0 0 5 5" | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
{...props} | ||
> | ||
<path | ||
d="M0.687978 4.28802L0.795978 4.14402L1.43198 3.32202L1.83998 2.84202C1.82798 2.81802 1.82198 2.79402 1.81598 2.76402L1.20998 2.62002L0.207978 2.33802L0.039978 2.28402L0.327978 1.40202L0.495978 1.45602L1.47398 1.81002L2.04398 2.04402C2.06798 2.02602 2.09198 2.00802 2.11598 1.99002L2.07398 1.39002L2.03798 0.346015V0.166016H2.96198V0.346015L2.92598 1.39002L2.87798 1.99002C2.90198 2.00802 2.92598 2.02602 2.94998 2.04402L3.51998 1.81002L4.50398 1.45602L4.67198 1.40202L4.95998 2.28402L4.78598 2.33802L3.78398 2.62002L3.17798 2.76402C3.17198 2.79402 3.16598 2.81802 3.15398 2.84202L3.56198 3.32202L4.20398 4.14402L4.30598 4.28802L3.55598 4.83402L3.45398 4.68402L2.87198 3.82002L2.54798 3.29202C2.52998 3.29202 2.51198 3.29202 2.49998 3.29202C2.48198 3.29202 2.46398 3.29202 2.44598 3.29202L2.12198 3.82002L1.53998 4.68402L1.43798 4.83402L0.687978 4.28802Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
} | ||
{...restProps} | ||
/> | ||
); | ||
}; | ||
|
||
export default Asterisk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
import { TextInputStyles } from './TextInput.types'; | ||
|
||
//optimisation needed for this part | ||
export const backgroundColor: TextInputStyles = { | ||
error: { light: 'red-100', dark: 'red-100' }, | ||
const backgroundColor: TextInputStyles = { | ||
error: { light: 'red-100', dark: 'gray-800' }, | ||
success: { light: 'green-100', dark: 'gray-800' }, | ||
disabled: { light: 'gray-200', dark: 'gray-800' }, | ||
default: { light: 'white', dark: 'gray-800' }, | ||
}; | ||
|
||
export const borderColor: TextInputStyles = { | ||
error: { light: 'red-400', dark: 'red-400' }, | ||
const borderColor: TextInputStyles = { | ||
error: { light: 'red-400', dark: 'red-500' }, | ||
success: { light: 'green-500', dark: 'green-400' }, | ||
disabled: { light: 'gray-300', dark: 'gray-900' }, | ||
default: { light: 'gray-200', dark: 'gray-800' }, | ||
}; | ||
|
||
export const textColor: TextInputStyles = { | ||
error: { light: 'red-700', dark: 'red-700' }, | ||
const textColor: TextInputStyles = { | ||
error: { light: 'gray-1000', dark: 'gray-100' }, | ||
success: { light: 'gray-1000', dark: 'gray-100' }, | ||
disabled: { light: 'gray-400', dark: 'gray-700' }, | ||
default: { light: 'gray-1000', dark: 'gray-100' }, | ||
}; | ||
|
||
export const placeholderColor: TextInputStyles = { | ||
error: { light: 'red-600', dark: 'red-600' }, | ||
const descriptionColor: TextInputStyles = { | ||
error: { light: 'gray-1000', dark: 'gray-100' }, | ||
success: { light: 'gray-1000', dark: 'gray-100' }, | ||
disabled: { light: 'gray-400', dark: 'gray-600' }, | ||
default: { light: 'gray-400', dark: 'gray-600' }, | ||
}; | ||
const iconColor: TextInputStyles = { | ||
error: { light: 'red-700', dark: 'red-500' }, | ||
success: { light: 'green-600', dark: 'green-400' }, | ||
disabled: { light: 'gray-400', dark: 'gray-700' }, | ||
default: { light: 'gray-400', dark: 'gray-500' }, | ||
default: { light: 'gray-300', dark: 'gray-600' }, | ||
}; | ||
|
||
export const textInputColor = { | ||
backgroundColor: backgroundColor, | ||
borderColor: borderColor, | ||
textColor: textColor, | ||
iconColor: iconColor, | ||
descriptionColor: descriptionColor, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { ThemeModeColors } from 'blocks/Blocks.types'; | ||
|
||
export type TextInputStates = 'error' | 'disabled' | 'default'; | ||
export type TextInputStates = 'error' | 'disabled' | 'default' | 'success'; | ||
export type TextInputStyles = Record<TextInputStates, ThemeModeColors>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters