@mozaic-ds/vue
Version:
Mozaic-Vue is the Vue.js implementation of ADEO Design system
61 lines (55 loc) • 1.72 kB
text/typescript
import type { Meta, StoryObj } from '@storybook/vue3-vite';
import { action } from 'storybook/actions';
import MTileClickable from './MTileClickable.vue';
const meta: Meta<typeof MTileClickable> = {
title: 'Content/Tile/Clickable',
component: MTileClickable,
parameters: {
docs: {
description: {
component:
'A tile is a container component used to group related content and actions within a structured layout. It provides a clickable or static area that can display text, images, icons, or interactive elements. Tiles are commonly used to present key information, navigate to detailed views, or trigger specific actions in dashboards, cards, and grid-based layouts. Their adaptable design allows them to accommodate various content types while maintaining a consistent and organized interface.',
},
},
},
args: {
appearance: 'primary',
iconPosition: 'right',
bordered: true,
default: `
<div class="placeholder-slot">
Insert a form element here to replace this slot.
</div>
`,
},
render: (args) => ({
components: { MTileClickable },
setup() {
const handleAction = action('action');
return { args, handleAction };
},
template: `
<MTileClickable v-bind="args" @action="handleAction">
${args.default}
</MTileClickable>
`,
}),
};
export default meta;
type Story = StoryObj<typeof MTileClickable>;
export const Default: Story = {};
export const WithBottomAction: Story = {
args: {
iconPosition: 'bottom',
},
};
export const ExternalLink: Story = {
args: {
href: '#',
},
};
export const InternalNavigation: Story = {
args: {
to: 'routeName',
},
};