[WEB-5083] chore: add stories to propel #7888
This commit is contained in:
parent
0cca31ef2e
commit
cbcb026e9a
38 changed files with 6786 additions and 874 deletions
|
|
@ -2,26 +2,19 @@ import type { Meta, StoryObj } from "@storybook/react";
|
|||
import React from "react";
|
||||
import { Sortable } from "./sortable";
|
||||
|
||||
const meta: Meta<typeof Sortable> = {
|
||||
type StoryItem = { id: string; name: string };
|
||||
|
||||
const meta: Meta<typeof Sortable<StoryItem>> = {
|
||||
title: "Sortable",
|
||||
component: Sortable,
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type StoryItem = { id: string; name: string };
|
||||
type Story = StoryObj<typeof Sortable<StoryItem>>;
|
||||
|
||||
const data = [
|
||||
{ id: "1", name: "John Doe" },
|
||||
{ id: "2", name: "Satish" },
|
||||
{ id: "3", name: "Alice" },
|
||||
{ id: "4", name: "Bob" },
|
||||
{ id: "5", name: "Charlie" },
|
||||
];
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
data,
|
||||
data: [
|
||||
{ id: "1", name: "John Doe" },
|
||||
{ id: "2", name: "Satish" },
|
||||
{ id: "3", name: "Alice" },
|
||||
{ id: "4", name: "Bob" },
|
||||
{ id: "5", name: "Charlie" },
|
||||
],
|
||||
render: (item: StoryItem) => (
|
||||
// <Draggable data={item} className="rounded-lg">
|
||||
<div className="border ">{item.name}</div>
|
||||
|
|
@ -31,3 +24,9 @@ export const Default: Story = {
|
|||
keyExtractor: (item) => item.id,
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue