Skip to content

Commit f057a1f

Browse files
LFDanLudevongovett
andauthored
docs: Restructure old docs in preparation of new docs site (#9154)
* add temp banner to stately * add banner to all pages * move react spectrum pages to v3 * move releases under v3 * make sure intro and concept pages appear in sidebar for v3 * move stately hooks to aria and remove uneeded aria hooks * lint * test redirect * add redirect pages for v3 and releases * fix redirects for intro and concepts pages * add redirects for react aria * redirect release index page and rename script for consistency * add redirects for blog and internationalized * get rid of chevron * properly redirect examples and point to new concepts page * update more redirects * have both stately and aria hooks in sidenav for react stately too * rename sidebar headers * add redirects for the remaining Foundation section pages * Remove redirect pages. Will handle in CDN instead. * Remove old docs that we migrated * Update URL structure * Update URLs * Build old docs as part of s2 build * Add stage docs build * Remove RedirectLayout * Fix more URLs * Fix more URLs * Remove Dialog from DatePicker examples * More broken links * Fix broken links * More links * Open search menu on components link at bottom of homepage Also fix more links * update migration banner * make react spectrum links relative and bring back s2 gradient * create relative links for aria and stately hook banner * remove banner from releases and fix filetrigger link * Fix one more url * Move Support page to v3 * Remove unused useStepList docs * Fix links * Fix separator link * Fix useDialog links * Fix stately links from migration banner --------- Co-authored-by: Devon Govett <devongovett@gmail.com>
1 parent f83b3ab commit f057a1f

File tree

302 files changed

+1098
-5303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+1098
-5303
lines changed

.circleci/comment.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ async function run() {
5959
[NextJS App Size](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/next-build-stats.txt)
6060
[Publish stats](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/publish.json)
6161
[Size diff since last release](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/size-diff.txt)
62-
[Docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/docs/index.html)
6362
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
6463
[S2 Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
6564
[S2 docs](https://d1pzu54gtk2aed.cloudfront.net/main/${process.env.CIRCLE_SHA1}/)
@@ -83,7 +82,6 @@ async function run() {
8382
8483
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
8584
* [View the S2 storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
86-
* [View the v3 docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)
8785
* [View the S2 docs](https://d1pzu54gtk2aed.cloudfront.net/pr/${process.env.CIRCLE_SHA1}/)
8886
* [View the React Aria docs](https://d5iwopk28bdhl.cloudfront.net/pr/${process.env.CIRCLE_SHA1}/)`
8987
});

.circleci/config.yml

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -485,45 +485,45 @@ jobs:
485485
paths:
486486
- '*/storybook-s2/'
487487

488-
docs:
488+
docs-production:
489489
executor: rsp-xlarge
490490
steps:
491491
- restore_cache:
492492
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
493493

494494
- run:
495495
name: build docs
496-
command: make website
496+
command: make website-production
497497

498498
- persist_to_workspace:
499499
root: dist
500500
paths:
501501
- '*/docs/'
502502

503-
docs-production:
503+
s2-docs:
504504
executor: rsp-xlarge
505505
steps:
506506
- restore_cache:
507507
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
508508

509509
- run:
510-
name: build docs
511-
command: make website-production
510+
name: build s2 docs
511+
command: make s2-docs
512512

513513
- persist_to_workspace:
514514
root: dist
515515
paths:
516-
- '*/docs/'
516+
- 's2-docs/'
517517

518-
s2-docs:
518+
s2-docs-stage:
519519
executor: rsp-xlarge
520520
steps:
521521
- restore_cache:
522522
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
523523

524524
- run:
525525
name: build s2 docs
526-
command: make s2-docs
526+
command: make s2-docs-stage
527527

528528
- persist_to_workspace:
529529
root: dist
@@ -567,37 +567,6 @@ jobs:
567567
paths:
568568
- storage
569569

570-
v-docs:
571-
executor: rsp-2xlarge
572-
steps:
573-
- restore_cache:
574-
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
575-
576-
- attach_workspace:
577-
at: /tmp/verdaccio-workspace
578-
579-
- run:
580-
name: build docs off verdaccio
581-
command: |
582-
./scripts/verdaccio-ci.sh
583-
./scripts/verdaccio-build.sh
584-
environment:
585-
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
586-
587-
- run:
588-
name: build docs off verdaccio retry
589-
command: |
590-
./scripts/verdaccio-ci.sh
591-
./scripts/verdaccio-build.sh
592-
environment:
593-
VERDACCIO_STORAGE_PATH: /tmp/verdaccio-workspace/storage
594-
when: on_fail
595-
596-
- persist_to_workspace:
597-
root: verdaccio_dist
598-
paths:
599-
- '*/verdaccio/docs'
600-
601570
v-rsp-cra-18:
602571
executor: rsp-xlarge
603572
steps:
@@ -973,13 +942,10 @@ workflows:
973942
- storybook-s2:
974943
requires:
975944
- install
976-
- docs:
977-
requires:
978-
- install
979945
- s2-docs:
980946
requires:
981947
- install
982-
- s2-docs-production:
948+
- s2-docs-stage:
983949
requires:
984950
- install
985951
filters:
@@ -991,9 +957,6 @@ workflows:
991957
only: main
992958
requires:
993959
- install
994-
- v-docs:
995-
requires:
996-
- verdaccio
997960
- v-rsp-cra-18:
998961
requires:
999962
- verdaccio
@@ -1038,7 +1001,6 @@ workflows:
10381001
- test-esm
10391002
- storybook
10401003
- storybook-s2
1041-
- docs
10421004
- deploy-s3-stage:
10431005
name: deploy-s3-commit
10441006
requires:
@@ -1050,13 +1012,12 @@ workflows:
10501012
name: deploy-s3-main
10511013
requires:
10521014
- s2-docs
1053-
- s2-docs-production
1015+
- s2-docs-stage
10541016
filters:
10551017
branches:
10561018
only: main
10571019
- deploy-verdaccio:
10581020
requires:
1059-
- v-docs
10601021
- v-rsp-cra-18
10611022
- v-webpack-4
10621023
- v-nextjs

Makefile

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ website-production:
117117
$(MAKE) starter-zip
118118
$(MAKE) tailwind-starter
119119
$(MAKE) s2-storybook-docs
120+
mv starters/docs/storybook-static dist/production/docs/react-aria-starter
121+
mv starters/docs/react-aria-starter.zip dist/production/docs/react-aria-starter.$$(git rev-parse --short HEAD).zip
122+
mv starters/tailwind/storybook-static dist/production/docs/react-aria-tailwind-starter
123+
mv starters/tailwind/react-aria-tailwind-starter.zip dist/production/docs/react-aria-tailwind-starter.$$(git rev-parse --short HEAD).zip
120124

121125
check-examples:
122126
node scripts/extractExamples.mjs
@@ -128,18 +132,14 @@ starter:
128132
starter-zip: starter
129133
cp LICENSE starters/docs/.
130134
cd starters/docs && zip -r react-aria-starter.zip . -x .gitignore .DS_Store "node_modules/*" "storybook-static/*"
131-
mv starters/docs/react-aria-starter.zip dist/production/docs/react-aria-starter.$$(git rev-parse --short HEAD).zip
132135
cd starters/docs && yarn build-storybook
133-
mv starters/docs/storybook-static dist/production/docs/react-aria-starter
134136

135137
tailwind-starter:
136138
cp LICENSE starters/tailwind/.
137139
cd starters/tailwind && yarn --no-immutable && yarn up react-aria-components && yarn up tailwindcss-react-aria-components && yarn tsc
138140

139141
cd starters/tailwind && zip -r react-aria-tailwind-starter.zip . -x .gitignore .DS_Store "node_modules/*" "storybook-static/*"
140-
mv starters/tailwind/react-aria-tailwind-starter.zip dist/production/docs/react-aria-tailwind-starter.$$(git rev-parse --short HEAD).zip
141142
cd starters/tailwind && yarn build-storybook
142-
mv starters/tailwind/storybook-static dist/production/docs/react-aria-tailwind-starter
143143

144144
s2-storybook-docs:
145145
yarn build:s2-storybook-docs -o dist/production/docs/s2
@@ -153,10 +153,17 @@ s2-docs:
153153
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/react-aria/$(BRANCH_TYPE)/$(HASH)/robots.txt
154154
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/s2/$(BRANCH_TYPE)/$(HASH)/robots.txt
155155

156+
s2-docs-stage:
157+
DOCS_ENV=stage PUBLIC_URL=/ $(MAKE) build-s2-docs
158+
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/react-aria/$(BRANCH_TYPE)/$(HASH)/robots.txt
159+
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/s2/$(BRANCH_TYPE)/$(HASH)/robots.txt
160+
$(MAKE) starters
161+
156162
s2-docs-production:
157163
DOCS_ENV=prod PUBLIC_URL=/ $(MAKE) build-s2-docs
158164
cp packages/dev/docs/pages/robots.txt dist/s2-docs/react-aria/robots.txt
159165
cp packages/dev/docs/pages/robots.txt dist/s2-docs/s2/robots.txt
166+
$(MAKE) starters
160167

161168
build-s2-docs:
162169
yarn workspace @react-spectrum/s2-docs generate:md
@@ -171,3 +178,16 @@ build-s2-docs:
171178
mkdir -p dist/s2-docs/react-aria/$(PUBLIC_URL)/registry
172179
mv starters/docs/registry dist/s2-docs/react-aria/$(PUBLIC_URL)/registry/vanilla
173180
mv starters/tailwind/registry dist/s2-docs/react-aria/$(PUBLIC_URL)/registry/tailwind
181+
182+
# Build old docs pages, which get inter-mixed with the new pages
183+
# TODO: We probably don't need to build this on every PR
184+
yarn parcel build 'packages/@react-spectrum/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx' --dist-dir dist/s2-docs/s2/$(PUBLIC_URL) --public-url $(PUBLIC_URL)
185+
yarn parcel build 'packages/@react-{aria,stately}/*/docs/*.mdx' --dist-dir dist/s2-docs/react-aria/$(PUBLIC_URL) --public-url $(PUBLIC_URL)
186+
187+
starters:
188+
$(MAKE) starter-zip
189+
$(MAKE) tailwind-starter
190+
mv starters/docs/storybook-static dist/s2-docs/react-aria-starter
191+
mv starters/docs/react-aria-starter.zip dist/s2-docs/react-aria-starter.$$(git rev-parse --short HEAD).zip
192+
mv starters/tailwind/storybook-static dist/s2-docs/react-aria-tailwind-starter
193+
mv starters/tailwind/react-aria-tailwind-starter.zip dist/s2-docs/react-aria-tailwind-starter.$$(git rev-parse --short HEAD).zip

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ React Spectrum includes several libraries, which you can choose depending on you
4747

4848
One of the goals of the React Spectrum project is to make building design systems and component libraries as easy as possible, while maintaining high quality interactions and accessibility support. We aim to raise the bar for web applications. The best way to achieve that goal is **together**. We would love contributions from the community no matter how big or small. 😍
4949

50-
Read our [contributing guide](https://react-spectrum.adobe.com/contribute.html) to learn about how to propose bugfixes and improvements, and how the development process works. For detailed information about our architecture, and how all of the pieces fit together, read our [architecture docs](https://react-spectrum.adobe.com/architecture.html).
50+
Read our [contributing guide](https://github.com/adobe/react-spectrum/blob/main/CONTRIBUTING.md) to learn about how to propose bugfixes and improvements, and how the development process works. For detailed information about our architecture, and how all of the pieces fit together, read our [architecture docs](https://react-spectrum.adobe.com/architecture.html).

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"start:s2": "NODE_ENV=storybook storybook dev -p 6006 --ci -c '.storybook-s2'",
2424
"build:storybook-s2": "NODE_ENV=storybook storybook build -c .storybook-s2 -o dist/$(git rev-parse HEAD)/storybook-s2",
2525
"build:s2-storybook-docs": "NODE_ENV=storybook storybook build -c .storybook-s2 --docs",
26-
"start:docs": "DOCS_ENV=dev parcel 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/react-aria-components/docs/**/*.mdx' 'packages/@internationalized/*/docs/*.mdx' 'packages/dev/docs/pages/**/*.mdx'",
27-
"build:docs": "DOCS_ENV=staging parcel build 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/react-aria-components/docs/**/*.mdx' 'packages/@internationalized/*/docs/*.mdx' 'packages/dev/docs/pages/**/*.mdx'",
26+
"start:docs": "DOCS_ENV=dev parcel 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'",
27+
"build:docs": "DOCS_ENV=staging parcel build 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'",
2828
"start:s2-docs": "yarn workspace @react-spectrum/s2-docs start",
2929
"build:s2-docs": "yarn workspace @react-spectrum/s2-docs build",
3030
"build:mcp": "yarn workspace @react-spectrum/mcp build && yarn workspace @react-aria/mcp build",

packages/@react-aria/autocomplete/src/useSearchAutocomplete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface SearchAutocompleteAria<T> extends ValidationResult {
2525
labelProps: DOMAttributes,
2626
/** Props for the search input element. */
2727
inputProps: InputHTMLAttributes<HTMLInputElement>,
28-
/** Props for the list box, to be passed to [useListBox](useListBox.html). */
28+
/** Props for the list box, to be passed to `useListBox`. */
2929
listBoxProps: AriaListBoxOptions<T>,
3030
/** Props for the search input's clear button. */
3131
clearButtonProps: AriaButtonProps,

packages/@react-aria/breadcrumbs/docs/useBreadcrumbs.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ function BreadcrumbItem(props) {
180180
}
181181

182182
<Breadcrumbs>
183-
<BreadcrumbItem href="/">Home</BreadcrumbItem>
184-
<BreadcrumbItem href="/react-aria/">React Aria</BreadcrumbItem>
183+
<BreadcrumbItem href="#">Home</BreadcrumbItem>
184+
<BreadcrumbItem href="#">React Aria</BreadcrumbItem>
185185
<BreadcrumbItem>useBreadcrumbs</BreadcrumbItem>
186186
</Breadcrumbs>
187187
```
@@ -196,8 +196,8 @@ Breadcrumbs can be disabled using the `isDisabled` prop, passed to each disabled
196196

197197
```tsx example
198198
<Breadcrumbs>
199-
<BreadcrumbItem href="/" isDisabled>Home</BreadcrumbItem>
200-
<BreadcrumbItem href="/react-aria/">React Aria</BreadcrumbItem>
199+
<BreadcrumbItem href="#" isDisabled>Home</BreadcrumbItem>
200+
<BreadcrumbItem href="#">React Aria</BreadcrumbItem>
201201
<BreadcrumbItem>useBreadcrumbs</BreadcrumbItem>
202202
</Breadcrumbs>
203203
```

packages/@react-aria/button/docs/useButton.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ cross browser inconsistencies in interactions and accessibility features to cons
4848
* Keyboard focus management and cross browser normalization
4949
* Keyboard event support for <Keyboard>Space</Keyboard> and <Keyboard>Enter</Keyboard> keys
5050

51-
Read our [blog post](/blog/building-a-button-part-1.html) about the complexities of building buttons that work well across devices and interaction methods.
51+
Read our [blog post](../blog/building-a-button-part-1) about the complexities of building buttons that work well across devices and interaction methods.
5252

5353
## Anatomy
5454

@@ -131,7 +131,7 @@ The following examples show how to use the `Button` component created in the abo
131131

132132
`useButton` supports user interactions via mouse, keyboard, and touch. You can handle all of these via the `onPress` prop. This is similar to the standard `onClick` event, but normalized to support all interaction methods equally. In addition, the `onPressStart`, `onPressEnd`, and `onPressChange` events are fired as the user interacts with the button.
133133

134-
Each of these handlers receives a <TypeLink links={typesDocs.links} type={typesDocs.exports.PressEvent} />, which exposes information about the target and the type of event that triggered the interaction. See [usePress](usePress.html) for more details.
134+
Each of these handlers receives a <TypeLink links={typesDocs.links} type={typesDocs.exports.PressEvent} />, which exposes information about the target and the type of event that triggered the interaction. See [usePress](../usePress) for more details.
135135

136136
```tsx example
137137
function Example() {

packages/@react-aria/button/docs/useToggleButton.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ If a visual label is not provided (e.g. an icon only button), then an `aria-labe
7070
## Example
7171

7272
By default, `useToggleButton` assumes that you are using it with a native `<button>` element. You can use a custom
73-
element type by passing the `elementType` prop to `useToggleButton`. See the [useButton](useButton.html#custom-element-type)
73+
element type by passing the `elementType` prop to `useToggleButton`. See the [useButton](../Button/useButton.html#custom-element-type)
7474
docs for an example of this.
7575

7676
The following example shows how to use the `useToggleButton` and `useToggleState` hooks to build a toggle button.

packages/@react-aria/button/docs/useToggleButtonGroup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ hook in `@react-stately/toggle`. The state object should be passed as an option
7070
and `useToggleButtonGroupItem`.
7171

7272
**Note:** `useToggleButtonGroupItem` should only be used when it is contained within a toggle button group. For a
73-
standalone toggle button, use the [useToggleButton](useToggleButton.html) hook instead.
73+
standalone toggle button, use the [useToggleButton](../ToggleButton/useToggleButton.html) hook instead.
7474

7575
## Example
7676

0 commit comments

Comments
 (0)