Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
b9417e2e
Commit
b9417e2e
authored
Feb 18, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix input styles
parent
28d52130
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
15 deletions
+24
-15
field.tsx
toolkit/chakra/field.tsx
+2
-0
semanticTokens.ts
toolkit/theme/foundations/semanticTokens.ts
+1
-0
field.recipe.ts
toolkit/theme/recipes/field.recipe.ts
+1
-1
input.recipe.ts
toolkit/theme/recipes/input.recipe.ts
+7
-1
Input.tsx
ui/showcases/Input.tsx
+13
-13
No files found.
toolkit/chakra/field.tsx
View file @
b9417e2e
...
...
@@ -27,6 +27,8 @@ export const Field = React.forwardRef<HTMLDivElement, FieldProps>(
size
:
props
.
size
,
floating
:
props
.
floating
,
bgColor
:
rest
.
bgColor
,
disabled
:
rest
.
disabled
,
readOnly
:
rest
.
readOnly
,
};
const
labelElement
=
(
...
...
toolkit/theme/foundations/semanticTokens.ts
View file @
b9417e2e
...
...
@@ -232,6 +232,7 @@ const semanticTokens: ThemingConfig['semanticTokens'] = {
readOnly
:
{
value
:
{
_light
:
'
{colors.gray.200}
'
,
_dark
:
'
{colors.gray.800}
'
}
},
error
:
{
value
:
'
{colors.red.500}
'
},
},
placeholder
:
{
value
:
'
{colors.gray.500}
'
},
},
field
:
{
placeholder
:
{
...
...
toolkit/theme/recipes/field.recipe.ts
View file @
b9417e2e
...
...
@@ -52,7 +52,7 @@ export const recipe = defineSlotRecipe({
bg
:
'
bg
'
,
top
:
'
2px
'
,
left
:
'
2px
'
,
color
:
'
gray.500
'
,
color
:
'
input.placeholder
'
,
width
:
'
calc(100% - 4px)
'
,
borderRadius
:
'
base
'
,
pointerEvents
:
'
none
'
,
...
...
toolkit/theme/recipes/input.recipe.ts
View file @
b9417e2e
...
...
@@ -52,8 +52,14 @@ export const recipe = defineRecipe({
outline
:
{
bg
:
'
input.bg
'
,
borderWidth
:
'
2px
'
,
borderColor
:
'
input.border
'
,
borderColor
:
'
input.border
.filled
'
,
focusVisibleRing
:
'
none
'
,
_placeholder
:
{
color
:
'
input.placeholder
'
,
},
_placeholderShown
:
{
borderColor
:
'
input.border
'
,
},
_hover
:
{
borderColor
:
'
input.border.hover
'
,
},
...
...
ui/showcases/Input.tsx
View file @
b9417e2e
...
...
@@ -66,11 +66,11 @@ const InputShowcase = () => {
<
Field
label=
"Email"
required
floating
size=
"xl"
helperText=
"Helper text"
maxWidth=
"300px"
>
<
Input
size=
"xl"
/>
</
Field
>
<
Field
label=
"Email (disabled)"
required
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
disabled
value=
"me@example.com"
/>
<
Field
label=
"Email (disabled)"
required
floating
disabled
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (readOnly)"
required
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
readOnly
value=
"me@example.com"
/>
<
Field
label=
"Email (readOnly)"
required
floating
readOnly
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (invalid)"
required
floating
size=
"xl"
errorText=
"Something went wrong"
invalid
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"duck"
/>
...
...
@@ -84,25 +84,25 @@ const InputShowcase = () => {
<
Field
label=
"Email"
required
helperText=
"Helper text"
maxWidth=
"200px"
>
<
Input
/>
</
Field
>
<
Field
label=
"Email (disabled)"
required
maxWidth=
"200px"
>
<
Input
disabled
value=
"me@example.com"
/>
<
Field
label=
"Email (disabled)"
required
disabled
maxWidth=
"200px"
>
<
Input
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (readOnly)"
required
maxWidth=
"200px"
>
<
Input
readOnly
value=
"me@example.com"
/>
<
Field
label=
"Email (readOnly)"
required
readOnly
maxWidth=
"200px"
>
<
Input
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (invalid)"
required
errorText=
"Something went wrong"
invalid
maxWidth=
"200px"
>
<
Input
size=
"xl"
value=
"duck"
/>
<
Input
value=
"duck"
/>
</
Field
>
</
Sample
>
<
Sample
label=
"floating label"
p=
{
4
}
bgColor=
{
{
_light
:
'
blackAlpha.200
'
,
_dark
:
'
whiteAlpha.200
'
}
}
alignItems=
"flex-start"
>
<
Field
label=
"Email"
required
floating
size=
"xl"
helperText=
"Helper text"
maxWidth=
"300px"
>
<
Input
size=
"xl"
/>
</
Field
>
<
Field
label=
"Email (disabled)"
required
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
disabled
value=
"me@example.com"
/>
<
Field
label=
"Email (disabled)"
required
disabled
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (readOnly)"
required
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
readOnly
value=
"me@example.com"
/>
<
Field
label=
"Email (readOnly)"
required
readOnly
floating
size=
"xl"
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"me@example.com"
/>
</
Field
>
<
Field
label=
"Email (invalid)"
required
floating
size=
"xl"
errorText=
"Something went wrong"
invalid
maxWidth=
"300px"
>
<
Input
size=
"xl"
value=
"duck"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment