import type { CSSObject } from 'styled-components' import type { FoundationTokenType } from '../../../tokens/theme.token' import { BreakpointType } from '../../../breakpoints/breakPoints' enum TextAreaState { DEFAULT = 'default', HOVER = 'hover', FOCUS = 'focus', ERROR = 'error', DISABLED = 'disabled', } export type TextAreaTokensType = { gap: CSSObject['gap'] placeholder?: { color?: CSSObject['color'] fontWeight?: CSSObject['fontWeight'] } label: { fontSize: CSSObject['fontSize'] fontWeight: CSSObject['fontWeight'] color: { [key in TextAreaState]: CSSObject['color'] } } subLabel: { fontSize: CSSObject['fontSize'] fontWeight: CSSObject['fontWeight'] color: { [key in TextAreaState]: CSSObject['color'] } } helpIcon: { width: CSSObject['width'] color: { [key in TextAreaState]: CSSObject['color'] } } hintText: { fontSize: CSSObject['fontSize'] fontWeight: CSSObject['fontWeight'] color: { [key in TextAreaState]: CSSObject['color'] } } errorMessage: { fontSize: CSSObject['fontSize'] fontWeight: CSSObject['fontWeight'] color: CSSObject['color'] } required: { color: CSSObject['color'] } inputContainer: { fontSize: CSSObject['fontSize'] fontWeight: CSSObject['fontWeight'] padding: { x: CSSObject['padding'] y: CSSObject['padding'] } borderRadius: CSSObject['borderRadius'] boxShadow: CSSObject['boxShadow'] border: { [key in TextAreaState]: CSSObject['border'] } color: { [key in TextAreaState]: CSSObject['color'] } backgroundColor: { [key in TextAreaState]: CSSObject['backgroundColor'] } } } export type ResponsiveTextAreaTokens = { [key in keyof BreakpointType]: TextAreaTokensType } export const getTextAreaTokens = ( foundationTokens: FoundationTokenType ): ResponsiveTextAreaTokens => { return { sm: { gap: foundationTokens.unit[8], placeholder: { color: foundationTokens.colors.gray[400], fontWeight: foundationTokens.font.weight[500], }, label: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], color: { default: foundationTokens.colors.gray[700], hover: foundationTokens.colors.gray[700], focus: foundationTokens.colors.gray[700], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, subLabel: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[400], color: { default: foundationTokens.colors.gray[400], hover: foundationTokens.colors.gray[400], focus: foundationTokens.colors.gray[400], disabled: foundationTokens.colors.gray[300], error: foundationTokens.colors.red[600], }, }, helpIcon: { width: foundationTokens.unit[14], color: { default: foundationTokens.colors.gray[400], hover: foundationTokens.colors.gray[400], focus: foundationTokens.colors.gray[400], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, hintText: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[400], color: { default: foundationTokens.colors.gray[500], hover: foundationTokens.colors.gray[500], focus: foundationTokens.colors.gray[500], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, errorMessage: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], color: foundationTokens.colors.red[600], }, required: { color: foundationTokens.colors.red[600], }, inputContainer: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], padding: { x: foundationTokens.unit[14], y: foundationTokens.unit[10], }, borderRadius: foundationTokens.unit[8], boxShadow: foundationTokens.shadows.sm, border: { default: `1px solid ${foundationTokens.colors.gray[200]}`, hover: `1px solid ${foundationTokens.colors.gray[400]}`, focus: `1px solid ${foundationTokens.colors.primary[500]}`, error: `1px solid ${foundationTokens.colors.red[500]}`, disabled: `1px solid ${foundationTokens.colors.gray[200]}`, }, color: { default: foundationTokens.colors.gray[700], hover: foundationTokens.colors.gray[700], focus: foundationTokens.colors.gray[700], error: foundationTokens.colors.red[700], disabled: foundationTokens.colors.gray[300], }, backgroundColor: { default: foundationTokens.colors.gray[0], hover: foundationTokens.colors.gray[0], focus: foundationTokens.colors.gray[0], error: foundationTokens.colors.gray[0], disabled: foundationTokens.colors.gray[50], }, }, }, lg: { gap: foundationTokens.unit[8], placeholder: { color: foundationTokens.colors.gray[400], fontWeight: foundationTokens.font.weight[500], }, label: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], color: { default: foundationTokens.colors.gray[700], hover: foundationTokens.colors.gray[700], focus: foundationTokens.colors.gray[700], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, subLabel: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[400], color: { default: foundationTokens.colors.gray[400], hover: foundationTokens.colors.gray[400], focus: foundationTokens.colors.gray[400], disabled: foundationTokens.colors.gray[300], error: foundationTokens.colors.red[600], }, }, helpIcon: { width: foundationTokens.unit[14], color: { default: foundationTokens.colors.gray[400], hover: foundationTokens.colors.gray[400], focus: foundationTokens.colors.gray[400], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, hintText: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[400], color: { default: foundationTokens.colors.gray[500], hover: foundationTokens.colors.gray[500], focus: foundationTokens.colors.gray[500], disabled: foundationTokens.colors.gray[400], error: foundationTokens.colors.red[600], }, }, errorMessage: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], color: foundationTokens.colors.red[600], }, required: { color: foundationTokens.colors.red[600], }, inputContainer: { fontSize: foundationTokens.font.size.body.md.fontSize, fontWeight: foundationTokens.font.weight[500], padding: { x: foundationTokens.unit[14], y: foundationTokens.unit[10], }, borderRadius: foundationTokens.unit[8], boxShadow: foundationTokens.shadows.sm, border: { default: `1px solid ${foundationTokens.colors.gray[200]}`, hover: `1px solid ${foundationTokens.colors.gray[400]}`, focus: `1px solid ${foundationTokens.colors.primary[500]}`, error: `1px solid ${foundationTokens.colors.red[500]}`, disabled: `1px solid ${foundationTokens.colors.gray[200]}`, }, color: { default: foundationTokens.colors.gray[700], hover: foundationTokens.colors.gray[700], focus: foundationTokens.colors.gray[700], error: foundationTokens.colors.red[700], disabled: foundationTokens.colors.gray[300], }, backgroundColor: { default: foundationTokens.colors.gray[0], hover: foundationTokens.colors.gray[0], focus: foundationTokens.colors.gray[0], error: foundationTokens.colors.gray[0], disabled: foundationTokens.colors.gray[50], }, }, }, } } export default getTextAreaTokens