File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
libs/flowbite-angular/form/src Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11import { injectFlowbiteHelperConfig } from '../config/helper-config' ;
22import { injectFlowbiteFormFieldState } from '../form-field/form-field-state' ;
3+ import type { FlowbiteFormFieldColors } from '../form-field/theme' ;
34import { flowbiteHelperState , provideFlowbiteHelperState } from './helper-state' ;
45
56import { colorToTheme , mergeDeep } from 'flowbite-angular' ;
@@ -28,6 +29,11 @@ export class Helper {
2829 readonly config = injectFlowbiteHelperConfig ( ) ;
2930 readonly formFieldState = injectFlowbiteFormFieldState ( ) ;
3031
32+ /**
33+ * @see {@link injectFlowbiteFormFieldState }
34+ */
35+ readonly color = input < keyof FlowbiteFormFieldColors > ( ) ;
36+
3137 /**
3238 * @see {@link injectFlowbiteHelperConfig }
3339 */
@@ -41,7 +47,7 @@ export class Helper {
4147 root : twMerge (
4248 mergedTheme . host . base ,
4349 mergedTheme . host . transition ,
44- colorToTheme ( mergedTheme . host . color , this . formFieldState ( ) . color ( ) )
50+ colorToTheme ( mergedTheme . host . color , this . state . color ( ) ?? this . formFieldState ( ) . color ( ) )
4551 ) ,
4652 } ,
4753 } ;
Original file line number Diff line number Diff line change 11import { injectFlowbiteLabelConfig } from '../config/label-config' ;
22import { injectFlowbiteFormFieldState } from '../form-field/form-field-state' ;
3+ import type { FlowbiteFormFieldColors } from '../form-field/theme' ;
34import { flowbiteLabelState , provideFlowbiteLabelState } from './label-state' ;
45
56import { colorToTheme , mergeDeep } from 'flowbite-angular' ;
@@ -28,6 +29,11 @@ export class Label {
2829 readonly config = injectFlowbiteLabelConfig ( ) ;
2930 readonly formFieldState = injectFlowbiteFormFieldState ( ) ;
3031
32+ /**
33+ * @see {@link injectFlowbiteFormFieldState }
34+ */
35+ readonly color = input < keyof FlowbiteFormFieldColors > ( ) ;
36+
3137 /**
3238 * @see {@link injectFlowbiteLabelConfig }
3339 */
@@ -41,7 +47,7 @@ export class Label {
4147 root : twMerge (
4248 mergedTheme . host . base ,
4349 mergedTheme . host . transition ,
44- colorToTheme ( mergedTheme . host . color , this . formFieldState ( ) . color ( ) ) ,
50+ colorToTheme ( mergedTheme . host . color , this . state . color ( ) ?? this . formFieldState ( ) . color ( ) ) ,
4551 mergedTheme . host . mode [ this . formFieldState ( ) . mode ( ) ]
4652 ) ,
4753 } ,
You can’t perform that action at this time.
0 commit comments