|
| 1 | +import { Meta } from "@storybook/react"; |
| 2 | +import { StoryObj } from "@storybook/react"; |
| 3 | +import { ProgressOutstanding, ProgressTick, progressTickVariants } from "./index"; |
| 4 | +import React from "react"; |
| 5 | + |
| 6 | +const meta = { |
| 7 | + title: "Elements/Progress", |
| 8 | + component: ProgressOutstanding, |
| 9 | + parameters: { |
| 10 | + layout: "centered" |
| 11 | + }, |
| 12 | + argTypes: { |
| 13 | + size: { |
| 14 | + description: "defining the size of the Item", |
| 15 | + control: "select", |
| 16 | + defaultValue: "sm", |
| 17 | + options: ["sm", "md"] |
| 18 | + } |
| 19 | + }, |
| 20 | + decorators: [ |
| 21 | + (Story) => ( |
| 22 | + <div className="flex items-center gap-7"> |
| 23 | + <Story /> |
| 24 | + </div> |
| 25 | + ) |
| 26 | + ], |
| 27 | + |
| 28 | + tags: ["autodocs"] |
| 29 | +} satisfies Meta<typeof ProgressOutstanding>; |
| 30 | + |
| 31 | +export default meta; |
| 32 | + |
| 33 | +type Story = StoryObj<typeof meta>; |
| 34 | + |
| 35 | +export const DefaultVariant: Story = { |
| 36 | + name: "Default", |
| 37 | + args: { |
| 38 | + size: "sm" |
| 39 | + }, |
| 40 | + render: ({ size }) => ( |
| 41 | + <> |
| 42 | + <ProgressOutstanding size={size} /> |
| 43 | + <ProgressTick size={size}> |
| 44 | + <svg |
| 45 | + className={progressTickVariants({ size })} |
| 46 | + viewBox="0 0 24 24" |
| 47 | + fill="black" |
| 48 | + xmlns="http://www.w3.org/2000/svg" |
| 49 | + > |
| 50 | + <path |
| 51 | + fillRule="evenodd" |
| 52 | + clipRule="evenodd" |
| 53 | + d="M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z" |
| 54 | + /> |
| 55 | + </svg> |
| 56 | + </ProgressTick> |
| 57 | + </> |
| 58 | + ) |
| 59 | +}; |
| 60 | + |
| 61 | +export const TickStory: Story = { |
| 62 | + name: "Progress Tick", |
| 63 | + args: { |
| 64 | + size: "md" |
| 65 | + }, |
| 66 | + render: ({ size }) => ( |
| 67 | + <ProgressTick size={size}> |
| 68 | + <svg |
| 69 | + className={progressTickVariants({ size: size })} |
| 70 | + viewBox="0 0 24 24" |
| 71 | + fill="black" |
| 72 | + xmlns="http://www.w3.org/2000/svg" |
| 73 | + > |
| 74 | + <path |
| 75 | + fillRule="evenodd" |
| 76 | + clipRule="evenodd" |
| 77 | + d="M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z" |
| 78 | + /> |
| 79 | + </svg> |
| 80 | + </ProgressTick> |
| 81 | + ) |
| 82 | +}; |
| 83 | + |
| 84 | +export const OutstandingStory: Story = { |
| 85 | + name: "Progress Outstanding", |
| 86 | + args: { |
| 87 | + size: "md" |
| 88 | + }, |
| 89 | + render: ({ size }) => <ProgressOutstanding size={size} /> |
| 90 | +}; |
0 commit comments