-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Export type for the parent component (#828)
To export the compound component type was not correct, as using the args in the story revealed
- Loading branch information
Showing
11 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { Banner as BaseBanner } from './Banner' | ||
import { Banner as BaseBanner, BannerProps } from './Banner' | ||
import { BannerIcon } from './BannerIcon' | ||
import { BannerMessage } from './BannerMessage' | ||
import { BannerActions } from './BannerActions' | ||
|
||
type BannerProps = typeof BaseBanner & { | ||
type BannerCompoundProps = typeof BaseBanner & { | ||
BannerIcon: typeof BannerIcon | ||
BannerMessage: typeof BannerMessage | ||
BannerActions: typeof BannerActions | ||
} | ||
|
||
const Banner = BaseBanner as BannerProps | ||
const Banner = BaseBanner as BannerCompoundProps | ||
|
||
Banner.BannerIcon = BannerIcon | ||
Banner.BannerMessage = BannerMessage | ||
Banner.BannerActions = BannerActions | ||
|
||
export { Banner, BannerProps } | ||
export { Banner } | ||
export type { BannerProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { Breadcrumbs as BaseComponent } from './Breadcrumbs' | ||
import { Breadcrumbs as BaseComponent, BreadcrumbsProps } from './Breadcrumbs' | ||
import { Breadcrumb } from './Breadcrumb' | ||
|
||
type BreadcrumbsProps = typeof BaseComponent & { | ||
type BreadcrumbsCompoundProps = typeof BaseComponent & { | ||
Breadcrumb: typeof Breadcrumb | ||
} | ||
|
||
const Breadcrumbs = BaseComponent as BreadcrumbsProps | ||
const Breadcrumbs = BaseComponent as BreadcrumbsCompoundProps | ||
|
||
Breadcrumbs.Breadcrumb = Breadcrumb | ||
|
||
export { Breadcrumbs, BreadcrumbsProps } | ||
export { Breadcrumbs } | ||
export type { BreadcrumbsProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
import { Card as CardWrapper } from './Card' | ||
import { Card as CardWrapper, CardProps } from './Card' | ||
import { CardActions } from './CardActions' | ||
import { CardMedia } from './CardMedia' | ||
import { CardHeader } from './CardHeader' | ||
import { CardHeaderTitle } from './CardHeaderTitle' | ||
|
||
type CardProps = typeof CardWrapper & { | ||
type CardCompoundProps = typeof CardWrapper & { | ||
CardActions: typeof CardActions | ||
CardHeader: typeof CardHeader | ||
CardMedia: typeof CardMedia | ||
CardHeaderTitle: typeof CardHeaderTitle | ||
} | ||
|
||
const Card = CardWrapper as CardProps | ||
const Card = CardWrapper as CardCompoundProps | ||
|
||
Card.CardActions = CardActions | ||
Card.CardHeader = CardHeader | ||
Card.CardMedia = CardMedia | ||
Card.CardHeaderTitle = CardHeaderTitle | ||
|
||
export { Card, CardProps } | ||
export { Card } | ||
export type { CardProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { List as BaseComponent } from './List' | ||
import { List as BaseComponent, ListProps } from './List' | ||
import { ListItem } from './ListItem' | ||
|
||
type ListProps = typeof BaseComponent & { | ||
type ListCompoundProps = typeof BaseComponent & { | ||
ListItem: typeof ListItem | ||
} | ||
|
||
const List = BaseComponent as ListProps | ||
const List = BaseComponent as ListCompoundProps | ||
|
||
List.ListItem = ListItem | ||
|
||
export { List, ListProps } | ||
export { List } | ||
export type { ListProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { Popover as BaseComponent } from './Popover' | ||
import { Popover as BaseComponent, PopoverProps } from './Popover' | ||
import { PopoverTitle } from './PopoverTitle' | ||
import { PopoverAnchor } from './PopoverAnchor' | ||
import { PopoverContent } from './PopoverContent' | ||
|
||
type PopoverProps = typeof BaseComponent & { | ||
type PopoverConformProps = typeof BaseComponent & { | ||
PopoverTitle: typeof PopoverTitle | ||
PopoverAnchor: typeof PopoverAnchor | ||
PopoverContent: typeof PopoverContent | ||
} | ||
|
||
const Popover = BaseComponent as PopoverProps | ||
const Popover = BaseComponent as PopoverConformProps | ||
|
||
Popover.PopoverTitle = PopoverTitle | ||
Popover.PopoverAnchor = PopoverAnchor | ||
Popover.PopoverContent = PopoverContent | ||
|
||
export { Popover, PopoverProps } | ||
export { Popover } | ||
export type { PopoverProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
import { Table as BaseComponent } from './Table' | ||
import { Table as BaseComponent, TableProps } from './Table' | ||
import { Body } from './Body' | ||
import { Cell } from './Cell' | ||
import { Head } from './Head' | ||
import { Row } from './Row' | ||
|
||
type TableProps = typeof BaseComponent & { | ||
type TableCompoundProps = typeof BaseComponent & { | ||
Body: typeof Body | ||
Cell: typeof Cell | ||
Head: typeof Head | ||
Row: typeof Row | ||
} | ||
|
||
const Table = BaseComponent as TableProps | ||
const Table = BaseComponent as TableCompoundProps | ||
|
||
Table.Body = Body | ||
Table.Cell = Cell | ||
Table.Head = Head | ||
Table.Row = Row | ||
|
||
export { Table, TableProps } | ||
export { Table } | ||
export type { TableProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import { TableOfContents as BaseComponent } from './TableOfContents' | ||
import { | ||
TableOfContents as BaseComponent, | ||
TableOfContentsProps, | ||
} from './TableOfContents' | ||
import { LinkItem } from './LinkItem' | ||
|
||
type TableOfContentsProps = typeof BaseComponent & { | ||
type TableOfContentsCompoundProps = typeof BaseComponent & { | ||
LinkItem: typeof LinkItem | ||
} | ||
|
||
const TableOfContents = BaseComponent as TableOfContentsProps | ||
const TableOfContents = BaseComponent as TableOfContentsCompoundProps | ||
|
||
TableOfContents.LinkItem = LinkItem | ||
|
||
export { TableOfContents, TableOfContentsProps } | ||
export { TableOfContents } | ||
export type { TableOfContentsProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { TopBar as BaseComponent } from './TopBar' | ||
import { TopBar as BaseComponent, TopbarProps } from './TopBar' | ||
import { Actions } from './Actions' | ||
import { Header } from './Header' | ||
import { CustomContent } from './CustomContent' | ||
|
||
type TopbarProps = typeof BaseComponent & { | ||
type TopbarCompoundProps = typeof BaseComponent & { | ||
Actions: typeof Actions | ||
Header: typeof Header | ||
CustomContent: typeof CustomContent | ||
} | ||
|
||
const TopBar = BaseComponent as TopbarProps | ||
const TopBar = BaseComponent as TopbarCompoundProps | ||
|
||
TopBar.Actions = Actions | ||
TopBar.Header = Header | ||
TopBar.CustomContent = CustomContent | ||
|
||
export { TopBar, TopbarProps } | ||
export { TopBar } | ||
export type { TopbarProps } |