diff --git a/README.md b/README.md index 6a918910..901d1781 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#
rbx
+## 👟 rbx :: UI Components for React, Based on Bulma [![Build Status](https://travis-ci.org/dfee/rbx.svg?branch=master)](https://travis-ci.org/dfee/rbx) [![Coverage Status](https://coveralls.io/repos/github/dfee/rbx/badge.svg?branch=master)](https://coveralls.io/github/dfee/rbx?branch=master) @@ -56,36 +56,67 @@ Some components may vary the api/naming convention with the Bulma Docs. Please r The following components were ported: -- Box ([Storybook](https://dfee.github.io/rbx/?selectedKind=Box)) ([Docs](http://bulma.io/documentation/elements/box/)) -- Breadcrumb ([Storybook](https://dfee.github.io/rbx/?selectedKind=Breadcrumb)) ([Docs](http://bulma.io/documentation/components/breadcrumb/)) -- Button ([Storybook](https://dfee.github.io/rbx/?selectedKind=Button)) ([Docs](http://bulma.io/documentation/elements/button/)) -- Card ([Storybook](https://dfee.github.io/rbx/?selectedKind=Card)) ([Docs](http://bulma.io/documentation/components/card/)) -- Column ([Storybook](https://dfee.github.io/rbx/?selectedKind=Columns)) ([Docs](http://bulma.io/documentation/columns/basics/)) -- Container ([Storybook](https://dfee.github.io/rbx/?selectedKind=Container)) ([Docs](http://bulma.io/documentation/layout/container/)) -- Content ([Storybook](https://dfee.github.io/rbx/?selectedKind=Content)) ([Docs](http://bulma.io/documentation/elements/content/)) -- Dropdown ([Storybook](https://dfee.github.io/rbx/?selectedKind=Dropdown)) ([Docs](http://bulma.io/documentation/components/dropdown/)) -- Footer ([Storybook](https://dfee.github.io/rbx/?selectedKind=Footer)) ([Docs](http://bulma.io/documentation/layout/footer/)) -- Form ([Storybook](https://dfee.github.io/rbx/?selectedKind=Form)) ([Docs](http://bulma.io/documentation/form/general/)) -- Heading (Title, Subtitle and heading on Bulma) ([Storybook](https://dfee.github.io/rbx/?selectedKind=Heading)) ([Docs](http://bulma.io/documentation/elements/title/)) -- Hero ([Storybook](https://dfee.github.io/rbx/?selectedKind=Hero)) ([Docs](http://bulma.io/documentation/layout/hero/)) -- Icon ([Storybook](https://dfee.github.io/rbx/?selectedKind=Icon)) ([Docs](http://bulma.io/documentation/elements/icon/)) -- Image ([Storybook](https://dfee.github.io/rbx/?selectedKind=Image)) ([Docs](http://bulma.io/documentation/elements/image/)) -- Level ([Storybook](https://dfee.github.io/rbx/?selectedKind=Level)) ([Docs](http://bulma.io/documentation/layout/level/)) -- Loader ([Storybook](https://dfee.github.io/rbx/?selectedKind=Loader)) -- Media ([Storybook](https://dfee.github.io/rbx/?selectedKind=Media)) ([Docs](http://bulma.io/documentation/layout/media-object/)) -- Message ([Storybook](https://dfee.github.io/rbx/?selectedKind=Message)) ([Docs](http://bulma.io/documentation/components/message/)) -- Menu ([Storybook](https://dfee.github.io/rbx/?selectedKind=Menu)) ([Docs](http://bulma.io/documentation/components/menu/)) -- Modal ([Storybook](https://dfee.github.io/rbx/?selectedKind=Modal)) ([Docs](http://bulma.io/documentation/components/modal/)) -- Navbar ([Storybook](https://dfee.github.io/rbx/?selectedKind=Navbar)) ([Docs](https://bulma.io/documentation/components/navbar/)) -- Notification ([Storybook](https://dfee.github.io/rbx/?selectedKind=Notification)) ([Docs](http://bulma.io/documentation/elements/notification/)) -- Pagination ([Storybook](https://dfee.github.io/rbx/?selectedKind=Pagination)) ([Docs](https://bulma.io/documentation/components/pagination/)) -- Panel ([Storybook](https://dfee.github.io/rbx/?selectedKind=Panel)) ([Docs](https://bulma.io/documentation/components/panel/)) -- Progress ([Storybook](https://dfee.github.io/rbx/?selectedKind=Progress)) ([Docs](http://bulma.io/documentation/elements/progress/)) -- Section ([Storybook](https://dfee.github.io/rbx/?selectedKind=Section)) ([Docs](http://bulma.io/documentation/layout/section/)) -- Tabs ([Storybook](https://dfee.github.io/rbx/?selectedKind=Tabs)) ([Docs](https://bulma.io/documentation/components/tabs/)) -- Table ([Storybook](https://dfee.github.io/rbx/?selectedKind=Table)) ([Docs](http://bulma.io/documentation/elements/table/)) -- Tag ([Storybook](https://dfee.github.io/rbx/?selectedKind=Tag)) ([Docs](http://bulma.io/documentation/elements/tag/)) -- Tile ([Storybook](https://dfee.github.io/rbx/?selectedKind=Tile)) ([Docs](http://bulma.io/documentation/layout/tiles/)) +#### Columns + +| Item | Storybook | Bulma Documentation | +| ------ | ----------------------------------------------------------- | -------------------------------------------------------------- | +| Column | [Stories](https://dfee.github.io/rbx/?selectedKind=Columns) | [Documentation](http://bulma.io/documentation/columns/basics/) | + +#### Layout + +| Item | Storybook | Bulma Documentation | +| --------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------- | +| Container | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FContainer) | [Documentation](http://bulma.io/documentation/layout/container/) | +| Level | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FLevel) | [Documentation](http://bulma.io/documentation/layout/level/) | +| Media | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FMedia) | [Documentation](http://bulma.io/documentation/layout/media-object/) | +| Hero | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FHero) | [Documentation](http://bulma.io/documentation/layout/hero/) | +| Section | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FSection) | [Documentation](http://bulma.io/documentation/layout/section/) | +| Footer | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FFooter) | [Documentation](http://bulma.io/documentation/layout/footer/) | +| Tile | [Stories](https://dfee.github.io/rbx/?selectedKind=Layout%2FTile) | [Documentation](http://bulma.io/documentation/layout/tiles/) | + +#### Form + +| Item | Storybook | Bulma Documentation | +| ---- | -------------------------------------------------------- | ------------------------------------------------------------ | +| Form | [Stories](https://dfee.github.io/rbx/?selectedKind=Form) | [Documentation](http://bulma.io/documentation/form/general/) | + +#### Elements + +| Item | Storybook | Bulma Documentation | +| ------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------- | +| Box | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FBox) | [Documentation](http://bulma.io/documentation/elements/box/) | +| Button | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FButton) | [Documentation](http://bulma.io/documentation/elements/button/) | +| Content | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FContent) | [Documentation](http://bulma.io/documentation/elements/content/) | +| Delete | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FDelete) | [Documentation](http://bulma.io/documentation/elements/delete/) | +| Icon | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FIcon) | [Documentation](http://bulma.io/documentation/elements/icon/) | +| Image | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FImage) | [Documentation](http://bulma.io/documentation/elements/image/) | +| Notification | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FNotification) | [Documentation](http://bulma.io/documentation/elements/notification/) | +| Progress | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FProgress) | [Documentation](http://bulma.io/documentation/elements/progress/) | +| Table | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FTable) | [Documentation](http://bulma.io/documentation/elements/table/) | +| Tag | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FTag) | [Documentation](http://bulma.io/documentation/elements/tag/) | +| - Title | [Stories](https://dfee.github.io/rbx/?selectedKind=Elements%2FTitle) | [Documentation](http://bulma.io/documentation/elements/title/) | + +#### Components + +| Item | Storybook | Bulma Documentation | +| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| Breadcrumb | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FBreadcrumb) | [Documentation](http://bulma.io/documentation/components/breadcrumb/) | +| Card | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FCard) | [Documentation](http://bulma.io/documentation/components/card/) | +| Dropdown | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FDropdown) | [Documentation](http://bulma.io/documentation/components/dropdown/) | +| Menu | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FMenu) | [Documentation](http://bulma.io/documentation/components/menu/) | +| Message | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FMessage) | [Documentation](http://bulma.io/documentation/components/message/) | +| Modal | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FModal) | [Documentation](http://bulma.io/documentation/components/modal/) | +| Navbar | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FNavbar) | [Documentation](https://bulma.io/documentation/components/navbar/) | +| Pagination | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FPagination) | [Documentation](https://bulma.io/documentation/components/pagination/) | +| Panel | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FPanel) | [Documentation](https://bulma.io/documentation/components/panel/) | +| Tabs | [Stories](https://dfee.github.io/rbx/?selectedKind=Components%2FTabs) | [Documentation](https://bulma.io/documentation/components/tabs/) | + +#### Extras + +| Item | Storybook | Bulma Documentation | +| ------- | -------------------------------------------------------------------- | ------------------- | +| Generic | [Stories](https://dfee.github.io/rbx/?selectedKind=Extras%2FGeneric) | N/A | +| Loader | [Stories](https://dfee.github.io/rbx/?selectedKind=Extras%2FLoader) | N/A | ### Override Bulma variables diff --git a/src/__tests__/__snapshots__/index.test.ts.snap b/src/__tests__/__snapshots__/index.test.ts.snap index d2eafa92..335a3f23 100644 --- a/src/__tests__/__snapshots__/index.test.ts.snap +++ b/src/__tests__/__snapshots__/index.test.ts.snap @@ -103,6 +103,15 @@ Object { }, "render": [Function], }, + "Checkbox": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "checked": false, + "children": null, + "disabled": false, + }, + "render": [Function], + }, "Columns": Object { "$$typeof": Symbol(react.forward_ref), "Column": Object { @@ -151,118 +160,67 @@ Object { }, "render": [Function], }, - "Dropdown": [Function], - "Element": Object { + "Control": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { "as": "div", + "fullwidth": false, + "iconLeft": false, + "iconRight": false, + "loading": false, }, "render": [Function], }, - "Footer": Object { + "Delete": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { - "as": "div", + "as": "a", + "size": "auto", }, "render": [Function], }, - "Form": Object { - "Checkbox": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "checked": false, - "children": null, - "disabled": false, - }, - "render": [Function], - }, - "Control": Object { + "Dropdown": [Function], + "Field": Object { + "$$typeof": Symbol(react.forward_ref), + "Body": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { "as": "div", - "fullwidth": false, - "iconLeft": false, - "iconRight": false, - "loading": false, }, "render": [Function], }, - "Field": Object { + "Label": Object { "$$typeof": Symbol(react.forward_ref), - "Body": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "as": "div", - }, - "render": [Function], - }, - "Label": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "as": "div", - }, - "render": [Function], - }, "defaultProps": Object { "as": "div", - "horizontal": false, - "multiline": false, - }, - "render": [Function], - }, - "Help": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "as": "p", }, "render": [Function], }, - "Input": Object { - "$$typeof": Symbol(react.forward_ref), - "render": [Function], - }, - "InputFile": [Function], - "Label": Object { - "$$typeof": Symbol(react.forward_ref), - "render": [Function], - }, - "Radio": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "checked": false, - "children": null, - "disabled": false, - }, - "render": [Function], + "defaultProps": Object { + "as": "div", + "horizontal": false, + "multiline": false, }, - "Select": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "children": null, - "disabled": false, - "loading": false, - "multiple": false, - "readOnly": false, - }, - "render": [Function], + "render": [Function], + }, + "Footer": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "as": "div", }, - "Textarea": Object { - "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "disabled": false, - "readOnly": false, - "rows": 4, - }, - "render": [Function], + "render": [Function], + }, + "Generic": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "as": "div", }, + "render": [Function], }, - "Heading": Object { + "Help": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { - "as": "h1", - "heading": false, - "spaced": false, - "subtitle": false, + "as": "p", }, "render": [Function], }, @@ -309,6 +267,15 @@ Object { }, "render": [Function], }, + "Input": Object { + "$$typeof": Symbol(react.forward_ref), + "render": [Function], + }, + "InputFile": [Function], + "Label": Object { + "$$typeof": Symbol(react.forward_ref), + "render": [Function], + }, "Level": Object { "$$typeof": Symbol(react.forward_ref), "Item": Object { @@ -563,6 +530,15 @@ Object { "$$typeof": Symbol(react.forward_ref), "render": [Function], }, + "Radio": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "checked": false, + "children": null, + "disabled": false, + }, + "render": [Function], + }, "Section": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { @@ -570,6 +546,17 @@ Object { }, "render": [Function], }, + "Select": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "children": null, + "disabled": false, + "loading": false, + "multiple": false, + "readOnly": false, + }, + "render": [Function], + }, "Table": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { @@ -611,6 +598,15 @@ Object { }, "render": [Function], }, + "Textarea": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "disabled": false, + "readOnly": false, + "rows": 4, + }, + "render": [Function], + }, "Tile": Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { @@ -620,5 +616,15 @@ Object { }, "render": [Function], }, + "Title": Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "as": "h1", + "heading": false, + "spaced": false, + "subtitle": false, + }, + "render": [Function], + }, } `; diff --git a/src/components/_variables.sass b/src/_variables.sass similarity index 100% rename from src/components/_variables.sass rename to src/_variables.sass diff --git a/src/components/columns/__tests__/__snapshots__/columns.test.tsx.snap b/src/columns/__tests__/__snapshots__/columns.test.tsx.snap similarity index 100% rename from src/components/columns/__tests__/__snapshots__/columns.test.tsx.snap rename to src/columns/__tests__/__snapshots__/columns.test.tsx.snap diff --git a/src/components/columns/__tests__/columns.test.tsx b/src/columns/__tests__/columns.test.tsx similarity index 100% rename from src/components/columns/__tests__/columns.test.tsx rename to src/columns/__tests__/columns.test.tsx diff --git a/src/components/columns/column.tsx b/src/columns/column.tsx similarity index 98% rename from src/components/columns/column.tsx rename to src/columns/column.tsx index 261bc9af..d51e423b 100644 --- a/src/components/columns/column.tsx +++ b/src/columns/column.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { ColumnSizes } from "./constants"; diff --git a/src/components/columns/columns.module.sass b/src/columns/columns.module.sass similarity index 100% rename from src/components/columns/columns.module.sass rename to src/columns/columns.module.sass diff --git a/src/components/columns/columns.story.tsx b/src/columns/columns.story.tsx similarity index 96% rename from src/components/columns/columns.story.tsx rename to src/columns/columns.story.tsx index 0147deaa..b7474a1a 100644 --- a/src/components/columns/columns.story.tsx +++ b/src/columns/columns.story.tsx @@ -2,9 +2,8 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Box } from "@/components/box"; -import { Columns } from "@/components/columns"; -import { Heading } from "@/components/heading"; +import { Columns } from "@/columns"; +import { Box, Title } from "@/elements"; import { COLUMN_SIZES } from "./constants"; storiesOf("Columns", module) @@ -339,22 +338,22 @@ storiesOf("Columns", module) - size={5} as="p"> + size={5} as="p"> Narrow column - - subtitle as="p"> + + subtitle as="p"> This column is only 200px wide. - + - size={5} as="p"> + size={5} as="p"> Flexible column - - subtitle as="p"> + + subtitle as="p"> This column will take up the remaining space available. - + @@ -362,9 +361,9 @@ storiesOf("Columns", module) .add("Responsive", () => (
- size={5} as="p"> + size={5} as="p"> Mobile - +

First Column

@@ -381,9 +380,9 @@ storiesOf("Columns", module)
- as="p" size={5}> + as="p" size={5}> Tablet - +

First Column

@@ -400,9 +399,9 @@ storiesOf("Columns", module)
- as="p" size={5}> + as="p" size={5}> Desktop - +

First Column

diff --git a/src/components/columns/columns.tsx b/src/columns/columns.tsx similarity index 96% rename from src/components/columns/columns.tsx rename to src/columns/columns.tsx index 192fc896..d7ff00d6 100644 --- a/src/components/columns/columns.tsx +++ b/src/columns/columns.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Breakpoints } from "@/modifiers/responsive"; import { Column } from "./column"; diff --git a/src/components/columns/constants.ts b/src/columns/constants.ts similarity index 100% rename from src/components/columns/constants.ts rename to src/columns/constants.ts diff --git a/src/components/columns/index.ts b/src/columns/index.ts similarity index 100% rename from src/components/columns/index.ts rename to src/columns/index.ts diff --git a/src/components/box/box.tsx b/src/components/box/box.tsx deleted file mode 100644 index 08847f5a..00000000 --- a/src/components/box/box.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { cx } from "emotion"; -import React from "react"; - -import { forwardRefAs } from "@/components/exotic"; -import { ModifierProps, transformModifiers } from "@/modifiers"; - -export type BoxModifierProps = Partial<{ - children: React.ReactNode; - className: string; - style: React.CSSProperties; -}>; - -export type BoxProps = ModifierProps & BoxModifierProps; - -export const Box = forwardRefAs((props, ref) => { - const { as, children, ...rest } = transformModifiers(props); - rest.className = cx("box", rest.className); - return React.createElement(as!, { children, ref, ...rest }); -}, "div"); diff --git a/src/components/breadcrumb/breadcrumb-item.tsx b/src/components/breadcrumb/breadcrumb-item.tsx index 5d907982..e1a4b0e4 100644 --- a/src/components/breadcrumb/breadcrumb-item.tsx +++ b/src/components/breadcrumb/breadcrumb-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export interface BreadcrumbItemModifierProps { diff --git a/src/components/breadcrumb/breadcrumb.module.sass b/src/components/breadcrumb/breadcrumb.module.sass index 72ec6878..d45f1671 100644 --- a/src/components/breadcrumb/breadcrumb.module.sass +++ b/src/components/breadcrumb/breadcrumb.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/breadcrumb.sass' \ No newline at end of file diff --git a/src/components/breadcrumb/breadcrumb.story.tsx b/src/components/breadcrumb/breadcrumb.story.tsx index 57209d9d..87206fef 100644 --- a/src/components/breadcrumb/breadcrumb.story.tsx +++ b/src/components/breadcrumb/breadcrumb.story.tsx @@ -2,10 +2,10 @@ import { select } from "@storybook/addon-knobs"; import { storiesOf } from "@storybook/react"; import React from "react"; -import { Box } from "@/components/box"; -import { Breadcrumb } from "@/components/breadcrumb"; +import { Breadcrumb } from "@/components"; +import { Box } from "@/elements"; -const makeSeparator = () => +const makeSeparatorSelector = () => select( "Separator", { @@ -23,11 +23,11 @@ const items = [ { active: true, href: "#3", name: "Breadcrumb Types" }, ]; -storiesOf("Breadcrumb", module) +storiesOf("Components/Breadcrumb", module) .add("Default", () => (
- + {items.map(({ active, href, name }, i) => ( {name} @@ -44,7 +44,7 @@ storiesOf("Breadcrumb", module) return (
- + {items.map(({ active, href: to, name }, i) => ( as={Link} diff --git a/src/components/breadcrumb/breadcrumb.tsx b/src/components/breadcrumb/breadcrumb.tsx index f80c69e3..21a92171 100644 --- a/src/components/breadcrumb/breadcrumb.tsx +++ b/src/components/breadcrumb/breadcrumb.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { tuple } from "@/utils"; import { BreadcrumbItem } from "./breadcrumb-item"; diff --git a/src/components/card/card-content.tsx b/src/components/card/card-content.tsx index 8938e3ac..51099a5b 100644 --- a/src/components/card/card-content.tsx +++ b/src/components/card/card-content.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type CardContentProps = ModifierProps; diff --git a/src/components/card/card-footer-item.tsx b/src/components/card/card-footer-item.tsx index 477f019d..12323980 100644 --- a/src/components/card/card-footer-item.tsx +++ b/src/components/card/card-footer-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type CardFooterItemProps = ModifierProps; diff --git a/src/components/card/card-footer.tsx b/src/components/card/card-footer.tsx index fefd357b..7c42b801 100644 --- a/src/components/card/card-footer.tsx +++ b/src/components/card/card-footer.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { CardFooterItem } from "./card-footer-item"; diff --git a/src/components/card/card-header-icon.tsx b/src/components/card/card-header-icon.tsx index fe9947f4..67d7435d 100644 --- a/src/components/card/card-header-icon.tsx +++ b/src/components/card/card-header-icon.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type CardHeaderIconProps = ModifierProps; diff --git a/src/components/card/card-header-title.tsx b/src/components/card/card-header-title.tsx index 3cc1fca1..9593bbd1 100644 --- a/src/components/card/card-header-title.tsx +++ b/src/components/card/card-header-title.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type CardHeaderTitleProps = ModifierProps; diff --git a/src/components/card/card-header.tsx b/src/components/card/card-header.tsx index 48803481..bd59b673 100644 --- a/src/components/card/card-header.tsx +++ b/src/components/card/card-header.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { CardHeaderIcon } from "./card-header-icon"; import { CardHeaderTitle } from "./card-header-title"; diff --git a/src/components/card/card-image.tsx b/src/components/card/card-image.tsx index e0954d1a..0e47fb7a 100644 --- a/src/components/card/card-image.tsx +++ b/src/components/card/card-image.tsx @@ -1,9 +1,9 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; -import { Image } from "@/components/image"; -import { ImageProps } from "@/components/image/image"; +import { Image } from "@/elements/image"; +import { ImageProps } from "@/elements/image/image"; +import { Generic } from "@/extras"; export type CardImageModifierProps = Partial<{ className: string; @@ -16,8 +16,8 @@ export type CardImageProps = Prefer< export const CardImage = React.forwardRef( ({ className, ...rest }, ref) => ( - + - + ), ); diff --git a/src/components/card/card.module.sass b/src/components/card/card.module.sass index e6491f80..9289af58 100644 --- a/src/components/card/card.module.sass +++ b/src/components/card/card.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/card.sass' \ No newline at end of file diff --git a/src/components/card/card.story.tsx b/src/components/card/card.story.tsx index 442b14fd..6dd21b8f 100644 --- a/src/components/card/card.story.tsx +++ b/src/components/card/card.story.tsx @@ -2,13 +2,11 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Card } from "@/components/card"; -import { Content } from "@/components/content"; -import { Heading } from "@/components/heading"; -import { Image } from "@/components/image"; -import { Media } from "@/components/media"; +import { Card } from "@/components"; +import { Content, Image, Title } from "@/elements"; +import { Media } from "@/layout"; -storiesOf("Card", module) +storiesOf("Components/Card", module) .addDecorator(story => (
{story()}
)) @@ -29,10 +27,10 @@ storiesOf("Card", module) /> - Devin Fee - + Devin Fee + @dfee - </Heading> + @@ -61,10 +59,10 @@ storiesOf("Card", module) /> - Devin Fee - + Devin Fee + @dfee - </Heading> + diff --git a/src/components/card/card.tsx b/src/components/card/card.tsx index 73b6891c..9a474c86 100644 --- a/src/components/card/card.tsx +++ b/src/components/card/card.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { CardContent } from "./card-content"; import { CardFooter } from "./card-footer"; diff --git a/src/components/dropdown/dropdown-item.tsx b/src/components/dropdown/dropdown-item.tsx index 998e9e28..906159d4 100644 --- a/src/components/dropdown/dropdown-item.tsx +++ b/src/components/dropdown/dropdown-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; export interface DropdownItemModifierProps { @@ -20,7 +20,7 @@ export const DropdownItem = React.forwardRef( rest.className = cx("dropdown-item", rest.className, { "is-active": active, }); - return ; + return ; }, ); diff --git a/src/components/dropdown/dropdown.module.sass b/src/components/dropdown/dropdown.module.sass index 9f073f0b..0f4ba150 100644 --- a/src/components/dropdown/dropdown.module.sass +++ b/src/components/dropdown/dropdown.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/dropdown.sass' .dropdown-item diff --git a/src/components/dropdown/dropdown.story.tsx b/src/components/dropdown/dropdown.story.tsx index 1a153e7f..c674db88 100644 --- a/src/components/dropdown/dropdown.story.tsx +++ b/src/components/dropdown/dropdown.story.tsx @@ -2,8 +2,8 @@ import React from "react"; import { storiesOf } from "@storybook/react"; +import { Dropdown } from "@/components"; import { Colors } from "@/modifiers/color"; -import { Dropdown } from "."; interface DropdownControllerProps { hoverable?: boolean; @@ -45,7 +45,7 @@ class DropdownController extends React.Component< } } -storiesOf("Dropdown", module) +storiesOf("Components/Dropdown", module) .add("Default", () => ( Dropdown item diff --git a/src/components/dropdown/dropdown.tsx b/src/components/dropdown/dropdown.tsx index 56afbc56..4c124e54 100644 --- a/src/components/dropdown/dropdown.tsx +++ b/src/components/dropdown/dropdown.tsx @@ -1,8 +1,8 @@ import { cx } from "emotion"; import React, { PureComponent } from "react"; -import { Button } from "@/components/button"; -import { Icon } from "@/components/icon"; +import { Button } from "@/elements/button"; +import { Icon } from "@/elements/icon"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; import { DropdownDivider } from "./dropdown-divider"; diff --git a/src/components/element/index.ts b/src/components/element/index.ts deleted file mode 100644 index 112e4faf..00000000 --- a/src/components/element/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Element } from "./element"; diff --git a/src/components/exotic/index.ts b/src/components/exotic/index.ts deleted file mode 100644 index 121d7086..00000000 --- a/src/components/exotic/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { forwardRefAs } from "./exotic"; diff --git a/src/components/heading/heading.story.tsx b/src/components/heading/heading.story.tsx deleted file mode 100644 index 51d87767..00000000 --- a/src/components/heading/heading.story.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from "react"; - -import { storiesOf } from "@storybook/react"; - -import { Box } from "@/components/box"; -import { Heading } from "@/components/heading"; - -storiesOf("Heading", module).add("Default", () => ( -
- - Title - - Subtitle - - - - Title - - Subtitle - - - - Title - subtitle size={4} as="h2"> - Subtitle - - - - Title - subtitle size={5} as="h2"> - Subtitle - - - - Title - subtitle size={6} as="h2"> - Subtitle - - -
-)); diff --git a/src/components/heading/index.ts b/src/components/heading/index.ts deleted file mode 100644 index 8c15af22..00000000 --- a/src/components/heading/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "./heading.module.sass"; - -export { Heading } from "./heading"; diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 00000000..fa0d5a08 --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1,10 @@ +export { Breadcrumb } from "./breadcrumb"; +export { Card } from "./card"; +export { Dropdown } from "./dropdown"; +export { Menu } from "./menu"; +export { Message } from "./message"; +export { Modal } from "./modal"; +export { Navbar } from "./navbar"; +export { Pagination } from "./pagination"; +export { Panel } from "./panel"; +export { Tabs } from "./tabs"; diff --git a/src/components/loader/loader.module.sass b/src/components/loader/loader.module.sass deleted file mode 100644 index 070cb1c8..00000000 --- a/src/components/loader/loader.module.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import '../utils.sass' - -.loader - +loader \ No newline at end of file diff --git a/src/components/menu/menu-list-item.tsx b/src/components/menu/menu-list-item.tsx index 28cce315..90ce85d3 100644 --- a/src/components/menu/menu-list-item.tsx +++ b/src/components/menu/menu-list-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { MenuList } from "./menu-list"; @@ -25,7 +25,7 @@ export const MenuListItem = React.forwardRef( if (typeof children === "string") { return (
  • - as="a" children={children} {...rest} /> + as="a" children={children} {...rest} />
  • ); } @@ -34,7 +34,7 @@ export const MenuListItem = React.forwardRef( const child = React.Children.only(children); return (
  • - as="a" children={child.props.title} {...rest} /> + as="a" children={child.props.title} {...rest} /> {React.cloneElement(child, { title: null })}
  • ); diff --git a/src/components/menu/menu-list.tsx b/src/components/menu/menu-list.tsx index e4927f0f..bd6e7964 100644 --- a/src/components/menu/menu-list.tsx +++ b/src/components/menu/menu-list.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { MenuListItem } from "./menu-list-item"; @@ -20,7 +20,7 @@ export const MenuList = Object.assign( return ( {title &&

    {title}

    } - + as="ul" className={cx("menu-list", className)} ref={ref} diff --git a/src/components/menu/menu.module.sass b/src/components/menu/menu.module.sass index a088c69d..09e9e49b 100644 --- a/src/components/menu/menu.module.sass +++ b/src/components/menu/menu.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/menu.sass' \ No newline at end of file diff --git a/src/components/menu/menu.story.tsx b/src/components/menu/menu.story.tsx index 7b32f0c1..440b6504 100644 --- a/src/components/menu/menu.story.tsx +++ b/src/components/menu/menu.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Menu } from "@/components/menu"; +import { Menu } from "@/components"; -storiesOf("Menu", module).add("Default", () => ( +storiesOf("Components/Menu", module).add("Default", () => ( Dashboard diff --git a/src/components/menu/menu.tsx b/src/components/menu/menu.tsx index 3b66f1c1..8191734c 100644 --- a/src/components/menu/menu.tsx +++ b/src/components/menu/menu.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { MenuList } from "./menu-list"; diff --git a/src/components/message/message-body.tsx b/src/components/message/message-body.tsx index 8374a7d6..d7778533 100644 --- a/src/components/message/message-body.tsx +++ b/src/components/message/message-body.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type MessageBodyProps = ModifierProps; diff --git a/src/components/message/message-header.tsx b/src/components/message/message-header.tsx index b0a956cd..f438b7ec 100644 --- a/src/components/message/message-header.tsx +++ b/src/components/message/message-header.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type MessageHeaderProps = ModifierProps; diff --git a/src/components/message/message.module.sass b/src/components/message/message.module.sass index b0a89650..084339c2 100644 --- a/src/components/message/message.module.sass +++ b/src/components/message/message.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/message.sass' \ No newline at end of file diff --git a/src/components/message/message.story.tsx b/src/components/message/message.story.tsx index b1d5225c..c9ba0050 100644 --- a/src/components/message/message.story.tsx +++ b/src/components/message/message.story.tsx @@ -1,10 +1,10 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Button } from "@/components/button"; -import { Message } from "@/components/message"; +import { Message } from "@/components"; +import { Button } from "@/elements"; -storiesOf("Message", module) +storiesOf("Components/Message", module) .add("Default", () => ( diff --git a/src/components/message/message.tsx b/src/components/message/message.tsx index 11a94894..ec1d4baa 100644 --- a/src/components/message/message.tsx +++ b/src/components/message/message.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; import { MessageBody } from "./message-body"; diff --git a/src/components/modal/modal-card-body.tsx b/src/components/modal/modal-card-body.tsx index af76b4ba..c572a9a9 100644 --- a/src/components/modal/modal-card-body.tsx +++ b/src/components/modal/modal-card-body.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ModalCardBodyProps = ModifierProps; diff --git a/src/components/modal/modal-card-foot.tsx b/src/components/modal/modal-card-foot.tsx index 2f55c763..be9dd3d4 100644 --- a/src/components/modal/modal-card-foot.tsx +++ b/src/components/modal/modal-card-foot.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ModalCardFootProps = ModifierProps; diff --git a/src/components/modal/modal-card-head.tsx b/src/components/modal/modal-card-head.tsx index 8b2ec380..734d8030 100644 --- a/src/components/modal/modal-card-head.tsx +++ b/src/components/modal/modal-card-head.tsx @@ -1,8 +1,8 @@ import { cx } from "emotion"; import React from "react"; -import { Button } from "@/components/button"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; +import { Button } from "@/elements/button"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ModalCardHeadModifierProps = Partial<{ diff --git a/src/components/modal/modal-card-title.tsx b/src/components/modal/modal-card-title.tsx index e7ffb760..1a0df6c8 100644 --- a/src/components/modal/modal-card-title.tsx +++ b/src/components/modal/modal-card-title.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ModalCardTitleProps = ModifierProps; diff --git a/src/components/modal/modal-card.tsx b/src/components/modal/modal-card.tsx index bbaceac5..f4cdc914 100644 --- a/src/components/modal/modal-card.tsx +++ b/src/components/modal/modal-card.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { ModalCardBody } from "./modal-card-body"; import { ModalCardFoot } from "./modal-card-foot"; @@ -19,10 +19,8 @@ export type ModalCardProps = Prefer< export const ModalCard = Object.assign( React.forwardRef( - ({ className, onClose, children, ...props }, ref) => ( - - {children} - + ({ className, onClose, ...props }, ref) => ( + ), ), { diff --git a/src/components/modal/modal-content.tsx b/src/components/modal/modal-content.tsx index 68371758..d7e6f4c2 100644 --- a/src/components/modal/modal-content.tsx +++ b/src/components/modal/modal-content.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ModalContentProps = ModifierProps; diff --git a/src/components/modal/modal.module.sass b/src/components/modal/modal.module.sass index bf9ad457..0b8f39b3 100644 --- a/src/components/modal/modal.module.sass +++ b/src/components/modal/modal.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/modal.sass' .modal-container diff --git a/src/components/modal/modal.story.tsx b/src/components/modal/modal.story.tsx index 9650488c..32e825cf 100644 --- a/src/components/modal/modal.story.tsx +++ b/src/components/modal/modal.story.tsx @@ -1,13 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Button } from "@/components/button"; -import { Content } from "@/components/content"; -import { Image } from "@/components/image"; -import { Level } from "@/components/level"; -import { Media } from "@/components/media"; -import { Modal } from "@/components/modal"; -import { Section } from "@/components/section"; +import { Modal } from "@/components"; +import { Button, Content, Image } from "@/elements"; +import { Level, Media, Section } from "@/layout"; interface OpenModalProps { modal?: {}; @@ -44,7 +40,7 @@ class OpenModal extends React.Component { private close = () => this.setState({ show: false }); } -storiesOf("Modal", module) +storiesOf("Components/Modal", module) .add("Default", () => ( diff --git a/src/components/navbar/navbar-brand.tsx b/src/components/navbar/navbar-brand.tsx index 5491eaf9..328e79a4 100644 --- a/src/components/navbar/navbar-brand.tsx +++ b/src/components/navbar/navbar-brand.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; export type NavbarBrandProps = Prefer< @@ -13,7 +13,7 @@ export const NavbarBrand = React.forwardRef( (props, ref) => { const { className, ...rest } = props; return ( - + ); }, ); diff --git a/src/components/navbar/navbar-burger.tsx b/src/components/navbar/navbar-burger.tsx index 1218eff8..24d0afee 100644 --- a/src/components/navbar/navbar-burger.tsx +++ b/src/components/navbar/navbar-burger.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { NavbarContext } from "./navbar-context"; @@ -16,7 +16,7 @@ export const NavbarBurger = React.forwardRef( return ( {({ active, setActive }) => ( - ( - + )} ); diff --git a/src/components/navbar/navbar-container.tsx b/src/components/navbar/navbar-container.tsx index 4b08d4f7..b2d20f00 100644 --- a/src/components/navbar/navbar-container.tsx +++ b/src/components/navbar/navbar-container.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type NavbarContainerModifierProps = Partial<{ diff --git a/src/components/navbar/navbar-divider.tsx b/src/components/navbar/navbar-divider.tsx index c0f42814..c9e58802 100644 --- a/src/components/navbar/navbar-divider.tsx +++ b/src/components/navbar/navbar-divider.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; export type NavbarDividerProps = Prefer< @@ -13,5 +13,5 @@ export const NavbarDivider = React.forwardRef< HTMLDivElement, NavbarDividerProps >(({ className, ...props }, ref) => ( - + )); diff --git a/src/components/navbar/navbar-dropdown.tsx b/src/components/navbar/navbar-dropdown.tsx index d7fa1c58..08b5f495 100644 --- a/src/components/navbar/navbar-dropdown.tsx +++ b/src/components/navbar/navbar-dropdown.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type NavbarDropdownModifierProps = Partial<{ diff --git a/src/components/navbar/navbar-item.tsx b/src/components/navbar/navbar-item.tsx index 330ca0ed..c4793a17 100644 --- a/src/components/navbar/navbar-item.tsx +++ b/src/components/navbar/navbar-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type NavbarItemModifierProps = Partial<{ diff --git a/src/components/navbar/navbar-link.tsx b/src/components/navbar/navbar-link.tsx index f58e3ef5..f3ef9365 100644 --- a/src/components/navbar/navbar-link.tsx +++ b/src/components/navbar/navbar-link.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type NavbarLinkProps = ModifierProps; diff --git a/src/components/navbar/navbar-menu.tsx b/src/components/navbar/navbar-menu.tsx index 5d5c954c..06011bb5 100644 --- a/src/components/navbar/navbar-menu.tsx +++ b/src/components/navbar/navbar-menu.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { NavbarContext } from "./navbar-context"; @@ -16,7 +16,7 @@ export const NavbarMenu = React.forwardRef( return ( {({ active }) => ( - select("Fixed", fixedSelectOptions, "Default"); -storiesOf("Navbar", module).add("Default", () => { +storiesOf("Components/Navbar", module).add("Default", () => { return ( - + ); } diff --git a/src/components/pagination/pagination.module.sass b/src/components/pagination/pagination.module.sass index d481296e..a98901aa 100644 --- a/src/components/pagination/pagination.module.sass +++ b/src/components/pagination/pagination.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/pagination.sass' diff --git a/src/components/pagination/pagination.story.tsx b/src/components/pagination/pagination.story.tsx index 7b0481e8..45eaaaf8 100644 --- a/src/components/pagination/pagination.story.tsx +++ b/src/components/pagination/pagination.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Pagination } from "../pagination"; +import { Pagination } from "@/components"; -storiesOf("Pagination", module) +storiesOf("Components/Pagination", module) .addDecorator(story =>
    {story()}
    ) .add("Default", () => ) .add("Without page number", () => ( diff --git a/src/components/pagination/pagination.tsx b/src/components/pagination/pagination.tsx index 987eab76..713faf33 100644 --- a/src/components/pagination/pagination.tsx +++ b/src/components/pagination/pagination.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { noop } from "@/utils"; @@ -97,7 +97,7 @@ class PaginationController extends React.PureComponent< const lastPage = this.lastPage(current!, total!); return ( - + {...props} aria-label="pagination" as="nav" @@ -155,7 +155,7 @@ class PaginationController extends React.PureComponent< )} -
    +
    ); } } diff --git a/src/components/panel/panel-block.tsx b/src/components/panel/panel-block.tsx index f8abbe8e..ff64b1df 100644 --- a/src/components/panel/panel-block.tsx +++ b/src/components/panel/panel-block.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type PanelBlockModifierProps = Partial<{ diff --git a/src/components/panel/panel-header.tsx b/src/components/panel/panel-header.tsx index 4ded334f..29f5c878 100644 --- a/src/components/panel/panel-header.tsx +++ b/src/components/panel/panel-header.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type PanelHeaderProps = ModifierProps; diff --git a/src/components/panel/panel-icon.tsx b/src/components/panel/panel-icon.tsx index d7ed5c67..7717e4a3 100644 --- a/src/components/panel/panel-icon.tsx +++ b/src/components/panel/panel-icon.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type PanelIconProps = ModifierProps; diff --git a/src/components/panel/panel-tab.tsx b/src/components/panel/panel-tab.tsx index 74372006..a54df986 100644 --- a/src/components/panel/panel-tab.tsx +++ b/src/components/panel/panel-tab.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type PanelTabModifierProps = Partial<{ diff --git a/src/components/panel/panel-tabs.tsx b/src/components/panel/panel-tabs.tsx index 56e4875e..4884a721 100644 --- a/src/components/panel/panel-tabs.tsx +++ b/src/components/panel/panel-tabs.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { PanelTab } from "./panel-tab"; diff --git a/src/components/panel/panel.module.sass b/src/components/panel/panel.module.sass index dbd8b7cb..1910f20c 100644 --- a/src/components/panel/panel.module.sass +++ b/src/components/panel/panel.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/panel.sass' \ No newline at end of file diff --git a/src/components/panel/panel.story.tsx b/src/components/panel/panel.story.tsx index f2529cd0..19d2b35d 100644 --- a/src/components/panel/panel.story.tsx +++ b/src/components/panel/panel.story.tsx @@ -1,12 +1,11 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Button } from "@/components/button"; -import { Checkbox, Control, Input } from "@/components/form"; -import { Icon } from "@/components/icon"; -import { Panel } from "@/components/panel"; +import { Panel } from "@/components"; +import { Button, Icon } from "@/elements"; +import { Checkbox, Control, Input } from "@/form"; -storiesOf("Panel", module) +storiesOf("Components/Panel", module) .addDecorator(story =>
    {story()}
    ) .add("Default", () => ( diff --git a/src/components/panel/panel.tsx b/src/components/panel/panel.tsx index 13eebbc0..081c9527 100644 --- a/src/components/panel/panel.tsx +++ b/src/components/panel/panel.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { PanelBlock } from "./panel-block"; import { PanelHeader } from "./panel-header"; diff --git a/src/components/tabs/tab.tsx b/src/components/tabs/tab.tsx index bbf7f12f..864d1f5c 100644 --- a/src/components/tabs/tab.tsx +++ b/src/components/tabs/tab.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type TabModifierProps = Partial<{ diff --git a/src/components/tabs/tabs.module.sass b/src/components/tabs/tabs.module.sass index 84c1d21f..7e86c952 100644 --- a/src/components/tabs/tabs.module.sass +++ b/src/components/tabs/tabs.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/tabs.sass' \ No newline at end of file diff --git a/src/components/tabs/tabs.story.tsx b/src/components/tabs/tabs.story.tsx index 4f96fbfa..3e346367 100644 --- a/src/components/tabs/tabs.story.tsx +++ b/src/components/tabs/tabs.story.tsx @@ -2,7 +2,7 @@ import { boolean, select } from "@storybook/addon-knobs"; import { storiesOf } from "@storybook/react"; import React from "react"; -import { Tabs } from "@/components/tabs"; +import { Tabs } from "@/components"; import { TabsProps } from "@/components/tabs/tabs"; // https://github.com/storybooks/storybook/issues/4865 @@ -14,7 +14,7 @@ const alignSelectOptions = ({ const makeAlignSelect = () => select("Align", alignSelectOptions, "Default"); -storiesOf("Tabs", module) +storiesOf("Components/Tabs", module) .addDecorator(story =>
    {story()}
    ) .add("Default", () => ( ( +storiesOf("Elements/Box", module).add("Default", () => ( ((props, ref) => { + const { as, ...rest } = transformModifiers(props); + rest.className = cx("box", rest.className); + return React.createElement(as!, { ref, ...rest }); +}, "div"); diff --git a/src/components/box/index.ts b/src/elements/box/index.ts similarity index 100% rename from src/components/box/index.ts rename to src/elements/box/index.ts diff --git a/src/components/button/__tests__/__snapshots__/button.test.tsx.snap b/src/elements/button/__tests__/__snapshots__/button.test.tsx.snap similarity index 100% rename from src/components/button/__tests__/__snapshots__/button.test.tsx.snap rename to src/elements/button/__tests__/__snapshots__/button.test.tsx.snap diff --git a/src/components/button/__tests__/button.test.tsx b/src/elements/button/__tests__/button.test.tsx similarity index 100% rename from src/components/button/__tests__/button.test.tsx rename to src/elements/button/__tests__/button.test.tsx diff --git a/src/components/button/button-group.tsx b/src/elements/button/button-group.tsx similarity index 93% rename from src/components/button/button-group.tsx rename to src/elements/button/button-group.tsx index 5ae590db..e439ecd8 100644 --- a/src/components/button/button-group.tsx +++ b/src/elements/button/button-group.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ButtonGroupModifierProps = Partial<{ diff --git a/src/components/button/button.module.sass b/src/elements/button/button.module.sass similarity index 78% rename from src/components/button/button.module.sass rename to src/elements/button/button.module.sass index c80ebf9f..151eece4 100644 --- a/src/components/button/button.module.sass +++ b/src/elements/button/button.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/button.sass' .delete diff --git a/src/components/button/button.story.tsx b/src/elements/button/button.story.tsx similarity index 92% rename from src/components/button/button.story.tsx rename to src/elements/button/button.story.tsx index 4078099c..9eb6686c 100644 --- a/src/components/button/button.story.tsx +++ b/src/elements/button/button.story.tsx @@ -3,10 +3,9 @@ import { boolean, select } from "@storybook/addon-knobs"; import { storiesOf } from "@storybook/react"; import React from "react"; -import { Box } from "@/components/box"; -import { Button } from "@/components/button"; -import { ButtonGroupProps } from "@/components/button/button-group"; -import { Section } from "@/components/section"; +import { Box, Button } from "@/elements"; +import { ButtonGroupProps } from "@/elements/button/button-group"; +import { Section } from "@/layout"; import { COLORS, Colors } from "@/modifiers/color"; const makeColorSelect = () => @@ -33,7 +32,7 @@ const makePositionSelect = () => "default", ); -storiesOf("Button", module) +storiesOf("Elements/Button", module) .addDecorator(story =>
    {story()}
    ) .add("Default", () => (
    diff --git a/src/components/button/button.tsx b/src/elements/button/button.tsx similarity index 97% rename from src/components/button/button.tsx rename to src/elements/button/button.tsx index 5409df0e..f8d96096 100644 --- a/src/components/button/button.tsx +++ b/src/elements/button/button.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; import { ButtonGroup } from "./button-group"; diff --git a/src/components/button/index.ts b/src/elements/button/index.ts similarity index 100% rename from src/components/button/index.ts rename to src/elements/button/index.ts diff --git a/src/components/content/__tests__/__snapshots__/content.test.tsx.snap b/src/elements/content/__tests__/__snapshots__/content.test.tsx.snap similarity index 100% rename from src/components/content/__tests__/__snapshots__/content.test.tsx.snap rename to src/elements/content/__tests__/__snapshots__/content.test.tsx.snap diff --git a/src/components/content/__tests__/content.test.tsx b/src/elements/content/__tests__/content.test.tsx similarity index 100% rename from src/components/content/__tests__/content.test.tsx rename to src/elements/content/__tests__/content.test.tsx diff --git a/src/components/content/content.module.sass b/src/elements/content/content.module.sass similarity index 61% rename from src/components/content/content.module.sass rename to src/elements/content/content.module.sass index ba87ac9a..a000637a 100644 --- a/src/components/content/content.module.sass +++ b/src/elements/content/content.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/content.sass' \ No newline at end of file diff --git a/src/components/content/content.story.tsx b/src/elements/content/content.story.tsx similarity index 99% rename from src/components/content/content.story.tsx rename to src/elements/content/content.story.tsx index 4b48d69d..308968f7 100644 --- a/src/components/content/content.story.tsx +++ b/src/elements/content/content.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Content } from "@/components/content"; +import { Content } from "@/elements"; -storiesOf("Content", module) +storiesOf("Elements/Content", module) .add("Default", () => (

    Hello World

    diff --git a/src/components/content/content.tsx b/src/elements/content/content.tsx similarity index 91% rename from src/components/content/content.tsx rename to src/elements/content/content.tsx index 1816e4d8..c1e87280 100644 --- a/src/components/content/content.tsx +++ b/src/elements/content/content.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type ContentModifierProps = Partial<{ diff --git a/src/components/content/index.ts b/src/elements/content/index.ts similarity index 100% rename from src/components/content/index.ts rename to src/elements/content/index.ts diff --git a/src/elements/delete/__tests__/__snapshots__/delete.test.tsx.snap b/src/elements/delete/__tests__/__snapshots__/delete.test.tsx.snap new file mode 100644 index 00000000..2d58a09c --- /dev/null +++ b/src/elements/delete/__tests__/__snapshots__/delete.test.tsx.snap @@ -0,0 +1,42 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Delete component should Exist 1`] = ` +Object { + "$$typeof": Symbol(react.forward_ref), + "defaultProps": Object { + "as": "a", + "size": "auto", + }, + "render": [Function], +} +`; + +exports[`Delete component should be size auto 1`] = ` + +`; + +exports[`Delete component should be size large 1`] = ` + +`; + +exports[`Delete component should be size medium 1`] = ` + +`; + +exports[`Delete component should be size small 1`] = ` + +`; + +exports[`Delete component should have delete classname 1`] = ` + +`; diff --git a/src/elements/delete/__tests__/delete.test.tsx b/src/elements/delete/__tests__/delete.test.tsx new file mode 100644 index 00000000..4cd10eba --- /dev/null +++ b/src/elements/delete/__tests__/delete.test.tsx @@ -0,0 +1,22 @@ +import React from "react"; +import renderer from "react-test-renderer"; + +import { Delete, DELETE_SIZES } from "../delete"; + +describe("Delete component", () => { + it("should Exist", () => { + expect(Delete).toMatchSnapshot(); + }); + + it("should have delete classname", () => { + const component = renderer.create(); + expect(component.toJSON()).toMatchSnapshot(); + }); + + DELETE_SIZES.map(size => { + it(`should be size ${size}`, () => { + const component = renderer.create(); + expect(component.toJSON()).toMatchSnapshot(); + }); + }); +}); diff --git a/src/elements/delete/delete.module.sass b/src/elements/delete/delete.module.sass new file mode 100644 index 00000000..3b407fb7 --- /dev/null +++ b/src/elements/delete/delete.module.sass @@ -0,0 +1 @@ +@import '../../utils.sass' diff --git a/src/elements/delete/delete.story.tsx b/src/elements/delete/delete.story.tsx new file mode 100644 index 00000000..2a901e5c --- /dev/null +++ b/src/elements/delete/delete.story.tsx @@ -0,0 +1,23 @@ +import { select } from "@storybook/addon-knobs"; +import { storiesOf } from "@storybook/react"; +import React from "react"; + +import { Delete } from "@/elements"; + +const makeSizeSelector = () => + select( + "Size", + { + auto: "auto", + small: "small", + medium: "medium", // tslint:disable-line:object-literal-sort-keys + large: "large", + }, + "auto", + ); + +storiesOf("Elements/Delete", module).add("Default", () => ( +
    + +
    +)); diff --git a/src/elements/delete/delete.tsx b/src/elements/delete/delete.tsx new file mode 100644 index 00000000..bfd24488 --- /dev/null +++ b/src/elements/delete/delete.tsx @@ -0,0 +1,25 @@ +import { cx } from "emotion"; +import React from "react"; + +import { forwardRefAs } from "@/exotic"; +import { ModifierProps } from "@/modifiers"; +import { tuple } from "@/utils"; + +export const DELETE_SIZES = tuple("small", "medium", "large", "auto"); +export type DeleteSizes = (typeof DELETE_SIZES)[number]; + +export type DeleteModifierProps = Partial<{ + size: DeleteSizes; +}>; + +export type DeleteProps = ModifierProps & DeleteModifierProps; + +export const Delete = forwardRefAs((props, ref) => { + const { as, size, ...rest } = props; + rest.className = cx("delete", rest.className, { + [`is-${size}`]: size !== "auto", + }); + return React.createElement(as!, { ref, ...rest }); +}, "a"); + +Delete.defaultProps = Object.assign({ size: "auto" }, Delete.defaultProps); diff --git a/src/elements/delete/index.ts b/src/elements/delete/index.ts new file mode 100644 index 00000000..93e56cc3 --- /dev/null +++ b/src/elements/delete/index.ts @@ -0,0 +1,2 @@ +import "./delete.module.sass"; +export { Delete } from "./delete"; diff --git a/src/components/icon/__tests__/__snapshots__/icon.test.tsx.snap b/src/elements/icon/__tests__/__snapshots__/icon.test.tsx.snap similarity index 100% rename from src/components/icon/__tests__/__snapshots__/icon.test.tsx.snap rename to src/elements/icon/__tests__/__snapshots__/icon.test.tsx.snap diff --git a/src/components/icon/__tests__/icon.test.tsx b/src/elements/icon/__tests__/icon.test.tsx similarity index 100% rename from src/components/icon/__tests__/icon.test.tsx rename to src/elements/icon/__tests__/icon.test.tsx diff --git a/src/components/icon/icon.module.sass b/src/elements/icon/icon.module.sass similarity index 99% rename from src/components/icon/icon.module.sass rename to src/elements/icon/icon.module.sass index b96135b1..78953356 100644 --- a/src/components/icon/icon.module.sass +++ b/src/elements/icon/icon.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/icon.sass' @font-face diff --git a/src/components/icon/icon.story.tsx b/src/elements/icon/icon.story.tsx similarity index 82% rename from src/components/icon/icon.story.tsx rename to src/elements/icon/icon.story.tsx index 8826fb56..695a4ef5 100644 --- a/src/components/icon/icon.story.tsx +++ b/src/elements/icon/icon.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Icon } from "@/components/icon"; +import { Icon } from "@/elements"; -storiesOf("Icon", module) +storiesOf("Elements/Icon", module) .add("Default", () => (
    diff --git a/src/components/icon/icon.tsx b/src/elements/icon/icon.tsx similarity index 100% rename from src/components/icon/icon.tsx rename to src/elements/icon/icon.tsx diff --git a/src/components/icon/index.ts b/src/elements/icon/index.ts similarity index 100% rename from src/components/icon/index.ts rename to src/elements/icon/index.ts diff --git a/src/components/image/__tests__/__snapshots__/image.test.tsx.snap b/src/elements/image/__tests__/__snapshots__/image.test.tsx.snap similarity index 100% rename from src/components/image/__tests__/__snapshots__/image.test.tsx.snap rename to src/elements/image/__tests__/__snapshots__/image.test.tsx.snap diff --git a/src/components/image/__tests__/image.test.tsx b/src/elements/image/__tests__/image.test.tsx similarity index 100% rename from src/components/image/__tests__/image.test.tsx rename to src/elements/image/__tests__/image.test.tsx diff --git a/src/components/image/constants.ts b/src/elements/image/constants.ts similarity index 100% rename from src/components/image/constants.ts rename to src/elements/image/constants.ts diff --git a/src/components/image/image.module.sass b/src/elements/image/image.module.sass similarity index 60% rename from src/components/image/image.module.sass rename to src/elements/image/image.module.sass index b0937f51..917201c0 100644 --- a/src/components/image/image.module.sass +++ b/src/elements/image/image.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/image.sass' \ No newline at end of file diff --git a/src/components/image/image.story.tsx b/src/elements/image/image.story.tsx similarity index 93% rename from src/components/image/image.story.tsx rename to src/elements/image/image.story.tsx index 9f9ac2a3..57c1e240 100644 --- a/src/components/image/image.story.tsx +++ b/src/elements/image/image.story.tsx @@ -2,11 +2,10 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Image } from "@/components/image"; -import { Table } from "@/components/table"; +import { Image, Table } from "@/elements"; import { IMAGE_SIZES } from "./constants"; -storiesOf("Image", module) +storiesOf("Elements/Image", module) .add("Default", () => (
    ( +storiesOf("Elements/Notification", module).add("Default", () => (
    Lorem ipsum dolor sit amet, consectetur adipiscing elit lorem ipsum dolor.{" "} diff --git a/src/components/notification/notification.tsx b/src/elements/notification/notification.tsx similarity index 92% rename from src/components/notification/notification.tsx rename to src/elements/notification/notification.tsx index 465c336b..4cec1d9a 100644 --- a/src/components/notification/notification.tsx +++ b/src/elements/notification/notification.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; diff --git a/src/components/progress/__tests__/__snapshots__/progress.test.tsx.snap b/src/elements/progress/__tests__/__snapshots__/progress.test.tsx.snap similarity index 100% rename from src/components/progress/__tests__/__snapshots__/progress.test.tsx.snap rename to src/elements/progress/__tests__/__snapshots__/progress.test.tsx.snap diff --git a/src/components/progress/__tests__/progress.test.tsx b/src/elements/progress/__tests__/progress.test.tsx similarity index 100% rename from src/components/progress/__tests__/progress.test.tsx rename to src/elements/progress/__tests__/progress.test.tsx diff --git a/src/components/progress/index.ts b/src/elements/progress/index.ts similarity index 100% rename from src/components/progress/index.ts rename to src/elements/progress/index.ts diff --git a/src/components/progress/progress.module.sass b/src/elements/progress/progress.module.sass similarity index 61% rename from src/components/progress/progress.module.sass rename to src/elements/progress/progress.module.sass index 919614b8..f7fe62da 100644 --- a/src/components/progress/progress.module.sass +++ b/src/elements/progress/progress.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/progress.sass' \ No newline at end of file diff --git a/src/components/progress/progress.story.tsx b/src/elements/progress/progress.story.tsx similarity index 77% rename from src/components/progress/progress.story.tsx rename to src/elements/progress/progress.story.tsx index 4a8231d0..c785cce6 100644 --- a/src/components/progress/progress.story.tsx +++ b/src/elements/progress/progress.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Progress } from "../progress"; +import { Progress } from "@/elements"; -storiesOf("Progress", module).add("Default", () => ( +storiesOf("Elements/Progress", module).add("Default", () => (
    diff --git a/src/components/progress/progress.tsx b/src/elements/progress/progress.tsx similarity index 91% rename from src/components/progress/progress.tsx rename to src/elements/progress/progress.tsx index 2a60cb48..1bd5fd74 100644 --- a/src/components/progress/progress.tsx +++ b/src/elements/progress/progress.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { Colors } from "@/modifiers/color"; @@ -25,7 +25,7 @@ export const Progress = React.forwardRef( [`is-${size}`]: size, }); return ( - + as="progress" max={max} ref={ref} diff --git a/src/components/table/__tests__/__snapshots__/table.test.tsx.snap b/src/elements/table/__tests__/__snapshots__/table.test.tsx.snap similarity index 100% rename from src/components/table/__tests__/__snapshots__/table.test.tsx.snap rename to src/elements/table/__tests__/__snapshots__/table.test.tsx.snap diff --git a/src/components/table/__tests__/table.test.tsx b/src/elements/table/__tests__/table.test.tsx similarity index 100% rename from src/components/table/__tests__/table.test.tsx rename to src/elements/table/__tests__/table.test.tsx diff --git a/src/components/table/index.ts b/src/elements/table/index.ts similarity index 100% rename from src/components/table/index.ts rename to src/elements/table/index.ts diff --git a/src/components/table/table.module.sass b/src/elements/table/table.module.sass similarity index 60% rename from src/components/table/table.module.sass rename to src/elements/table/table.module.sass index 7e9d68ca..8138d732 100644 --- a/src/components/table/table.module.sass +++ b/src/elements/table/table.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/table.sass' \ No newline at end of file diff --git a/src/components/table/table.story.tsx b/src/elements/table/table.story.tsx similarity index 99% rename from src/components/table/table.story.tsx rename to src/elements/table/table.story.tsx index 4b20a298..d339811f 100644 --- a/src/components/table/table.story.tsx +++ b/src/elements/table/table.story.tsx @@ -1,9 +1,9 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Table } from "@/components/table"; +import { Table } from "@/elements"; -storiesOf("Table", module).add("Default", () => ( +storiesOf("Elements/Table", module).add("Default", () => ( diff --git a/src/components/table/table.tsx b/src/elements/table/table.tsx similarity index 87% rename from src/components/table/table.tsx rename to src/elements/table/table.tsx index f4c0dc76..45ed231b 100644 --- a/src/components/table/table.tsx +++ b/src/elements/table/table.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; export type TableModifierProps = Partial<{ @@ -26,7 +26,7 @@ export const Table = React.forwardRef( "is-bordered": bordered, "is-striped": striped, }); - return as="table" ref={ref} {...rest} />; + return as="table" ref={ref} {...rest} />; }, ); diff --git a/src/components/tag/__tests__/__snapshots__/tag.test.tsx.snap b/src/elements/tag/__tests__/__snapshots__/tag.test.tsx.snap similarity index 100% rename from src/components/tag/__tests__/__snapshots__/tag.test.tsx.snap rename to src/elements/tag/__tests__/__snapshots__/tag.test.tsx.snap diff --git a/src/components/tag/__tests__/tag.test.tsx b/src/elements/tag/__tests__/tag.test.tsx similarity index 100% rename from src/components/tag/__tests__/tag.test.tsx rename to src/elements/tag/__tests__/tag.test.tsx diff --git a/src/components/tag/index.ts b/src/elements/tag/index.ts similarity index 100% rename from src/components/tag/index.ts rename to src/elements/tag/index.ts diff --git a/src/components/tag/tag-group.tsx b/src/elements/tag/tag-group.tsx similarity index 83% rename from src/components/tag/tag-group.tsx rename to src/elements/tag/tag-group.tsx index 3850ef5b..7c24d3f5 100644 --- a/src/components/tag/tag-group.tsx +++ b/src/elements/tag/tag-group.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; export type TagGroupModifierProps = Partial<{ @@ -19,7 +19,7 @@ export const TagGroup = React.forwardRef( rest.className = cx("tags", rest.className, { "has-addons": gapless, }); - return as="span" ref={ref} {...rest} />; + return as="span" ref={ref} {...rest} />; }, ); diff --git a/src/components/tag/tag.module.sass b/src/elements/tag/tag.module.sass similarity index 59% rename from src/components/tag/tag.module.sass rename to src/elements/tag/tag.module.sass index 3de8f9b0..f0b5a070 100644 --- a/src/components/tag/tag.module.sass +++ b/src/elements/tag/tag.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/tag.sass' \ No newline at end of file diff --git a/src/components/tag/tag.story.tsx b/src/elements/tag/tag.story.tsx similarity index 92% rename from src/components/tag/tag.story.tsx rename to src/elements/tag/tag.story.tsx index c8385942..0e6aafff 100644 --- a/src/components/tag/tag.story.tsx +++ b/src/elements/tag/tag.story.tsx @@ -1,10 +1,10 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Control, Field } from "@/components/form"; -import { Tag } from "@/components/tag"; +import { Tag } from "@/elements"; +import { Control, Field } from "@/form"; -storiesOf("Tag", module) +storiesOf("Elements/Tag", module) .addDecorator(story =>
    {story()}
    ) .add("Default", () => Tag Text) .add("Group Tags", () => ( diff --git a/src/components/tag/tag.tsx b/src/elements/tag/tag.tsx similarity index 95% rename from src/components/tag/tag.tsx rename to src/elements/tag/tag.tsx index 387053f9..90a27cd6 100644 --- a/src/components/tag/tag.tsx +++ b/src/elements/tag/tag.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; import { TagGroup } from "./tag-group"; diff --git a/src/components/heading/__tests__/__snapshots__/heading.test.tsx.snap b/src/elements/title/__tests__/__snapshots__/title.test.tsx.snap similarity index 58% rename from src/components/heading/__tests__/__snapshots__/heading.test.tsx.snap rename to src/elements/title/__tests__/__snapshots__/title.test.tsx.snap index 0e8990fe..ad5a37c3 100644 --- a/src/components/heading/__tests__/__snapshots__/heading.test.tsx.snap +++ b/src/elements/title/__tests__/__snapshots__/title.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Heading component should be a subtitle with size rendered as P 1`] = ` +exports[`Title component should be a subtitle with size rendered as P 1`] = `

    @@ -8,7 +8,7 @@ exports[`Heading component should be a subtitle with size rendered as P 1`] = `

    `; -exports[`Heading component should be spaced 1`] = ` +exports[`Title component should be spaced 1`] = `

    @@ -16,7 +16,7 @@ exports[`Heading component should be spaced 1`] = `

    `; -exports[`Heading component should concat classname in props with Bulma classname 1`] = ` +exports[`Title component should concat classname in props with Bulma classname 1`] = `

    @@ -26,7 +26,7 @@ exports[`Heading component should concat classname in props with Bulma classname

    `; -exports[`Heading component should exist 1`] = ` +exports[`Title component should exist 1`] = ` Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { @@ -39,7 +39,7 @@ Object { } `; -exports[`Heading component should have title classname 1`] = ` +exports[`Title component should have title classname 1`] = `

    @@ -50,7 +50,7 @@ exports[`Heading component should have title classname 1`] = `

    `; -exports[`Heading component should not be spaced because is subtitle 1`] = ` +exports[`Title component should not be spaced because is subtitle 1`] = `

    @@ -58,7 +58,7 @@ exports[`Heading component should not be spaced because is subtitle 1`] = `

    `; -exports[`Heading component should use inline styles 1`] = ` +exports[`Title component should use inline styles 1`] = `

    { +describe("Title component", () => { it("should exist", () => { - expect(Heading).toMatchSnapshot(); + expect(Title).toMatchSnapshot(); }); it("should have title classname", () => { const component = renderer.create( - + Test <a>Give me</a> - </Heading>, + , ); expect(component.toJSON()).toMatchSnapshot(); }); it("should concat classname in props with Bulma classname", () => { const component = renderer.create( - + <p>Default</p> - </Heading>, + , ); expect(component.toJSON()).toMatchSnapshot(); }); it("should use inline styles", () => { const component = renderer.create( - + <p>Default</p> - </Heading>, + , ); expect(component.toJSON()).toMatchSnapshot(); }); it("should be a subtitle with size rendered as P", () => { const component = renderer.create( - size={3} subtitle as="p"> + size={3} subtitle as="p"> Subtitle - , + , ); expect(component.toJSON()).toMatchSnapshot(); }); it("should not be spaced because is subtitle", () => { const component = renderer.create( - spaced subtitle as="p"> + spaced subtitle as="p"> Subtitle - , + , ); expect(component.toJSON()).toMatchSnapshot(); }); it("should be spaced", () => { const component = renderer.create( - spaced as="p"> + spaced as="p"> Subtitle - , + , ); expect(component.toJSON()).toMatchSnapshot(); }); diff --git a/src/elements/title/index.ts b/src/elements/title/index.ts new file mode 100644 index 00000000..22e20bf3 --- /dev/null +++ b/src/elements/title/index.ts @@ -0,0 +1,3 @@ +import "./title.module.sass"; + +export { Title } from "./title"; diff --git a/src/components/heading/heading.module.sass b/src/elements/title/title.module.sass similarity index 85% rename from src/components/heading/heading.module.sass rename to src/elements/title/title.module.sass index 0e01e8a9..d15d3ca4 100644 --- a/src/components/heading/heading.module.sass +++ b/src/elements/title/title.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/title.sass' .heading diff --git a/src/elements/title/title.story.tsx b/src/elements/title/title.story.tsx new file mode 100644 index 00000000..d737b21a --- /dev/null +++ b/src/elements/title/title.story.tsx @@ -0,0 +1,40 @@ +import React from "react"; + +import { storiesOf } from "@storybook/react"; + +import { Box, Title } from "@/elements"; + +storiesOf("Elements/Title", module).add("Default", () => ( +
    + + Title + + Subtitle + + + + Title + + Subtitle + + + + Title + subtitle size={4} as="h2"> + Subtitle + + + + Title + subtitle size={5} as="h2"> + Subtitle + + + + Title + subtitle size={6} as="h2"> + Subtitle + + +
    +)); diff --git a/src/components/heading/heading.tsx b/src/elements/title/title.tsx similarity index 71% rename from src/components/heading/heading.tsx rename to src/elements/title/title.tsx index 2db2ebb2..7fbee334 100644 --- a/src/components/heading/heading.tsx +++ b/src/elements/title/title.tsx @@ -1,10 +1,10 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; -export type HeadingModifierProps = Partial<{ +export type TitleModifierProps = Partial<{ heading: boolean; size: 1 | 2 | 3 | 4 | 5 | 6; spaced: boolean; @@ -12,9 +12,9 @@ export type HeadingModifierProps = Partial<{ weight: "light" | "normal" | "semibold" | "bold"; }>; -export type HeadingProps = ModifierProps & HeadingModifierProps; +export type TitleProps = ModifierProps & TitleModifierProps; -export const Heading = forwardRefAs((props, ref) => { +export const Title = forwardRefAs((props, ref) => { const { as, heading, @@ -35,11 +35,11 @@ export const Heading = forwardRefAs((props, ref) => { return React.createElement(as!, { ref, ...rest }); }, "h1"); -Heading.defaultProps = Object.assign( +Title.defaultProps = Object.assign( { heading: false, spaced: false, subtitle: false, }, - Heading.defaultProps, + Title.defaultProps, ); diff --git a/src/components/exotic/exotic.ts b/src/exotic.ts similarity index 100% rename from src/components/exotic/exotic.ts rename to src/exotic.ts diff --git a/src/components/element/__tests__/__snapshots__/element.test.tsx.snap b/src/extras/generic/__tests__/__snapshots__/generic.test.tsx.snap similarity index 64% rename from src/components/element/__tests__/__snapshots__/element.test.tsx.snap rename to src/extras/generic/__tests__/__snapshots__/generic.test.tsx.snap index 3b29fb42..a07eb3bb 100644 --- a/src/components/element/__tests__/__snapshots__/element.test.tsx.snap +++ b/src/extras/generic/__tests__/__snapshots__/generic.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Element component Should Exist 1`] = ` +exports[`Generic component Should Exist 1`] = ` Object { "$$typeof": Symbol(react.forward_ref), "defaultProps": Object { @@ -10,14 +10,14 @@ Object { } `; -exports[`Element component should accept a react component as 'as' prop 1`] = ` +exports[`Generic component should accept a react component as 'as' prop 1`] = `

    Custom This should be a p element

    `; -exports[`Element component should have helpers classnames 1`] = ` +exports[`Generic component should have helpers classnames 1`] = `
    diff --git a/src/components/element/__tests__/element.test.tsx b/src/extras/generic/__tests__/generic.test.tsx similarity index 69% rename from src/components/element/__tests__/element.test.tsx rename to src/extras/generic/__tests__/generic.test.tsx index 242c4840..fbc90b31 100644 --- a/src/components/element/__tests__/element.test.tsx +++ b/src/extras/generic/__tests__/generic.test.tsx @@ -1,18 +1,18 @@ import React from "react"; import renderer from "react-test-renderer"; -import { Element } from "../element"; +import { Generic } from "../generic"; -describe("Element component", () => { +describe("Generic component", () => { it("Should Exist", () => { - expect(Element).toMatchSnapshot(); + expect(Generic).toMatchSnapshot(); }); it("should have helpers classnames", () => { const component = renderer.create( - + Facebook - , + , ); expect(component.toJSON()).toMatchSnapshot(); }); @@ -26,7 +26,7 @@ describe("Element component", () => { ); const component = renderer.create( - as={Custom}>This should be a p element, + as={Custom}>This should be a p element, ); expect(component.toJSON()).toMatchSnapshot(); }); diff --git a/src/components/element/element.story.tsx b/src/extras/generic/generic.story.tsx similarity index 78% rename from src/components/element/element.story.tsx rename to src/extras/generic/generic.story.tsx index e53a06af..6ca23683 100644 --- a/src/components/element/element.story.tsx +++ b/src/extras/generic/generic.story.tsx @@ -2,10 +2,10 @@ import { boolean } from "@storybook/addon-knobs"; import { storiesOf } from "@storybook/react"; import React from "react"; -import { Element } from "."; +import { Generic } from "@/extras"; -storiesOf("Element", module).add("Default", () => ( - ( + ( }, }} > - Custom Element to use Bulma helper - + Custom element to use Bulma helper + )); diff --git a/src/components/element/element.tsx b/src/extras/generic/generic.tsx similarity index 58% rename from src/components/element/element.tsx rename to src/extras/generic/generic.tsx index e42624dc..4c28e88c 100644 --- a/src/components/element/element.tsx +++ b/src/extras/generic/generic.tsx @@ -1,11 +1,11 @@ import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; -export type ElementProps = ModifierProps; +export type GenericProps = ModifierProps; -export const Element = forwardRefAs((props, ref) => { +export const Generic = forwardRefAs((props, ref) => { const { as, ...rest } = transformModifiers(props); return React.createElement(as!, { ref, ...rest }); }, "div"); diff --git a/src/extras/generic/index.ts b/src/extras/generic/index.ts new file mode 100644 index 00000000..b89598e6 --- /dev/null +++ b/src/extras/generic/index.ts @@ -0,0 +1 @@ +export { Generic } from "./generic"; diff --git a/src/extras/index.ts b/src/extras/index.ts new file mode 100644 index 00000000..f3d514ae --- /dev/null +++ b/src/extras/index.ts @@ -0,0 +1,2 @@ +export { Generic } from "./generic"; +export { Loader } from "./loader"; diff --git a/src/components/loader/__tests__/__snapshots__/loader.test.tsx.snap b/src/extras/loader/__tests__/__snapshots__/loader.test.tsx.snap similarity index 100% rename from src/components/loader/__tests__/__snapshots__/loader.test.tsx.snap rename to src/extras/loader/__tests__/__snapshots__/loader.test.tsx.snap diff --git a/src/components/loader/__tests__/loader.test.tsx b/src/extras/loader/__tests__/loader.test.tsx similarity index 100% rename from src/components/loader/__tests__/loader.test.tsx rename to src/extras/loader/__tests__/loader.test.tsx diff --git a/src/components/loader/index.ts b/src/extras/loader/index.ts similarity index 100% rename from src/components/loader/index.ts rename to src/extras/loader/index.ts diff --git a/src/extras/loader/loader.module.sass b/src/extras/loader/loader.module.sass new file mode 100644 index 00000000..11e7d2a6 --- /dev/null +++ b/src/extras/loader/loader.module.sass @@ -0,0 +1,4 @@ +@import '../../utils.sass' + +.loader + +loader \ No newline at end of file diff --git a/src/components/loader/loader.story.sass b/src/extras/loader/loader.story.sass similarity index 100% rename from src/components/loader/loader.story.sass rename to src/extras/loader/loader.story.sass diff --git a/src/components/loader/loader.story.tsx b/src/extras/loader/loader.story.tsx similarity index 86% rename from src/components/loader/loader.story.tsx rename to src/extras/loader/loader.story.tsx index b20e5b25..81bd3815 100644 --- a/src/components/loader/loader.story.tsx +++ b/src/extras/loader/loader.story.tsx @@ -2,10 +2,10 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Loader } from "@/components/loader"; +import { Loader } from "@/extras"; import "./loader.story.sass"; -storiesOf("Loader", module) +storiesOf("Extras/Loader", module) .add("Default", () => ) .add("with inline style", () => ( {filename} )} - + ); } } diff --git a/src/components/form/input.tsx b/src/form/input.tsx similarity index 96% rename from src/components/form/input.tsx rename to src/form/input.tsx index 512f86c0..16e056aa 100644 --- a/src/components/form/input.tsx +++ b/src/form/input.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { Element } from "@/components/element"; +import { Generic } from "@/extras/generic"; import { ModifierProps } from "@/modifiers"; import { Colors } from "@/modifiers/color"; @@ -63,7 +63,7 @@ class InputController extends React.PureComponent { ...props } = this.props; return ( - + {...props} ref={innerRef} as="input" diff --git a/src/components/form/label.tsx b/src/form/label.tsx similarity index 100% rename from src/components/form/label.tsx rename to src/form/label.tsx diff --git a/src/components/form/radio.tsx b/src/form/radio.tsx similarity index 100% rename from src/components/form/radio.tsx rename to src/form/radio.tsx diff --git a/src/components/form/select.tsx b/src/form/select.tsx similarity index 100% rename from src/components/form/select.tsx rename to src/form/select.tsx diff --git a/src/components/form/textarea.tsx b/src/form/textarea.tsx similarity index 100% rename from src/components/form/textarea.tsx rename to src/form/textarea.tsx diff --git a/src/index.ts b/src/index.ts index 9575a17f..3ddbcc8d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,35 +1,8 @@ import "./index.module.sass"; -import * as Form from "./components/form"; - -export { Box } from "./components/box"; -export { Breadcrumb } from "./components/breadcrumb"; -export { Button } from "./components/button"; -export { Card } from "./components/card"; -export { Columns } from "./components/columns"; -export { Container } from "./components/container"; -export { Content } from "./components/content"; -export { Dropdown } from "./components/dropdown"; -export { Element } from "./components/element"; -export { Footer } from "./components/footer"; -export { Form }; -export { Heading } from "./components/heading"; -export { Hero } from "./components/hero"; -export { Icon } from "./components/icon"; -export { Image } from "./components/image"; -export { Level } from "./components/level"; -export { Loader } from "./components/loader"; -export { Media } from "./components/media"; -export { Menu } from "./components/menu"; -export { Message } from "./components/message"; -export { Modal } from "./components/modal"; -export { Navbar } from "./components/navbar"; -export { Notification } from "./components/notification"; -export { Pagination } from "./components/pagination"; -export { Panel } from "./components/panel"; -export { Progress } from "./components/progress"; -export { Section } from "./components/section"; -export { Table } from "./components/table"; -export { Tabs } from "./components/tabs"; -export { Tag } from "./components/tag"; -export { Tile } from "./components/tile"; +export * from "./columns"; +export * from "./components"; +export * from "./elements"; +export * from "./form"; +export * from "./layout"; +export * from "./extras"; diff --git a/src/components/container/__tests__/__snapshots__/container.test.tsx.snap b/src/layout/container/__tests__/__snapshots__/container.test.tsx.snap similarity index 100% rename from src/components/container/__tests__/__snapshots__/container.test.tsx.snap rename to src/layout/container/__tests__/__snapshots__/container.test.tsx.snap diff --git a/src/components/container/__tests__/container.test.tsx b/src/layout/container/__tests__/container.test.tsx similarity index 100% rename from src/components/container/__tests__/container.test.tsx rename to src/layout/container/__tests__/container.test.tsx diff --git a/src/components/container/container.module.sass b/src/layout/container/container.module.sass similarity index 62% rename from src/components/container/container.module.sass rename to src/layout/container/container.module.sass index 38ae86ce..09ee60b7 100644 --- a/src/components/container/container.module.sass +++ b/src/layout/container/container.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/elements/container.sass' \ No newline at end of file diff --git a/src/components/container/container.story.tsx b/src/layout/container/container.story.tsx similarity index 54% rename from src/components/container/container.story.tsx rename to src/layout/container/container.story.tsx index cb48e42e..18689277 100644 --- a/src/components/container/container.story.tsx +++ b/src/layout/container/container.story.tsx @@ -2,57 +2,57 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Container } from "@/components/container"; -import { Heading } from "@/components/heading"; -import { Section } from "@/components/section"; +import { Title } from "@/elements"; +import { Container } from "@/layout/container"; +import { Section } from "@/layout/section"; -storiesOf("Container", module).add("Default", () => ( +storiesOf("Layout/Container", module).add("Default", () => (

    - size={5} as="p"> + size={5} as="p"> Default - - subtitle as="p"> + + subtitle as="p"> Container - +

    - size={5} as="p"> + size={5} as="p"> Fluid - - subtitle as="p"> + + subtitle as="p"> Container - +

    - size={5} as="p"> + size={5} as="p"> Breakpoint Widescreen - - subtitle as="p"> + + subtitle as="p"> Container - +

    - size={5} as="p"> + size={5} as="p"> Breakpoint Fullhd - - subtitle as="p"> + + subtitle as="p"> Container - +

    diff --git a/src/components/container/container.tsx b/src/layout/container/container.tsx similarity index 93% rename from src/components/container/container.tsx rename to src/layout/container/container.tsx index 969f3d0f..33d21660 100644 --- a/src/components/container/container.tsx +++ b/src/layout/container/container.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Breakpoints } from "@/modifiers/responsive"; diff --git a/src/components/container/index.ts b/src/layout/container/index.ts similarity index 100% rename from src/components/container/index.ts rename to src/layout/container/index.ts diff --git a/src/components/footer/__tests__/__snapshots__/footer.test.tsx.snap b/src/layout/footer/__tests__/__snapshots__/footer.test.tsx.snap similarity index 100% rename from src/components/footer/__tests__/__snapshots__/footer.test.tsx.snap rename to src/layout/footer/__tests__/__snapshots__/footer.test.tsx.snap diff --git a/src/components/footer/__tests__/footer.test.tsx b/src/layout/footer/__tests__/footer.test.tsx similarity index 100% rename from src/components/footer/__tests__/footer.test.tsx rename to src/layout/footer/__tests__/footer.test.tsx diff --git a/src/components/footer/footer.module.sass b/src/layout/footer/footer.module.sass similarity index 59% rename from src/components/footer/footer.module.sass rename to src/layout/footer/footer.module.sass index 88061604..7fbe5a1f 100644 --- a/src/components/footer/footer.module.sass +++ b/src/layout/footer/footer.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/layout/footer.sass' \ No newline at end of file diff --git a/src/components/footer/footer.story.tsx b/src/layout/footer/footer.story.tsx similarity index 77% rename from src/components/footer/footer.story.tsx rename to src/layout/footer/footer.story.tsx index cd8f08a8..32e49b00 100644 --- a/src/components/footer/footer.story.tsx +++ b/src/layout/footer/footer.story.tsx @@ -1,12 +1,10 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Container } from "@/components/container"; -import { Content } from "@/components/content"; -import { Footer } from "@/components/footer"; -import { Hero } from "@/components/hero"; +import { Content } from "@/elements"; +import { Container, Footer, Hero } from "@/layout"; -storiesOf("Footer", module).add("Default", () => ( +storiesOf("Layout/Footer", module).add("Default", () => ( as="header" /> diff --git a/src/components/footer/footer.tsx b/src/layout/footer/footer.tsx similarity index 88% rename from src/components/footer/footer.tsx rename to src/layout/footer/footer.tsx index 15592d50..69d81dfc 100644 --- a/src/components/footer/footer.tsx +++ b/src/layout/footer/footer.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type FooterProps = ModifierProps; diff --git a/src/components/footer/index.ts b/src/layout/footer/index.ts similarity index 100% rename from src/components/footer/index.ts rename to src/layout/footer/index.ts diff --git a/src/components/hero/__tests__/__snapshots__/hero.test.tsx.snap b/src/layout/hero/__tests__/__snapshots__/hero.test.tsx.snap similarity index 100% rename from src/components/hero/__tests__/__snapshots__/hero.test.tsx.snap rename to src/layout/hero/__tests__/__snapshots__/hero.test.tsx.snap diff --git a/src/components/hero/__tests__/hero.test.tsx b/src/layout/hero/__tests__/hero.test.tsx similarity index 100% rename from src/components/hero/__tests__/hero.test.tsx rename to src/layout/hero/__tests__/hero.test.tsx diff --git a/src/components/hero/hero-body.tsx b/src/layout/hero/hero-body.tsx similarity index 88% rename from src/components/hero/hero-body.tsx rename to src/layout/hero/hero-body.tsx index 2f62435a..37ebc100 100644 --- a/src/components/hero/hero-body.tsx +++ b/src/layout/hero/hero-body.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type HeroBodyProps = ModifierProps; diff --git a/src/components/hero/hero-footer.tsx b/src/layout/hero/hero-footer.tsx similarity index 88% rename from src/components/hero/hero-footer.tsx rename to src/layout/hero/hero-footer.tsx index 93247ed5..0f36b41a 100644 --- a/src/components/hero/hero-footer.tsx +++ b/src/layout/hero/hero-footer.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type HeroFooterProps = ModifierProps; diff --git a/src/components/hero/hero-head.tsx b/src/layout/hero/hero-head.tsx similarity index 88% rename from src/components/hero/hero-head.tsx rename to src/layout/hero/hero-head.tsx index 67ab39de..72584b6a 100644 --- a/src/components/hero/hero-head.tsx +++ b/src/layout/hero/hero-head.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type HeroHeadProps = ModifierProps; diff --git a/src/components/hero/hero.module.sass b/src/layout/hero/hero.module.sass similarity index 85% rename from src/components/hero/hero.module.sass rename to src/layout/hero/hero.module.sass index f0f6945c..7418845e 100644 --- a/src/components/hero/hero.module.sass +++ b/src/layout/hero/hero.module.sass @@ -1,4 +1,4 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/layout/hero.sass' .has-navbar-fixed-top, .has-navbar-fixed-bottom diff --git a/src/components/hero/hero.story.tsx b/src/layout/hero/hero.story.tsx similarity index 69% rename from src/components/hero/hero.story.tsx rename to src/layout/hero/hero.story.tsx index 0d44fd83..4a14a29f 100644 --- a/src/components/hero/hero.story.tsx +++ b/src/layout/hero/hero.story.tsx @@ -2,22 +2,20 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Container } from "@/components/container"; -import { Heading } from "@/components/heading"; -import { Hero } from "@/components/hero"; -import { Section } from "@/components/section"; +import { Title } from "@/elements"; +import { Container, Hero, Section } from "@/layout"; -storiesOf("Hero", module) +storiesOf("Layout/Hero", module) .add("Default with color", () => (
    - Hero title Primary - + Hero title Primary + Subtitle - </Heading> + @@ -27,10 +25,10 @@ storiesOf("Hero", module) - Hero title Danger - + Hero title Danger + Subtitle - </Heading> + @@ -39,10 +37,10 @@ storiesOf("Hero", module) - Hero title Info - + Hero title Info + Subtitle - </Heading> + @@ -55,10 +53,10 @@ storiesOf("Hero", module) - Hero title Primary - + Hero title Primary + Subtitle - </Heading> + @@ -68,10 +66,10 @@ storiesOf("Hero", module) - Hero title Danger - + Hero title Danger + Subtitle - </Heading> + @@ -80,10 +78,10 @@ storiesOf("Hero", module) - Hero title Info - + Hero title Info + Subtitle - </Heading> + diff --git a/src/components/hero/hero.tsx b/src/layout/hero/hero.tsx similarity index 95% rename from src/components/hero/hero.tsx rename to src/layout/hero/hero.tsx index 7cb47a39..7fdaf876 100644 --- a/src/components/hero/hero.tsx +++ b/src/layout/hero/hero.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; import { HeroBody } from "./hero-body"; diff --git a/src/components/hero/index.ts b/src/layout/hero/index.ts similarity index 100% rename from src/components/hero/index.ts rename to src/layout/hero/index.ts diff --git a/src/layout/index.ts b/src/layout/index.ts new file mode 100644 index 00000000..1c49bb5d --- /dev/null +++ b/src/layout/index.ts @@ -0,0 +1,7 @@ +export { Container } from "./container"; +export { Footer } from "./footer"; +export { Hero } from "./hero"; +export { Level } from "./level"; +export { Media } from "./media"; +export { Section } from "./section"; +export { Tile } from "./tile"; diff --git a/src/components/level/__tests__/__snapshots__/level.test.tsx.snap b/src/layout/level/__tests__/__snapshots__/level.test.tsx.snap similarity index 100% rename from src/components/level/__tests__/__snapshots__/level.test.tsx.snap rename to src/layout/level/__tests__/__snapshots__/level.test.tsx.snap diff --git a/src/components/level/__tests__/level.test.tsx b/src/layout/level/__tests__/level.test.tsx similarity index 100% rename from src/components/level/__tests__/level.test.tsx rename to src/layout/level/__tests__/level.test.tsx diff --git a/src/components/level/index.ts b/src/layout/level/index.ts similarity index 100% rename from src/components/level/index.ts rename to src/layout/level/index.ts diff --git a/src/components/level/level-item.tsx b/src/layout/level/level-item.tsx similarity index 88% rename from src/components/level/level-item.tsx rename to src/layout/level/level-item.tsx index 249710f7..46e8a7a9 100644 --- a/src/components/level/level-item.tsx +++ b/src/layout/level/level-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type LevelItemProps = ModifierProps; diff --git a/src/components/level/level-side.tsx b/src/layout/level/level-side.tsx similarity index 93% rename from src/components/level/level-side.tsx rename to src/layout/level/level-side.tsx index a0961416..994707f9 100644 --- a/src/components/level/level-side.tsx +++ b/src/layout/level/level-side.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type LevelSideModifierProps = Partial<{ diff --git a/src/components/level/level.module.sass b/src/layout/level/level.module.sass similarity index 61% rename from src/components/level/level.module.sass rename to src/layout/level/level.module.sass index 3e201648..c5c1addb 100644 --- a/src/components/level/level.module.sass +++ b/src/layout/level/level.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/level.sass' \ No newline at end of file diff --git a/src/components/level/level.story.tsx b/src/layout/level/level.story.tsx similarity index 65% rename from src/components/level/level.story.tsx rename to src/layout/level/level.story.tsx index f317b81f..4c4ce0c5 100644 --- a/src/components/level/level.story.tsx +++ b/src/layout/level/level.story.tsx @@ -2,18 +2,13 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Box } from "@/components/box"; -import { Button } from "@/components/button"; -import { Container } from "@/components/container"; -import { Control, Field, Input } from "@/components/form"; -import { Heading } from "@/components/heading"; -import { Hero } from "@/components/hero"; -import { Level } from "@/components/level"; -import { Section } from "@/components/section"; +import { Box, Button, Title } from "@/elements"; +import { Control, Field, Input } from "@/form"; +import { Container, Hero, Level, Section } from "@/layout"; const style: React.CSSProperties = { textAlign: "center" }; -storiesOf("Level", module) +storiesOf("Layout/Level", module) .addDecorator(story => ( as="header"> @@ -27,9 +22,9 @@ storiesOf("Level", module) as="nav"> - + <strong>123</strong> posts - </Heading> + @@ -72,42 +67,42 @@ storiesOf("Level", module) as="nav">
    - as="p" heading> + as="p" heading> Tweets - - as="p" heading> + + as="p" heading> 3,210 - +
    - as="p" heading> + as="p" heading> Following - - as="p" heading> + + as="p" heading> 210 - +
    - as="p" heading> + as="p" heading> Followers - - as="p" heading> + + as="p" heading> 321 - +
    - as="p" heading> + as="p" heading> Likes - - as="p" heading> + + as="p" heading> 321K - +
    @@ -119,47 +114,47 @@ storiesOf("Level", module) const breakpoint = title === "Mobile" ? "mobile" : undefined; return (
    - {title} + {title} as="nav" breakpoint={breakpoint}>
    - as="p" heading> + as="p" heading> Tweets - - as="p" heading> + + as="p" heading> 3,210 - +
    - as="p" heading> + as="p" heading> Following - - as="p" heading> + + as="p" heading> 210 - +
    - as="p" heading> + as="p" heading> Followers - - as="p" heading> + + as="p" heading> 321 - +
    - as="p" heading> + as="p" heading> Likes - - as="p" heading> + + as="p" heading> 321K - +
    diff --git a/src/components/level/level.tsx b/src/layout/level/level.tsx similarity index 93% rename from src/components/level/level.tsx rename to src/layout/level/level.tsx index 5e8371de..b163362c 100644 --- a/src/components/level/level.tsx +++ b/src/layout/level/level.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Breakpoints } from "@/modifiers/responsive"; import { LevelItem } from "./level-item"; diff --git a/src/components/media/__tests__/__snapshots__/media.test.tsx.snap b/src/layout/media/__tests__/__snapshots__/media.test.tsx.snap similarity index 100% rename from src/components/media/__tests__/__snapshots__/media.test.tsx.snap rename to src/layout/media/__tests__/__snapshots__/media.test.tsx.snap diff --git a/src/components/media/__tests__/media.test.tsx b/src/layout/media/__tests__/media.test.tsx similarity index 100% rename from src/components/media/__tests__/media.test.tsx rename to src/layout/media/__tests__/media.test.tsx diff --git a/src/components/media/index.ts b/src/layout/media/index.ts similarity index 100% rename from src/components/media/index.ts rename to src/layout/media/index.ts diff --git a/src/components/media/media-content.tsx b/src/layout/media/media-content.tsx similarity index 89% rename from src/components/media/media-content.tsx rename to src/layout/media/media-content.tsx index 03f1d20f..30ec66f4 100644 --- a/src/components/media/media-content.tsx +++ b/src/layout/media/media-content.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type MediaContentProps = ModifierProps; diff --git a/src/components/media/media-item.tsx b/src/layout/media/media-item.tsx similarity index 93% rename from src/components/media/media-item.tsx rename to src/layout/media/media-item.tsx index 711ef6da..19f2f07f 100644 --- a/src/components/media/media-item.tsx +++ b/src/layout/media/media-item.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type MediaItemModifierProps = Partial<{ diff --git a/src/components/media/media.module.sass b/src/layout/media/media.module.sass similarity index 61% rename from src/components/media/media.module.sass rename to src/layout/media/media.module.sass index c0d48890..eba12875 100644 --- a/src/components/media/media.module.sass +++ b/src/layout/media/media.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/components/media.sass' \ No newline at end of file diff --git a/src/components/media/media.story.tsx b/src/layout/media/media.story.tsx similarity index 93% rename from src/components/media/media.story.tsx rename to src/layout/media/media.story.tsx index 07a95caa..82f69b08 100644 --- a/src/components/media/media.story.tsx +++ b/src/layout/media/media.story.tsx @@ -2,18 +2,13 @@ import React from "react"; import { storiesOf } from "@storybook/react"; -import { Box } from "@/components/box"; -import { Button } from "@/components/button"; -import { Content } from "@/components/content"; -import { Control, Field, Textarea } from "@/components/form"; -import { Image } from "@/components/image"; -import { Level } from "@/components/level"; -import { Media } from "@/components/media"; -import { Section } from "@/components/section"; +import { Box, Button, Content, Image } from "@/elements"; +import { Control, Field, Textarea } from "@/form"; +import { Level, Media, Section } from "@/layout"; const style = { background: "#e6e6e6", width: 64, height: 64 }; -storiesOf("Media", module) +storiesOf("Layout/Media", module) .add("Default", () => (
    diff --git a/src/components/media/media.tsx b/src/layout/media/media.tsx similarity index 91% rename from src/components/media/media.tsx rename to src/layout/media/media.tsx index 42bafd5c..402c8b37 100644 --- a/src/components/media/media.tsx +++ b/src/layout/media/media.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { MediaContent } from "./media-content"; import { MediaItem } from "./media-item"; diff --git a/src/components/section/__tests__/__snapshots__/section.test.tsx.snap b/src/layout/section/__tests__/__snapshots__/section.test.tsx.snap similarity index 100% rename from src/components/section/__tests__/__snapshots__/section.test.tsx.snap rename to src/layout/section/__tests__/__snapshots__/section.test.tsx.snap diff --git a/src/components/section/__tests__/section.test.tsx b/src/layout/section/__tests__/section.test.tsx similarity index 100% rename from src/components/section/__tests__/section.test.tsx rename to src/layout/section/__tests__/section.test.tsx diff --git a/src/components/section/index.ts b/src/layout/section/index.ts similarity index 100% rename from src/components/section/index.ts rename to src/layout/section/index.ts diff --git a/src/components/section/section.module.sass b/src/layout/section/section.module.sass similarity index 60% rename from src/components/section/section.module.sass rename to src/layout/section/section.module.sass index 10bb9e7c..f2c37b03 100644 --- a/src/components/section/section.module.sass +++ b/src/layout/section/section.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/layout/section.sass' \ No newline at end of file diff --git a/src/components/section/section.story.tsx b/src/layout/section/section.story.tsx similarity index 70% rename from src/components/section/section.story.tsx rename to src/layout/section/section.story.tsx index ff3e2591..f9a7c639 100644 --- a/src/components/section/section.story.tsx +++ b/src/layout/section/section.story.tsx @@ -1,47 +1,46 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Container } from "@/components/container"; -import { Heading } from "@/components/heading"; -import { Section } from "../section"; +import { Title } from "@/elements"; +import { Container, Section } from "@/layout"; -storiesOf("Section", module) +storiesOf("Layout/Section", module) .add("Default", () => (
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    @@ -50,29 +49,29 @@ storiesOf("Section", module)
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    @@ -81,29 +80,29 @@ storiesOf("Section", module)
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    - Section - + Section + A simple container to divide your page into{" "} <strong>sections</strong>, like the one you are currently reading - </Heading> +
    diff --git a/src/components/section/section.tsx b/src/layout/section/section.tsx similarity index 91% rename from src/components/section/section.tsx rename to src/layout/section/section.tsx index 31d727c9..33d88195 100644 --- a/src/components/section/section.tsx +++ b/src/layout/section/section.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; export type SectionModifierProps = Partial<{ diff --git a/src/components/tile/__tests__/__snapshots__/tile.test.tsx.snap b/src/layout/tile/__tests__/__snapshots__/tile.test.tsx.snap similarity index 100% rename from src/components/tile/__tests__/__snapshots__/tile.test.tsx.snap rename to src/layout/tile/__tests__/__snapshots__/tile.test.tsx.snap diff --git a/src/components/tile/__tests__/tile.test.tsx b/src/layout/tile/__tests__/tile.test.tsx similarity index 100% rename from src/components/tile/__tests__/tile.test.tsx rename to src/layout/tile/__tests__/tile.test.tsx diff --git a/src/components/tile/index.ts b/src/layout/tile/index.ts similarity index 100% rename from src/components/tile/index.ts rename to src/layout/tile/index.ts diff --git a/src/components/tile/tile.module.sass b/src/layout/tile/tile.module.sass similarity index 57% rename from src/components/tile/tile.module.sass rename to src/layout/tile/tile.module.sass index e816e3ce..04151616 100644 --- a/src/components/tile/tile.module.sass +++ b/src/layout/tile/tile.module.sass @@ -1,2 +1,2 @@ -@import '../utils.sass' +@import '../../utils.sass' @import '~bulma/sass/grid/tiles.sass' \ No newline at end of file diff --git a/src/components/tile/tile.story.tsx b/src/layout/tile/tile.story.tsx similarity index 66% rename from src/components/tile/tile.story.tsx rename to src/layout/tile/tile.story.tsx index 8be3dd8a..7bbd6ff6 100644 --- a/src/components/tile/tile.story.tsx +++ b/src/layout/tile/tile.story.tsx @@ -1,13 +1,10 @@ import { storiesOf } from "@storybook/react"; import React from "react"; -import { Box } from "@/components/box"; -import { Heading } from "@/components/heading"; -import { Image } from "@/components/image"; -import { Section } from "@/components/section"; -import { Tile } from "@/components/tile"; +import { Box, Image, Title } from "@/elements"; +import { Section, Tile } from "@/layout"; -storiesOf("Tile", module).add("Default", () => ( +storiesOf("Layout/Tile", module).add("Default", () => (
    @@ -20,8 +17,8 @@ storiesOf("Tile", module).add("Default", () => ( notification color="primary" > - Vertical... - Top tile + Vertical... + Top tile as="article" @@ -29,8 +26,8 @@ storiesOf("Tile", module).add("Default", () => ( notification color="warning" > - Tiles... - Bottom Tile... + Tiles... + Bottom Tile... @@ -40,8 +37,8 @@ storiesOf("Tile", module).add("Default", () => ( notification color="info" > - Middle Tile... - With image Tile... + Middle Tile... + With image Tile... ( notification color="danger" > - Wide tile - Aligned with the right tile + Wide tile + Aligned with the right tile
    @@ -70,8 +67,8 @@ storiesOf("Tile", module).add("Default", () => ( color="success" >
    - Tall tile - With even more content + Tall tile + With even more content
    diff --git a/src/components/tile/tile.tsx b/src/layout/tile/tile.tsx similarity index 95% rename from src/components/tile/tile.tsx rename to src/layout/tile/tile.tsx index a6dec5e3..a18d7456 100644 --- a/src/components/tile/tile.tsx +++ b/src/layout/tile/tile.tsx @@ -1,7 +1,7 @@ import { cx } from "emotion"; import React from "react"; -import { forwardRefAs } from "@/components/exotic"; +import { forwardRefAs } from "@/exotic"; import { ModifierProps, transformModifiers } from "@/modifiers"; import { Colors } from "@/modifiers/color"; diff --git a/src/components/utils.sass b/src/utils.sass similarity index 100% rename from src/components/utils.sass rename to src/utils.sass