mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
feat: add appearance control to checkbox component stories
This commit is contained in:
@@ -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>
|
||||
`,
|
||||
|
||||
Reference in New Issue
Block a user