Skip to content

Commit

Permalink
fix(ui-library): props alignment form label
Browse files Browse the repository at this point in the history
  • Loading branch information
RubirajAccenture committed Feb 22, 2024
1 parent e459f9f commit 8617051
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import { Themes } from '../../foundation/_tokens-generated/index.themes';
import { FormSizes, LabelVariants } from '../../globals/constants';
import { FormSizes } from '../../globals/constants';
import { BlrFormLabelType } from './index';
import { BlrFormLabelRenderFunction } from './renderFunction';
import { html } from 'lit-html';
Expand Down Expand Up @@ -56,13 +56,14 @@ export default {
},

hasError: {
name: 'hasError',
description: 'Choose if component has an error.',
options: LabelVariants,
control: { type: 'select' },
defaultValue: false,
table: {
category: 'Validation',
category: 'Validations',
},
},

forValue: {
description: 'This references the id of the component to which the label is added.',
control: { type: 'text' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('blr-form-label', () => {
);
const blrLabel = querySelectorDeep('label.blr-form-label', element.getRootNode() as HTMLElement);
const errorLabel = blrLabel?.getAttribute('class');
expect(errorLabel).to.contain('true');
expect(errorLabel).to.contain('error');
});

it('has a size md by default', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-library/src/components/form-label/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class BlrFormLabel extends LitElement {
const labelClasses = classMap({
'blr-form-label': true,
[`${this.sizeVariant}`]: this.sizeVariant,
[`${this.hasError}`]: this.hasError,
'error': this.hasError,
});

const spanClasses = classMap({
Expand Down

0 comments on commit 8617051

Please sign in to comment.