diff --git a/.changeset/three-schools-promise.md b/.changeset/three-schools-promise.md new file mode 100644 index 0000000..3a2cc74 --- /dev/null +++ b/.changeset/three-schools-promise.md @@ -0,0 +1,5 @@ +--- +"@sandwich-ui/docs": patch +--- + +Add core and react docs diff --git a/PREVIOUS_CHANGELOGS.md b/PREVIOUS_CHANGELOGS.md deleted file mode 100644 index 8060c08..0000000 --- a/PREVIOUS_CHANGELOGS.md +++ /dev/null @@ -1,37 +0,0 @@ -# @mrsquaare/sandwich-ui - -## 0.3.1 - -### Patch Changes - -- [#3](https://github.com/MrSquaare/sandwich-ui/pull/3) [`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Bump packages, migrate to ESLint v9 - -## 0.3.0 - -### Minor Changes - -- [#1](https://github.com/MrSquaare/sandwich-ui/pull/1) [`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Initial version - ---- - -# @sandwich-ui/storybook - -## 0.1.1 - -### Patch Changes - -- [#3](https://github.com/MrSquaare/sandwich-ui/pull/3) [`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Bump packages, migrate to ESLint v9 - -- Updated dependencies [[`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f)]: - - @mrsquaare/sandwich-ui@0.3.1 - -## 0.1.0 - -### Minor Changes - -- [#1](https://github.com/MrSquaare/sandwich-ui/pull/1) [`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Initial version - -### Patch Changes - -- Updated dependencies [[`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87)]: - - @mrsquaare/sandwich-ui@0.3.0 diff --git a/README.md b/README.md index d8fd207..a056cb7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # sandwich-ui -A tasty React UI kit +A tasty UI kit ## Table of Contents @@ -13,42 +13,26 @@ A tasty React UI kit ## About -Sandwich UI is a React UI kit used for my personal projects. +Sandwich UI is a UI kit used for my personal projects. This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo), powered by [Turborepo](https://turborepo.org/). -It is composed of three projects: +It is composed of multiple packages: -- the [Sandwich UI library](sandwich-ui) -- the [Docs](docs) -- the [Storybook](storybook) +- [Core library](packages/core) +- [React library](packages/react) +- [React storybook](packages/react-storybook) +- [Docs](docs) ## Getting started -### Installation - -```sh -# npm -npm install @sandwich-ui/react - -# yarn -yarn add @sandwich-ui/react - -# pnpm -pnpm install @sandwich-ui/react -``` +- [Core library](docs/src/content/docs/core/getting-started.mdx) +- [React library](docs/src/content/docs/react/getting-started.mdx) ## Using -```jsx -import { Button } from "@sandwich-ui/react"; - -function Example() { - return ( - - ); -} -``` +- [Core library](docs/src/content/docs/core/using.mdx) +- [React library](docs/src/content/docs/react/using.mdx) ## Contributing diff --git a/docs/README.md b/docs/README.md index 77181af..678b994 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,3 @@ -# docs +# @sandwich-ui/docs The Sandwich UI docs \ No newline at end of file diff --git a/docs/astro.config.js b/docs/astro.config.js index 964c236..fc235eb 100644 --- a/docs/astro.config.js +++ b/docs/astro.config.js @@ -14,8 +14,12 @@ export default defineConfig({ }, sidebar: [ { - label: "Guide", - autogenerate: { directory: "guide" }, + label: "@sandwich-ui/core", + autogenerate: { directory: "core" }, + }, + { + label: "@sandwich-ui/react", + autogenerate: { directory: "react" }, }, ], }), diff --git a/docs/src/content/docs/core/getting-started.mdx b/docs/src/content/docs/core/getting-started.mdx new file mode 100644 index 0000000..f059b39 --- /dev/null +++ b/docs/src/content/docs/core/getting-started.mdx @@ -0,0 +1,56 @@ +--- +title: Getting started +description: How to start with Sandwich UI core +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +## Installation + +### Install and setup Panda CSS + +See the [Panda CSS documentation](https://panda-css.com/docs/overview/getting-started#installation) for installation and setup instructions. + +### Install the dependency + + + + +```bash +npm install @sandwich-ui/core +``` + + + + +```bash +yarn add @sandwich-ui/core +``` + + + + +```bash +pnpm install @sandwich-ui/core +``` + + + + +### Update the `panda.config.ts` + +```ts +import { defineConfig } from "@pandacss/dev"; +import sandwichUIPreset from "@sandwich-ui/core/preset"; + +export default defineConfig({ + preflight: true, + presets: ["@pandacss/dev/presets", sandwichUIPreset], + include: [ + "./node_modules/@sandwich-ui/core/dist/panda.buildinfo.json", + "**/*.html", + ], + importMap: "@sandwich-ui/core", + outdir: "./node_modules/@sandwich-ui/core/dist/styled-system", +}); +``` \ No newline at end of file diff --git a/docs/src/content/docs/core/using.mdx b/docs/src/content/docs/core/using.mdx new file mode 100644 index 0000000..034b123 --- /dev/null +++ b/docs/src/content/docs/core/using.mdx @@ -0,0 +1,34 @@ +--- +title: Using +description: How to use Sandwich UI +--- + +import { Aside } from '@astrojs/starlight/components'; + +## Using the styled system + +```jsx +import { css } from "@sandwich-ui/core/css"; + +function Example() { + return ( + `

Lorem ipsum

` + ); +} +``` + +## Using a recipe + +```jsx +import { ButtonRecipe } from "@sandwich-ui/core/recipes"; + +function Example() { + return ( + `` + ); +} +``` + + diff --git a/docs/src/content/docs/guide/getting-started.mdx b/docs/src/content/docs/guide/getting-started.mdx deleted file mode 100644 index 5ebefc3..0000000 --- a/docs/src/content/docs/guide/getting-started.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Getting started -description: How to start with Sandwich UI ---- - -## Installation - -import { Tabs, TabItem } from '@astrojs/starlight/components'; - - - -```bash -npm install @sandwich-ui/react -``` - - -```bash -yarn add @sandwich-ui/react -``` - - -```bash -pnpm install @sandwich-ui/react -``` - - \ No newline at end of file diff --git a/docs/src/content/docs/guide/using.md b/docs/src/content/docs/guide/using.md deleted file mode 100644 index f4ac8ea..0000000 --- a/docs/src/content/docs/guide/using.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Using -description: How to use Sandwich UI ---- - -```jsx -import { Button } from "@sandwich-ui/react"; - -function Example() { - return ( - - ); -} -``` \ No newline at end of file diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index 97154da..abcef93 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -1,17 +1,17 @@ --- title: Sandwich UI -description: A tasty React UI kit +description: A tasty UI kit template: splash hero: - tagline: A tasty React UI kit + tagline: A tasty UI kit image: file: ../../assets/houston.webp actions: - - text: Getting started - link: /guide/getting-started/ + - text: React Getting started + link: /react/getting-started/ icon: right-arrow variant: primary - - text: Storybook + - text: React Storybook link: https://sb-sandwich-ui.mrsquaare.fr/ icon: external --- diff --git a/docs/src/content/docs/react/getting-started.mdx b/docs/src/content/docs/react/getting-started.mdx new file mode 100644 index 0000000..082d2ae --- /dev/null +++ b/docs/src/content/docs/react/getting-started.mdx @@ -0,0 +1,57 @@ +--- +title: Getting started +description: How to start with Sandwich UI React +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; + +## Installation + +### Install and setup Panda CSS + +See the [Panda CSS documentation](https://panda-css.com/docs/overview/getting-started#installation) for installation and setup instructions. + +### Install the dependencies + + + + +```bash +npm install @sandwich-ui/core @sandwich-ui/react +``` + + + + +```bash +yarn add @sandwich-ui/core @sandwich-ui/react +``` + + + + +```bash +pnpm install @sandwich-ui/core @sandwich-ui/react +``` + + + + +### Update the `panda.config.ts` + +```ts +import { defineConfig } from "@pandacss/dev"; +import sandwichUIPreset from "@sandwich-ui/core/preset"; + +export default defineConfig({ + preflight: true, + presets: ["@pandacss/dev/presets", sandwichUIPreset], + include: [ + "./node_modules/@sandwich-ui/core/dist/panda.buildinfo.json", + "./node_modules/@sandwich-ui/react/dist/panda.buildinfo.json", + "**/*.{js,jsx,ts,tsx}", + ], + importMap: "@sandwich-ui/core", + outdir: "./node_modules/@sandwich-ui/core/dist/styled-system", +}); +``` \ No newline at end of file diff --git a/docs/src/content/docs/react/using.mdx b/docs/src/content/docs/react/using.mdx new file mode 100644 index 0000000..d7f8101 --- /dev/null +++ b/docs/src/content/docs/react/using.mdx @@ -0,0 +1,28 @@ +--- +title: Using +description: How to use Sandwich UI React +--- + +## Using the styled system + +```jsx +import { css } from "@sandwich-ui/core/css"; + +function Example() { + return ( +

Lorem ipsum

+ ); +} +``` + +## Using a component + +```jsx +import { Button } from "@sandwich-ui/react"; + +function Example() { + return ( + + ); +} +``` \ No newline at end of file diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000..4e88e8f --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,3 @@ +# @sandwich-ui/core + +The Sandwich UI core library \ No newline at end of file diff --git a/packages/react-storybook/CHANGELOG.md b/packages/react-storybook/CHANGELOG.md index 2342896..d86ede7 100644 --- a/packages/react-storybook/CHANGELOG.md +++ b/packages/react-storybook/CHANGELOG.md @@ -33,3 +33,23 @@ - Updated dependencies [[`5359733`](https://github.com/MrSquaare/sandwich-ui/commit/53597336cdedb347f282eb81e6917f59596194bf), [`0563f83`](https://github.com/MrSquaare/sandwich-ui/commit/0563f833a175875d357d8c5aa9a7efc37f2a3cee), [`5359733`](https://github.com/MrSquaare/sandwich-ui/commit/53597336cdedb347f282eb81e6917f59596194bf), [`5359733`](https://github.com/MrSquaare/sandwich-ui/commit/53597336cdedb347f282eb81e6917f59596194bf)]: - @sandwich-ui/core@0.1.0 - @sandwich-ui/react@0.4.0 + +## 0.1.1 + +### Patch Changes + +- [#3](https://github.com/MrSquaare/sandwich-ui/pull/3) [`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Bump packages, migrate to ESLint v9 + +- Updated dependencies [[`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f)]: + - @mrsquaare/sandwich-ui@0.3.1 + +## 0.1.0 + +### Minor Changes + +- [#1](https://github.com/MrSquaare/sandwich-ui/pull/1) [`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Initial version + +### Patch Changes + +- Updated dependencies [[`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87)]: + - @mrsquaare/sandwich-ui@0.3.0 diff --git a/packages/react-storybook/README.md b/packages/react-storybook/README.md index feda326..cb3fe2a 100644 --- a/packages/react-storybook/README.md +++ b/packages/react-storybook/README.md @@ -1,3 +1,3 @@ -# storybook +# @sandwich-ui/react-storybook -The Sandwich UI storybook \ No newline at end of file +The Sandwich UI React Storybook \ No newline at end of file diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 8370cc4..f7ad724 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -32,3 +32,19 @@ - Updated dependencies [[`5359733`](https://github.com/MrSquaare/sandwich-ui/commit/53597336cdedb347f282eb81e6917f59596194bf), [`5359733`](https://github.com/MrSquaare/sandwich-ui/commit/53597336cdedb347f282eb81e6917f59596194bf)]: - @sandwich-ui/core@0.1.0 + +--- + +# @mrsquaare/sandwich-ui + +## 0.3.1 + +### Patch Changes + +- [#3](https://github.com/MrSquaare/sandwich-ui/pull/3) [`b2f564c`](https://github.com/MrSquaare/sandwich-ui/commit/b2f564cbfdd825519727065e9037e2f6c6d9c02f) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Bump packages, migrate to ESLint v9 + +## 0.3.0 + +### Minor Changes + +- [#1](https://github.com/MrSquaare/sandwich-ui/pull/1) [`67e57ad`](https://github.com/MrSquaare/sandwich-ui/commit/67e57ad4e631cc20297386ad3099dfe48aceae87) Thanks [@MrSquaare](https://github.com/MrSquaare)! - Initial version diff --git a/packages/react/README.md b/packages/react/README.md index 865228a..f00d698 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -1,3 +1,3 @@ -# sandwich-ui +# @sandwich-ui/react -The Sandwich UI library \ No newline at end of file +The Sandwich UI React library \ No newline at end of file