-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update textarea to new styles (#2016)
* feat: update textarea to new styles * chore: fix used component in tools app * chore: add changeset
- Loading branch information
Showing
5 changed files
with
144 additions
and
152 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@kadena/react-ui": patch | ||
--- | ||
|
||
feat: update textarea component to new styling |
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
70 changes: 25 additions & 45 deletions
70
packages/libs/react-ui/src/components/Form/TextareaField/TextareaField.css.ts
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,54 +1,34 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
import { atoms, token } from '../../../styles'; | ||
import { style, styleVariants } from '@vanilla-extract/css'; | ||
import { token } from '../../../styles'; | ||
|
||
export const addon = style({ | ||
position: 'absolute', | ||
insetBlockStart: token('spacing.sm'), | ||
insetInlineEnd: token('spacing.sm'), | ||
}); | ||
|
||
export const textarea = style([ | ||
atoms({ | ||
borderRadius: 'sm', | ||
backgroundColor: 'input.default', | ||
border: 'none', | ||
color: 'text.base.default', | ||
outline: 'none', | ||
flex: 1, | ||
overflow: 'hidden', | ||
}), | ||
{ | ||
paddingInline: token('spacing.md'), | ||
paddingBlock: token('spacing.sm'), | ||
minHeight: token('size.n20'), | ||
resize: 'none', | ||
'::placeholder': { | ||
color: token('color.text.subtlest.default'), | ||
const textareaBase = style({ | ||
resize: 'none', | ||
scrollbarWidth: 'none', | ||
}); | ||
|
||
export const textarea = styleVariants({ | ||
sm: [ | ||
textareaBase, | ||
{ | ||
minHeight: token('size.n24'), | ||
}, | ||
boxShadow: `0px 1px 0 0 ${token('color.border.base.default')}`, | ||
outlineOffset: '2px', | ||
selectors: { | ||
'&[data-outlined]': { | ||
border: `2px solid ${token('color.border.base.default')}`, | ||
}, | ||
[`&:has(~ ${addon})`]: { | ||
paddingInlineEnd: `calc(var(--end-addon-width) + ${token( | ||
'spacing.lg', | ||
)})`, | ||
}, | ||
'&[data-positive]': { | ||
outline: `2px solid ${token('color.border.semantic.positive.@focus')}`, | ||
}, | ||
'&[data-disabled]': { | ||
pointerEvents: 'none', | ||
backgroundColor: token('color.background.layer.default'), | ||
}, | ||
'&[data-focused]': { | ||
outline: `2px solid ${token('color.border.semantic.info.@focus')}`, | ||
}, | ||
'&[data-invalid]': { | ||
outline: `2px solid ${token('color.border.semantic.negative.@focus')}`, | ||
}, | ||
], | ||
md: [ | ||
textareaBase, | ||
{ | ||
minHeight: token('size.n30'), | ||
}, | ||
}, | ||
]); | ||
], | ||
lg: [ | ||
textareaBase, | ||
{ | ||
minHeight: '140px', | ||
}, | ||
], | ||
}); |
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
Oops, something went wrong.