Skip to content

Commit

Permalink
chore: nits
Browse files Browse the repository at this point in the history
  • Loading branch information
macci001 committed Jan 28, 2025
1 parent 46ba46a commit acccb82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 5 additions & 5 deletions apps/docs/content/docs/components/spinner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ Spinner express an unspecified wait time or display the length of a process.

### Variants

<CodeDemo title="Label colors" files={spinnerContent.variants} />
<CodeDemo title="Variants" files={spinnerContent.variants} />

## Slots

- **base**: The base slot of the spinner, it wraps the circles and the label.
- **wrapper**: The wrapper of the circles.
- **circle1**: The first circle of the spinner. (Effective only when variant is `default` or `gradient`)
- **circle2**: The second circle of the spinner. (Effective only when variant is `default` or `gradient`)
- **dots**: Dots of the component. (Effective only when variant is `dots` or `dots-blink`)
- **bars**: Bars of the component. (Effective only when variant is `bars`)
- **circle1**: The first circle of the spinner component. (Effective only when variant is `default` or `gradient`)
- **circle2**: The second circle of the spinner component. (Effective only when variant is `default` or `gradient`)
- **dots**: Dots of the spinner component. (Effective only when variant is `dots` or `dots-blink`)
- **bars**: Bars of the spinner component. (Effective only when variant is `bars`)
- **label**: The label content.

<Spacer y={4} />
Expand Down
2 changes: 1 addition & 1 deletion packages/components/spinner/src/use-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type UseSpinnerProps = Props & SpinnerVariantProps;

export function useSpinner(originalProps: UseSpinnerProps) {
const [props, variantProps] = mapPropsVariants(originalProps, spinner.variantKeys);
const {variant} = originalProps;
const variant = originalProps.variant ?? "default";

const {children, className, classNames, label: labelProp, ...otherProps} = props;

Expand Down
6 changes: 6 additions & 0 deletions packages/components/spinner/stories/spinner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export default {
},
options: ["sm", "md", "lg"],
},
variant: {
control: {
type: "select",
},
options: ["default", "gradient", "star", "dots", "dots-blink"],
},
},
decorators: [
(Story) => (
Expand Down

0 comments on commit acccb82

Please sign in to comment.