import type { Meta, StoryObj } from 'storybook-solidjs-vite';
import { Skeleton } from './skeleton';
import { componentDescription } from '../stories/docs/element-controls';
const meta = {
title: 'Solid (Advanced)/Primitives/Skeleton',
component: Skeleton,
tags: ['autodocs'],
parameters: {
layout: 'padded',
docs: {
controls: { exclude: ['use:eventListener'] },
description: componentDescription([
'A pulsing **placeholder** block used to indicate loading content. It has no shape of its own — size and rounding come from the `class` you pass.',
'**When to use:** while content (messages, lists, cards, tool output) is loading, to preserve layout and signal progress without a spinner.',
'**How to use:** compose one or more `Skeleton` elements and set width/height/rounding via utility classes (e.g. `class="h-4 w-3/4"`). Build skeletons that mirror the real layout they replace.',
'**Placement:** message bubbles, conversation lists, code blocks, tool calls, input areas, and full-page loading states.',
]),
},
},
argTypes: {
class: {
control: 'text',
description: 'Utility classes that set the size and rounding of the placeholder.',
},
},
args: {
class: 'h-4 w-64',
},
render: (args) => ,
} satisfies Meta;
export default meta;
type Story = StoryObj;
const IMPORT = `import { Skeleton } from '@kitn.ai/chat';`;
const src = (code: string) => ({
parameters: { docs: { source: { code: `${IMPORT}\n\n${code}`, language: 'tsx' } } },
});
/** Interactive playground — edit `class` to resize the placeholder. */
export const Playground: Story = {
...src(``),
};
export const Basic: Story = {
render: () => (