Skip to content

Commit a64cfe8

Browse files
authored
chore: prepare 20.1.3 (#148)
* fix(form_field): add color input on helper and label ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> - [x] Release <!-- Please set this as a title and change the version number If you don't know the version number, run on the main branch the release GitHub workflow with dryRun enabled chore: prepare 20.1.3 -->
2 parents 6640e16 + 15a448c commit a64cfe8

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

libs/flowbite-angular/form/src/helper/helper.directive.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { injectFlowbiteHelperConfig } from '../config/helper-config';
22
import { injectFlowbiteFormFieldState } from '../form-field/form-field-state';
3+
import type { FlowbiteFormFieldColors } from '../form-field/theme';
34
import { flowbiteHelperState, provideFlowbiteHelperState } from './helper-state';
45

56
import { 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
};

libs/flowbite-angular/form/src/label/label.directive.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { injectFlowbiteLabelConfig } from '../config/label-config';
22
import { injectFlowbiteFormFieldState } from '../form-field/form-field-state';
3+
import type { FlowbiteFormFieldColors } from '../form-field/theme';
34
import { flowbiteLabelState, provideFlowbiteLabelState } from './label-state';
45

56
import { 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
},

0 commit comments

Comments
 (0)