import type { Meta, StoryObj } from '@storybook/vue3'; import { default as FitxButton } from './fitx-button.vue'; import ContentDe from './readme.de.md?raw'; // import ContentEn from './readme.en.md?raw'; import { getMarkdownDocsTranslationBlock } from '../../../utils/docs-translation'; const ComponentDescription = getMarkdownDocsTranslationBlock(ContentDe); const demoStylesOverview = `section, .demo { --demo-text-color: inherit; [data-theme=dark] & { --demo-text-color: white; } display: flex; flex-wrap: wrap; gap: 1rem; margin-block-end: 3rem; color: var(--demo-text-color); & p { margin: 0 } & h1 { flex: 1 0 100%; margin: 0; } }`; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta = { title: 'components/Button', component: FitxButton, // This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs tags: ['autodocs'], parameters: { docs: { description: { //story: ComponentDescription, component: ComponentDescription, }, }, }, args: { default: 'Klick mich', }, } satisfies Meta; export default meta; type Story = StoryObj; /* *👇 Render functions are a framework specific feature to allow you control on how the component renders. * See https://storybook.js.org/docs/api/csf * to learn how to use render functions. */ export const Default: Story = { args: {}, }; export const Slots: Story = { args: { default: 'blubb', 'icon-start': '(:', 'icon-end': '!!!', }, }; export const Primary: Story = { args: { // state: 'hover', }, render: () => ({ components: { FitxButton, }, setup() { return { demoStylesOverview, // theme: computed(() => args.theme), }; }, template: ` {{ demoStylesOverview }}

Primary

Primary Primary (hover|focus|active) Primary disabled

Primary small

Primary small Primary small (hover|focus|active) Primary small disabled
`, }), }; export const Secondary: Story = { args: { // state: 'hover', }, render: () => ({ components: { FitxButton, }, setup() { return { demoStylesOverview, // theme: computed(() => args.theme), }; }, template: ` {{ demoStylesOverview }}

Secondary

Secondary Secondary (hover|focus|active) Secondary disabled

Secondary small

Secondary small Secondary small (hover|focus|active) Secondary small disabled
`, }), }; export const Tertiary: Story = { args: { // state: 'hover', }, render: () => ({ components: { FitxButton, }, setup() { return { demoStylesOverview, // theme: computed(() => args.theme), }; }, template: ` {{ demoStylesOverview }}

Tertiary

Tertiary Tertiary (hover|focus|active) Tertiary disabled

Tertiary small

Tertiary small Tertiary small (hover|focus|active) Tertiary small disabled
`, }), }; export const Loading: Story = { args: { isIdle: true, }, };