diff --git a/packages/components/progress-tracker/src/ProgressTracker.doc.mdx b/packages/components/progress-tracker/src/ProgressTracker.doc.mdx index f88f419892..095182ddac 100644 --- a/packages/components/progress-tracker/src/ProgressTracker.doc.mdx +++ b/packages/components/progress-tracker/src/ProgressTracker.doc.mdx @@ -1,5 +1,6 @@ import { Meta, Canvas } from '@storybook/addon-docs' import { ArgTypes } from '@docs/helpers/ArgTypes' +import { Kbd } from '@spark-ui/kbd' import { ProgressTracker } from '.' @@ -41,3 +42,31 @@ import { ProgressTracker } from '@spark-ui/progress-tracker' ### Default + +### Sizes + +Use `size` prop to set the size of the progress indicators. Smallest size doesn't get any content. + + + +### Intent + +Use `intent` prop to set the color intent. + +### Design + +Use `design` prop to set the look and feel. + +### Disabled + +Use `disabled` prop on a step to disable it. + +### Orientation + +## Accessibility + +### Keyboard Interactions + +- Tab: Moves focus to the next step depending on `orientation`. +- Space: Activates the step. +- Enter: Activates the step. diff --git a/packages/components/progress-tracker/src/ProgressTracker.stories.tsx b/packages/components/progress-tracker/src/ProgressTracker.stories.tsx index bb499e19dd..6d76f91030 100644 --- a/packages/components/progress-tracker/src/ProgressTracker.stories.tsx +++ b/packages/components/progress-tracker/src/ProgressTracker.stories.tsx @@ -1,6 +1,7 @@ +import { StoryLabel } from '@docs/helpers/StoryLabel' import { Meta, StoryFn } from '@storybook/react' -import { ProgressTracker } from '.' +import { ProgressTracker, type ProgressTrackerProps } from '.' const meta: Meta = { title: 'Experimental/ProgressTracker', @@ -9,6 +10,8 @@ const meta: Meta = { export default meta +const sizes: ProgressTrackerProps['size'][] = ['sm', 'md', 'lg'] + export const Default: StoryFn = _args => ( console.log('Clicked on', id)}> @@ -16,3 +19,18 @@ export const Default: StoryFn = _args => ( ) + +export const Size: StoryFn = _args => ( +
+ {sizes.map(size => ( +
+ {`${size}${size === 'lg' ? ' (default)' : ''}`} + + + + + +
+ ))} +
+) diff --git a/packages/components/progress-tracker/src/ProgressTrackerStep.styles.ts b/packages/components/progress-tracker/src/ProgressTrackerStep.styles.ts index 3482f072c4..16b5a40bf6 100644 --- a/packages/components/progress-tracker/src/ProgressTrackerStep.styles.ts +++ b/packages/components/progress-tracker/src/ProgressTrackerStep.styles.ts @@ -51,7 +51,7 @@ export const stepButtonVariant = cva( { variants: { size: { - sm: ['before:w-sz-16 before:h-sz-16', 'before:content-["_"]'], + sm: ['before:w-sz-16 before:h-sz-16', 'before:!content-["_"]'], md: 'before:w-sz-24 before:h-sz-24', lg: 'before:w-sz-32 before:h-sz-32', },