feat: add appearance control to checkbox component stories

This commit is contained in:
Lorenz Hilpert
2025-03-14 16:14:03 +01:00
parent 576d439a79
commit d4c1cdbc6e

View File

@@ -1,9 +1,10 @@
import { type Meta, type StoryObj } from '@storybook/angular';
import { CheckboxComponent } from '@isa/ui/input-controls';
import { type Meta, type StoryObj, argsToTemplate } from '@storybook/angular';
import { CheckboxAppearance, CheckboxComponent } from '@isa/ui/input-controls';
type CheckboxComponentInputs = {
checked: boolean;
disabled: boolean;
appearance: CheckboxAppearance;
};
const meta: Meta<CheckboxComponentInputs> = {
@@ -12,11 +13,15 @@ const meta: Meta<CheckboxComponentInputs> = {
argTypes: {
checked: { control: 'boolean' },
disabled: { control: 'boolean' },
appearance: { control: 'select', options: Object.values(CheckboxAppearance) },
},
args: {
appearance: 'bullet',
},
render: (args) => ({
props: args,
template: `
<ui-checkbox>
<ui-checkbox ${argsToTemplate(args, { include: ['appearance'] })}>
<input type="checkbox" ${args.disabled ? 'disabled' : ''} ${args.checked ? 'checked' : ''} />
</ui-checkbox>
`,