progress.stories.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // @ts-nocheck
  2. import * as mod from "./progress"
  3. import { create } from "../storybook/scaffold"
  4. const docs = `### Overview
  5. Linear progress indicator with optional label and value display.
  6. Use in forms, uploads, or background tasks.
  7. ### API
  8. - \`value\` and \`maxValue\` control progress.
  9. - Optional: \`showValueLabel\`, \`hideLabel\`.
  10. - Children provide the label text.
  11. ### Variants and states
  12. - Supports indeterminate state via Kobalte props (if provided).
  13. ### Behavior
  14. - Uses Kobalte Progress for value calculation.
  15. ### Accessibility
  16. - TODO: confirm ARIA attributes from Kobalte.
  17. ### Theming/tokens
  18. - Uses \`data-component="progress"\` with track/fill slots.
  19. `
  20. const story = create({
  21. title: "UI/Progress",
  22. mod,
  23. args: {
  24. value: 60,
  25. maxValue: 100,
  26. children: "Progress",
  27. showValueLabel: true,
  28. },
  29. })
  30. export default {
  31. title: "UI/Progress",
  32. id: "components-progress",
  33. component: story.meta.component,
  34. tags: ["autodocs"],
  35. parameters: {
  36. docs: {
  37. description: {
  38. component: docs,
  39. },
  40. },
  41. },
  42. }
  43. export const Basic = story.Basic
  44. export const NoLabel = {
  45. args: {
  46. children: "",
  47. hideLabel: true,
  48. showValueLabel: false,
  49. value: 30,
  50. },
  51. }
  52. export const Indeterminate = {
  53. render: () => <mod.Progress>Loading</mod.Progress>,
  54. }