import type { Args, Meta, StoryObj } from '@storybook/vue3-vite' import CpHeading from '@/components/CpHeading.vue' import { docLabelStyle } from '@/stories/documentationStyles' const headingLevels = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const const headingSizes = [100, 200, 300, 400, 500, 600, 700, 800, 900] as const const headingRowStyle = 'display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center;' const meta = { title: 'Atoms/CpHeading', component: CpHeading, tags: ['deprecated'], parameters: { docs: { description: { component: '> ⚠️ **Deprecated.** `CpHeading` is kept for backwards compatibility only. Use CpText instead.', }, }, }, argTypes: { headingLevel: { control: 'select', options: headingLevels, description: 'HTML heading level', }, size: { control: 'select', options: headingSizes, description: 'Size variant of the heading', }, }, } satisfies Meta export default meta type Story = StoryObj /** * @deprecated Default heading. Prefer native `

`–`

` styled with typography CSS variables. */ export const Default: Story = { args: { headingLevel: 'h1', size: 500, }, render: (args: Args) => ({ components: { CpHeading }, setup() { return { args } }, template: `
Default Heading
`, }), } /* -------------------------------------------------------------------------- */ /* Sizes */ /* -------------------------------------------------------------------------- */ /** * @deprecated All sizes stacked from `100` (smallest) to `900` (largest). The * visual size is decoupled from the semantic HTML level. */ export const Sizes: Story = { parameters: { controls: { disable: true } }, render: () => ({ components: { CpHeading }, setup() { return { headingSizes, headingRowStyle, docLabelStyle, } }, template: `
{{ size }} Size {{ size }} Heading
`, }), } /* -------------------------------------------------------------------------- */ /* Semantic level */ /* -------------------------------------------------------------------------- */ /** * @deprecated The recommended pairing between semantic HTML level and visual * size — but any combination is valid. Picking the right `headingLevel` * matters for accessibility and document outline, while `size` controls the * look. */ export const LevelAndSizePairing: Story = { parameters: { controls: { disable: true } }, render: () => ({ components: { CpHeading }, template: `
H1 with Size 900 H2 with Size 800 H3 with Size 700 H4 with Size 600 H5 with Size 500 H6 with Size 400
`, }), }