Skip to content
Merged
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
13 changes: 4 additions & 9 deletions 2nd-gen/packages/swc/components/asset/stories/asset.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ argTypes.size = {
// we need to use a select option and render a predefined HTML template based on the selected option
argTypes['default-slot'] = {
...argTypes['default-slot'],
control: { type: 'select' },
options: [undefined, 'slotted image'],
control: { type: 'text' },
};

/*
Expand Down Expand Up @@ -77,15 +76,11 @@ export default meta;
export const Playground: Story = {
// since we cant't use HTML templates in a slot control,
// we need to use a select option and render a predefined HTML template based on the selected option
render: (args) =>
html`<swc-asset label="${args.label}" variant="${args.variant}">
${args['default-slot'] === 'slotted image'
? html`<img src="https://picsum.photos/120/120" alt="Avatar" />`
: ''}
</swc-asset>`,
render: (args) => template({ ...args }),
args: {
variant: 'file',
label: 'picture.png',
variant: undefined,
'default-slot': `<img src="https://picsum.photos/120/120" alt="Avatar" />`,
},
tags: ['autodocs', 'dev'],
};
Expand Down
Loading