Skip to content

Commit

Permalink
fix(ui-library): harmonized naming in form-caption and dependencie files
Browse files Browse the repository at this point in the history
  • Loading branch information
JpunktWpunkt committed Mar 12, 2024
1 parent 3701db6 commit 95e2648
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class BlrCheckbox extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.hintMessage,
icon: this.hintIcon,
})}
Expand All @@ -211,7 +211,7 @@ export class BlrCheckbox extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.errorMessage,
icon: this.errorIcon,
})}
Expand Down
18 changes: 9 additions & 9 deletions packages/ui-library/src/components/form-caption/index.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const sharedStyles = html`
export default {
title: 'Components/Form Caption',
argTypes: {
size: {
sizeVariant: {
options: FormSizes,
control: { type: 'radio' },
description: ' Choose size of the component.',
Expand Down Expand Up @@ -101,7 +101,7 @@ const args: BlrFormCaptionType = {
message: 'Message-text',
icon: 'blr360',
variant: 'hint',
size: 'sm',
sizeVariant: 'sm',
};

BlrFormCaption.args = args;
Expand All @@ -119,7 +119,7 @@ export const Variant = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'sm',
sizeVariant: 'sm',
message: 'Hint',
icon: 'blr360',
})}
Expand All @@ -128,7 +128,7 @@ export const Variant = () => {
${BlrFormCaptionRenderFunction({
variant: 'error',
theme: 'Light',
size: 'sm',
sizeVariant: 'sm',
message: 'Error',
icon: 'blrErrorFilled',
})}
Expand All @@ -149,7 +149,7 @@ export const SizeVariant = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'sm',
sizeVariant: 'sm',
message: 'Form Caption SM',
icon: 'blr360',
})}
Expand All @@ -158,7 +158,7 @@ export const SizeVariant = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'md',
sizeVariant: 'md',
message: 'Form Caption MD',
icon: 'blr360',
})}
Expand All @@ -168,7 +168,7 @@ export const SizeVariant = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'lg',
sizeVariant: 'lg',
message: 'Form Caption LG',
icon: 'blr360',
})}
Expand All @@ -191,7 +191,7 @@ export const Icon = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'sm',
sizeVariant: 'sm',
message: 'With icon',
icon: 'blr360',
})}
Expand All @@ -200,7 +200,7 @@ export const Icon = () => {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: 'Light',
size: 'sm',
sizeVariant: 'sm',
message: 'Without icon',
})}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const sampleParams: BlrFormCaptionType = {
message: 'hallo',
icon: 'blr360',
variant: 'hint',
size: 'sm',
sizeVariant: 'sm',
};

describe('blr-form-caption', () => {
Expand Down
10 changes: 5 additions & 5 deletions packages/ui-library/src/components/form-caption/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ export class BlrFormCaption extends LitElement {
@property() message?: string;
@property() icon?: SizelessIconType;
@property() variant: CaptionVariantType = 'hint';
@property() size?: FormSizesType = 'md';
@property() sizeVariant?: FormSizesType = 'md';
@property() childElement?: TemplateResult<1>;
@property() theme: ThemeType = 'Light';

protected render() {
if (this.size) {
if (this.sizeVariant) {
const dynamicStyles = this.theme === 'Light' ? [captionLight] : [captionDark];

const classes = classMap({
'blr-form-caption': true,
[`${this.variant}`]: this.variant,
[`${this.size}`]: this.size,
[`${this.sizeVariant}`]: this.sizeVariant,
});

const iconClasses = classMap({
'blr-icon': true,
[this.size]: this.size,
[this.sizeVariant]: this.sizeVariant,
});

const iconSizeVariant = getComponentConfigToken([
'cmp',
'CaptionComponent',
'Icon',
'SizeVariant',
this.size.toUpperCase(),
this.sizeVariant.toUpperCase(),
]).toLowerCase() as SizesType;

return html`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class BlrInputFieldNumber extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.hintMessage,
icon: this.hintIcon,
})}
Expand All @@ -227,7 +227,7 @@ export class BlrInputFieldNumber extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.errorMessage,
icon: this.errorIcon,
})}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/input-field-text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class BlrInputFieldText extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.hintMessage,
icon: this.hintIcon,
})
Expand All @@ -153,7 +153,7 @@ export class BlrInputFieldText extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.errorMessage,
icon: this.errorIcon,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/radio-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class BlrRadioGroup extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.groupHintMessage,
icon: this.groupHintIcon,
})
Expand All @@ -80,7 +80,7 @@ export class BlrRadioGroup extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.groupErrorMessage,
icon: this.groupErrorIcon,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/radio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class BlrRadio extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.hintMessage,
icon: this.hintIcon,
})}
Expand All @@ -67,7 +67,7 @@ export class BlrRadio extends LitElement {
${BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.size,
sizeVariant: this.size,
message: this.errorMessage,
icon: this.errorIcon,
})}
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class BlrSelect extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.sizeVariant,
sizeVariant: this.sizeVariant,
message: this.hintMessage,
icon: this.hintMessageIcon,
})
Expand All @@ -142,7 +142,7 @@ export class BlrSelect extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.sizeVariant,
sizeVariant: this.sizeVariant,
message: this.errorMessage,
icon: this.errorMessageIcon,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-library/src/components/textarea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class BlrTextarea extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'hint',
theme: this.theme,
size: this.sizeVariant,
sizeVariant: this.sizeVariant,
message: this.hintMessage,
icon: this.hintMessageIcon,
})
Expand All @@ -186,7 +186,7 @@ export class BlrTextarea extends LitElement {
? BlrFormCaptionRenderFunction({
variant: 'error',
theme: this.theme,
size: this.sizeVariant,
sizeVariant: this.sizeVariant,
message: this.errorMessage,
icon: this.errorMessageIcon,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-library/src/components/toggle-switch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class BlrToggleSwitch extends LitElement {
message: this.hintMessage,
variant: 'hint',
icon: this.hintIcon,
size: this.size || 'sm',
sizeVariant: this.size || 'sm',
theme: this.theme,
})
: nothing}
Expand Down

0 comments on commit 95e2648

Please sign in to comment.