diff --git a/packages/react-common-docs/src/components/Nav.tsx b/packages/react-common-docs/src/components/Nav/Nav.tsx similarity index 97% rename from packages/react-common-docs/src/components/Nav.tsx rename to packages/react-common-docs/src/components/Nav/Nav.tsx index dc18ba9..dad668f 100644 --- a/packages/react-common-docs/src/components/Nav.tsx +++ b/packages/react-common-docs/src/components/Nav/Nav.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import Link from 'next/link' import styled from 'styled-components' -import NavLink from './NavLink/NavLink' +import NavLink from '../NavLink/NavLink' const StyledLink = styled('a')({ display: 'block', diff --git a/packages/react-common-docs/src/components/NavLink/NavLink.tsx b/packages/react-common-docs/src/components/NavLink/NavLink.tsx index 2765106..ec80f59 100644 --- a/packages/react-common-docs/src/components/NavLink/NavLink.tsx +++ b/packages/react-common-docs/src/components/NavLink/NavLink.tsx @@ -80,6 +80,7 @@ export const basePropTypes = { subtitle: PropTypes.string, graphics: PropTypes.shape(menuGraphicsPropTypes), indicator: PropTypes.string, + onClick: PropTypes.func, } const propTypes = { @@ -136,7 +137,7 @@ const NavLink = React.forwardRef(( && ( ) diff --git a/packages/react-common-docs/src/components/Playground.tsx b/packages/react-common-docs/src/components/Playground/Playground.tsx similarity index 100% rename from packages/react-common-docs/src/components/Playground.tsx rename to packages/react-common-docs/src/components/Playground/Playground.tsx diff --git a/packages/react-common-docs/src/components/Sidebar.tsx b/packages/react-common-docs/src/components/Sidebar/Sidebar.tsx similarity index 98% rename from packages/react-common-docs/src/components/Sidebar.tsx rename to packages/react-common-docs/src/components/Sidebar/Sidebar.tsx index 013f70c..6b868e1 100644 --- a/packages/react-common-docs/src/components/Sidebar.tsx +++ b/packages/react-common-docs/src/components/Sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import Nav from './Nav' +import Nav from '../Nav/Nav' import Link from 'next/link' import * as React from 'react' diff --git a/packages/react-common-docs/src/pages/_app.tsx b/packages/react-common-docs/src/pages/_app.tsx index b7f3ca3..aa992f7 100644 --- a/packages/react-common-docs/src/pages/_app.tsx +++ b/packages/react-common-docs/src/pages/_app.tsx @@ -2,7 +2,7 @@ import '../../public/global.css' import '../../public/theme/dark.css' import sidebar from '../sidebar.json' import brand from '../../brand' -import Sidebar from '../components/Sidebar' +import Sidebar from '../components/Sidebar/Sidebar' import styled from 'styled-components' const Container = styled('div')({ diff --git a/packages/react-common-docs/src/pages/components/Button.mdx b/packages/react-common-docs/src/pages/components/Button.mdx index 50ade25..f07e316 100644 --- a/packages/react-common-docs/src/pages/components/Button.mdx +++ b/packages/react-common-docs/src/pages/components/Button.mdx @@ -3,7 +3,7 @@ title: Button --- import { Button } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # Button diff --git a/packages/react-common-docs/src/pages/components/Checkbox.mdx b/packages/react-common-docs/src/pages/components/Checkbox.mdx index 08ec4ce..0f804d5 100644 --- a/packages/react-common-docs/src/pages/components/Checkbox.mdx +++ b/packages/react-common-docs/src/pages/components/Checkbox.mdx @@ -3,7 +3,7 @@ name: Checkbox --- import { Checkbox } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # Checkbox diff --git a/packages/react-common-docs/src/pages/components/Icon.mdx b/packages/react-common-docs/src/pages/components/Icon.mdx index 2972703..580d969 100644 --- a/packages/react-common-docs/src/pages/components/Icon.mdx +++ b/packages/react-common-docs/src/pages/components/Icon.mdx @@ -3,7 +3,7 @@ name: Icon --- import { Icon } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # Icon diff --git a/packages/react-common-docs/src/pages/components/RadioButton.mdx b/packages/react-common-docs/src/pages/components/RadioButton.mdx index 70a1d3e..05b0471 100644 --- a/packages/react-common-docs/src/pages/components/RadioButton.mdx +++ b/packages/react-common-docs/src/pages/components/RadioButton.mdx @@ -3,7 +3,7 @@ name: RadioButton --- import { RadioButton } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # RadioButton diff --git a/packages/react-common-docs/src/pages/components/Select.mdx b/packages/react-common-docs/src/pages/components/Select.mdx index 928023d..a50fb13 100644 --- a/packages/react-common-docs/src/pages/components/Select.mdx +++ b/packages/react-common-docs/src/pages/components/Select.mdx @@ -3,7 +3,7 @@ name: Select --- import { Select } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # Select diff --git a/packages/react-common-docs/src/pages/components/Slider.mdx b/packages/react-common-docs/src/pages/components/Slider.mdx index be97034..c93830f 100644 --- a/packages/react-common-docs/src/pages/components/Slider.mdx +++ b/packages/react-common-docs/src/pages/components/Slider.mdx @@ -3,7 +3,7 @@ name: Slider --- import { Slider } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # Slider diff --git a/packages/react-common-docs/src/pages/components/TextInput.mdx b/packages/react-common-docs/src/pages/components/TextInput.mdx index be4ff72..f260775 100644 --- a/packages/react-common-docs/src/pages/components/TextInput.mdx +++ b/packages/react-common-docs/src/pages/components/TextInput.mdx @@ -3,7 +3,7 @@ name: TextInput --- import { TextInput } from '@tesseract-design/react-common' -import Playground from '../../components/Playground' +import Playground from '../../components/Playground/Playground' # TextInput diff --git a/packages/react-common/components/Button/Button.test.tsx b/packages/react-common/src/components/Button/Button.test.tsx similarity index 98% rename from packages/react-common/components/Button/Button.test.tsx rename to packages/react-common/src/components/Button/Button.test.tsx index d992ea1..da96c88 100644 --- a/packages/react-common/components/Button/Button.test.tsx +++ b/packages/react-common/src/components/Button/Button.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/Button/Button.tsx b/packages/react-common/src/components/Button/Button.tsx similarity index 100% rename from packages/react-common/components/Button/Button.tsx rename to packages/react-common/src/components/Button/Button.tsx diff --git a/packages/react-common/components/Checkbox/Checkbox.test.tsx b/packages/react-common/src/components/Checkbox/Checkbox.test.tsx similarity index 96% rename from packages/react-common/components/Checkbox/Checkbox.test.tsx rename to packages/react-common/src/components/Checkbox/Checkbox.test.tsx index b0715a3..8260f98 100644 --- a/packages/react-common/components/Checkbox/Checkbox.test.tsx +++ b/packages/react-common/src/components/Checkbox/Checkbox.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/Checkbox/Checkbox.tsx b/packages/react-common/src/components/Checkbox/Checkbox.tsx similarity index 100% rename from packages/react-common/components/Checkbox/Checkbox.tsx rename to packages/react-common/src/components/Checkbox/Checkbox.tsx diff --git a/packages/react-common/components/Icon/Icon.test.tsx b/packages/react-common/src/components/Icon/Icon.test.tsx similarity index 93% rename from packages/react-common/components/Icon/Icon.test.tsx rename to packages/react-common/src/components/Icon/Icon.test.tsx index e642da8..eefc5ed 100644 --- a/packages/react-common/components/Icon/Icon.test.tsx +++ b/packages/react-common/src/components/Icon/Icon.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/Icon/Icon.tsx b/packages/react-common/src/components/Icon/Icon.tsx similarity index 100% rename from packages/react-common/components/Icon/Icon.tsx rename to packages/react-common/src/components/Icon/Icon.tsx diff --git a/packages/react-common/components/RadioButton/RadioButton.test.tsx b/packages/react-common/src/components/RadioButton/RadioButton.test.tsx similarity index 96% rename from packages/react-common/components/RadioButton/RadioButton.test.tsx rename to packages/react-common/src/components/RadioButton/RadioButton.test.tsx index f26bc4b..b16f788 100644 --- a/packages/react-common/components/RadioButton/RadioButton.test.tsx +++ b/packages/react-common/src/components/RadioButton/RadioButton.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/RadioButton/RadioButton.tsx b/packages/react-common/src/components/RadioButton/RadioButton.tsx similarity index 100% rename from packages/react-common/components/RadioButton/RadioButton.tsx rename to packages/react-common/src/components/RadioButton/RadioButton.tsx diff --git a/packages/react-common/components/Select/Select.test.tsx b/packages/react-common/src/components/Select/Select.test.tsx similarity index 97% rename from packages/react-common/components/Select/Select.test.tsx rename to packages/react-common/src/components/Select/Select.test.tsx index a6010a1..7722302 100644 --- a/packages/react-common/components/Select/Select.test.tsx +++ b/packages/react-common/src/components/Select/Select.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/Select/Select.tsx b/packages/react-common/src/components/Select/Select.tsx similarity index 100% rename from packages/react-common/components/Select/Select.tsx rename to packages/react-common/src/components/Select/Select.tsx diff --git a/packages/react-common/components/Slider/Slider.test.tsx b/packages/react-common/src/components/Slider/Slider.test.tsx similarity index 97% rename from packages/react-common/components/Slider/Slider.test.tsx rename to packages/react-common/src/components/Slider/Slider.test.tsx index 65e2d61..d9085d4 100644 --- a/packages/react-common/components/Slider/Slider.test.tsx +++ b/packages/react-common/src/components/Slider/Slider.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/Slider/Slider.tsx b/packages/react-common/src/components/Slider/Slider.tsx similarity index 100% rename from packages/react-common/components/Slider/Slider.tsx rename to packages/react-common/src/components/Slider/Slider.tsx diff --git a/packages/react-common/components/TextInput/TextInput.test.tsx b/packages/react-common/src/components/TextInput/TextInput.test.tsx similarity index 98% rename from packages/react-common/components/TextInput/TextInput.test.tsx rename to packages/react-common/src/components/TextInput/TextInput.test.tsx index 6193eae..b0a20ff 100644 --- a/packages/react-common/components/TextInput/TextInput.test.tsx +++ b/packages/react-common/src/components/TextInput/TextInput.test.tsx @@ -1,5 +1,5 @@ /// -/// +/// import * as fc from 'fast-check' import * as Enzyme from 'enzyme' diff --git a/packages/react-common/components/TextInput/TextInput.tsx b/packages/react-common/src/components/TextInput/TextInput.tsx similarity index 100% rename from packages/react-common/components/TextInput/TextInput.tsx rename to packages/react-common/src/components/TextInput/TextInput.tsx diff --git a/packages/react-common/index.test.ts b/packages/react-common/src/index.test.ts similarity index 91% rename from packages/react-common/index.test.ts rename to packages/react-common/src/index.test.ts index 01f1c22..f59c0de 100644 --- a/packages/react-common/index.test.ts +++ b/packages/react-common/src/index.test.ts @@ -1,5 +1,5 @@ /// -/// +/// import * as T from './index' diff --git a/packages/react-common/index.ts b/packages/react-common/src/index.ts similarity index 100% rename from packages/react-common/index.ts rename to packages/react-common/src/index.ts diff --git a/packages/react-common/services/isEmpty.test.ts b/packages/react-common/src/services/isEmpty.test.ts similarity index 100% rename from packages/react-common/services/isEmpty.test.ts rename to packages/react-common/src/services/isEmpty.test.ts diff --git a/packages/react-common/services/isEmpty.ts b/packages/react-common/src/services/isEmpty.ts similarity index 100% rename from packages/react-common/services/isEmpty.ts rename to packages/react-common/src/services/isEmpty.ts diff --git a/packages/react-common/services/splitValueAndUnit.test.ts b/packages/react-common/src/services/splitValueAndUnit.test.ts similarity index 100% rename from packages/react-common/services/splitValueAndUnit.test.ts rename to packages/react-common/src/services/splitValueAndUnit.test.ts diff --git a/packages/react-common/services/splitValueAndUnit.ts b/packages/react-common/src/services/splitValueAndUnit.ts similarity index 100% rename from packages/react-common/services/splitValueAndUnit.ts rename to packages/react-common/src/services/splitValueAndUnit.ts diff --git a/packages/react-common/services/stringify.test.ts b/packages/react-common/src/services/stringify.test.ts similarity index 96% rename from packages/react-common/services/stringify.test.ts rename to packages/react-common/src/services/stringify.test.ts index e329c43..7694e57 100644 --- a/packages/react-common/services/stringify.test.ts +++ b/packages/react-common/src/services/stringify.test.ts @@ -1,5 +1,5 @@ import * as fc from 'fast-check' -import * as fcArb from '../../../utilities/fast-check/arbitraries' +import * as fcArb from '../../../../utilities/fast-check/arbitraries' import stringify from './stringify' it('should exist', () => { diff --git a/packages/react-common/services/stringify.ts b/packages/react-common/src/services/stringify.ts similarity index 100% rename from packages/react-common/services/stringify.ts rename to packages/react-common/src/services/stringify.ts diff --git a/packages/react-common/services/utilities.ts b/packages/react-common/src/services/utilities.ts similarity index 100% rename from packages/react-common/services/utilities.ts rename to packages/react-common/src/services/utilities.ts diff --git a/plop/templates/component/{{pascalCase name}}.mdx.hbs b/plop/templates/react-common-docs/component/{{pascalCase name}}.mdx.hbs similarity index 100% rename from plop/templates/component/{{pascalCase name}}.mdx.hbs rename to plop/templates/react-common-docs/component/{{pascalCase name}}.mdx.hbs diff --git a/plop/templates/component/{{pascalCase name}}.test.tsx.hbs b/plop/templates/react-common/component/{{pascalCase name}}.test.tsx.hbs similarity index 100% rename from plop/templates/component/{{pascalCase name}}.test.tsx.hbs rename to plop/templates/react-common/component/{{pascalCase name}}.test.tsx.hbs diff --git a/plop/templates/component/{{pascalCase name}}.tsx.hbs b/plop/templates/react-common/component/{{pascalCase name}}.tsx.hbs similarity index 100% rename from plop/templates/component/{{pascalCase name}}.tsx.hbs rename to plop/templates/react-common/component/{{pascalCase name}}.tsx.hbs diff --git a/plopfile.js b/plopfile.js index eeef2f1..16dee6a 100644 --- a/plopfile.js +++ b/plopfile.js @@ -1,4 +1,3 @@ -const testName = require('./plop/helpers/testName.js') module.exports = plop => { plop.setGenerator('component', { description: 'Creates a component.', @@ -21,9 +20,15 @@ module.exports = plop => { actions: [ { type: 'addMany', - templateFiles: 'plop/templates/component/*', - base: 'plop/templates/component', - destination: 'packages/react-common/components/{{pascalCase name}}', + templateFiles: 'plop/templates/react-common/component/*', + base: 'plop/templates/react-common/component', + destination: 'packages/react-common/src/components/{{pascalCase name}}', + }, + { + type: 'addMany', + templateFiles: 'plop/templates/react-common-docs/component/*', + base: 'plop/templates/react-common-docs/component', + destination: 'packages/react-common-docs/src/pages/components', }, ], }) diff --git a/rollup.config.js b/rollup.config.js index 9d24294..4a78af8 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,7 +4,7 @@ import typescript from '@rollup/plugin-typescript' import pkg from './package.json' -const ENTRY_POINT = './packages/react-common/index.ts' +const ENTRY_POINT = './packages/react-common/src/index.ts' export default { input: ENTRY_POINT,