import type { Meta, StoryObj } from '@storybook/react-vite' import { NavItem } from './NavItem' import { SectionLabel } from './SectionLabel' /** Every section title renders through this span — a style change is one edit. Under Signal it becomes the mono uppercase micro-label. */ const meta = { title: 'Primitives/SectionLabel', component: SectionLabel, args: { children: 'Starred' }, } satisfies Meta export default meta type Story = StoryObj export const Default: Story = {} /** Where it lives: heading a group of rows. */ export const HeadingAList: Story = { parameters: { controls: { disable: true } }, render: () => (
Recent
{['Quarterly plan', 'Reading list', 'Archive'].map((row) => ( ))}
), } /** `tone="secondary"`: a heading inside a menu or a list of results labels the rows, it is not one of them. */ export const Secondary: Story = { args: { tone: 'secondary', children: 'Section' } } /** `tone="muted"`: a label that marks a place in a list rather than heading it, a date between messages. */ export const Muted: Story = { args: { tone: 'muted', children: 'Yesterday' } } /** `truncate`: a long label in a narrow row ends in an ellipsis instead of spilling. */ export const Truncated: Story = { args: { truncate: true, children: 'Promoted to a topic whose title is far longer than its row' }, render: (args) => (
), } /** The title of a group that folds: in Leaf it keeps Ship's type; in Signal and Ship it looks like any label. Switch the toolbar to Leaf to see the difference. */ export const Folds: Story = { args: { folds: true, children: 'Group' } }