-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
docs: migrate docs site to rspress #5004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adamTrz
wants to merge
18
commits into
main
Choose a base branch
from
adamTrz/migrate-docs-rspress-ck-theme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0294677
migrate docs site to rspress
adamTrz bd8572d
align homepage content edges
adamTrz 10329e6
docs: fix rspress docs lint checks
adamTrz 2efcfe9
docs: fix rspress migration follow-ups
adamTrz e0c2214
docs: remove local playwright visual checks
adamTrz c555f49
docs: remove stale docusaurus files
adamTrz da70d0a
docs: remove stale babel config
adamTrz f9a7962
docs: keep generated component docs as ts modules
adamTrz acabdf4
docs: generate component metadata as json
adamTrz e26990e
style: format component docs generator
adamTrz a7bf5ad
fix: make component docs generator ts-compatible
adamTrz 7650554
fix: run docs generator without strip-types
adamTrz 7da93f2
style: satisfy prettier in docs generator
adamTrz c928ed0
Fix docs client-side navigation
adamTrz 0ed99a6
Remove duplicated versioned docs sources
adamTrz 2edea79
Merge branch 'main' of github.com:callstack/react-native-paper into a…
satya164 6b48f0e
Fix docs version selector navbar placement
adamTrz 776efb5
Fix docs test formatting
adamTrz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [ | ||
| { | ||
| "text": "Guides", | ||
| "link": "/docs/guides/getting-started", | ||
| "activeMatch": "^/docs/guides/" | ||
| }, | ||
| { | ||
| "text": "Components", | ||
| "link": "/docs/components/ActivityIndicator", | ||
| "activeMatch": "^/docs/components/" | ||
| }, | ||
| { | ||
| "text": "Showcase", | ||
| "link": "/docs/showcase", | ||
| "activeMatch": "^/docs/showcase$" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [ | ||
| { | ||
| "type": "dir-section-header", | ||
| "name": "guides", | ||
| "label": "Guides" | ||
| }, | ||
| { | ||
| "type": "dir-section-header", | ||
| "name": "components", | ||
| "label": "Components" | ||
| }, | ||
| { | ||
| "type": "file", | ||
| "name": "showcase", | ||
| "label": "Showcase" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| title: ActivityIndicator | ||
| --- | ||
|
|
||
| import PropTable from '@site/src/components/PropTable.tsx'; | ||
| import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; | ||
| import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; | ||
| import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; | ||
| import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; | ||
|
|
||
| Activity indicator is used to present progress of some activity in the app. | ||
| It can be used as a drop-in replacement for the ActivityIndicator shipped with React Native. | ||
|
|
||
|
|
||
|
|
||
|
|
||
| <ScreenshotTabs screenshotData={"screenshots/activity-indicator.gif"} baseUrl="/react-native-paper/"/> | ||
|
|
||
|
|
||
| ## Usage | ||
| ```js | ||
| import * as React from 'react'; | ||
| import { ActivityIndicator, MD2Colors } from 'react-native-paper'; | ||
|
|
||
| const MyComponent = () => ( | ||
| <ActivityIndicator animating={true} color={MD2Colors.red800} /> | ||
| ); | ||
|
|
||
| export default MyComponent; | ||
| ``` | ||
|
|
||
|
|
||
| ## Props | ||
| <span /> | ||
|
|
||
|
|
||
|
|
||
| <div> | ||
|
|
||
| ### animating | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="animating" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### color | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="color" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### size | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="size" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### hidesWhenStopped | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="hidesWhenStopped" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### style | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="style" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### theme | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="ActivityIndicator" prop="theme" version="5.x" /> | ||
|
|
||
|
|
||
|
|
||
| <span /> | ||
|
|
||
|
|
||
| ## Theme colors | ||
|
|
||
| <ThemeColorsTable themeColorsData={{"-":{"borderColor":"theme.colors.primary"}}} componentName="ActivityIndicator" /> | ||
|
|
||
|
|
||
| <span /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| --- | ||
| title: Appbar | ||
| --- | ||
|
|
||
| import PropTable from '@site/src/components/PropTable.tsx'; | ||
| import ExtendsLink from '@site/src/components/ExtendsLink.tsx'; | ||
| import ThemeColorsTable from '@site/src/components/ThemeColorsTable.tsx'; | ||
| import ScreenshotTabs from '@site/src/components/ScreenshotTabs.tsx'; | ||
| import ExtendedExample from '@site/src/components/ExtendedExample.tsx'; | ||
|
|
||
| A component to display action items in a bar. It can be placed at the top or bottom. | ||
| The top bar usually contains the screen title, controls such as navigation buttons, menu button etc. | ||
| The bottom bar usually provides access to a drawer and up to four actions. | ||
|
|
||
| By default Appbar uses primary color as a background, in dark theme with `adaptive` mode it will use surface colour instead. | ||
| See [Dark Theme](https://callstack.github.io/react-native-paper/docs/guides/theming#dark-theme) for more informations | ||
|
|
||
|
|
||
|
|
||
|
|
||
| <ScreenshotTabs screenshotData={"screenshots/appbar.png"} baseUrl="/react-native-paper/"/> | ||
|
|
||
|
|
||
| ## Usage | ||
| ### Top bar | ||
| ```js | ||
| import * as React from 'react'; | ||
| import { Appbar } from 'react-native-paper'; | ||
|
|
||
| const MyComponent = () => ( | ||
| <Appbar.Header> | ||
| <Appbar.BackAction onPress={() => {}} /> | ||
| <Appbar.Content title="Title" /> | ||
| <Appbar.Action icon="calendar" onPress={() => {}} /> | ||
| <Appbar.Action icon="magnify" onPress={() => {}} /> | ||
| </Appbar.Header> | ||
| ); | ||
|
|
||
| export default MyComponent; | ||
| ``` | ||
|
|
||
| ### Bottom bar | ||
| ```js | ||
| import * as React from 'react'; | ||
| import { StyleSheet } from 'react-native'; | ||
| import { Appbar, FAB, useTheme } from 'react-native-paper'; | ||
| import { useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
|
|
||
| const BOTTOM_APPBAR_HEIGHT = 80; | ||
| const MEDIUM_FAB_HEIGHT = 56; | ||
|
|
||
| const MyComponent = () => { | ||
| const { bottom } = useSafeAreaInsets(); | ||
| const theme = useTheme(); | ||
|
|
||
| return ( | ||
| <Appbar | ||
| style={[ | ||
| styles.bottom, | ||
| { | ||
| height: BOTTOM_APPBAR_HEIGHT + bottom, | ||
| backgroundColor: theme.colors.elevation.level2, | ||
| }, | ||
| ]} | ||
| safeAreaInsets={{ bottom }} | ||
| > | ||
| <Appbar.Action icon="archive" onPress={() => {}} /> | ||
| <Appbar.Action icon="email" onPress={() => {}} /> | ||
| <Appbar.Action icon="label" onPress={() => {}} /> | ||
| <Appbar.Action icon="delete" onPress={() => {}} /> | ||
| <FAB | ||
| mode="flat" | ||
| size="medium" | ||
| icon="plus" | ||
| onPress={() => {}} | ||
| style={[ | ||
| styles.fab, | ||
| { top: (BOTTOM_APPBAR_HEIGHT - MEDIUM_FAB_HEIGHT) / 2 }, | ||
| ]} | ||
| /> | ||
| </Appbar> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| bottom: { | ||
| backgroundColor: 'aquamarine', | ||
| position: 'absolute', | ||
| left: 0, | ||
| right: 0, | ||
| bottom: 0, | ||
| }, | ||
| fab: { | ||
| position: 'absolute', | ||
| right: 16, | ||
| }, | ||
| }); | ||
|
|
||
| export default MyComponent; | ||
| ``` | ||
|
|
||
|
|
||
| ## Props | ||
| <span /> | ||
|
|
||
|
|
||
|
|
||
| <div> | ||
|
|
||
| ### dark | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="dark" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### children (required) | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="children" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### mode <span class="badge badge-supported "><span class="badge-text">Available in v5.x with theme version 3</span></span> | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="mode" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### elevated <span class="badge badge-supported "><span class="badge-text">Available in v5.x with theme version 3</span></span> | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="elevated" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### safeAreaInsets | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="safeAreaInsets" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### theme | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="theme" version="5.x" /> | ||
|
|
||
| <div> | ||
|
|
||
| ### style | ||
|
|
||
| </div> | ||
|
|
||
| <PropTable componentLink="Appbar/Appbar" prop="style" version="5.x" /> | ||
|
|
||
|
|
||
|
|
||
| <span /> | ||
|
|
||
|
|
||
| ## Theme colors | ||
|
|
||
| <ThemeColorsTable themeColorsData={{"default":{"backgroundColor":"theme.colors.surface"},"elevated":{"backgroundColor":"theme.colors.elevation.level2"}}} componentName="Appbar" /> | ||
|
|
||
|
|
||
| <span /> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep this as .ts