1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-24 06:54:27 +07:00

chore(build): add missing export (#417)

Co-authored-by: Juan Picado @jotadeveloper <juanpicado19@gmail.com>
This commit is contained in:
Alfonso Austin 2020-01-14 01:43:31 -05:00 committed by Juan Picado @jotadeveloper
parent 1eca1f4079
commit d4f2720994
6 changed files with 35 additions and 33 deletions

View File

@ -1,13 +1,10 @@
import React, { forwardRef } from 'react';
import { default as MaterialUITypography, TypographyProps } from '@material-ui/core/Typography';
import { default as MaterialUITypography } from '@material-ui/core/Typography';
import { TextProps } from './TextConfig';
type TextType = 'subtitle1' | 'subtitle2' | 'body1' | 'body2';
type TextRef = HTMLElementTagNameMap[keyof HTMLElementTagNameMap];
export interface TextProps extends Omit<TypographyProps, 'variant'> {
variant?: TextType;
}
// The reference is already from type of the Component, so the any below is not a problem
const Text = forwardRef<TextRef, TextProps>(function Text(props, ref) {
return <MaterialUITypography {...props} ref={ref} />;

View File

@ -0,0 +1,7 @@
import { TypographyProps } from '@material-ui/core/Typography';
type TextType = 'subtitle1' | 'subtitle2' | 'body1' | 'body2';
export interface TextProps extends Omit<TypographyProps, 'variant'> {
variant?: TextType;
}

View File

@ -1 +1,2 @@
export { default, TextProps } from './Text';
export { default } from './Text';
export { TextProps } from './TextConfig';

View File

@ -1,24 +1,6 @@
import { createContext, Consumer, Provider } from 'react';
import { PackageMetaInterface } from '../../../types/packageMeta';
export interface DetailContextProps {
packageMeta: PackageMetaInterface;
packageVersion?: string;
readMe: string;
packageName: string;
enableLoading: () => void;
isLoading: boolean;
hasNotBeenFound: boolean;
}
export interface VersionPageConsumerProps {
packageMeta: PackageMetaInterface;
readMe: string;
packageName: string;
packageVersion?: string;
// FIXME: looking for the appropiated type here
enableLoading: any;
}
import { DetailContextProps, VersionPageConsumerProps } from './version-config';
export const DetailContext = createContext<Partial<DetailContextProps>>({});

View File

@ -1,8 +1,4 @@
export {
DetailContext,
DetailContextConsumer,
DetailContextProvider,
DetailContextProps,
VersionPageConsumerProps,
} from './context';
export { DetailContext, DetailContextConsumer, DetailContextProvider } from './context';
export { VersionPageConsumerProps, DetailContextProps } from './version-config';
export { default } from './Version';

View File

@ -0,0 +1,19 @@
import { PackageMetaInterface } from '../../../types/packageMeta';
export interface DetailContextProps {
enableLoading: () => void;
hasNotBeenFound: boolean;
isLoading: boolean;
packageMeta: PackageMetaInterface;
packageName: string;
packageVersion?: string;
readMe: string;
}
export interface VersionPageConsumerProps {
enableLoading: () => void;
packageMeta: PackageMetaInterface;
packageName: string;
packageVersion?: string;
readMe: string;
}