summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/spinner.stories.tsx
blob: be6106d148674a0d4196776da360e2fef09d301a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @ts-nocheck
import * as mod from "./spinner"
import { create } from "../storybook/scaffold"

const docs = `### Overview
Animated loading indicator for inline or page-level loading states.

Use with \`Button\` or in empty states.

### API
- Accepts standard SVG props (class, style).

### Variants and states
- Single default animation style.

### Behavior
- Animation is CSS-driven via data attributes.

### Accessibility
- Use alongside text or aria-live regions to convey loading state.

### Theming/tokens
- Uses \`data-component="spinner"\` for styling hooks.

`

const story = create({ title: "UI/Spinner", mod })

export default {
  title: "UI/Spinner",
  id: "components-spinner",
  component: story.meta.component,
  tags: ["autodocs"],
  parameters: {
    docs: {
      description: {
        component: docs,
      },
    },
  },
}

export const Basic = story.Basic

export const Sizes = {
  render: () => (
    <div style={{ display: "flex", gap: "16px", "align-items": "center" }}>
      <mod.Spinner style={{ width: "12px", height: "12px" }} />
      <mod.Spinner style={{ width: "20px", height: "20px" }} />
      <mod.Spinner style={{ width: "28px", height: "28px" }} />
    </div>
  ),
}