Skip to content

Commit ba9db32

Browse files
committed
stories fixed
1 parent d360dc1 commit ba9db32

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

stories/LoadingStates.stories.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
22
import type { Meta, StoryObj } from "@storybook/react";
33
import { TableAdapter, TableWithLoadingStates } from "../src"; // Adjust import path as needed
44
import { columns, smallDataSet, mediumDataSet, Person } from "./mockData";
5+
import { ColumnDef } from "@tanstack/react-table";
56

67
/**
78
* This file demonstrates the different loading states available in the TableAdapter component.
@@ -44,10 +45,9 @@ type Story = StoryObj<typeof TableAdapter<Person>>;
4445
export const BasicLoading: Story = {
4546
args: {
4647
data: [],
47-
columns: columns,
48+
columns: columns as ColumnDef<Person>[],
4849
isLoading: true,
4950
className: "w-full max-w-4xl",
50-
tableClassName: "min-w-full divide-y divide-gray-200",
5151
},
5252
};
5353

@@ -57,9 +57,8 @@ export const BasicLoading: Story = {
5757
export const PaginationLoading: Story = {
5858
args: {
5959
data: mediumDataSet,
60-
columns: columns,
60+
columns: columns as ColumnDef<Person>[],
6161
className: "w-full max-w-4xl",
62-
tableClassName: "min-w-full divide-y divide-gray-200",
6362
enablePagination: true,
6463
isPaginationLoading: true,
6564
},
@@ -71,9 +70,8 @@ export const PaginationLoading: Story = {
7170
export const OverlayLoading: Story = {
7271
args: {
7372
data: smallDataSet,
74-
columns: columns,
73+
columns: columns as ColumnDef<Person>[],
7574
className: "w-full max-w-4xl",
76-
tableClassName: "min-w-full divide-y divide-gray-200",
7775
isLoading: true,
7876
showOverlayLoading: true,
7977
},
@@ -85,9 +83,8 @@ export const OverlayLoading: Story = {
8583
export const CustomLoadingComponents: Story = {
8684
args: {
8785
data: smallDataSet,
88-
columns: columns,
86+
columns: columns as ColumnDef<Person>[],
8987
className: "w-full max-w-4xl",
90-
tableClassName: "min-w-full divide-y divide-gray-200",
9188
isLoading: true,
9289
loadingComponent: (
9390
<div className="flex flex-col items-center justify-center h-24">
@@ -174,9 +171,8 @@ export const LoadingStateTransitions: Story = {
174171
);
175172
},
176173
args: {
177-
columns: columns,
174+
columns: columns as ColumnDef<Person>[],
178175
className: "w-full max-w-4xl",
179-
tableClassName: "min-w-full divide-y divide-gray-200",
180176
enablePagination: true,
181177
pageSize: 10,
182178
},
@@ -231,9 +227,8 @@ export const TableWithLoadingStatesWrapper: Story = {
231227
);
232228
},
233229
args: {
234-
columns: columns,
230+
columns: columns as ColumnDef<Person>[],
235231
className: "w-full max-w-4xl",
236-
tableClassName: "min-w-full divide-y divide-gray-200",
237232
enablePagination: true,
238233
pageSize: 10,
239234
},

stories/TableAdapter.stories.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import type { Meta, StoryObj } from "@storybook/react";
3-
import { TableAdapter } from "../src"; // Adjust import path as needed
3+
import { TableAdapter } from "../src";
44
import {
55
columns,
66
smallDataSet,
@@ -40,10 +40,6 @@ const meta: Meta<typeof TableAdapter<Person>> = {
4040
control: "text",
4141
description: "CSS class for the wrapper div",
4242
},
43-
tableClassName: {
44-
control: "text",
45-
description: "CSS class for the table element",
46-
},
4743
enablePagination: {
4844
control: "boolean",
4945
description: "Whether to enable pagination",
@@ -84,9 +80,11 @@ type Story = StoryObj<typeof TableAdapter<Person>>;
8480
export const Basic: Story = {
8581
args: {
8682
data: smallDataSet,
87-
columns: columns,
83+
columns: columns as any,
8884
className: "w-full max-w-4xl",
89-
tableClassName: "min-w-full divide-y divide-gray-200",
85+
classNames: {
86+
table: "min-w-full divide-y divide-gray-200",
87+
},
9088
},
9189
};
9290

0 commit comments

Comments
 (0)