diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1b88fc3c66..f8619adc07 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -37,6 +37,7 @@ jobs: path: | packages/fuselage/storybook-static packages/fuselage-ui-kit/storybook-static + packages/onboarding-ui/storybook-static - if: github.ref == 'refs/heads/master' uses: actions/upload-artifact@v2 with: @@ -111,9 +112,10 @@ jobs: name: docs path: . - run: | - rm -rf "fuselage/${{ needs.build-and-test.outputs.branch-name }}" "fuselage-ui-kit/${{ needs.build-and-test.outputs.branch-name }}" + rm -rf "fuselage/${{ needs.build-and-test.outputs.branch-name }}" "fuselage-ui-kit/${{ needs.build-and-test.outputs.branch-name }}" "onboarding-ui/${{ needs.build-and-test.outputs.branch-name }}" mv -v "packages/fuselage/storybook-static" "fuselage/${{ needs.build-and-test.outputs.branch-name }}" mv -v "packages/fuselage-ui-kit/storybook-static" "fuselage-ui-kit/${{ needs.build-and-test.outputs.branch-name }}" + mv -v "packages/onboarding-ui/storybook-static" "onboarding-ui/${{ needs.build-and-test.outputs.branch-name }}" rm -rf packages - uses: crazy-max/ghaction-github-pages@v2 with: diff --git a/.github/workflows/ci-pr-closed.yml b/.github/workflows/ci-pr-closed.yml index fc3df33f5c..bb60ebccb0 100644 --- a/.github/workflows/ci-pr-closed.yml +++ b/.github/workflows/ci-pr-closed.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 with: ref: gh-pages - - run: rm -rf "fuselage/${{ github.event.number }}" "fuselage-ui-kit/${{ github.event.number }}" + - run: rm -rf "fuselage/${{ github.event.number }}" "fuselage-ui-kit/${{ github.event.number }}" "onboarding-ui/${{ github.event.number }}" - uses: crazy-max/ghaction-github-pages@v2 with: target_branch: gh-pages diff --git a/.github/workflows/ci-pr-opened.yml b/.github/workflows/ci-pr-opened.yml index 6ef2031d8d..1a449ba4c6 100644 --- a/.github/workflows/ci-pr-opened.yml +++ b/.github/workflows/ci-pr-opened.yml @@ -43,6 +43,7 @@ jobs: path: | fuselage/storybook-static fuselage-ui-kit/storybook-static + onboarding-ui/storybook-static publish-to-gh-pages: name: Publish to GitHub Pages @@ -61,9 +62,10 @@ jobs: name: storybooks path: packages - run: | - rm -rf "fuselage/${{ needs.download-artifact.outputs.pr-number }}" "fuselage-ui-kit/${{ needs.download-artifact.outputs.pr-number }}" + rm -rf "fuselage/${{ needs.download-artifact.outputs.pr-number }}" "fuselage-ui-kit/${{ needs.download-artifact.outputs.pr-number }}" "onboarding-ui/${{ needs.download-artifact.outputs.pr-number }}" mv -v packages/fuselage/storybook-static "fuselage/${{ needs.download-artifact.outputs.pr-number }}" mv -v packages/fuselage-ui-kit/storybook-static "fuselage-ui-kit/${{ needs.download-artifact.outputs.pr-number }}" + mv -v packages/onboarding-ui/storybook-static "onboarding-ui/${{ needs.download-artifact.outputs.pr-number }}" rm -rf packages - uses: crazy-max/ghaction-github-pages@v2 with: diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 9a86a1b4cb..6d54264235 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -35,6 +35,7 @@ jobs: path: | packages/fuselage/storybook-static packages/fuselage-ui-kit/storybook-static + packages/onboarding-ui/storybook-static test-with-loki: name: Test with Loki @@ -63,11 +64,16 @@ jobs: - run: | cat packages/fuselage/package.json | sed s/\.docker/.app/ > packages/fuselage/package.json-new cat packages/fuselage-ui-kit/package.json | sed s/\.docker/.app/ > packages/fuselage-ui-kit/package.json-new + cat packages/onboarding-ui/package.json | sed s/\.docker/.app/ > packages/onboarding-ui/package.json-new mv packages/fuselage/package.json-new packages/fuselage/package.json mv packages/fuselage-ui-kit/package.json-new packages/fuselage-ui-kit/package.json + mv packages/onboarding-ui/package.json-new packages/onboarding-ui/package.json - uses: ./.github/actions/loki/test with: working_dir: ./packages/fuselage - uses: ./.github/actions/loki/test with: working_dir: ./packages/fuselage-ui-kit + - uses: ./.github/actions/loki/test + with: + working_dir: ./packages/onboarding-ui diff --git a/.vscode/settings.json b/.vscode/settings.json index b06f14d06d..1c995bccd0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -40,6 +40,10 @@ "directory": "packages/mp3-encoder", "changeProcessCWD": true }, + { + "directory": "packages/onboarding-ui", + "changeProcessCWD": true + }, { "directory": "packages/peggy-loader", "changeProcessCWD": true diff --git a/README.md b/README.md index 2893c91597..64fb971b18 100644 --- a/README.md +++ b/README.md @@ -14,21 +14,22 @@ ![Pull requests](https://img.shields.io/github/issues-pr/RocketChat/Rocket.Chat.Fuselage?style=flat-square) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/RocketChat/Rocket.Chat.Fuselage?style=flat-square) -| Package | Description | Version | Dependencies | -| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| 📦 [`@rocket.chat/css-in-js`](/packages/@rocket.chat/css-in-js) | Toolset to transpile and use CSS on runtime | ![npm](https://img.shields.io/npm/v/@rocket.chat/css-in-js?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fcss-in-js&style=flat-square) | -| 📦 [`@rocket.chat/emitter`](/packages/@rocket.chat/emitter) | Event Emitter by Rocket.Chat | ![npm](https://img.shields.io/npm/v/@rocket.chat/emitter?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Femitter&style=flat-square) | -| 📦 [`@rocket.chat/eslint-config-alt`](/packages/@rocket.chat/eslint-config-alt) | ESLint configuration for Rocket.Chat repositories | ![npm](https://img.shields.io/npm/v/@rocket.chat/eslint-config-alt?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Feslint-config-alt&style=flat-square) | -| 📦 [`@rocket.chat/fuselage`](/packages/@rocket.chat/fuselage) | | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage&style=flat-square) | -| 📦 [`@rocket.chat/fuselage-hooks`](/packages/@rocket.chat/fuselage-hooks) | React hooks for Fuselage, Rocket.Chat's design system and UI toolkit | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-hooks?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-hooks&style=flat-square) | -| 📦 [`@rocket.chat/fuselage-polyfills`](/packages/@rocket.chat/fuselage-polyfills) | A bundle of useful poly/ponyfills used by fuselage | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-polyfills?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-polyfills&style=flat-square) | -| 📦 [`@rocket.chat/fuselage-tokens`](/packages/@rocket.chat/fuselage-tokens) | Design tokens for Fuselage, Rocket.Chat's design system | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-tokens?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-tokens&style=flat-square) | -| 📦 [`@rocket.chat/fuselage-ui-kit`](/packages/@rocket.chat/fuselage-ui-kit) | UiKit elements for Rocket.Chat Apps built under Fuselage design system | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-ui-kit?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-ui-kit&style=flat-square) | -| 📦 [`@rocket.chat/icons`](/packages/@rocket.chat/icons) | | ![npm](https://img.shields.io/npm/v/@rocket.chat/icons?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ficons&style=flat-square) | -| 📦 [`@rocket.chat/memo`](/packages/@rocket.chat/memo) | Memoization utilities | ![npm](https://img.shields.io/npm/v/@rocket.chat/memo?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmemo&style=flat-square) | -| 📦 [`@rocket.chat/message-parser`](/packages/@rocket.chat/message-parser) | Rocket.Chat parser for messages | ![npm](https://img.shields.io/npm/v/@rocket.chat/message-parser?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmessage-parser&style=flat-square) | -| 📦 [`@rocket.chat/mp3-encoder`](/packages/@rocket.chat/mp3-encoder) | A LAME encoder to be used in web workers | ![npm](https://img.shields.io/npm/v/@rocket.chat/mp3-encoder?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmp3-encoder&style=flat-square) | -| 📦 [`@rocket.chat/peggy-loader`](/packages/@rocket.chat/peggy-loader) | Peggy loader for webpack | ![npm](https://img.shields.io/npm/v/@rocket.chat/peggy-loader?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fpeggy-loader&style=flat-square) | -| 📦 [`@rocket.chat/prettier-config`](/packages/@rocket.chat/prettier-config) | Prettier configuration for Rocket.Chat repositories | ![npm](https://img.shields.io/npm/v/@rocket.chat/prettier-config?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fprettier-config&style=flat-square) | -| 📦 [`@rocket.chat/string-helpers`](/packages/@rocket.chat/string-helpers) | Helper functions for string manipulation | ![npm](https://img.shields.io/npm/v/@rocket.chat/string-helpers?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fstring-helpers&style=flat-square) | -| 📦 [`@rocket.chat/ui-kit`](/packages/@rocket.chat/ui-kit) | Interactive UI elements for Rocket.Chat Apps | ![npm](https://img.shields.io/npm/v/@rocket.chat/ui-kit?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fui-kit&style=flat-square) | +| Package | Description | Version | Dependencies | +| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| 📦 [`@rocket.chat/css-in-js`](/packages/@rocket.chat/css-in-js) | Toolset to transpile and use CSS on runtime | ![npm](https://img.shields.io/npm/v/@rocket.chat/css-in-js?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fcss-in-js&style=flat-square) | +| 📦 [`@rocket.chat/emitter`](/packages/@rocket.chat/emitter) | Event Emitter by Rocket.Chat | ![npm](https://img.shields.io/npm/v/@rocket.chat/emitter?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Femitter&style=flat-square) | +| 📦 [`@rocket.chat/eslint-config-alt`](/packages/@rocket.chat/eslint-config-alt) | ESLint configuration for Rocket.Chat repositories | ![npm](https://img.shields.io/npm/v/@rocket.chat/eslint-config-alt?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Feslint-config-alt&style=flat-square) | +| 📦 [`@rocket.chat/fuselage`](/packages/@rocket.chat/fuselage) | | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage&style=flat-square) | +| 📦 [`@rocket.chat/fuselage-hooks`](/packages/@rocket.chat/fuselage-hooks) | React hooks for Fuselage, Rocket.Chat's design system and UI toolkit | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-hooks?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-hooks&style=flat-square) | +| 📦 [`@rocket.chat/fuselage-polyfills`](/packages/@rocket.chat/fuselage-polyfills) | A bundle of useful poly/ponyfills used by fuselage | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-polyfills?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-polyfills&style=flat-square) | +| 📦 [`@rocket.chat/fuselage-tokens`](/packages/@rocket.chat/fuselage-tokens) | Design tokens for Fuselage, Rocket.Chat's design system | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-tokens?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-tokens&style=flat-square) | +| 📦 [`@rocket.chat/fuselage-ui-kit`](/packages/@rocket.chat/fuselage-ui-kit) | UiKit elements for Rocket.Chat Apps built under Fuselage design system | ![npm](https://img.shields.io/npm/v/@rocket.chat/fuselage-ui-kit?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ffuselage-ui-kit&style=flat-square) | +| 📦 [`@rocket.chat/icons`](/packages/@rocket.chat/icons) | | ![npm](https://img.shields.io/npm/v/@rocket.chat/icons?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Ficons&style=flat-square) | +| 📦 [`@rocket.chat/memo`](/packages/@rocket.chat/memo) | Memoization utilities | ![npm](https://img.shields.io/npm/v/@rocket.chat/memo?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmemo&style=flat-square) | +| 📦 [`@rocket.chat/message-parser`](/packages/@rocket.chat/message-parser) | Rocket.Chat parser for messages | ![npm](https://img.shields.io/npm/v/@rocket.chat/message-parser?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmessage-parser&style=flat-square) | +| 📦 [`@rocket.chat/mp3-encoder`](/packages/@rocket.chat/mp3-encoder) | A LAME encoder to be used in web workers | ![npm](https://img.shields.io/npm/v/@rocket.chat/mp3-encoder?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fmp3-encoder&style=flat-square) | +| 📦 [`@rocket.chat/onboarding-ui`](/packages/@rocket.chat/onboarding-ui) | Set of components and functions for the onboarding experience on Rocket.Chat | ![npm](https://img.shields.io/npm/v/@rocket.chat/onboarding-ui?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fonboarding-ui&style=flat-square) | +| 📦 [`@rocket.chat/peggy-loader`](/packages/@rocket.chat/peggy-loader) | Peggy loader for webpack | ![npm](https://img.shields.io/npm/v/@rocket.chat/peggy-loader?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fpeggy-loader&style=flat-square) | +| 📦 [`@rocket.chat/prettier-config`](/packages/@rocket.chat/prettier-config) | Prettier configuration for Rocket.Chat repositories | ![npm](https://img.shields.io/npm/v/@rocket.chat/prettier-config?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fprettier-config&style=flat-square) | +| 📦 [`@rocket.chat/string-helpers`](/packages/@rocket.chat/string-helpers) | Helper functions for string manipulation | ![npm](https://img.shields.io/npm/v/@rocket.chat/string-helpers?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fstring-helpers&style=flat-square) | +| 📦 [`@rocket.chat/ui-kit`](/packages/@rocket.chat/ui-kit) | Interactive UI elements for Rocket.Chat Apps | ![npm](https://img.shields.io/npm/v/@rocket.chat/ui-kit?style=flat-square) | ![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fui-kit&style=flat-square) | diff --git a/packages/fuselage/README.md b/packages/fuselage/README.md index bcc66a45e3..b7b9371234 100644 --- a/packages/fuselage/README.md +++ b/packages/fuselage/README.md @@ -23,11 +23,11 @@ Firstly, install the peer dependencies (prerequisites): ```sh -npm i @rocket.chat/fuselage-hooks @rocket.chat/fuselage-polyfills @rocket.chat/icons react react-dom +npm i @rocket.chat/fuselage-hooks @rocket.chat/fuselage-polyfills @rocket.chat/icons react react-dom react-virtuoso # or, if you are using yarn: -yarn add @rocket.chat/fuselage-hooks @rocket.chat/fuselage-polyfills @rocket.chat/icons react react-dom +yarn add @rocket.chat/fuselage-hooks @rocket.chat/fuselage-polyfills @rocket.chat/icons react react-dom react-virtuoso ``` Add `@rocket.chat/fuselage` as a dependency: diff --git a/packages/onboarding-ui/.eslintignore b/packages/onboarding-ui/.eslintignore new file mode 100644 index 0000000000..5066b993be --- /dev/null +++ b/packages/onboarding-ui/.eslintignore @@ -0,0 +1,3 @@ +/node_modules +/dist +!/.storybook diff --git a/packages/onboarding-ui/.eslintrc.js b/packages/onboarding-ui/.eslintrc.js new file mode 100644 index 0000000000..d11c05a965 --- /dev/null +++ b/packages/onboarding-ui/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: '@rocket.chat/eslint-config-alt/typescript', + env: { + jest: true, + }, +}; diff --git a/packages/onboarding-ui/.gitignore b/packages/onboarding-ui/.gitignore new file mode 100644 index 0000000000..9f5dd2822c --- /dev/null +++ b/packages/onboarding-ui/.gitignore @@ -0,0 +1,2 @@ +/.storybook/jest-results.json +/dist diff --git a/packages/onboarding-ui/.loki/reference/chrome_iphone7_MyComponent_My_Component.png b/packages/onboarding-ui/.loki/reference/chrome_iphone7_MyComponent_My_Component.png new file mode 100644 index 0000000000..00fe269d5b Binary files /dev/null and b/packages/onboarding-ui/.loki/reference/chrome_iphone7_MyComponent_My_Component.png differ diff --git a/packages/onboarding-ui/.loki/reference/chrome_laptop_MyComponent_My_Component.png b/packages/onboarding-ui/.loki/reference/chrome_laptop_MyComponent_My_Component.png new file mode 100644 index 0000000000..9e441c748f Binary files /dev/null and b/packages/onboarding-ui/.loki/reference/chrome_laptop_MyComponent_My_Component.png differ diff --git a/packages/onboarding-ui/.prettierignore b/packages/onboarding-ui/.prettierignore new file mode 100644 index 0000000000..8225baa4a7 --- /dev/null +++ b/packages/onboarding-ui/.prettierignore @@ -0,0 +1,2 @@ +/node_modules +/dist diff --git a/packages/onboarding-ui/.prettierrc.js b/packages/onboarding-ui/.prettierrc.js new file mode 100644 index 0000000000..b57f474edb --- /dev/null +++ b/packages/onboarding-ui/.prettierrc.js @@ -0,0 +1 @@ +module.exports = require('@rocket.chat/prettier-config/fuselage'); diff --git a/packages/onboarding-ui/.storybook/logo.svg b/packages/onboarding-ui/.storybook/logo.svg new file mode 100644 index 0000000000..6ae18fa4b9 --- /dev/null +++ b/packages/onboarding-ui/.storybook/logo.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/onboarding-ui/.storybook/logo.svg.d.ts b/packages/onboarding-ui/.storybook/logo.svg.d.ts new file mode 100644 index 0000000000..27c0914b23 --- /dev/null +++ b/packages/onboarding-ui/.storybook/logo.svg.d.ts @@ -0,0 +1,3 @@ +declare const path: string; + +export = path; diff --git a/packages/onboarding-ui/.storybook/main.ts b/packages/onboarding-ui/.storybook/main.ts new file mode 100644 index 0000000000..9c7cce1c74 --- /dev/null +++ b/packages/onboarding-ui/.storybook/main.ts @@ -0,0 +1,7 @@ +module.exports = { + addons: ['@storybook/addon-essentials'], + stories: ['../src/**/*.stories.tsx'], + features: { + postcss: false, + }, +}; diff --git a/packages/onboarding-ui/.storybook/manager.ts b/packages/onboarding-ui/.storybook/manager.ts new file mode 100644 index 0000000000..15f19a1a23 --- /dev/null +++ b/packages/onboarding-ui/.storybook/manager.ts @@ -0,0 +1,17 @@ +import colorTokens from '@rocket.chat/fuselage-tokens/colors.json'; +import { addons } from '@storybook/addons'; +import { create } from '@storybook/theming'; + +import manifest from '../package.json'; +import logo from './logo.svg'; + +addons.setConfig({ + theme: create({ + base: 'light', + brandTitle: manifest.name, + brandImage: logo, + brandUrl: manifest.homepage, + colorPrimary: colorTokens.n500, + colorSecondary: colorTokens.b500, + }), +}); diff --git a/packages/onboarding-ui/.storybook/preview-head.html b/packages/onboarding-ui/.storybook/preview-head.html new file mode 100644 index 0000000000..fda57d2749 --- /dev/null +++ b/packages/onboarding-ui/.storybook/preview-head.html @@ -0,0 +1,6 @@ + diff --git a/packages/onboarding-ui/.storybook/preview.ts b/packages/onboarding-ui/.storybook/preview.ts new file mode 100644 index 0000000000..b74b6e0b33 --- /dev/null +++ b/packages/onboarding-ui/.storybook/preview.ts @@ -0,0 +1,22 @@ +import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks'; +import { addParameters } from '@storybook/react'; +import 'loki/configure-react'; +import '@rocket.chat/icons/dist/rocketchat.css'; +import '@rocket.chat/fuselage-polyfills'; + +addParameters({ + backgrounds: { + grid: { + cellSize: 4, + cellAmount: 4, + opacity: 0.5, + }, + }, + docs: { + container: DocsContainer, + page: DocsPage, + }, + options: { + storySort: ([, a], [, b]) => a.kind.localeCompare(b.kind), + }, +}); diff --git a/packages/onboarding-ui/CHANGELOG.md b/packages/onboarding-ui/CHANGELOG.md new file mode 100644 index 0000000000..29aa6317f9 --- /dev/null +++ b/packages/onboarding-ui/CHANGELOG.md @@ -0,0 +1,38 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [0.26.0](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.25.0...v0.26.0) (2021-05-28) + +**Note:** Version bump only for package @rocket.chat/string-helpers + + + + + +# [0.25.0](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.24.0...v0.25.0) (2021-05-19) + + +### Bug Fixes + +* **fuselage:** fix duplicated values on paginated multi select ([#456](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues/456)) ([4518a4e](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/4518a4e661cb525d957f6140d59a641a50fc7b20)) +* **string-helpers:** Wrong typesVersions declaration ([256758c](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/256758c60ff8ed5ec7d86ff027ad3ea82f84aaf6)) +* Location in typesVersions field ([#449](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues/449)) ([491f98b](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/491f98b8cbc5e30f73adde377965f79fe565438b)) + + +### Features + +* [@rocket](https://github.com/rocket).chat/message-parser ([#443](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues/443)) ([4722cdf](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/4722cdff46f5987f335d989be59649c7652bb12a)) +* Peggy loader ([#450](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues/450)) ([0496cad](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/0496cad457d76f8a4d6a217209e4a55e315e8365)) + + + + + +# [0.24.0](https://github.com/RocketChat/Rocket.Chat.Fuselage/compare/v0.23.0...v0.24.0) (2021-04-28) + + +### Features + +* [@rocket](https://github.com/rocket).chat/string-helpers ([#431](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues/431)) ([2509d6a](https://github.com/RocketChat/Rocket.Chat.Fuselage/commit/2509d6acdbe5ec8b216e8d4430373797c5f5dfe2)) diff --git a/packages/onboarding-ui/README.md b/packages/onboarding-ui/README.md new file mode 100644 index 0000000000..d3c1e9db67 --- /dev/null +++ b/packages/onboarding-ui/README.md @@ -0,0 +1,91 @@ + + +

+ + Rocket.Chat + +

+ +# `@rocket.chat/onboarding-ui` + +> Set of components and functions for the onboarding experience on Rocket.Chat + +--- + +![npm@latest](https://img.shields.io/npm/v/@rocket.chat/onboarding-ui/latest?style=flat-square) ![npm@next](https://img.shields.io/npm/v/@rocket.chat/onboarding-ui/next?style=flat-square) ![npm downloads](https://img.shields.io/npm/dw/@rocket.chat/onboarding-ui?style=flat-square) ![License: MIT](https://img.shields.io/npm/l/@rocket.chat/onboarding-ui?style=flat-square) + +![deps](https://img.shields.io/david/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fonboarding-ui&style=flat-square) ![peer deps](https://img.shields.io/david/peer/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fonboarding-ui&style=flat-square) ![dev deps](https://img.shields.io/david/dev/RocketChat/Rocket.Chat.Fuselage?path=packages%2Fonboarding-ui&style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/min/@rocket.chat/onboarding-ui?style=flat-square) + + + +## Install + + + +Add `@rocket.chat/onboarding-ui` as a dependency: + +```sh +npm i @rocket.chat/onboarding-ui + +# or, if you are using yarn: + +yarn add @rocket.chat/onboarding-ui +``` + + + +## Contributing + + + +Contributions, issues, and feature requests are welcome!
+Feel free to check the [issues](https://github.com/RocketChat/Rocket.Chat.Fuselage/issues). + + + +### Building + +As this package dependends on others in this monorepo, before anything run the following at the root directory: + + + +```sh +yarn build +``` + + + +### Linting + +To ensure the source is matching our coding style, we perform [linting](). +Before commiting, check if your code fits our style by running: + + + +```sh +yarn lint +``` + + + +Some linter warnings and errors can be automatically fixed: + + + +```sh +yarn lint-fix +``` + + + +### Running tests + +Whenever possible, add tests to describe exactly what your code do. You can run them by yourself: + + + +```sh +yarn test +``` + + diff --git a/packages/onboarding-ui/babel.config.js b/packages/onboarding-ui/babel.config.js new file mode 100644 index 0000000000..04d5a5be5c --- /dev/null +++ b/packages/onboarding-ui/babel.config.js @@ -0,0 +1,7 @@ +module.exports = { + plugins: [ + ['@babel/plugin-proposal-private-property-in-object', { loose: true }], + ['@babel/plugin-proposal-private-methods', { loose: true }], + ['@babel/plugin-proposal-class-properties', { loose: true }], + ], +}; diff --git a/packages/onboarding-ui/jest.config.js b/packages/onboarding-ui/jest.config.js new file mode 100644 index 0000000000..aba24c1c97 --- /dev/null +++ b/packages/onboarding-ui/jest.config.js @@ -0,0 +1,13 @@ +module.exports = { + preset: 'ts-jest', + errorOnDeprecated: true, + testMatch: ['/src/**/*.spec.[jt]s?(x)'], + globals: { + 'ts-jest': { + tsconfig: { + noUnusedLocals: false, + noUnusedParameters: false, + }, + }, + }, +}; diff --git a/packages/onboarding-ui/package.json b/packages/onboarding-ui/package.json new file mode 100644 index 0000000000..9137bae7b1 --- /dev/null +++ b/packages/onboarding-ui/package.json @@ -0,0 +1,102 @@ +{ + "name": "@rocket.chat/onboarding-ui", + "version": "0.26.0", + "description": "Set of components and functions for the onboarding experience on Rocket.Chat", + "keywords": [ + "rocketchat" + ], + "author": { + "name": "Rocket.Chat", + "url": "https://rocket.chat/" + }, + "homepage": "https://github.com/RocketChat/Rocket.Chat.Fuselage#readme", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/RocketChat/Rocket.Chat.Fuselage.git", + "directory": "packages/onboarding-ui" + }, + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "types": "dist/ts3.4/index.d.ts", + "files": [ + "/dist" + ], + "scripts": { + "build": "run-s .:build:clean .:build:esm .:build:cjs .:build:ts3.4", + ".:build:clean": "rimraf dist", + ".:build:esm": "tsc -p tsconfig-esm.json", + ".:build:cjs": "tsc -p tsconfig-cjs.json", + ".:build:ts3.4": "downlevel-dts dist/esm/ dist/ts3.4/ --to=3.4", + "lint": "eslint src", + "lint-fix": "eslint --fix src", + "lint-staged": "lint-staged", + "test": "jest --runInBand", + "docs": "typedoc", + "storybook": "start-storybook -p 6006", + "build-storybook": "build-storybook", + "update-storybook": "run-s .:update-storybook:build-storybook .:update-storybook:loki-update", + ".:update-storybook:build-storybook": "run-s build-storybook", + ".:update-storybook:loki-update": "loki update --chromeDockerImage=chinello/alpine-chrome:latest --chromeFlags=\"--headless --no-sandbox --disable-gpu --disable-features=VizDisplayCompositor\" --verboseRenderer --requireReference --reactUri file:./storybook-static", + "loki:test": "loki test --chromeDockerImage=chinello/alpine-chrome:latest --chromeFlags=\"--headless --no-sandbox --disable-gpu --disable-features=VizDisplayCompositor\" --verboseRenderer --requireReference --reactUri file:./storybook-static" + }, + "bugs": { + "url": "https://github.com/RocketChat/Rocket.Chat.Fuselage/issues" + }, + "devDependencies": { + "@rocket.chat/eslint-config-alt": "^0.26.0", + "@rocket.chat/fuselage-tokens": "workspace:packages/fuselage-tokens", + "@rocket.chat/prettier-config": "^0.26.0", + "@storybook/addon-essentials": "^6.2.9", + "@storybook/addons": "^6.2.9", + "@storybook/react": "^6.2.9", + "@storybook/source-loader": "^6.2.9", + "@storybook/theming": "^6.2.9", + "@types/jest": "^26.0.23", + "@types/react": "^17.0.8", + "@types/react-dom": "^17.0.5", + "downlevel-dts": "^0.7.0", + "eslint": "^7.26.0", + "jest": "^26.6.3", + "lint-staged": "^11.0.0", + "loki": "^0.28.1", + "npm-run-all": "^4.1.5", + "prettier": "^2.2.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "rimraf": "^3.0.2", + "ts-jest": "^26.5.6", + "typedoc": "^0.20.36", + "typescript": "^4.2.4" + }, + "dependencies": { + "@rocket.chat/fuselage": "workspace:packages/fuselage", + "@rocket.chat/fuselage-hooks": "workspace:packages/fuselage-hooks", + "@rocket.chat/fuselage-polyfills": "workspace:packages/fuselage-polyfills", + "@rocket.chat/icons": "workspace:packages/icons", + "tslib": "^2.2.0" + }, + "peerDependencies": { + "react": "17.0.2", + "react-dom": "17.0.2" + }, + "loki": { + "configurations": { + "chrome.laptop": { + "target": "chrome.docker", + "width": 1366, + "height": 768, + "deviceScaleFactor": 1, + "mobile": false, + "fitWindow": false + }, + "chrome.iphone7": { + "target": "chrome.docker", + "preset": "iPhone 7" + } + } + } +} diff --git a/packages/onboarding-ui/src/MyComponent.spec.tsx b/packages/onboarding-ui/src/MyComponent.spec.tsx new file mode 100644 index 0000000000..0ae56d0765 --- /dev/null +++ b/packages/onboarding-ui/src/MyComponent.spec.tsx @@ -0,0 +1,9 @@ +import ReactDOM from 'react-dom'; + +import MyComponent from './MyComponent'; + +it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + ReactDOM.unmountComponentAtNode(div); +}); diff --git a/packages/onboarding-ui/src/MyComponent.stories.tsx b/packages/onboarding-ui/src/MyComponent.stories.tsx new file mode 100644 index 0000000000..3ed6c3f27b --- /dev/null +++ b/packages/onboarding-ui/src/MyComponent.stories.tsx @@ -0,0 +1,10 @@ +import { ReactElement } from 'react'; + +import MyComponent from './MyComponent'; + +export default { + title: 'MyComponent', + component: MyComponent, +}; + +export const _MyComponent = (): ReactElement => ; diff --git a/packages/onboarding-ui/src/MyComponent.tsx b/packages/onboarding-ui/src/MyComponent.tsx new file mode 100644 index 0000000000..5657043ec4 --- /dev/null +++ b/packages/onboarding-ui/src/MyComponent.tsx @@ -0,0 +1,5 @@ +import { ReactElement } from 'react'; + +const MyComponent = (): ReactElement =>
Hello, World!
; + +export default MyComponent; diff --git a/packages/onboarding-ui/src/common/.gitignore b/packages/onboarding-ui/src/common/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/packages/onboarding-ui/src/common/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/packages/onboarding-ui/src/emails/.gitignore b/packages/onboarding-ui/src/emails/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/packages/onboarding-ui/src/emails/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/packages/onboarding-ui/src/forms/.gitignore b/packages/onboarding-ui/src/forms/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/packages/onboarding-ui/src/forms/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/packages/onboarding-ui/src/index.ts b/packages/onboarding-ui/src/index.ts new file mode 100644 index 0000000000..a68cfe323f --- /dev/null +++ b/packages/onboarding-ui/src/index.ts @@ -0,0 +1 @@ +export { default as MyComponent } from './MyComponent'; diff --git a/packages/onboarding-ui/src/pages/.gitignore b/packages/onboarding-ui/src/pages/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/packages/onboarding-ui/src/pages/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/packages/onboarding-ui/tsconfig-cjs.json b/packages/onboarding-ui/tsconfig-cjs.json new file mode 100644 index 0000000000..94db2d7e97 --- /dev/null +++ b/packages/onboarding-ui/tsconfig-cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "./dist/cjs" + }, + "exclude": ["./**/*.stories.tsx", "./**/*.spec.tsx"] +} diff --git a/packages/onboarding-ui/tsconfig-esm.json b/packages/onboarding-ui/tsconfig-esm.json new file mode 100644 index 0000000000..5201be01de --- /dev/null +++ b/packages/onboarding-ui/tsconfig-esm.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["./**/*.stories.tsx", "./**/*.spec.tsx"] +} diff --git a/packages/onboarding-ui/tsconfig.json b/packages/onboarding-ui/tsconfig.json new file mode 100644 index 0000000000..0c9ff42708 --- /dev/null +++ b/packages/onboarding-ui/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "rootDir": "./src", + "target": "es5", + "module": "ESNext", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist/esm", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "jsx": "react-jsx" + } +} diff --git a/packages/onboarding-ui/typedoc.json b/packages/onboarding-ui/typedoc.json new file mode 100644 index 0000000000..2c42f9dfd6 --- /dev/null +++ b/packages/onboarding-ui/typedoc.json @@ -0,0 +1,6 @@ +{ + "entryPoints": [ + "src/index.ts" + ], + "out": "../../static/onboarding-ui" +} diff --git a/yarn.lock b/yarn.lock index 58960ab550..13b9f0d1fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4441,6 +4441,45 @@ __metadata: languageName: unknown linkType: soft +"@rocket.chat/onboarding-ui@workspace:packages/onboarding-ui": + version: 0.0.0-use.local + resolution: "@rocket.chat/onboarding-ui@workspace:packages/onboarding-ui" + dependencies: + "@rocket.chat/eslint-config-alt": ^0.26.0 + "@rocket.chat/fuselage": "workspace:packages/fuselage" + "@rocket.chat/fuselage-hooks": "workspace:packages/fuselage-hooks" + "@rocket.chat/fuselage-polyfills": "workspace:packages/fuselage-polyfills" + "@rocket.chat/fuselage-tokens": "workspace:packages/fuselage-tokens" + "@rocket.chat/icons": "workspace:packages/icons" + "@rocket.chat/prettier-config": ^0.26.0 + "@storybook/addon-essentials": ^6.2.9 + "@storybook/addons": ^6.2.9 + "@storybook/react": ^6.2.9 + "@storybook/source-loader": ^6.2.9 + "@storybook/theming": ^6.2.9 + "@types/jest": ^26.0.23 + "@types/react": ^17.0.8 + "@types/react-dom": ^17.0.5 + downlevel-dts: ^0.7.0 + eslint: ^7.26.0 + jest: ^26.6.3 + lint-staged: ^11.0.0 + loki: ^0.28.1 + npm-run-all: ^4.1.5 + prettier: ^2.2.1 + react: ^17.0.2 + react-dom: ^17.0.2 + rimraf: ^3.0.2 + ts-jest: ^26.5.6 + tslib: ^2.2.0 + typedoc: ^0.20.36 + typescript: ^4.2.4 + peerDependencies: + react: 17.0.2 + react-dom: 17.0.2 + languageName: unknown + linkType: soft + "@rocket.chat/peggy-loader@^0.26.0, @rocket.chat/peggy-loader@workspace:packages/peggy-loader": version: 0.0.0-use.local resolution: "@rocket.chat/peggy-loader@workspace:packages/peggy-loader" @@ -6080,6 +6119,15 @@ __metadata: languageName: node linkType: hard +"@types/react-dom@npm:^17.0.5": + version: 17.0.5 + resolution: "@types/react-dom@npm:17.0.5" + dependencies: + "@types/react": "*" + checksum: b3e23acb7be9405050abb4bcd443d14b16b2f3ded2d1853528199e4307b17b25186f905ddd236c27b6ef0297e6779b7fedd11fd24ee9170771be45a7e8e70f4b + languageName: node + linkType: hard + "@types/react-syntax-highlighter@npm:11.0.5": version: 11.0.5 resolution: "@types/react-syntax-highlighter@npm:11.0.5" @@ -6110,6 +6158,17 @@ __metadata: languageName: node linkType: hard +"@types/react@npm:^17.0.8": + version: 17.0.8 + resolution: "@types/react@npm:17.0.8" + dependencies: + "@types/prop-types": "*" + "@types/scheduler": "*" + csstype: ^3.0.2 + checksum: b59a3abafd240b2880f9e6a11b2b7f75165888260c56e95a77ed10a7dd55570b307fb2356eda7fde2a8e1255d2def11797e4ae9800ae114a1f578546acabda67 + languageName: node + linkType: hard + "@types/resize-observer-browser@npm:^0.1.5": version: 0.1.5 resolution: "@types/resize-observer-browser@npm:0.1.5"