Skip to content

Commit

Permalink
fix: fixed warnings in stories
Browse files Browse the repository at this point in the history
  • Loading branch information
Powerplex committed Apr 27, 2023
1 parent 4c543b7 commit d258423
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
6 changes: 5 additions & 1 deletion packages/components/checkbox/src/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ const intent = ['primary', 'success', 'alert', 'error'] as const
export const Intent: StoryFn = _args => (
<>
{intent.map(color => {
return <Checkbox intent={color}>{color}</Checkbox>
return (
<Checkbox key={color} intent={color}>
{color}
</Checkbox>
)
})}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/components/icon/src/Icon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const intents: ComponentProps<typeof Icon>['intent'][] = [
export const Colors: StoryFn = _args => (
<div className="gap-lg flex">
{intents.map(intent => (
<Icon intent={intent}>
<Icon key={intent} intent={intent}>
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M8.91958 20.1667C8.73748 20.1667 8.56045 20.1323 8.38847 20.0635C8.21649 19.9947 8.05969 19.8915 7.91806 19.7539L2.42489 14.4176C2.14163 14.1425 2 13.8083 2 13.4152C2 13.0222 2.14163 12.688 2.42489 12.4129C2.70814 12.1377 3.04704 12.0001 3.44158 12.0001C3.83612 12.0001 4.18513 12.1377 4.48862 12.4129L8.91958 16.7173L19.5417 6.42797C19.825 6.1528 20.1639 6.0103 20.5584 6.00048C20.953 5.99065 21.2919 6.13315 21.5751 6.42797C21.8584 6.70313 22 7.03727 22 7.43036C22 7.82346 21.8584 8.15759 21.5751 8.43276L9.92109 19.7539C9.77946 19.8915 9.62266 19.9947 9.45068 20.0635C9.27871 20.1323 9.10167 20.1667 8.91958 20.1667Z" />
</svg>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/radio/src/Radio.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Intent: StoryFn = _args => {
return (
<div className="gap-lg flex flex-col">
{intents.map(intent => (
<div className="gap-md flex flex-col justify-center">
<div key={intent} className="gap-md flex flex-col justify-center">
<p className="text-headline-2">{intent}</p>
<RadioGroup key={intent} defaultValue="1" intent={intent} orientation="horizontal">
<Radio value="1">First</Radio>
Expand All @@ -75,7 +75,7 @@ export const Size: StoryFn = _args => {
return (
<div className="gap-lg flex flex-col">
{sizes.map(size => (
<div className="gap-lg flex flex-col justify-center">
<div key={size} className="gap-lg flex flex-col justify-center">
<p className="text-headline-2">{size}</p>
<RadioGroup key={size} defaultValue="1" size={size} orientation="horizontal">
<Radio value="1">First</Radio>
Expand Down
5 changes: 3 additions & 2 deletions packages/components/spinner/src/Spinner.doc.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ArgsTable, Meta, Story, Canvas } from '@storybook/addon-docs'
import { Meta, Story, Canvas } from '@storybook/addon-docs'
import { ArgTypes } from '@storybook/blocks'

import { Spinner } from '.'

Expand All @@ -24,7 +25,7 @@ import { Spinner } from '@spark-ui/spinner'

# Props

<ArgsTable of={Spinner} />
<ArgTypes of={Spinner} />

# Default

Expand Down
4 changes: 2 additions & 2 deletions packages/components/switch/src/Switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const switchSizes: ComponentProps<typeof Switch>['size'][] = ['sm', 'md']
export const Sizes: StoryFn = _args => (
<div className="gap-lg flex flex-col">
{switchSizes.map(size => (
<Switch name="small" size={size}>
<Switch key={size} name="small" size={size}>
{size}
</Switch>
))}
Expand All @@ -53,7 +53,7 @@ const switchColors: ComponentProps<typeof Switch>['intent'][] = [
export const Colors: StoryFn = _args => (
<div className="gap-lg flex flex-col">
{switchColors.map(color => (
<Switch name="primary" intent={color} defaultChecked>
<Switch key={color} name="primary" intent={color} defaultChecked>
{color}
</Switch>
))}
Expand Down
6 changes: 5 additions & 1 deletion packages/components/tag/src/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export const Intent: StoryFn = _args => (
export const Shapes: StoryFn = _args => (
<div className="gap-md flex items-center">
{shapes.map(shape => {
return <Tag shape={shape}>{shape} tag</Tag>
return (
<Tag key={shape} shape={shape}>
{shape} tag
</Tag>
)
})}
</div>
)

0 comments on commit d258423

Please sign in to comment.