Skip to content

Commit bff14e0

Browse files
committed
Enhance reexports
1 parent 6ddabfe commit bff14e0

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/DSVImport.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const BasicUsage = () => {
2828
</DSVImport>
2929
);
3030
};
31-
BasicUsage.story = { name: 'Basic usage', parameters: { docs: { storyDescription: 'Hello' } } };
31+
BasicUsage.story = { name: 'Basic usage' };
3232

3333
export const UsingOnChangeCallback = () => {
3434
const columns: ColumnType<BasicType>[] = [

src/DSVImport.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { createValidatorMiddleware } from './middlewares/validatorMiddleware';
88
import { ValidationError } from './models/validation';
99
import { createTransformerMiddleware } from './middlewares/transformerMiddleware';
1010
import { Transformer } from './models/transformer';
11+
import { TextareaInput } from './components/inputs/TextareaInput';
12+
import { TablePreview } from './components/previews/TablePreview';
1113

1214
interface EventListenerProps<T> {
1315
onChange?: (value: T[]) => void;
@@ -52,7 +54,7 @@ export type Props<T> = {
5254
};
5355

5456
/**
55-
* Hello
57+
* This is the main component, which creates a context for it's children. All children can access the information of the `DSVImport`.
5658
*/
5759
export function DSVImport<T extends GenericColumnType>(props: PropsWithChildren<Props<T>>) {
5860
const DSVImportContext = getDSVImportContext<T>();
@@ -73,3 +75,6 @@ export function DSVImport<T extends GenericColumnType>(props: PropsWithChildren<
7375
</DSVImportContext.Provider>
7476
);
7577
}
78+
79+
DSVImport.TextareaInput = TextareaInput;
80+
DSVImport.TablePreview = TablePreview;

src/index.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
import { PropsWithChildren } from 'react';
2-
import { DSVImport as Import, Props } from './DSVImport';
3-
import { GenericColumnType } from './models/column';
4-
import { TextareaInput } from './components/inputs/TextareaInput';
5-
import { TablePreview } from './components/previews/TablePreview';
6-
7-
export function DSVImport<T extends GenericColumnType>(props: PropsWithChildren<Props<T>>) {
8-
return Import<T>(props);
9-
}
10-
11-
DSVImport.TextareaInput = TextareaInput;
12-
DSVImport.TablePreview = TablePreview;
13-
1+
export { DSVImport } from './DSVImport';
142
export { ColumnType, GenericColumnType } from './models/column';
153
export { useDSVImport } from './features/context';
164
export { Rule } from './models/rule';

0 commit comments

Comments
 (0)