Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-library): props alignment form caption #1023

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const hintCaption = BlrFormCaptionRenderFunction({
message: 'This is a hint',
variant: 'hint',
icon: 'blrInfo',
size: 'md',
sizeVariant: 'md',
theme: 'Light',
});

const errorCaption = BlrFormCaptionRenderFunction({
message: 'This is an error',
variant: 'error',
icon: 'blrInfo',
size: 'md',
sizeVariant: 'md',
theme: 'Light',
});

Expand Down
22 changes: 10 additions & 12 deletions packages/ui-library/src/components/form-caption/index.stories.ts
thrbnhrtmnn marked this conversation as resolved.
Show resolved Hide resolved
thrbnhrtmnn marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
sizeVariant: {
options: FormSizes,
control: { type: 'radio' },
defaultValue: 'sm',
description: ' Choose size of the component.',
table: {
category: 'Appearance',
Expand All @@ -43,20 +44,20 @@ export default {
category: 'Appearance',
},
},

icon: {
options: [undefined, ...PureIconKeys],
control: { type: 'select' },
defaultValue: 'blr360',
description: 'Select an icon which is displayed inside of the input.',
table: {
category: 'Content / Setting',
category: 'Content / Settings',
thrbnhrtmnn marked this conversation as resolved.
Show resolved Hide resolved
},
},
message: {
options: [undefined, ...PureIconKeys],
description: 'Enter the message the component should have.',
table: {
category: 'Content / Setting',
category: 'Content / Settings',
},
},
},
Expand All @@ -72,15 +73,12 @@ export default {
description: {
component: `<Markdown>
Form Caption provides either a brief hint or error message to a related form element such as Input Field Text or Select. It is typically displayed below the form element, and it can be used to provide additional information about the type of information a user has to provide, like an example of the correct data format.
- [**Appearance**](#appearance)
- [**Variant**](#variant)
- [**Size Variant**](#size-variant)
- [**Dependencies**](#dependencies)
- [**Icon**](#icon)
The Form Caption is intended to be used when creating new components. Currently, it is used like this in the following components:
- [**Form Caption Group**](?path=/docs/components-form-caption-group--docs)
- [**Toggle Switch**](?path=/docs/components-toggle-switch--docs)
Expand All @@ -99,7 +97,7 @@ BlrFormCaption.storyName = 'Form Caption';
const args: BlrFormCaptionType = {
theme: 'Light',
message: 'Message-text',
icon: 'blr360',
icon: 'blrInfo',
variant: 'hint',
sizeVariant: 'sm',
};
Expand All @@ -121,7 +119,7 @@ export const Variant = () => {
theme: 'Light',
sizeVariant: 'sm',
message: 'Hint',
icon: 'blr360',
icon: 'blrInfo',
})}
</div>
<div class="wrapper">
Expand Down Expand Up @@ -151,7 +149,7 @@ export const SizeVariant = () => {
theme: 'Light',
sizeVariant: 'sm',
message: 'Form Caption SM',
icon: 'blr360',
icon: 'blrInfo',
})}
</div>
<div class="wrapper">
Expand All @@ -160,7 +158,7 @@ export const SizeVariant = () => {
theme: 'Light',
sizeVariant: 'md',
message: 'Form Caption MD',
icon: 'blr360',
icon: 'blrInfo',
})}
</div>
Expand All @@ -170,7 +168,7 @@ export const SizeVariant = () => {
theme: 'Light',
sizeVariant: 'lg',
message: 'Form Caption LG',
icon: 'blr360',
icon: 'blrInfo',
})}
</div>
`;
Expand All @@ -193,7 +191,7 @@ export const Icon = () => {
theme: 'Light',
sizeVariant: 'sm',
message: 'With icon',
icon: 'blr360',
icon: 'blrInfo',
})}
</div>
<div class="wrapper">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-library/src/components/form-caption/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class BlrFormCaption extends LitElement {
${dynamicStyles}
</style>
<div class=${classes}>
${this.icon
${Boolean(this.icon)
? BlrIconRenderFunction(
{
icon: calculateIconName(
Expand Down
Loading