From 8002b8e8adc8f75b25ac61ee1b861607d4e50766 Mon Sep 17 00:00:00 2001 From: Benji Trosch Date: Mon, 14 Mar 2022 12:52:40 -0400 Subject: [PATCH] fix: export types from components --- src/CodeMockup/CodeMockup.tsx | 7 +- src/CodeMockup/index.ts | 6 +- src/PhoneMockup/PhoneMockup.tsx | 2 +- src/PhoneMockup/index.ts | 2 - src/WindowMockup/WindowMockup.tsx | 4 +- src/WindowMockup/index.ts | 2 - src/index.ts | 345 +++++++++++++++++++++--------- 7 files changed, 256 insertions(+), 112 deletions(-) diff --git a/src/CodeMockup/CodeMockup.tsx b/src/CodeMockup/CodeMockup.tsx index 63e678fd..7e98244c 100644 --- a/src/CodeMockup/CodeMockup.tsx +++ b/src/CodeMockup/CodeMockup.tsx @@ -1,14 +1,13 @@ -import React, { forwardRef, ReactNode } from 'react' -import clsx from 'clsx' +import React, { forwardRef } from 'react' import { twMerge } from 'tailwind-merge' import { IComponentBaseProps } from '../types' import { CodeMockupLine } from './CodeMockupLine' -export type CodeProps = React.HTMLAttributes & +export type CodeMockupProps = React.HTMLAttributes & IComponentBaseProps -const CodeMockup = forwardRef( +const CodeMockup = forwardRef( ({ dataTheme, className, children, ...props }, ref): JSX.Element => { const classes = twMerge('mockup-code', className) diff --git a/src/CodeMockup/index.ts b/src/CodeMockup/index.ts index e32f1c35..527256d1 100644 --- a/src/CodeMockup/index.ts +++ b/src/CodeMockup/index.ts @@ -1,5 +1,3 @@ -export * from './CodeMockup' - -import { CodeMockup, CodeProps as TCodeProps } from './CodeMockup' -export type CodeProps = TCodeProps +import { CodeMockup, CodeMockupProps as TCodeMockupProps } from './CodeMockup' +export type CodeMockupProps = TCodeMockupProps export default CodeMockup diff --git a/src/PhoneMockup/PhoneMockup.tsx b/src/PhoneMockup/PhoneMockup.tsx index 5c40f25a..c8e8f8e3 100644 --- a/src/PhoneMockup/PhoneMockup.tsx +++ b/src/PhoneMockup/PhoneMockup.tsx @@ -1,4 +1,4 @@ -import React, { createRef, forwardRef, ReactNode } from 'react' +import React, { forwardRef } from 'react' import clsx from 'clsx' import { twMerge } from 'tailwind-merge' diff --git a/src/PhoneMockup/index.ts b/src/PhoneMockup/index.ts index 5fd2bdba..38d521fb 100644 --- a/src/PhoneMockup/index.ts +++ b/src/PhoneMockup/index.ts @@ -1,5 +1,3 @@ -export * from './PhoneMockup'; - import PhoneMockup, { PhoneMockupProps as TPhoneMockupProps } from './PhoneMockup' export type PhoneMockupProps = TPhoneMockupProps export default PhoneMockup diff --git a/src/WindowMockup/WindowMockup.tsx b/src/WindowMockup/WindowMockup.tsx index 26466f43..e85038da 100644 --- a/src/WindowMockup/WindowMockup.tsx +++ b/src/WindowMockup/WindowMockup.tsx @@ -1,8 +1,8 @@ -import React, { createRef, forwardRef, ReactNode } from 'react' +import React, { forwardRef } from 'react' import clsx from 'clsx' import { twMerge } from 'tailwind-merge' -import { IComponentBaseProps, ComponentColor } from '../types' +import { IComponentBaseProps } from '../types' import { bgColors, brandColors, componentStatuses } from '../constants' export const windowMockupColors = [ diff --git a/src/WindowMockup/index.ts b/src/WindowMockup/index.ts index 12877c14..2804bf99 100644 --- a/src/WindowMockup/index.ts +++ b/src/WindowMockup/index.ts @@ -1,5 +1,3 @@ -export * from './WindowMockup' - import WindowMockup, { WindowMockupProps as TWindowMockupProps, } from './WindowMockup' diff --git a/src/index.ts b/src/index.ts index a9726ae4..b06673b4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,97 +1,248 @@ -import Alert from './Alert' -import Artboard from './Artboard' -import Avatar from './Avatar' -import Badge from './Badge' -import Breadcrumbs from './Breadcrumbs' -import Button from './Button' -import ButtonGroup from './ButtonGroup' -import Card from './Card' -import Carousel from './Carousel' -import Checkbox from './Checkbox' -import CodeMockup from './CodeMockup' -import Collapse from './Collapse' -import Countdown from './Countdown' -import Divider from './Divider' -import Drawer from './Drawer' -import Dropdown from './Dropdown' -import Footer from './Footer' -import Form from './Form' -import Hero from './Hero' -import Indicator from './Indicator' -import Input from './Input' -import InputGroup from './InputGroup' -import Kbd from './Kbd' -import Link from './Link' -import Mask from './Mask' -import Menu from './Menu' -import Modal from './Modal' -import Navbar from './Navbar' -import PhoneMockup from './PhoneMockup' -import Pagination from './Pagination' -import Progress from './Progress' -import RadialProgress from './RadialProgress' -import Radio from './Radio' -import Range from './Range' -import Rating from './Rating' -import Select from './Select' -import Stack from './Stack' -import Stats from './Stats' -import Steps from './Steps' -import Swap from './Swap' -import Table from './Table' -import Tabs from './Tabs' -import Textarea from './Textarea' -import Theme from './Theme' -import Toggle from './Toggle' -import Tooltip from './Tooltip' -import WindowMockup from './WindowMockup' - -export { - Alert, - Artboard, - Avatar, - Badge, - Breadcrumbs, - Button, - ButtonGroup, - Card, - Carousel, - Checkbox, - CodeMockup, - Collapse, - Countdown, - Divider, - Drawer, - Dropdown, - Footer, - Form, - Hero, - Indicator, - Input, - InputGroup, - Kbd, - Link, - Mask, - Menu, - Modal, - Navbar, - PhoneMockup, - Pagination, - Progress, - RadialProgress, - Radio, - Range, - Rating, - Select, - Stack, - Stats, - Steps, - Swap, - Table, - Tabs, - Textarea, - Theme, - Toggle, - Tooltip, - WindowMockup, -} +// ----------------------- < Actions > ----------------------- // + +// Actions > Button +export { default as Button } from './Button' +import { ButtonProps as TButtonProps } from './Button' +export type ButtonProps = TButtonProps + +// Actions > Dropdown +export { default as Dropdown } from './Dropdown' +import { DropdownProps as TDropdownProps } from './Dropdown' +export type DropdownProps = TDropdownProps + +// Actions > Modal +export { default as Modal } from './Modal' +import { ModalProps as TModalProps } from './Modal' +export type ModalProps = TModalProps + +// Actions > Swap +export { default as Swap } from './Swap' +import { SwapProps as TSwapProps } from './Swap' +export type SwapProps = TSwapProps + +// ----------------------- < Data Display > ----------------------- // + +// Data Display > Alert +export { default as Alert } from './Alert' +import { AlertProps as TAlertProps } from './Alert' +export type AlertProps = TAlertProps + +// Data Display > Avatar +export { default as Avatar } from './Avatar' +import { AvatarProps as TAvatarProps } from './Avatar' +export type AvatarProps = TAvatarProps + +// Data Display > Badge +export { default as Badge } from './Badge' +import { BadgeProps as TBadgeProps } from './Badge' +export type BadgeProps = TBadgeProps + +// Data Display > Card +export { default as Card } from './Card' +import { CardProps as TCardProps } from './Card' +export type CardProps = TCardProps + +// Data Display > Carousel +export { default as Carousel } from './Carousel' +import { CarouselProps as TCarouselProps } from './Carousel' +export type CarouselProps = TCarouselProps + +// Data Display > Collapse +export { default as Collapse } from './Collapse' +import { CollapseProps as TCollapseProps } from './Collapse' +export type CollapseProps = TCollapseProps + +// Data Display > Countdown +export { default as Countdown } from './Countdown' +import { CountdownProps as TCountdownProps } from './Countdown' +export type CountdownProps = TCountdownProps + +// Data Display > Kdb +export { default as Kbd } from './Kbd' +import { KbdProps as TKbdProps } from './Kbd' +export type KbdProps = TKbdProps + +// Data Display > Progress +export { default as Progress } from './Progress' +import { ProgressProps as TProgressProps } from './Progress' +export type ProgressProps = TProgressProps + +// Data Display > RadialProgress +export { default as RadialProgress } from './RadialProgress' +import { RadialProgressProps as TRadialProgressProps } from './RadialProgress' +export type RadialProgressProps = TRadialProgressProps + +// Data Display > Stats +export { default as Stats } from './Stats' +import { StatsProps as TStatsProps } from './Stats' +export type StatsProps = TStatsProps + +// Data Display > Table +export { default as Table } from './Table' +import { TableProps as TTableProps } from './Table' +export type TableProps = TTableProps + +// Data Display > Tooltip +export { default as Tooltip } from './Tooltip' +import { TooltipProps as TTooltipProps } from './Tooltip' +export type TooltipProps = TTooltipProps + +// ----------------------- < Data Input > ----------------------- // + +// Data Input > Form +export { default as Form } from './Form' +import { FormProps as TFormProps } from './Form' +export type FormProps = TFormProps + +// Data Input > Checkbox +export { default as Checkbox } from './Checkbox' +import { CheckboxProps as TCheckboxProps } from './Checkbox' +export type CheckboxProps = TCheckboxProps + +// Data Input > Input +export { default as Input } from './Input' +import { InputProps as TInputProps } from './Input' +export type InputProps = TInputProps + +// Data Input > Radio +export { default as Radio } from './Radio' +import { RadioProps as TRadioProps } from './Radio' +export type RadioProps = TRadioProps + +// Data Input > Range +export { default as Range } from './Range' +import { RangeProps as TRangeProps } from './Range' +export type RangeProps = TRangeProps + +// Data Input > Rating +export { default as Rating } from './Rating' +import { RatingProps as TRatingProps } from './Rating' +export type RatingProps = TRatingProps + +// Data Input > Select +export { default as Select } from './Select' +import { SelectProps as TSelectProps } from './Select' +export type SelectProps = TSelectProps + +// Data Input > Toggle +export { default as Toggle } from './Toggle' +import { ToggleProps as TToggleProps } from './Toggle' +export type ToggleProps = TToggleProps + +// Data Input > Textarea +export { default as Textarea } from './Textarea' +import { TextareaProps as TTextareaProps } from './Textarea' +export type TextareaProps = TTextareaProps + +// ----------------------- < Layout > ----------------------- // + +// Layout > Artboard +export { default as Artboard } from './Artboard' +import { ArtboardProps as TArtboardProps } from './Artboard' +export type ArtboardProps = TArtboardProps + +// Layout > ButtonGroup +export { default as ButtonGroup } from './ButtonGroup' +import { ButtonGroupProps as TButtonGroupProps } from './ButtonGroup' +export type ButtonGroupProps = TButtonGroupProps + +// Layout > Divider +export { default as Divider } from './Divider' +import { DividerProps as TDividerProps } from './Divider' +export type DividerProps = TDividerProps + +// Layout > Drawer +export { default as Drawer } from './Drawer' +import { DrawerProps as TDrawerProps } from './Drawer' +export type DrawerProps = TDrawerProps + +// Layout > Footer +export { default as Footer } from './Footer' +import { FooterProps as TFooterProps } from './Footer' +export type FooterProps = TFooterProps + +// Layout > Hero +export { default as Hero } from './Hero' +import { HeroProps as THeroProps } from './Hero' +export type HeroProps = THeroProps + +// Layout > Indicator +export { default as Indicator } from './Indicator' +import { IndicatorProps as TIndicatorProps } from './Indicator' +export type IndicatorProps = TIndicatorProps + +// Layout > InputGroup +export { default as InputGroup } from './InputGroup' +import { InputGroupProps as TInputGroupProps } from './InputGroup' +export type InputGroupProps = TInputGroupProps + +// Layout > Mask +export { default as Mask } from './Mask' +import { MaskProps as TMaskProps } from './Mask' +export type MaskProps = TMaskProps + +// Layout > Stack +export { default as Stack } from './Stack' +import { StackProps as TStackProps } from './Stack' +export type StackProps = TStackProps + +// ----------------------- < Navigation > ----------------------- // + +// Navigation > Breadcrumbs +export { default as Breadcrumbs } from './Breadcrumbs' +import { BreadcrumbsProps as TBreadcrumbsProps } from './Breadcrumbs' +export type BreadcrumbsProps = TBreadcrumbsProps + +// Navigation > Link +export { default as Link } from './Link' +import { LinkProps as TLinkProps } from './Link' +export type LinkProps = TLinkProps + +// Navigation > Menu +export { default as Menu } from './Menu' +import { MenuProps as TMenuProps } from './Menu' +export type MenuProps = TMenuProps + +// Navigation > Navbar +export { default as Navbar } from './Navbar' +import { NavbarProps as TNavbarProps } from './Navbar' +export type NavbarProps = TNavbarProps + +// Navigation > Pagination +export { default as Pagination } from './Pagination' +import { PaginationProps as TPaginationProps } from './Pagination' +export type PaginationProps = TPaginationProps + +// Navigation > Steps +export { default as Steps } from './Steps' +import { StepsProps as TStepsProps } from './Steps' +export type StepsProps = TStepsProps + +// Navigation > Tabs +export { default as Tabs } from './Tabs' +import { TabsProps as TTabsProps } from './Tabs' +export type TabsProps = TTabsProps + +// ----------------------- < Mockup > ----------------------- // + +// Mockup > CodeMockup +export { default as CodeMockup } from './CodeMockup' +import { CodeMockupProps as TCodeMockupProps } from './CodeMockup' +export type CodeMockupProps = TCodeMockupProps + +// Mockup > PhoneMockup +export { default as PhoneMockup } from './PhoneMockup' +import { PhoneMockupProps as TPhoneProps } from './PhoneMockup' +export type PhoneProps = TPhoneProps + +// Mockup > WindowMockup +export { default as WindowMockup } from './WindowMockup' +import { WindowMockupProps as TWindowMockupProps } from './WindowMockup' +export type WindowMockupProps = TWindowMockupProps + +// ----------------------- < Utils > ----------------------- // + +// Utils > Theme +export { default as Theme } from './Theme' +import { ThemeProps as TThemeProps } from './Theme' +export type ThemeProps = TThemeProps