UNPKG

@mozaic-ds/vue

Version:

Mozaic-Vue is the Vue.js implementation of ADEO Design system

62 lines (56 loc) 1.79 kB
import type { Meta, StoryObj } from '@storybook/vue3-vite'; import { action } from 'storybook/actions'; import MTileSelectable from './MTileSelectable.vue'; const meta: Meta<typeof MTileSelectable> = { title: 'Content/Tile/Selectable', component: MTileSelectable, 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: { modelValue: false, inputType: 'checkbox', inputPosition: 'right', bordered: true, default: ` <div class="placeholder-slot"> Insert a form element here to replace this slot. </div> `, }, render: (args) => ({ components: { MTileSelectable }, setup() { const handleUpdate = action('update:modelValue'); return { args, handleUpdate }; }, template: ` <MTileSelectable v-bind="args" v-model="args.modelValue" @update:modelValue="handleUpdate"> ${args.default} </MTileSelectable> `, }), }; export default meta; type Story = StoryObj<typeof MTileSelectable>; export const Default: Story = {}; export const Radio: Story = { args: { inputType: 'radio', }, }; export const Left: Story = { args: { inputPosition: 'left', }, }; export const ClickableContainer: Story = { args: { trigger: 'container', }, };