File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed
packages/orchestrator-ui-components/src/components Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ export const getCommonFormFieldStyles = ({ theme }: WfoTheme) => {
21
21
} ,
22
22
} ) ;
23
23
24
+ const errorStyle = css ( {
25
+ color : theme . colors . dangerText ,
26
+ } ) ;
24
27
return {
28
+ errorStyle,
25
29
formRowStyle,
26
30
} ;
27
31
} ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ import { usePydanticFormContext } from 'pydantic-forms' ;
4
+
5
+ import { css } from '@emotion/react' ;
6
+
7
+ const headerStyling = css `
8
+ padding : 20px 0 ;
9
+ font-size : larger;
10
+ font-weight : bold;
11
+ margin-bottom : 15px ;
12
+ ` ;
13
+
14
+ export const Header = ( ) => {
15
+ const { pydanticFormSchema } = usePydanticFormContext ( ) ;
16
+
17
+ return < h3 css = { headerStyling } > { pydanticFormSchema ?. title } </ h3 > ;
18
+ } ;
Original file line number Diff line number Diff line change @@ -12,19 +12,31 @@ export const Row: RowRenderComponent = ({
12
12
description,
13
13
error,
14
14
isInvalid,
15
+ required,
15
16
children,
16
17
} ) => {
17
- const { formRowStyle } = useWithOrchestratorTheme ( getCommonFormFieldStyles ) ;
18
+ const { formRowStyle, errorStyle } = useWithOrchestratorTheme (
19
+ getCommonFormFieldStyles ,
20
+ ) ;
21
+
18
22
return (
19
23
< EuiFormRow
20
24
css = { formRowStyle }
21
- label = { title }
25
+ label = {
26
+ title ? (
27
+ < EuiText size = "m" >
28
+ < div css = { error && errorStyle } >
29
+ { title } { required && '*' }
30
+ </ div >
31
+ </ EuiText >
32
+ ) : undefined
33
+ }
22
34
labelAppend = { < EuiText size = "m" > { description } </ EuiText > }
23
35
error = { error }
24
36
isInvalid = { isInvalid }
25
37
fullWidth
26
38
>
27
- < div > { children } </ div >
39
+ < > { children } </ >
28
40
</ EuiFormRow >
29
41
) ;
30
42
} ;
You can’t perform that action at this time.
0 commit comments