diff --git a/.circleci/config.yml b/.circleci/config.yml index 005e3c8307..0b2168708a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,21 +114,21 @@ jobs: - packages/IconFont/fonts # current version build (common to previews & prod) - docs_build: + website_build: <<: *defaults steps: - attach_workspace: at: ~/welcome-ui - restore_cache: key: << pipeline.parameters.cache_version >>-welcome-ui-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn docs:build + - run: yarn website:build - persist_to_workspace: root: ~/welcome-ui paths: - website/out # current version deploy for previews - docs_deploy_preview: + website_deploy_preview: <<: *defaults steps: - attach_workspace: @@ -138,7 +138,7 @@ jobs: - run: node_modules/.bin/netlify deploy --dir=website/out --alias $CIRCLE_BRANCH # current version deploy for production - docs_deploy_prod: + website_deploy_prod: <<: *defaults steps: - attach_workspace: @@ -156,7 +156,7 @@ jobs: - run: node_modules/.bin/netlify deploy --dir=docs_production --prod # previous versions build & deploy for production - previous_docs_versions_build_deploy_prod: + previous_website_versions_build_deploy_prod: <<: *defaults steps: - attach_workspace: @@ -165,7 +165,7 @@ jobs: key: << pipeline.parameters.cache_version >>-welcome-ui-{{ .Environment.CIRCLE_SHA1 }} - run: name: build w/ prefix - command: VERSION=$CIRCLE_BRANCH yarn docs:build + command: VERSION=$CIRCLE_BRANCH yarn website:build - aws-s3/sync: from: website/out to: s3://welcome-ui/docs_production/$CIRCLE_BRANCH @@ -205,7 +205,6 @@ jobs: command: yarn lerna publish from-git --yes --no-verify-access --dist-tag next workflows: - version: 2 btd: jobs: - checkout: @@ -253,13 +252,13 @@ workflows: requires: - yarn_install - build - - docs_build: + - website_build: filters: tags: only: /.*/ requires: - build - - docs_deploy_prod: + - website_deploy_prod: context: - aws - netlify @@ -272,18 +271,18 @@ workflows: requires: - test - lint - - docs_build + - website_build - build_and_release_icon_font - - docs_deploy_preview: + - website_deploy_preview: context: - netlify - welcome-ui requires: - test - lint - - docs_build + - website_build - build_and_release_icon_font - - previous_docs_versions_build_deploy_prod: + - previous_website_versions_build_deploy_prod: context: - aws - netlify diff --git a/.eslintignore b/.eslintignore index e77fdaddab..25ebde8eae 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,3 @@ **/node_modules/** **/dist/** packages/Panda/** -docs/** diff --git a/.gitignore b/.gitignore index 5920310bc0..708459d200 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ .env dist/ -docs/out -docs/.next website/out website/.next .cache/ diff --git a/.npmignore b/.npmignore index 0f6f9ee4a5..604327b89c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,4 @@ /* !/dist/*.js *.test.js -/docs +/website diff --git a/README.md b/README.md index 8bf1d960b7..41c3b2bea1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Welcome UI - - Welcome to the _Welcome UI library_ created by [Welcome to the jungle](https://www.welcometothejungle.com), a customizable design system with react • typescript • styled-components • styled-system and ariakit. Here you'll find all the core components you need to create a delightful webapp. diff --git a/docs/babel.config.js b/docs/babel.config.js deleted file mode 100644 index e52d572838..0000000000 --- a/docs/babel.config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - presets: ['next/babel'], - plugins: [ - [ - 'styled-components', - { - ssr: true, - topLevelImportPaths: [ - '@xstyled/styled-components', - '@xstyled/styled-components/no-tags', - '@xstyled/styled-components/native', - '@xstyled/styled-components/primitives', - ], - }, - ], - ], -} diff --git a/docs/components/App.js b/docs/components/App.js deleted file mode 100644 index 1de3ff5f94..0000000000 --- a/docs/components/App.js +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { createTheme, WuiProvider } from '@welcome-ui/core' -import { MDXProvider } from '@mdx-js/react' -import { welcomeTheme } from '@welcome-ui/themes.welcome' -import { darkTheme } from '@welcome-ui/themes.dark' -import { welcomeDarkTheme } from '@welcome-ui/themes.welcome-dark' -import { Notifications } from '@welcome-ui/toast' - -import { useThemeContext } from '../context/theme' - -import { Layouts } from './Layouts' -import { MDXComponents } from './Mdx' -import { Head } from './Head' -import { GlobalStyle } from './GlobalStyle' - -const coreTheme = createTheme() - -const getTheme = themeStorage => { - if (themeStorage === 'welcome') { - return welcomeTheme - } else if (themeStorage === 'dark') { - return darkTheme - } else if (themeStorage === 'welcomeDark') { - return welcomeDarkTheme - } else { - return coreTheme - } -} - -export function App({ component: Component, pageProps }) { - const themeStorage = useThemeContext() - const initialTheme = welcomeTheme - const [globalTheme, setGlobalTheme] = useState(initialTheme) - - useEffect(() => { - setGlobalTheme(getTheme(themeStorage)) - }, [themeStorage]) - - return ( - - - - - - - - - - - ) -} diff --git a/docs/components/Colors.js b/docs/components/Colors.js deleted file mode 100644 index 53a094c27b..0000000000 --- a/docs/components/Colors.js +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react' -import { withTheme } from '@xstyled/styled-components' -import { Card } from '@welcome-ui/card' -import { Box } from '@welcome-ui/box' -import { Grid } from '@welcome-ui/grid' -import { Text } from '@welcome-ui/text' - -const getColors = (name, theme) => { - return Object.keys(theme.colors) - .filter(color => color.startsWith(name)) - .reduce((colors, color) => { - colors[color] = theme.colors[color] - return colors - }, {}) -} - -function Wrapper({ name, theme, colorsObject }) { - const colors = colorsObject || getColors(name, theme) - const isLight = name === 'light' - const textColor = isLight && 'light-900' - - return ( - - - - {Object.entries(colors).map(([key, depth]) => ( - - - - - {key} - - - {depth} - - - - ))} - - - - ) -} - -export const Colors = withTheme(Wrapper) diff --git a/docs/components/ComponentsList/Link.js b/docs/components/ComponentsList/Link.js deleted file mode 100644 index b15de4e25f..0000000000 --- a/docs/components/ComponentsList/Link.js +++ /dev/null @@ -1,37 +0,0 @@ -import React, { cloneElement, useEffect, useRef } from 'react' -import NextLink from 'next/link' -import { useRouter } from 'next/router' - -export function Link({ children, href, ...props }) { - const router = useRouter() - const ref = useRef() - let isActive = false - - useEffect(() => { - if (isActive) { - const element = ref.current - - if (element) { - element.scrollIntoView({ - block: 'center', - }) - } - } - }, [isActive]) - - if (router.pathname === href) { - isActive = true - } - - const childrenCloned = cloneElement(children, { - 'aria-current': isActive ? 'page' : undefined, - ref, - ...children.props, - }) - - return ( - - {childrenCloned} - - ) -} diff --git a/docs/components/ComponentsList/VersionSelector/index.js b/docs/components/ComponentsList/VersionSelector/index.js deleted file mode 100644 index 69e2923e61..0000000000 --- a/docs/components/ComponentsList/VersionSelector/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import { Select } from '@welcome-ui/select' -import React from 'react' - -import { version } from '../../../../lerna.json' - -const versions = [ - { value: 'v5', label: `${version}` }, - { value: 'v4', label: 'v4' }, - { value: 'v3', label: 'v3' }, -] - -export function VersionSelector() { - const handleChange = value => { - if (['v3', 'v4'].includes(value)) { - window.open(`http://welcome-ui.com/${value}`, '_self') - } - } - - return ( -