mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-18 14:44:40 +00:00
chore: storybook (#15285)
Co-authored-by: David Hill <iamdavidhill@gmail.com>
This commit is contained in:
67
packages/ui/src/components/progress.stories.tsx
Normal file
67
packages/ui/src/components/progress.stories.tsx
Normal file
@@ -0,0 +1,67 @@
|
||||
// @ts-nocheck
|
||||
import * as mod from "./progress"
|
||||
import { create } from "../storybook/scaffold"
|
||||
|
||||
const docs = `### Overview
|
||||
Linear progress indicator with optional label and value display.
|
||||
|
||||
Use in forms, uploads, or background tasks.
|
||||
|
||||
### API
|
||||
- \`value\` and \`maxValue\` control progress.
|
||||
- Optional: \`showValueLabel\`, \`hideLabel\`.
|
||||
- Children provide the label text.
|
||||
|
||||
### Variants and states
|
||||
- Supports indeterminate state via Kobalte props (if provided).
|
||||
|
||||
### Behavior
|
||||
- Uses Kobalte Progress for value calculation.
|
||||
|
||||
### Accessibility
|
||||
- TODO: confirm ARIA attributes from Kobalte.
|
||||
|
||||
### Theming/tokens
|
||||
- Uses \`data-component="progress"\` with track/fill slots.
|
||||
|
||||
`
|
||||
|
||||
const story = create({
|
||||
title: "UI/Progress",
|
||||
mod,
|
||||
args: {
|
||||
value: 60,
|
||||
maxValue: 100,
|
||||
children: "Progress",
|
||||
showValueLabel: true,
|
||||
},
|
||||
})
|
||||
|
||||
export default {
|
||||
title: "UI/Progress",
|
||||
id: "components-progress",
|
||||
component: story.meta.component,
|
||||
tags: ["autodocs"],
|
||||
parameters: {
|
||||
docs: {
|
||||
description: {
|
||||
component: docs,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const Basic = story.Basic
|
||||
|
||||
export const NoLabel = {
|
||||
args: {
|
||||
children: "",
|
||||
hideLabel: true,
|
||||
showValueLabel: false,
|
||||
value: 30,
|
||||
},
|
||||
}
|
||||
|
||||
export const Indeterminate = {
|
||||
render: () => <mod.Progress>Loading</mod.Progress>,
|
||||
}
|
||||
Reference in New Issue
Block a user