├── .eslintignore ├── .eslintrc.js ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ └── config.yml ├── release-drafter.yaml └── workflows │ ├── deploy-docs.yaml │ ├── release-drafter.yaml │ └── update-changelog.yaml ├── .gitignore ├── .prettierrc.js ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets ├── stacks-logo.png └── stacks-preview.png ├── bun.lockb ├── docs ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── babel.config.js ├── bun.lockb ├── components │ ├── Components.module.css │ ├── Components.tsx │ ├── Device.module.css │ ├── Device.tsx │ ├── Divider.module.css │ ├── Divider.tsx │ ├── Example.module.css │ ├── Example.tsx │ ├── Placeholder.module.css │ ├── Placeholder.tsx │ └── svg │ │ ├── icon-design.svg │ │ ├── icon-glasses.svg │ │ ├── icon-grid.svg │ │ ├── icon-multiple-devices.svg │ │ ├── icon-smartphone-tablet.svg │ │ └── stacks-logo.svg ├── examples │ ├── bleed │ │ └── bleed.tsx │ ├── box │ │ ├── align-x.tsx │ │ ├── align-y.tsx │ │ ├── flex.tsx │ │ ├── gap.tsx │ │ ├── margin.tsx │ │ ├── padding.tsx │ │ └── size.tsx │ ├── columns │ │ ├── align-x.tsx │ │ ├── align-y.tsx │ │ ├── collapse-below.tsx │ │ ├── flex.tsx │ │ └── reverse.tsx │ ├── float-box │ │ └── float-box.tsx │ ├── grid │ │ └── grid.tsx │ ├── inline │ │ ├── align-x.tsx │ │ ├── align-y.tsx │ │ └── space.tsx │ ├── inset │ │ └── inset.tsx │ ├── rows │ │ ├── align-x.tsx │ │ ├── align-y.tsx │ │ ├── flex.tsx │ │ └── rows.tsx │ ├── stack │ │ ├── align.tsx │ │ ├── divider.tsx │ │ ├── horizontal.tsx │ │ └── space.tsx │ └── tiles │ │ ├── columns.tsx │ │ ├── fill.tsx │ │ └── space.tsx ├── next-env.d.ts ├── next.config.js ├── package.json ├── pages │ ├── _app.mdx │ ├── _meta.json │ ├── about.mdx │ ├── docs │ │ ├── _meta.json │ │ ├── components.mdx │ │ ├── components │ │ │ ├── _meta.json │ │ │ ├── bleed.mdx │ │ │ ├── box.mdx │ │ │ ├── columns.mdx │ │ │ ├── float-box.mdx │ │ │ ├── grid.mdx │ │ │ ├── hidden.mdx │ │ │ ├── inline.mdx │ │ │ ├── inset.mdx │ │ │ ├── rows.mdx │ │ │ ├── stack.mdx │ │ │ └── tiles.mdx │ │ ├── getting-started.mdx │ │ ├── hooks.mdx │ │ ├── index.mdx │ │ ├── migration-guide.mdx │ │ ├── types.mdx │ │ └── usage.mdx │ └── index.mdx ├── postcss.config.js ├── public │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── og-slogan.png │ ├── og-website.png │ └── stacks-preview.png ├── styles.css ├── tailwind.config.js ├── theme.config.jsx ├── tsconfig.json └── unistyles.ts ├── example ├── .gitignore ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── anonymous │ │ │ │ └── stacks │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ └── splashscreen_image.png │ │ │ ├── drawable-mdpi │ │ │ └── splashscreen_image.png │ │ │ ├── drawable-xhdpi │ │ │ └── splashscreen_image.png │ │ │ ├── drawable-xxhdpi │ │ │ └── splashscreen_image.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── splashscreen_image.png │ │ │ ├── drawable │ │ │ ├── rn_edit_text_material.xml │ │ │ └── splashscreen.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ └── colors.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── app │ ├── _layout.tsx │ ├── bleed │ │ └── index.tsx │ ├── columns │ │ └── index.tsx │ ├── components │ │ ├── Divider.tsx │ │ ├── Placeholder.tsx │ │ └── Screen.tsx │ ├── float-box │ │ └── index.tsx │ ├── grid │ │ └── index.tsx │ ├── index.tsx │ ├── inline │ │ └── index.tsx │ ├── inset │ │ └── index.tsx │ ├── rows │ │ └── index.tsx │ ├── stack │ │ └── index.tsx │ ├── styles │ │ └── unistyles.ts │ └── tiles │ │ └── index.tsx ├── assets │ ├── adaptive-icon.png │ ├── favicon.png │ ├── icon.png │ └── splash.png ├── babel.config.js ├── bun.lockb ├── ios │ ├── .gitignore │ ├── .xcode.env │ ├── Podfile │ ├── Podfile.lock │ ├── Podfile.properties.json │ ├── stacks.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── stacks.xcscheme │ ├── stacks.xcworkspace │ │ └── contents.xcworkspacedata │ └── stacks │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── App-Icon-1024x1024@1x.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── SplashScreen.imageset │ │ │ ├── Contents.json │ │ │ └── image.png │ │ └── SplashScreenBackground.imageset │ │ │ ├── Contents.json │ │ │ └── image.png │ │ ├── Info.plist │ │ ├── SplashScreen.storyboard │ │ ├── Supporting │ │ └── Expo.plist │ │ ├── main.m │ │ ├── noop-file.swift │ │ ├── stacks-Bridging-Header.h │ │ └── stacks.entitlements ├── metro.config.js ├── package.json └── tsconfig.json ├── package.json ├── plugin └── index.js ├── src ├── components │ ├── Bleed.tsx │ ├── Box.tsx │ ├── Column.tsx │ ├── Columns.tsx │ ├── FloatBox.tsx │ ├── Grid.tsx │ ├── Hidden.tsx │ ├── Inline.tsx │ ├── Inset.tsx │ ├── Row.tsx │ ├── Rows.tsx │ ├── Stack.tsx │ ├── Tiles.tsx │ └── index.ts ├── hooks │ ├── index.ts │ ├── useBreakpointComparators.ts │ ├── useDebugStyle.ts │ ├── useResponsiveProp.ts │ └── useSpacingHelpers.ts ├── index.ts ├── polymorphic.ts ├── types.ts └── utils.ts ├── tsconfig.json └── tsup.config.ts /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [require.resolve('@grapp/eslint-config/react-native')], 3 | } 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: mobily 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: File a bug report 3 | labels: 4 | - 'needs review' 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this bug report! 10 | 11 | Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already: 12 | - Issues tab: https://github.com/grapp-dev/stacks/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc 13 | - Closed issues tab: https://github.com/grapp-dev/stacks/issues?q=is%3Aissue+is%3Aclosed 14 | - Discussions tab: https://github.com/grapp-dev/stacks/discussions 15 | - type: markdown 16 | attributes: 17 | value: | 18 | ## Required information 19 | - type: textarea 20 | id: description 21 | attributes: 22 | label: Description 23 | description: Please provide a clear, concise and descriptive explanation of what the bug is. Include screenshots or a video if needed by drag and dropping them to the box below. 24 | validations: 25 | required: true 26 | 27 | - type: input 28 | id: repro 29 | attributes: 30 | label: Snack or a link to a repository (optional) 31 | description: | 32 | Please provide a Snack (https://snack.expo.io/) or a link to a repository on GitHub under your username that reproduces the issue. 33 | Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve. 34 | Issues without a reproduction are likely to stale. 35 | placeholder: Link to a Snack or a GitHub repository 36 | 37 | - type: input 38 | id: stacks-version 39 | attributes: 40 | label: Stacks version 41 | description: What version of Stacks are you using? 42 | placeholder: 3.0.0 43 | validations: 44 | required: true 45 | 46 | - type: input 47 | id: react-native-version 48 | attributes: 49 | label: React Native version 50 | description: What version of react-native are you using? 51 | placeholder: 0.73.0 52 | validations: 53 | required: true 54 | 55 | - type: dropdown 56 | id: platforms 57 | attributes: 58 | label: Platforms 59 | description: On what platform your application is running on? 60 | multiple: true 61 | options: 62 | - Android 63 | - iOS 64 | - React Native Web 65 | - SSR 66 | - React Native macOS 67 | validations: 68 | required: true 69 | 70 | - type: dropdown 71 | id: engine 72 | attributes: 73 | label: Engine 74 | description: Which engine do you use? 75 | multiple: false 76 | options: 77 | - Hermes 78 | - JSC 79 | validations: 80 | required: true 81 | 82 | - type: dropdown 83 | id: architecture 84 | attributes: 85 | label: Architecture 86 | description: Which architecture do you use? 87 | multiple: false 88 | options: 89 | - Paper (old) 90 | - Fabric (new) 91 | validations: 92 | required: true 93 | 94 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Question 4 | url: https://github.com/grapp-dev/stacks/discussions/categories/q-a 5 | about: Please ask and answer questions here. 6 | - name: Feature Request 7 | url: https://github.com/grapp-dev/stacks/discussions/categories/ideas 8 | about: Please submit feature requests, feedback and ideas here. 9 | -------------------------------------------------------------------------------- /.github/release-drafter.yaml: -------------------------------------------------------------------------------- 1 | name-template: 'v$RESOLVED_VERSION' 2 | tag-template: 'v$RESOLVED_VERSION' 3 | categories: 4 | - title: 🛠 Breaking Changes 5 | labels: 6 | - 'breaking change' 7 | - title: 🚀 Features 8 | labels: 9 | - feature 10 | - enhancement 11 | - title: 🐛 Bug Fixes 12 | labels: 13 | - bugfix 14 | - fix 15 | - title: 🚩 Other Changes 16 | labels: 17 | - chore 18 | category-template: '#### $TITLE' 19 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 20 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. 21 | version-resolver: 22 | major: 23 | labels: 24 | - 'major' 25 | minor: 26 | labels: 27 | - 'minor' 28 | patch: 29 | labels: 30 | - 'patch' 31 | default: patch 32 | template: | 33 | ### What's Changed 34 | 35 | $CHANGES 36 | 37 | autolabeler: 38 | - label: 'bugfix' 39 | branch: 40 | - '/fix\/.+/' 41 | title: 42 | - '/fix/i' 43 | - label: 'feature' 44 | branch: 45 | - '/(feat|feature)\/.+/' 46 | title: 47 | - '/feat/i' 48 | - label: 'chore' 49 | title: 50 | - '/(chore|docs)/i' 51 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yaml: -------------------------------------------------------------------------------- 1 | name: Build & Deploy docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - docs/** 9 | 10 | jobs: 11 | deploy: 12 | permissions: 13 | contents: write 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: 18 20 | - uses: oven-sh/setup-bun@v1 21 | - uses: actions/cache@v4 22 | with: 23 | path: | 24 | ~/.npm 25 | ${{ github.workspace }}/docs/.next/cache 26 | key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} 27 | restore-keys: | 28 | ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}- 29 | - run: | 30 | bun install 31 | cd docs 32 | bun install 33 | bun run build 34 | cd .. 35 | - uses: SamKirkland/FTP-Deploy-Action@v4.3.5 36 | with: 37 | server: ${{ secrets.GRAPP_FTP_SERVER_URL }} 38 | username: ${{ secrets.GRAPP_FTP_USERNAME }} 39 | password: ${{ secrets.GRAPP_FTP_PASSWORD }} 40 | local-dir: './docs/out/' 41 | server-dir: 'stacks/' 42 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yaml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | types: [opened, reopened, synchronize] 9 | pull_request_target: 10 | types: [opened, reopened, synchronize] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | update_release_draft: 17 | permissions: 18 | contents: write 19 | pull-requests: write 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: release-drafter/release-drafter@v5 23 | with: 24 | config-name: release-drafter.yaml 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yaml: -------------------------------------------------------------------------------- 1 | name: Update Changelog 2 | 3 | on: 4 | release: 5 | types: [released] 6 | 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | 11 | permissions: 12 | contents: write 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | with: 17 | ref: ${{ github.event.release.target_commitish }} 18 | 19 | - uses: stefanzweifel/changelog-updater-action@v1 20 | with: 21 | latest-version: ${{ github.event.release.tag_name }} 22 | release-notes: ${{ github.event.release.body }} 23 | 24 | - uses: stefanzweifel/git-auto-commit-action@v5 25 | with: 26 | branch: ${{ github.event.release.target_commitish }} 27 | commit_message: 'chore: update CHANGELOG.md' 28 | file_pattern: CHANGELOG.md 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .buildlog/ 8 | .history 9 | .svn/ 10 | 11 | # Editors 12 | *.iml 13 | *.ipr 14 | *.iws 15 | .atom/ 16 | .idea/ 17 | .vscode/ 18 | 19 | # Bun 20 | dist/ 21 | node_modules/ 22 | .mind/ 23 | lib/ 24 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@grapp/prettier-config') 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## v3.1.0 - 2024-04-11 4 | 5 | ### What's Changed 6 | 7 | #### 🚀 Features 8 | 9 | - feat(Box): add support for `borderTopWidth`, `borderRightWidth`, `borderBottomWidth` and `borderLeftWidth` @mobily (#49) 10 | 11 | ## v3.0.3 - 2024-04-09 12 | 13 | ### What's Changed 14 | 15 | #### 🐛 Bug Fixes 16 | 17 | - fix: allow passing 0 to `multiply`/`divide` functions @mobily (#48) 18 | 19 | ## v3.0.2 - 2024-04-09 20 | 21 | ### What's Changed 22 | 23 | #### 🐛 Bug Fixes 24 | 25 | - fix: improve `Row.from` and `Column.from` type signatures @mobily (#47) 26 | 27 | ## v3.0.1 - 2024-04-08 28 | 29 | ### What's Changed 30 | 31 | #### 🐛 Bug Fixes 32 | 33 | - fix: 🐛 Export all props of the components @mobily (#46) 34 | 35 | ## v3.0.0 - 2024-04-08 36 | 37 | ### What's Changed 38 | 39 | `Stacks` is now published in the `@grapp` scope. So, you need to fix the imports first. Don't worry, it's a quick fix! 40 | 41 | ~`@mobily/stacks`~ → `@grapp/stacks` 42 | 43 | ### General 44 | 45 | The `Stacks` library has been completely rewritten in TypeScript, so it no longer supports ReScript. 46 | [React Native Unistyles](https://github.com/jpudysz/react-native-unistyles) is a core dependency. 47 | The `flex gap` values now define spaces between components (excluding `Columns`, see [this](https://github.com/Doist/reactist/pull/739#issuecomment-1373825792)). 48 | 49 | ### Components 50 | 51 | #### Provider 52 | 53 | `Stacks` now uses Unistyles, which means that you can remove `StacksProvider` from the React component tree and provide configuration values to the `Unistyles` theme object, as described [here](/docs/getting-started). 54 | 55 | #### Box 56 | 57 | Several new props have been added to the `Box` component, including `width`, `height`, `gap`, `rowGap`, `columnGap`, `backgroundColor`, `borderRadius`, `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomLeftRadius`, `borderBottomRightRadius`, `borderColor`, `borderWidth`, and `debuggable`. 58 | 59 | #### Columns 60 | 61 | The `defaultWidth` prop is now `defaultFlex`, and the `width` prop has been changed to `flex`. 62 | Use `Column.from` to create a custom `Column` component. 63 | The `markAsColumn` prop has been removed. 64 | 65 | #### FillView 66 | 67 | `FillView` has been renamed to `FloatBox`. 68 | The `unset` helper has been removed, and the positioning has been fixed if you don't provide all offset values. 69 | 70 | #### Hidden 71 | 72 | Experimental support for hiding elements by transforming the React component tree with the provided `Babel` plugin has been added. 73 | 74 | #### Inline 75 | 76 | The `spaceX` and `spaceY` props have been added. 77 | 78 | #### Rows 79 | 80 | The `defaultHeight` prop is now `defaultFlex`, and the `height` prop has been changed to `flex`. 81 | Use `Row.from` to create a custom `Row` component. 82 | The `markAsRow` prop has been removed. 83 | 84 | #### Tiles 85 | 86 | The `spaceX` and `spaceY` props have been added, and `empty` has been renamed to `fill`. 87 | 88 | ### Hooks 89 | 90 | - `useStacks` has been removed, as `StacksProvider` is no longer needed. 91 | - `useCurrentBreakpoint` has been removed. To get the current breakpoint name, you can use `useStyles` from Unistyles. 92 | - `useSpacing` has been removed. To achieve the same result, you can use `useSpacingHelpers` and `multiply`. 93 | - `useWindowDimensions` has been removed. You can now get the screen dimensions with `UnistylesRuntime.screen`. 94 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Marcin Dziewulski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stacks · [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/grapp-dev/stacks/blob/master/LICENSE) [![npm](https://img.shields.io/npm/v/@grapp/stacks.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/@grapp/stacks) 2 | 3 | Stacks, a set of components for building layouts in React Native 4 | 5 | > A set of components for building layouts in React Native. Powered by [React Native Unistyles](https://github.com/jpudysz/react-native-unistyles). 6 | 7 | `Stacks` primarily aims to simplify building and maintaining layouts, making it quick and easy. It follows a design principle that suggests components should not include any surrounding white space. Instead, layout components should solely own spacing between elements. 8 | 9 | ## Documentation 10 | 11 | Full documentation can be found [here](https://stacks.grapp.dev). 12 | 13 | ## Installation 14 | 15 | To install Stacks, you should use your preferred package manager. 16 | 17 | ```shell 18 | bun add @grapp/stacks 19 | ``` 20 | 21 | ```shell 22 | pnpm add @grapp/stacks 23 | ``` 24 | 25 | ```shell 26 | yarn add @grapp/stacks 27 | ``` 28 | 29 | ```shell 30 | npm install @grapp/stacks --save 31 | ``` 32 | 33 | ## Discord 34 | 35 | Join [Discord](https://discord.gg/DhS6neVJBK) to get involved with the community, ask questions, and share tips. 36 | 37 | ## License 38 | 39 | The MIT License. 40 | 41 | See [LICENSE](LICENSE) 42 | -------------------------------------------------------------------------------- /assets/stacks-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/assets/stacks-logo.png -------------------------------------------------------------------------------- /assets/stacks-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/assets/stacks-preview.png -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/bun.lockb -------------------------------------------------------------------------------- /docs/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [require.resolve('@grapp/eslint-config/default')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore 2 | 3 | # Logs 4 | 5 | logs 6 | _.log 7 | npm-debug.log_ 8 | yarn-debug.log* 9 | yarn-error.log* 10 | lerna-debug.log* 11 | .pnpm-debug.log* 12 | 13 | # Caches 14 | 15 | .cache 16 | 17 | # Diagnostic reports (https://nodejs.org/api/report.html) 18 | 19 | report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json 20 | 21 | # Runtime data 22 | 23 | pids 24 | _.pid 25 | _.seed 26 | *.pid.lock 27 | 28 | # Directory for instrumented libs generated by jscoverage/JSCover 29 | 30 | lib-cov 31 | 32 | # Coverage directory used by tools like istanbul 33 | 34 | coverage 35 | *.lcov 36 | 37 | # nyc test coverage 38 | 39 | .nyc_output 40 | 41 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 42 | 43 | .grunt 44 | 45 | # Bower dependency directory (https://bower.io/) 46 | 47 | bower_components 48 | 49 | # node-waf configuration 50 | 51 | .lock-wscript 52 | 53 | # Compiled binary addons (https://nodejs.org/api/addons.html) 54 | 55 | build/Release 56 | 57 | # Dependency directories 58 | 59 | node_modules/ 60 | jspm_packages/ 61 | 62 | # Snowpack dependency directory (https://snowpack.dev/) 63 | 64 | web_modules/ 65 | 66 | # TypeScript cache 67 | 68 | *.tsbuildinfo 69 | 70 | # Optional npm cache directory 71 | 72 | .npm 73 | 74 | # Optional eslint cache 75 | 76 | .eslintcache 77 | 78 | # Optional stylelint cache 79 | 80 | .stylelintcache 81 | 82 | # Microbundle cache 83 | 84 | .rpt2_cache/ 85 | .rts2_cache_cjs/ 86 | .rts2_cache_es/ 87 | .rts2_cache_umd/ 88 | 89 | # Optional REPL history 90 | 91 | .node_repl_history 92 | 93 | # Output of 'npm pack' 94 | 95 | *.tgz 96 | 97 | # Yarn Integrity file 98 | 99 | .yarn-integrity 100 | 101 | # dotenv environment variable files 102 | 103 | .env 104 | .env.development.local 105 | .env.test.local 106 | .env.production.local 107 | .env.local 108 | 109 | # parcel-bundler cache (https://parceljs.org/) 110 | 111 | .parcel-cache 112 | 113 | # Next.js build output 114 | 115 | .next 116 | out 117 | 118 | # Nuxt.js build / generate output 119 | 120 | .nuxt 121 | dist 122 | 123 | # Gatsby files 124 | 125 | # Comment in the public line in if your project uses Gatsby and not Next.js 126 | 127 | # https://nextjs.org/blog/next-9-1#public-directory-support 128 | 129 | # public 130 | 131 | # vuepress build output 132 | 133 | .vuepress/dist 134 | 135 | # vuepress v2.x temp and cache directory 136 | 137 | .temp 138 | 139 | # Docusaurus cache and generated files 140 | 141 | .docusaurus 142 | 143 | # Serverless directories 144 | 145 | .serverless/ 146 | 147 | # FuseBox cache 148 | 149 | .fusebox/ 150 | 151 | # DynamoDB Local files 152 | 153 | .dynamodb/ 154 | 155 | # TernJS port file 156 | 157 | .tern-port 158 | 159 | # Stores VSCode versions used for testing VSCode extensions 160 | 161 | .vscode-test 162 | 163 | # yarn v2 164 | 165 | .yarn/cache 166 | .yarn/unplugged 167 | .yarn/build-state.yml 168 | .yarn/install-state.gz 169 | .pnp.* 170 | 171 | # IntelliJ based IDEs 172 | .idea 173 | 174 | # Finder (MacOS) folder config 175 | .DS_Store 176 | .htaccess 177 | -------------------------------------------------------------------------------- /docs/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@grapp/prettier-config') 2 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = api => { 4 | api.cache(true); 5 | 6 | return { 7 | presets: ['next/babel'], 8 | plugins: [ 9 | [ 10 | 'module-resolver', 11 | { 12 | alias: { 13 | 'react-native': path.join(__dirname, 'node_modules', 'react-native-web'), 14 | }, 15 | }, 16 | ], 17 | ], 18 | }; 19 | }; 20 | -------------------------------------------------------------------------------- /docs/bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/bun.lockb -------------------------------------------------------------------------------- /docs/components/Components.module.css: -------------------------------------------------------------------------------- 1 | .root { 2 | margin: 30px 0 20px; 3 | } 4 | 5 | .card { 6 | min-height: 175px; 7 | padding: 8px; 8 | } 9 | 10 | .link { 11 | color: unset; 12 | text-decoration: unset; 13 | } 14 | 15 | .title { 16 | padding: 0 8px 8px; 17 | text-align: center; 18 | font-size: 0.9rem; 19 | font-weight: 500; 20 | } 21 | 22 | .content { 23 | position: relative; 24 | height: 100%; 25 | background-color: #EAECEE; 26 | border-radius: 4px; 27 | padding: 12px; 28 | display: flex; 29 | flex-direction: column; 30 | flex: 1; 31 | 32 | :global(.dark) & { 33 | background-color: #191D27; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /docs/components/Device.module.css: -------------------------------------------------------------------------------- 1 | .root { 2 | display: flex; 3 | flex-direction: row; 4 | 5 | @media (max-width: 480px) { 6 | transform: scale(0.8); 7 | } 8 | 9 | @media (max-width: 380px) { 10 | transform: scale(0.7); 11 | } 12 | 13 | @media (max-width: 330px) { 14 | transform: scale(0.6); 15 | } 16 | 17 | @media (max-width: 310px) { 18 | transform: scale(0.5); 19 | } 20 | } 21 | 22 | .title { 23 | margin-bottom: 16px; 24 | } 25 | 26 | .iphone { 27 | display: block; 28 | color: #fff; 29 | text-align: center; 30 | background-color: #fff; 31 | border: solid #111; 32 | margin-bottom: 2em; 33 | position: relative; 34 | box-shadow: 0 0.5em 2em 0.2em rgba(0, 0, 0, 0.33), 0 0 0 0.5px #000 inset; 35 | width: 380px; 36 | height: 818px; 37 | border-width: 24px; 38 | border-radius: 56px; 39 | } 40 | 41 | .iphoneX { 42 | position: relative; 43 | margin: 40px 0; 44 | width: 360px; 45 | height: 780px; 46 | background-color: #fff; 47 | border-radius: 40px; 48 | box-shadow: 0px 0px 0px 11px #1f1f1f, 0px 0px 0px 13px #191919, 0px 0px 0px 20px #111; 49 | display: flex; 50 | flex-direction: row; 51 | } 52 | 53 | :is(html[class~=dark]) { 54 | .iphoneX { 55 | background-color: #232731; 56 | } 57 | } 58 | 59 | .iphoneX:before, .iphoneX:after { 60 | content: ""; 61 | position: absolute; 62 | z-index: 2; 63 | left: 50%; 64 | transform: translateX(-50%); 65 | } 66 | 67 | .iphoneX:after { 68 | bottom: 7px; 69 | width: 140px; 70 | height: 4px; 71 | background-color: #111; 72 | border-radius: 10px; 73 | } 74 | 75 | .iphoneX:before { 76 | top: 0px; 77 | width: 56%; 78 | height: 30px; 79 | background-color: #1f1f1f; 80 | border-radius: 0px 0px 40px 40px; 81 | } 82 | 83 | .iphoneX .speaker, 84 | .iphoneX .camera, 85 | .iphoneX .action-button { 86 | position: absolute; 87 | z-index: 2; 88 | display: block; 89 | color: transparent; 90 | } 91 | 92 | .iphoneX .speaker { 93 | top: 0px; 94 | left: 50%; 95 | transform: translate(-50%, 6px); 96 | height: 8px; 97 | width: 15%; 98 | background-color: #101010; 99 | border-radius: 8px; 100 | box-shadow: inset 0px -3px 3px 0px rgba(255, 255, 255, 0.2); 101 | } 102 | 103 | .iphoneX .camera { 104 | left: 10%; 105 | top: 0px; 106 | transform: translate(180px, 4px); 107 | width: 12px; 108 | height: 12px; 109 | background-color: #101010; 110 | border-radius: 12px; 111 | box-shadow: inset 0px -3px 2px 0px rgba(255, 255, 255, 0.2); 112 | } 113 | 114 | .iphoneX .camera:after { 115 | content: ""; 116 | position: absolute; 117 | background-color: #2d4d76; 118 | width: 6px; 119 | height: 6px; 120 | top: 2px; 121 | left: 2px; 122 | top: 3px; 123 | left: 3px; 124 | display: block; 125 | border-radius: 4px; 126 | box-shadow: inset 0px -2px 2px rgba(0, 0, 0, 0.5); 127 | } 128 | 129 | .iphoneX .screen { 130 | padding: 30px 1px 24px; 131 | position: relative; 132 | display: flex; 133 | flex-direction: column; 134 | flex: 1; 135 | border-radius: 38px; 136 | overflow: hidden; 137 | } 138 | 139 | .iphoneX .content { 140 | padding: 16px; 141 | display: flex; 142 | flex: 1; 143 | flex-direction: column; 144 | } 145 | -------------------------------------------------------------------------------- /docs/components/Device.tsx: -------------------------------------------------------------------------------- 1 | import styles from './Device.module.css'; 2 | 3 | import * as React from 'react'; 4 | 5 | type Props = React.PropsWithChildren<{ 6 | readonly title?: string; 7 | }>; 8 | 9 | export const Device = (props: Props) => { 10 | const { children, title } = props; 11 | 12 | return ( 13 |
14 |
15 |
16 |
17 |
18 |
19 | {title && ( 20 |

23 | {title} 24 |

25 | )} 26 | {children} 27 |
28 |
29 |
30 |
31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /docs/components/Divider.module.css: -------------------------------------------------------------------------------- 1 | .root { 2 | background-color: rgba(11, 15, 26, 0.14); 3 | height: 1px; 4 | } 5 | 6 | :is(html[class~=dark]) { 7 | .root { 8 | background-color: rgba(255, 137, 175, 0.3); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/components/Divider.tsx: -------------------------------------------------------------------------------- 1 | import styles from './Divider.module.css'; 2 | 3 | import * as React from 'react'; 4 | 5 | export const Divider = () => { 6 | return
; 7 | }; 8 | 9 | Divider.displayName = 'Divider'; 10 | -------------------------------------------------------------------------------- /docs/components/Placeholder.module.css: -------------------------------------------------------------------------------- 1 | .label { 2 | font-family: 'JetBrains Mono'; 3 | font-size: 13px; 4 | color: rgba(11, 15, 26, 1.0); 5 | } 6 | 7 | :is(html[class~=dark]) { 8 | .label { 9 | color: #2BBBB2; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/components/Placeholder.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { useTheme } from 'nextra-theme-docs'; 6 | 7 | import styles from './Placeholder.module.css'; 8 | 9 | type Props = { 10 | readonly width?: number; 11 | readonly height?: number; 12 | readonly label?: string; 13 | readonly flex?: 'fluid' | 'content'; 14 | }; 15 | 16 | export const Placeholder = (props: Props) => { 17 | const { label, width, height = 46, flex } = props; 18 | 19 | const theme = useTheme(); 20 | 21 | return ( 22 | 30 | {label && {label}} 31 | 32 | ); 33 | }; 34 | 35 | Placeholder.displayName = 'Placeholder'; 36 | -------------------------------------------------------------------------------- /docs/components/svg/icon-design.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/components/svg/icon-glasses.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/components/svg/icon-grid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/components/svg/icon-multiple-devices.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/components/svg/icon-smartphone-tablet.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/components/svg/stacks-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/examples/bleed/bleed.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Bleed, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ); 38 | }; 39 | 40 | export default Example; 41 | -------------------------------------------------------------------------------- /docs/examples/box/align-x.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | }; 37 | 38 | export default Example; 39 | -------------------------------------------------------------------------------- /docs/examples/box/align-y.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | }; 37 | 38 | export default Example; 39 | -------------------------------------------------------------------------------- /docs/examples/box/flex.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ); 60 | }; 61 | 62 | export default Example; 63 | -------------------------------------------------------------------------------- /docs/examples/box/gap.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | ); 26 | }; 27 | 28 | export default Example; 29 | -------------------------------------------------------------------------------- /docs/examples/box/margin.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ); 33 | }; 34 | 35 | export default Example; 36 | -------------------------------------------------------------------------------- /docs/examples/box/padding.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ); 33 | }; 34 | 35 | export default Example; 36 | -------------------------------------------------------------------------------- /docs/examples/box/size.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default Example; 27 | -------------------------------------------------------------------------------- /docs/examples/columns/align-x.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Columns, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default Example; 50 | -------------------------------------------------------------------------------- /docs/examples/columns/align-y.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Columns, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ); 32 | }; 33 | 34 | export default Example; 35 | -------------------------------------------------------------------------------- /docs/examples/columns/collapse-below.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Columns } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | }; 17 | 18 | export default Example; 19 | -------------------------------------------------------------------------------- /docs/examples/columns/flex.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Column, Columns, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | ); 110 | }; 111 | 112 | export default Example; 113 | -------------------------------------------------------------------------------- /docs/examples/columns/reverse.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Column, Columns } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | }; 20 | 21 | export default Example; 22 | -------------------------------------------------------------------------------- /docs/examples/float-box/float-box.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Box, FloatBox } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ); 27 | }; 28 | 29 | export default Example; 30 | -------------------------------------------------------------------------------- /docs/examples/grid/grid.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Grid, Row, Rows } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | <> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default Example; 27 | -------------------------------------------------------------------------------- /docs/examples/inline/align-x.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Inline } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ); 20 | }; 21 | 22 | export default Example; 23 | -------------------------------------------------------------------------------- /docs/examples/inline/align-y.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Inline } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default Example; 24 | -------------------------------------------------------------------------------- /docs/examples/inline/space.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Inline, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ); 34 | }; 35 | 36 | export default Example; 37 | -------------------------------------------------------------------------------- /docs/examples/inset/inset.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Inset, Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | ); 37 | }; 38 | 39 | export default Example; 40 | -------------------------------------------------------------------------------- /docs/examples/rows/align-x.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Row, Rows } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default Example; 24 | -------------------------------------------------------------------------------- /docs/examples/rows/align-y.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Row, Rows } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default Example; 24 | -------------------------------------------------------------------------------- /docs/examples/rows/flex.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Row, Rows } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | }; 19 | 20 | export default Example; 21 | -------------------------------------------------------------------------------- /docs/examples/rows/rows.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Row, Rows } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default Example; 24 | -------------------------------------------------------------------------------- /docs/examples/stack/align.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | }; 17 | 18 | export default Example; 19 | -------------------------------------------------------------------------------- /docs/examples/stack/divider.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Stack } from '@grapp/stacks'; 4 | 5 | import { Divider } from '../../components/Divider'; 6 | import { Placeholder } from '../../components/Placeholder'; 7 | 8 | const Example = () => { 9 | return ( 10 | }> 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | 19 | export default Example; 20 | -------------------------------------------------------------------------------- /docs/examples/stack/horizontal.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | ); 18 | }; 19 | 20 | export default Example; 21 | -------------------------------------------------------------------------------- /docs/examples/stack/space.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Stack } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | }; 20 | 21 | export default Example; 22 | -------------------------------------------------------------------------------- /docs/examples/tiles/columns.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Tiles } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | }; 22 | 23 | export default Example; 24 | -------------------------------------------------------------------------------- /docs/examples/tiles/fill.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Tiles } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ); 16 | }; 17 | 18 | export default Example; 19 | -------------------------------------------------------------------------------- /docs/examples/tiles/space.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { Stack, Tiles } from '@grapp/stacks'; 4 | 5 | import { Placeholder } from '../../components/Placeholder'; 6 | 7 | const Example = () => { 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default Example; 27 | -------------------------------------------------------------------------------- /docs/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /docs/next.config.js: -------------------------------------------------------------------------------- 1 | const nextra = require('nextra'); 2 | const path = require('path'); 3 | 4 | const { getNextraOptions, getWithNextraOptions } = require('@grapp/nextra-theme/config/nextra'); 5 | 6 | const withNextra = nextra(getNextraOptions()); 7 | 8 | module.exports = withNextra( 9 | getWithNextraOptions({ 10 | transpilePackages: ['react-native-unistyles', '@grapp/stacks'], 11 | webpack: config => { 12 | Object.assign(config.resolve.alias, { 13 | react: path.resolve(__dirname, '..', 'node_modules', 'react'), 14 | 'react-native$': path.resolve(__dirname, '..', 'node_modules', 'react-native'), 15 | }); 16 | }, 17 | }), 18 | ); 19 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grapp/stacks-docs", 3 | "module": "index.ts", 4 | "license": "MIT", 5 | "private": true, 6 | "scripts": { 7 | "dev": "next", 8 | "build": "next build", 9 | "start": "next start" 10 | }, 11 | "devDependencies": { 12 | "@grapp/eslint-config": "^0.1.1", 13 | "@grapp/prettier-config": "^0.1.1", 14 | "@grapp/ts-config": "^0.1.3", 15 | "@types/react": "^18.2.65", 16 | "@types/react-dom": "^18.2.21", 17 | "babel-plugin-module-resolver": "^5.0.0", 18 | "bun-types": "latest", 19 | "eslint": "^8.57.0", 20 | "prettier": "^3.2.5", 21 | "raw-loader": "^4.0.2" 22 | }, 23 | "dependencies": { 24 | "@grapp/nextra-theme": "0.4.9", 25 | "@grapp/stacks": "3.1.0", 26 | "react-element-to-jsx-string": "^15.0.0", 27 | "react-native-web": "^0.19.10", 28 | "react-slick": "^0.30.2", 29 | "slick-carousel": "^1.8.1" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docs/pages/_app.mdx: -------------------------------------------------------------------------------- 1 | import '../styles.css'; 2 | import '../unistyles' 3 | 4 | import * as React from 'react'; 5 | 6 | export default function MyApp({ Component, pageProps }) { 7 | return ; 8 | } 9 | -------------------------------------------------------------------------------- /docs/pages/_meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "type": "page", 4 | "title": "Stacks", 5 | "display": "hidden", 6 | "theme": { 7 | "layout": "raw" 8 | } 9 | }, 10 | "docs": { 11 | "type": "page", 12 | "title": "Documentation" 13 | }, 14 | "about": { 15 | "type": "page", 16 | "title": "About Grapp.Dev", 17 | "theme": { 18 | "typesetting": "article" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs/pages/about.mdx: -------------------------------------------------------------------------------- 1 | import { About } from '@grapp/nextra-theme' 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/pages/docs/_meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": "Introduction", 3 | "getting-started": "", 4 | "usage": "", 5 | "migration-guide": "", 6 | "-- reference": { 7 | "type": "separator", 8 | "title": "Reference" 9 | }, 10 | "components": "", 11 | "hooks": "", 12 | "types": "", 13 | "-- more": { 14 | "type": "separator", 15 | "title": "More" 16 | }, 17 | "sponsor_link": { 18 | "title": "Sponsor ↗", 19 | "href": "https://github.com/sponsors/mobily", 20 | "newWindow": true 21 | }, 22 | "github_link": { 23 | "title": "GitHub ↗", 24 | "href": "https://github.com/grapp-dev/stacks", 25 | "newWindow": true 26 | }, 27 | "discord_link": { 28 | "title": "Discord ↗", 29 | "href": "https://discord.gg/DhS6neVJBK", 30 | "newWindow": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /docs/pages/docs/components.mdx: -------------------------------------------------------------------------------- 1 | import { Cards, Card } from 'nextra/components'; 2 | import { Components } from '../../components/Components' 3 | 4 | ## Components 5 | 6 | #### Layout 7 | 8 | 9 | 10 | #### Other 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/pages/docs/components/_meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "box": "", 3 | "bleed": "", 4 | "columns": "", 5 | "float-box": "FloatBox" 6 | } 7 | -------------------------------------------------------------------------------- /docs/pages/docs/components/bleed.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['bleed/bleed']); 8 | } 9 | 10 | ## Bleed 11 | 12 | The `Bleed` component is specifically designed to create a container with negative margins so that its content appears to extend beyond the container's boundaries. This is particularly useful when you want to visually break out of a parent container without having to refactor the entire component tree. 13 | 14 | 15 | 16 | This component works in contrast to the [`Inset`](/docs/components/inset) component, which creates a padded container. While `Inset` creates a container that keeps its content within its boundaries, this component creates a container that allows its content to "bleed" into the surrounding layout. 17 | 18 | ### Props 19 | 20 | The `Bleed` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 21 | 22 | 23 | Unavailable `Box` props: `margin`, `marginX`, `marginY`, `marginTop`, `marginRight`, `marginBottom`, `marginLeft`, `marginStart`, `marginEnd` 24 | 25 | 26 | #### space 27 | 28 | "]}> 29 | Applies a negative margin to each side. 30 | 31 | 32 | #### horizontal 33 | 34 | "]}> 35 | Applies a negative margin horizontally. 36 | 37 | 38 | #### vertical 39 | 40 | "]}> 41 | Applies a negative margin vertically. 42 | 43 | 44 | #### top 45 | 46 | "]}> 47 | Applies a negative margin to the top. 48 | 49 | 50 | #### right 51 | 52 | "]}> 53 | Applies a negative margin to the right. 54 | 55 | 56 | #### bottom 57 | 58 | "]}> 59 | Applies a negative margin to the bottom. 60 | 61 | 62 | #### left 63 | 64 | "]}> 65 | Applies a negative margin to the left. 66 | 67 | 68 | #### start 69 | 70 | "]}> 71 | Applies a negative margin to the left for the `ltr` direction, otherwise to the right. 72 | 73 | 74 | #### end 75 | 76 | "]}> 77 | Applies a negative margin to the right for the `ltr` direction, otherwise to the left. 78 | 79 | -------------------------------------------------------------------------------- /docs/pages/docs/components/columns.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['columns/flex', 'columns/reverse', 'columns/align-x', 'columns/align-y']); 8 | } 9 | 10 | ## Columns 11 | 12 | `Columns` is a layout component that helps you organize your content horizontally into columns with consistent spacing between them. By default, all columns have the same width, but you can modify the width of each column based on your preference. You can even assign fractional flex values up to 1/5 to a column for more precise layout control. 13 | 14 | 15 | 16 | If you want a column to be as small as possible, you can set its flex value to `content`. This ensures the column takes up the least amount of space necessary to display its content. 17 | 18 | The `alignY` prop allows you to vertically align columns with varying content heights. 19 | 20 | 21 | 22 | You can use the `alignX` prop to horizontally align the columns when the total width of all columns is less than the width of the parent container. 23 | 24 | 25 | 26 | The `reverse` prop allows you to reverse the order of the columns if you need to display them in a different order. 27 | 28 | 29 | 30 | If you want to stack the columns vertically on smaller screens, you can use the `collapseBelow` prop. 31 | 32 | ### Custom Column component 33 | 34 | To include a custom component within `Columns`, you should utilize the `Column.from` method. This method enables you to create a new `Column` instance from a custom component and use it in your `Columns` layout. Following this approach, you can ensure your custom component is correctly integrated and behaves as expected. 35 | 36 | ```tsx 37 | const Content = Column.from(props => { 38 | return ; 39 | }); 40 | ``` 41 | 42 | ### Props 43 | 44 | The `Columns` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 45 | 46 | 47 | Unavailable `Box` props: `gap`, `rowGap`, `columnGap` 48 | 49 | 50 | #### defaultFlex 51 | 52 | "]} defaultValue="fluid"> 53 | Assigns a default flex value to each column. 54 | 55 | 56 | #### space 57 | 58 | ']}> 59 | Sets the space between children. 60 | 61 | 62 | #### alignX 63 | 64 | "]}> 65 | Aligns children horizontally. 66 | 67 | 68 | #### alignY 69 | 70 | "]}> 71 | Aligns children vertically. 72 | 73 | 74 | #### collapseBelow 75 | 76 | 77 | Stacks the columns vertically when the current breakpoint is smaller than the provided breakpoint. 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /docs/pages/docs/components/float-box.mdx: -------------------------------------------------------------------------------- 1 | 2 | import { Property } from '@grapp/nextra-theme' 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['float-box/float-box']); 8 | } 9 | 10 | ## FloatBox 11 | 12 | `FloatBox` is a component that can position its child elements over the parent component using absolute positioning. It's similar to the [`Box`](/docs/components/box) component but has the added benefit of positioning elements precisely within the parent container. 13 | 14 | With `FloatBox`, you can easily control the position of each child element by specifying exact coordinates, such as `top`, `bottom`, `left`, and `right`. 15 | 16 | 17 | 18 | ### Props 19 | 20 | The `FloatBox` component is created using the [`Box`](/docs/components/box) component. It extends all the props supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 21 | 22 | #### offset 23 | 24 | "]}> 25 | Specifies the value of each offset. 26 | 27 | 28 | #### top 29 | 30 | "]}> 31 | Sets the top offset. 32 | 33 | 34 | #### right 35 | 36 | "]}> 37 | Sets the right offset. 38 | 39 | 40 | #### bottom 41 | 42 | "]}> 43 | Sets the bottom offset. 44 | 45 | 46 | #### left 47 | 48 | "]}> 49 | Sets the left offset. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/pages/docs/components/grid.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['grid/grid']); 8 | } 9 | 10 | ## Grid 11 | 12 | The `Grid` component renders a design system grid in your React Native application. It's worth noting that you should only utilize this component once and at the highest level of your component tree. This will ensure that the grid is applied consistently throughout your application. 13 | 14 | 15 | 16 | ### Props 17 | 18 | #### gutter 19 | 20 | "]} defaultValue="2"> 21 | Set the space between columns. 22 | 23 | 24 | #### margin 25 | 26 | "]} defaultValue="2"> 27 | Specifies the amount of space on both the left and right sides. 28 | 29 | 30 | #### columns 31 | 32 | "]} defaultValue="8"> 33 | Sets the number of columns. 34 | 35 | 36 | #### opacity 37 | 38 | "]} defaultValue="0.2"> 39 | Adjusts the transparency level for each column. 40 | 41 | 42 | #### color 43 | 44 | "]} defaultValue="red"> 45 | Sets the color of each column. 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/pages/docs/components/hidden.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components" 3 | 4 | ## Hidden 5 | 6 | The `Hidden` component allows you to hide content responsively. This can be achieved by using the `above` and `below` props, which let you specify a breakpoint name. 7 | 8 | --- 9 | 10 | 11 | To use `Hidden` you must add the Babel plugin to your config. 12 | 13 | 14 | ```js 15 | module.exports = { 16 | plugins: [ 17 | ... 18 | '@grapp/stacks/plugin', 19 | ], 20 | }; 21 | ``` 22 | 23 | --- 24 | 25 | ### Props 26 | 27 | #### above 28 | 29 | 30 | Hides the content if the current breakpoint is larger than the provided breakpoint. 31 | 32 | 33 | #### below 34 | 35 | 36 | Hides the content if the current breakpoint is smaller than the provided breakpoint. 37 | 38 | -------------------------------------------------------------------------------- /docs/pages/docs/components/inline.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['inline/space', 'inline/align-y', 'inline/align-x']); 8 | } 9 | 10 | ## Inline 11 | 12 | The `Inline` component arranges its children horizontally, allowing you to display multiple items side by side. If the children exceed the available space, the component wraps them to the next line, with equal spacing between children. 13 | 14 | 15 | 16 | The `alignX` prop can be used to align children horizontally. 17 | 18 | 19 | 20 | The `alignY` prop enables you to vertically align children of varying heights vertically, ensuring they are all at the same level. 21 | 22 | 23 | 24 | The `collapseBelow` prop allows you to collapse all items into a single vertical stack, ensuring that your content remains accessible, even on smaller screens. 25 | 26 | ### Props 27 | 28 | The `Inline` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 29 | 30 | 31 | Unavailable `Box` props:: `gap`, `rowGap`, `columnGap`, `direction`, `wrap` 32 | 33 | 34 | #### space 35 | 36 | ']}> 37 | Sets the space between children. 38 | 39 | 40 | #### spaceX 🚀 41 | 42 | ']}> 43 | Sets the horizontal space between children. 44 | 45 | 46 | #### spaceY 47 | 48 | ']}> 49 | Sets the vertical space between children. 50 | 51 | 52 | #### alignX 53 | 54 | "]}> 55 | Aligns children horizontally. 56 | 57 | 58 | #### alignY 59 | 60 | "]}> 61 | Aligns children vertically. 62 | 63 | 64 | #### collapseBelow 65 | 66 | 67 | Stacks children vertically when the current breakpoint is smaller than the provided breakpoint. 68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/pages/docs/components/inset.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['inset/inset']); 8 | } 9 | 10 | ## Inset 11 | 12 | The `Inset` component is a component that creates a container with additional space around its content. This extra space, also known as padding, can be customized via props. 13 | 14 | 15 | 16 | ### Props 17 | 18 | The `Inset` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 19 | 20 | 21 | Unavailable `Box` props: `padding`, `paddingX`, `paddingY`, `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft`, `paddingStart`, `paddingEnd` 22 | 23 | 24 | #### space 25 | 26 | "]}> 27 | Add padding to all sides. 28 | 29 | 30 | #### horizontal 31 | 32 | "]}> 33 | Adds padding horizontally. 34 | 35 | 36 | #### vertical 37 | 38 | "]}> 39 | Adds padding vertically. 40 | 41 | 42 | #### top 43 | 44 | "]}> 45 | Adds padding to the top. 46 | 47 | 48 | #### right 49 | 50 | "]}> 51 | Adds padding to the right. 52 | 53 | 54 | #### bottom 55 | 56 | "]}> 57 | Adds padding to the bottom. 58 | 59 | 60 | #### left 61 | 62 | "]}> 63 | Adds padding to the left. 64 | 65 | 66 | #### start 67 | 68 | "]}> 69 | Adds padding to the left for the `ltr` direction, otherwise to the right. 70 | 71 | 72 | #### end 73 | 74 | "]}> 75 | Adds padding to the right for the `ltr` direction, otherwise to the left. 76 | 77 | -------------------------------------------------------------------------------- /docs/pages/docs/components/rows.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['rows/rows', 'rows/align-x', 'rows/align-y', 'rows/flex']); 8 | } 9 | 10 | ## Rows 11 | 12 | The `Rows` component is designed to organize its children in rows with consistent vertical spacing. It is particularly useful in building the generic `Screen` component. 13 | 14 | 15 | 16 | If you have rows with varying heights, you can use the `alignY` prop to align them vertically. 17 | 18 | 19 | 20 | The `alignX` prop can also help horizontally align the rows when their total width is less than that of the parent container. 21 | 22 | 23 | 24 | To set the flex value of a row, you can place `Row` directly inside `Rows` and set a flex property. To define a default flex for all rows, use the `defaultFlex` property on `Rows`. 25 | 26 | 27 | 28 | ### Custom Row component 29 | 30 | To include a custom component within `Rows`, you should utilize the `Row.from` method. This method enables you to create a new `Row` instance from a custom component and use it in your `Rows` layout. Following this approach, you can ensure your custom component is correctly integrated and behaves as expected. 31 | 32 | ```tsx 33 | const Content = Row.from(props => { 34 | return ; 35 | }); 36 | ``` 37 | 38 | ### Props 39 | 40 | The `Rows` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 41 | 42 | 43 | Unavailable `Box` props: `direction`, `gap`, `rowGap`, `columnGap` 44 | 45 | 46 | #### defaultFlex 47 | 48 | "]} defaultValue="fluid"> 49 | Assigns a default flex value to each column. 50 | 51 | 52 | #### space 53 | 54 | ']}> 55 | Sets the space between children. 56 | 57 | 58 | #### alignX 59 | 60 | "]}> 61 | Aligns children horizontally. 62 | 63 | 64 | #### alignY 65 | 66 | "]}> 67 | Aligns children vertically. 68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/pages/docs/components/stack.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['stack/space', 'stack/align', 'stack/horizontal', 'stack/divider']); 8 | } 9 | 10 | ## Stack 11 | 12 | `Stack` is a layout component that helps in positioning child elements vertically with equal spacing between them. 13 | 14 | 15 | 16 | The component also supports horizontal alignment, which allows you to align children left, right, or center within the stack. 17 | 18 | 19 | 20 | `Stack` allows you to arrange children in a horizontal layout by using the `horizontal` property. 21 | 22 | 23 | 24 | Additionally, you can insert a custom divider between all stack children by setting the `divider` prop on `Stack`. This is useful when you want to separate child elements with a visible line or space. 25 | 26 | 27 | 28 | ### Props 29 | 30 | The `Stack` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 31 | 32 | 33 | Unavailable `Box` props: `direction`, `alignX`, `alignY`, `rowGap`, `columnGap` 34 | 35 | 36 | #### space 37 | 38 | ']}> 39 | Set the space between children. 40 | 41 | 42 | #### horizontal 43 | 44 | "]}> 45 | Arranges children horizontally. 46 | 47 | 48 | #### align 49 | 50 | "]}> 51 | Aligns children horizontally or vertically, depending on the value of the `horizontal` prop. 52 | 53 | 54 | #### divider 55 | 56 | 57 | Inserts a custom divider between each child. 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/pages/docs/components/tiles.mdx: -------------------------------------------------------------------------------- 1 | import { Property } from '@grapp/nextra-theme' 2 | import { Callout } from "nextra/components"; 3 | 4 | import { Example, getExamples } from '../../../components/Example' 5 | 6 | export const getStaticProps = () => { 7 | return getExamples(['tiles/space', 'tiles/columns', 'tiles/fill']); 8 | } 9 | 10 | ## Tiles 11 | 12 | The `Tiles` component displays a grid of elements with equal spacing between them. You can use the `space` and `columns` props to customize the spacing and number of columns per screen size. 13 | 14 | The `space` prop adjusts the spacing between the tiles. 15 | 16 | 17 | 18 | The `columns` prop sets the number of columns to display. 19 | 20 | 21 | 22 | The `fill` prop allows you to determine whether the empty content needs to be filled if the last row has fewer columns than defined in the `columns` prop. Depending on your requirements, you can set the value of the `fill` prop to `true` or `false`. 23 | 24 | 25 | 26 | ### Props 27 | 28 | The `Tiles` component is created using the [`Box`](/docs/components/box) component. It extends all the props* supported by `Box`, as well as [React Native View](https://reactnative.dev/docs/view#props), and the props mentioned below. 29 | 30 | 31 | Unavailable `Box` props: `gap`, `rowGap`, `columnGap`, `direction`, `alignX` 32 | 33 | 34 | #### columns 35 | 36 | ']} defaultValue="1"> 37 | Define the number of columns. 38 | 39 | 40 | #### space 41 | 42 | ']}> 43 | Sets the space between children. 44 | 45 | 46 | #### spaceX 🚀 47 | 48 | ']}> 49 | Sets the horizontal space between children. 50 | 51 | 52 | #### spaceY 53 | 54 | ']}> 55 | Sets the vertical space between children. 56 | 57 | 58 | #### fill 59 | 60 | "]} defaultValue="false"> 61 | Fills the last row if it has fewer columns than defined in the `columns` prop. 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docs/pages/docs/getting-started.mdx: -------------------------------------------------------------------------------- 1 | import { Tabs } from 'nextra/components' 2 | 3 | ## Getting Started 4 | 5 | #### Installation 6 | 7 | To install `Stacks`, you should use your preferred package manager. 8 | 9 | 10 | 11 | ```shell 12 | bun add @grapp/stacks 13 | ``` 14 | 15 | 16 | ```shell 17 | pnpm add @grapp/stacks 18 | ``` 19 | 20 | 21 | ```shell 22 | yarn add @grapp/stacks 23 | ``` 24 | 25 | 26 | ```shell 27 | npm install @grapp/stacks --save 28 | ``` 29 | 30 | 31 | 32 | 33 | #### Unistyles 34 | 35 | Once you have installed the library, check out the Unistyles setup guide at this [link](https://www.unistyl.es/start/setup/). This guide provides a step-by-step process for configuring Unistyles in your app. You can skip this step if you have installed and configured Unistyles properly. 36 | 37 | #### Stacks 38 | 39 | Adding `Stacks` support to the existing `Unistyles` configuration is a simple process. To do this, you need to add the following properties to your theme: 40 | 41 | ```tsx 42 | const theme = { 43 | ... 44 | stacks: { 45 | spacing: 4, 46 | debug: false, 47 | }, 48 | }; 49 | ``` 50 | 51 | If you are using TypeScript, it is necessary to create types for breakpoints after overriding `Unistyles` types. 52 | 53 | ```tsx {6-8} 54 | declare module 'react-native-unistyles' { 55 | export interface UnistylesBreakpoints extends AppBreakpoints {} 56 | export interface UnistylesThemes extends AppThemes {} 57 | } 58 | 59 | declare module '@grapp/stacks' { 60 | export interface StacksBreakpoints extends Breakpoints {} 61 | } 62 | ``` 63 | 64 | #### Explore 65 | 66 | You can now explore the various components and become familiar with their properties by visiting the [`Components`](/docs/components) page. 67 | -------------------------------------------------------------------------------- /docs/pages/docs/hooks.mdx: -------------------------------------------------------------------------------- 1 | ## Hooks 2 | 3 | #### useResponsiveProp 4 | 5 | This hook returns a function that can be used to resolve responsive props in components. It accepts the responsive props format as an argument. 6 | 7 | ```ts 8 | function useResponsiveProp(value: ResponsiveProp): T; 9 | ``` 10 | 11 | ```tsx 12 | type Props = { 13 | size: ResponsiveProp; 14 | }; 15 | 16 | const Avatar = (props: Props) => { 17 | const resolveResponsiveProp = useResponsiveProp(); 18 | const size = resolveResponsiveProp(props.size); 19 | 20 | return ( 21 | 22 | ); 23 | }; 24 | 25 | 26 | ``` 27 | 28 | #### useSpacingHelpers 29 | 30 | This hook returns two helper functions - `multiply` and `divide`. These functions allow you to adjust the spacing between elements in your components by multiplying or dividing a value by the spacing value set in the Unistyles theme object. 31 | 32 | ```ts 33 | type SpacingHelper = { 34 | (value: number): number; 35 | (value: number | undefined): number | undefined; 36 | }; 37 | 38 | type SpacingHelpers = { 39 | multiply: SpacingHelper; 40 | divide: SpacingHelper; 41 | }; 42 | 43 | function useSpacingHelpers(): SpacingHelpers; 44 | ``` 45 | 46 | ```tsx 47 | type Props = React.PropsWitchChildren<{ 48 | value: number; 49 | }>; 50 | 51 | const Padding = (props: Props) => { 52 | const { value, children } = props 53 | const { multiply } = useSpacingHelpers() 54 | 55 | return ( 56 | 57 | {children} 58 | 59 | ); 60 | }; 61 | 62 | 63 | Hello! 64 | 65 | ``` 66 | 67 | #### useBreakpointComparators 68 | 69 | This hook returns two functions - `isAbove` and `isBelow`. These functions can compare the current breakpoint with the provided breakpoint, which can be helpful when adjusting component styling based on screen size. 70 | 71 | ```ts 72 | type BreakpointComparator = (breakpoint?: Breakpoint) => boolean; 73 | 74 | type BreakpointComparators = { 75 | isBelow: BreakpointComparator; 76 | isAbove: BreakpointComparator; 77 | }; 78 | 79 | function useBreakpointComparators(): BreakpointComparators; 80 | ``` 81 | 82 | ```tsx 83 | type Props = React.PropsWitchChildren<{ 84 | below: Breakpoint; 85 | }>; 86 | 87 | const Collapse = (props: Props) => { 88 | const { below, children } = props; 89 | const { isBelow } = useBreakpointComparators(); 90 | 91 | const isCollapsed = breakpoint.isBelow(below); 92 | const direction = isCollapsed ? 'column' : 'row'; 93 | 94 | return ( 95 | 96 | {children} 97 | 98 | ); 99 | }; 100 | 101 | 102 | {elements} 103 | 104 | ``` 105 | 106 | #### useDebugStyle 107 | 108 | This hook generates a style object with a random `backgroundColor` value. It can be useful for quickly identifying specific components in your application when the debug mode is enabled. 109 | 110 | ```ts 111 | function useDebugStyle(): ViewStyle | undefined; 112 | ``` 113 | 114 | ```tsx 115 | const Debug = (props: React.PropsWitchChildren) => { 116 | const { children } = props; 117 | const debugStyle = useDebugStyle(); 118 | 119 | return ( 120 | 121 | {children} 122 | 123 | ); 124 | }; 125 | 126 | 127 | Debug 128 | 129 | ``` 130 | 131 | -------------------------------------------------------------------------------- /docs/pages/docs/index.mdx: -------------------------------------------------------------------------------- 1 | import { Cards, Card } from 'nextra/components'; 2 | import { Components } from '../../components/Components' 3 | 4 | ## Stacks 5 | 6 | Stacks is a set of various components for building layouts in React Native. 7 | 8 | The `Stacks` library follows a design principle that states components should not provide surrounding white space. Instead, layout components solely own the spacing between elements. This approach ensures that the system is highly composable while maintaining predictable white space. 9 | 10 | All components can be nested infinitely within each other, creating various standard layouts in React Native. To work efficiently with `Stacks`, understanding the following components is necessary. 11 | 12 | --- 13 | 14 | 15 | 16 | --- 17 | 18 | The main objective of the `Stacks` library is to make building and maintaining layouts quick and easy. Whenever possible, component APIs should resemble how a designer would describe them. 19 | 20 | ## Unistyles 21 | 22 | To streamline the development process of `Stacks`, I have decided to add [Unistyles](https://github.com/jpudysz/react-native-unistyles/tree/main) as a dependency. Unistyles is a style library for React Native that has several benefits. First, it has a simple setup process, making it easy to use. Second, the library is actively developing, and the core maintainer ([@jacekp](https://twitter.com/jpudysz)) continuously improves and expands its capabilities. Any issues or bugs are quickly addressed and fixed. 23 | 24 | Another significant advantage of using Unistyles is that it provides everything you need to work with styles in React Native. It supports media queries, which enables the creation of responsive designs that adapt to different screen sizes. It also supports defined breakpoints, allowing you to set specific styles for various screen sizes. It also supports variants, which makes it easy to create different versions of a component based on certain conditions. 25 | 26 | Unistyles also provides excellent performance, which is crucial for any mobile app. The library is optimized for speed. Moreover, it's compatible with React Native Web, so you can write code once and use it on mobile and web platforms. 27 | 28 | Unistyles is an excellent choice for simplifying the styling process in React Native projects. Its simple setup, comprehensive features, and excellent performance make it a reliable and efficient style library. 29 | -------------------------------------------------------------------------------- /docs/pages/docs/migration-guide.mdx: -------------------------------------------------------------------------------- 1 | 2 | import { Callout } from "nextra/components"; 3 | 4 | ## Migration Guide 5 | 6 | The migration process should be hassle-free for users upgrading from Stacks v2 to v3. However, you should be aware of some notable changes. 7 | 8 | 9 | `Stacks` is now published in the `@grapp` scope. So, you need to fix the imports first. Don't worry, it's a quick fix! 10 | ~`@mobily/stacks`~ → `@grapp/stacks` 11 | 12 | 13 | ### General 14 | 15 | The `Stacks` library has been completely rewritten in TypeScript, so it no longer supports ReScript. 16 | The `flex gap` values now define spaces between components (excluding `Columns`, see [this](https://github.com/Doist/reactist/pull/739#issuecomment-1373825792)). 17 | 18 | ### Components 19 | 20 | #### Provider 21 | 22 | `Stacks` now uses Unistyles, which means that you can remove `StacksProvider` from the React component tree and provide configuration values to the `Unistyles` theme object, as described [here](/docs/getting-started). 23 | 24 | #### Box 25 | 26 | Several new props have been added to the `Box` component, including `width`, `height`, `gap`, `rowGap`, `columnGap`, `backgroundColor`, `borderRadius`, `borderTopLeftRadius`, `borderTopRightRadius`, `borderBottomLeftRadius`, `borderBottomRightRadius`, `borderColor`, `borderWidth`, `borderTopWidth`, `borderRightWidth`, `borderBottomWidth`, `borderLeftWidth`, and `debuggable`. 27 | 28 | #### Columns 29 | 30 | The `defaultWidth` prop is now `defaultFlex`, and the `width` prop has been changed to `flex`. 31 | Use `Column.from` to create a custom `Column` component. 32 | The `markAsColumn` function has been removed. 33 | 34 | #### FillView 35 | 36 | `FillView` has been renamed to `FloatBox`. 37 | The `unset` helper has been removed, and the positioning has been fixed if you don't provide all offset values. 38 | 39 | #### Hidden 40 | 41 | Experimental support for hiding elements by transforming the React component tree with the provided `Babel` plugin has been added. 42 | 43 | #### Inline 44 | 45 | The `spaceX` and `spaceY` props have been added. 46 | 47 | #### Rows 48 | 49 | The `defaultHeight` prop is now `defaultFlex`, and the `height` prop has been changed to `flex`. 50 | Use `Row.from` to create a custom `Row` component. 51 | The `markAsRow` function has been removed. 52 | 53 | #### Tiles 54 | 55 | The `spaceX` and `spaceY` props have been added, and `empty` has been renamed to `fill`. 56 | 57 | ### Hooks 58 | 59 | - `useStacks` has been removed, as `StacksProvider` is no longer needed. 60 | - `useCurrentBreakpoint` has been removed. To get the current breakpoint name, you can use `useStyles` from Unistyles. 61 | - `useSpacing` has been removed. To achieve the same result, you can use `useSpacingHelpers` and `multiply`. 62 | - `useWindowDimensions` has been removed. You can now get the screen dimensions with `UnistylesRuntime.screen`. 63 | 64 | _That's all folks!_ 65 | -------------------------------------------------------------------------------- /docs/pages/docs/types.mdx: -------------------------------------------------------------------------------- 1 | ## Types 2 | 3 | ```ts 4 | type Breakpoint = keyof UnistylesBreakpoints; 5 | type AxisX = 'left' | 'center' | 'right'; 6 | type AxisY = 'top' | 'center' | 'bottom'; 7 | type Stretch = 'stretch'; 8 | type Space = 'between' | 'around' | 'evenly'; 9 | type Direction = 'row' | 'row-reverse' | 'column' | 'column-reverse'; 10 | type Wrap = 'wrap' | 'no-wrap' | 'wrap-reverse'; 11 | 12 | type Flex = 13 | | 'content' 14 | | 'fluid' 15 | | '1/2' 16 | | '1/3' 17 | | '2/3' 18 | | '1/4' 19 | | '3/4' 20 | | '1/5' 21 | | '2/5' 22 | | '3/5' 23 | | '4/5'; 24 | 25 | type ResponsiveProp = T | readonly T[]; 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/pages/docs/usage.mdx: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | #### Spacings 4 | 5 | To use `Stacks`, you must first define a default spacing value in the Unistyles theme object. This is explained in detail in the [`Getting Started`](/docs/getting-started) page. 6 | 7 | The spacing value is measured in logical pixels, the same unit you are already familiar with for `margin` or `padding`. `Stacks` automatically multiplies the default spacing value by the space passed to the components. 8 | 9 | ```tsx 10 | const theme = { 11 | stacks: { 12 | spacing: 4, 13 | }, 14 | }; 15 | 16 | // 4 * 2 = 8 logical pixels 17 | // 4 * 3 = 12 logical pixels 18 | ``` 19 | 20 | #### Responsive Props 21 | 22 | `Stacks` also supports the responsive props format. You can use responsive props to customize the spacing, number of columns, or alignments per screen size. 23 | 24 | Let's say you have a configuration for breakpoints that defines the different screen sizes. This configuration could look like this: 25 | 26 | ```tsx 27 | const breakpoints = { 28 | mobile: 0, 29 | tablet: 768, 30 | desktop: 998, 31 | } as const; 32 | ``` 33 | 34 | In Stacks, the responsive prop can be used to set values for different screen sizes. This prop can take either a primitive value or a responsive prop format. 35 | 36 | When you pass a primitive value, it applies to all the breakpoints in your configuration. 37 | 38 | ```tsx 39 | 40 | ``` 41 | 42 | On the other hand, a responsive prop is an array of values where you can specify different values to apply to different breakpoints. The first value in the array is applied to the `mobile` breakpoint, the second to the `tablet` breakpoint, and the third to the `desktop` breakpoint. 43 | 44 | For example: 45 | 46 | ```tsx 47 | 48 | 49 | 50 | ``` 51 | 52 | - if you pass `[1]`, the same value `1` will be used across all breakpoints. 53 | - if you pass `[1, 4]`, the value `1` will apply to the `mobile` breakpoint, and `4` will apply to the `tablet` and `desktop` breakpoints. 54 | - if you pass `[1, 4, 8]`, the value `1` will apply to the `mobile` breakpoint, `4` to the `tablet` breakpoint, and `8` to the `desktop` breakpoint. 55 | 56 | -------------------------------------------------------------------------------- /docs/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@grapp/nextra-theme/config/postcss') 2 | -------------------------------------------------------------------------------- /docs/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/favicon-16x16.png -------------------------------------------------------------------------------- /docs/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/favicon-32x32.png -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/favicon.ico -------------------------------------------------------------------------------- /docs/public/og-slogan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/og-slogan.png -------------------------------------------------------------------------------- /docs/public/og-website.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/og-website.png -------------------------------------------------------------------------------- /docs/public/stacks-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grapp-dev/stacks/34fa5f71c5cc597a0fef279d6219cc277efecf9e/docs/public/stacks-preview.png -------------------------------------------------------------------------------- /docs/styles.css: -------------------------------------------------------------------------------- 1 | @import "@grapp/nextra-theme/lib/global.css"; 2 | @import "@grapp/nextra-theme/lib/index.css"; 3 | 4 | @import "slick-carousel/slick/slick.css"; 5 | 6 | @tailwind base; 7 | @tailwind components; 8 | @tailwind utilities; 9 | 10 | .nextra-code-block pre { 11 | font-size: 16px; 12 | --tw-bg-opacity: 0.03; 13 | background-color: rgba(0, 0, 0, var(--tw-bg-opacity)); 14 | } 15 | 16 | :root { 17 | --grapp-hero-text-column-span: span 4 / span 4; 18 | --grapp-features-list-column-span: span 2 / span 2; 19 | --grapp-features-grid-cols: repeat(2, minmax(0, 1fr)); 20 | --grapp-features-container-grid-cols: repeat(4, minmax(0, 1fr)); 21 | --grapp-features-preview-column-span: span 2 / span 2; 22 | } 23 | 24 | html { 25 | &.dark { 26 | --shiki-token-constant: #1BCABE; 27 | --shiki-token-string-expression: #faf39c; 28 | --grapp-property-type-color: #ff89af; 29 | --grapp-property-default-value-color: var(--shiki-token-string-expression); 30 | --grapp-hero-button-background-color: #232731; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /docs/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@grapp/nextra-theme/config/tailwind') 2 | -------------------------------------------------------------------------------- /docs/theme.config.jsx: -------------------------------------------------------------------------------- 1 | import { Footer, Logo } from '@grapp/nextra-theme'; 2 | import { getDefaultConfig } from '@grapp/nextra-theme/config/next'; 3 | 4 | import StacksLogo from './components/svg/stacks-logo.svg'; 5 | 6 | export default getDefaultConfig({ 7 | title: 'Stacks', 8 | description: 9 | 'A set of components for building layouts in React Native. Powered by React Native Unistyles.', 10 | github: 'https://github.com/grapp-dev/stacks', 11 | discord: 'https://discord.gg/DhS6neVJBK', 12 | docs: 'https://stacks.grapp.dev', 13 | logo: () => { 14 | return ; 15 | }, 16 | footer: () => { 17 | return ( 18 |