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
8fadb565
Commit
8fadb565
authored
Jun 15, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks for require indicator
parent
9263c645
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
Form.ts
theme/components/Form.ts
+5
-1
Input.ts
theme/components/Input.ts
+1
-1
getDefaultFormColors.ts
theme/utils/getDefaultFormColors.ts
+2
-2
No files found.
theme/components/Form.ts
View file @
8fadb565
...
@@ -19,7 +19,7 @@ const getActiveInputStyles = (theme: Dict, fc: string) => ({
...
@@ -19,7 +19,7 @@ const getActiveInputStyles = (theme: Dict, fc: string) => ({
const
variantFloating
:
PartsStyleFunction
<
typeof
parts
>
=
(
props
:
StyleFunctionProps
)
=>
{
const
variantFloating
:
PartsStyleFunction
<
typeof
parts
>
=
(
props
:
StyleFunctionProps
)
=>
{
const
{
theme
}
=
props
;
const
{
theme
}
=
props
;
const
{
focus
BorderColor
:
fc
,
errorBorde
rColor
:
ec
}
=
getDefaultFormColors
(
props
);
const
{
focus
Color
:
fc
,
erro
rColor
:
ec
}
=
getDefaultFormColors
(
props
);
const
activeLabelStyles
=
getActiveLabelStyles
(
theme
,
fc
);
const
activeLabelStyles
=
getActiveLabelStyles
(
theme
,
fc
);
const
activeInputStyles
=
getActiveInputStyles
(
theme
,
fc
);
const
activeInputStyles
=
getActiveInputStyles
(
theme
,
fc
);
...
@@ -65,6 +65,10 @@ const variantFloating: PartsStyleFunction<typeof parts> = (props: StyleFunctionP
...
@@ -65,6 +65,10 @@ const variantFloating: PartsStyleFunction<typeof parts> = (props: StyleFunctionP
borderColor
:
getColor
(
theme
,
ec
),
borderColor
:
getColor
(
theme
,
ec
),
},
},
},
},
requiredIndicator
:
{
marginStart
:
0
,
color
:
fc
,
},
}
}
}
}
...
...
theme/components/Input.ts
View file @
8fadb565
...
@@ -17,7 +17,7 @@ const sizes: Record<string, SystemStyleObject> = {
...
@@ -17,7 +17,7 @@ const sizes: Record<string, SystemStyleObject> = {
const
variantOutline
:
PartsStyleFunction
<
typeof
parts
>
=
(
props
)
=>
{
const
variantOutline
:
PartsStyleFunction
<
typeof
parts
>
=
(
props
)
=>
{
const
{
theme
}
=
props
const
{
theme
}
=
props
const
{
focus
BorderColor
:
fc
,
errorBorde
rColor
:
ec
}
=
getDefaultFormColors
(
props
)
const
{
focus
Color
:
fc
,
erro
rColor
:
ec
}
=
getDefaultFormColors
(
props
)
return
{
return
{
field
:
{
field
:
{
...
...
theme/utils/getDefaultFormColors.ts
View file @
8fadb565
...
@@ -4,7 +4,7 @@ import { mode } from '@chakra-ui/theme-tools';
...
@@ -4,7 +4,7 @@ import { mode } from '@chakra-ui/theme-tools';
export
default
function
getDefaultFormColors
(
props
:
StyleFunctionProps
)
{
export
default
function
getDefaultFormColors
(
props
:
StyleFunctionProps
)
{
const
{
focusBorderColor
:
fc
,
errorBorderColor
:
ec
}
=
props
const
{
focusBorderColor
:
fc
,
errorBorderColor
:
ec
}
=
props
return
{
return
{
focus
Border
Color
:
fc
||
mode
(
'
brand.700
'
,
'
brand.300
'
)(
props
),
focusColor
:
fc
||
mode
(
'
brand.700
'
,
'
brand.300
'
)(
props
),
error
Border
Color
:
ec
||
mode
(
'
red.400
'
,
'
red.300
'
)(
props
),
errorColor
:
ec
||
mode
(
'
red.400
'
,
'
red.300
'
)(
props
),
}
}
}
}
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