Skip to content

Commit 07c8177

Browse files
dannifydevongovettsnowystinger
authored
docs(homepage): Homepage copy changes (#9315)
* update tagline * Update packages/dev/s2-docs/pages/s2/home/Home.tsx * A few updates * Add React Spectrum v3 link * Add Search Menu to S2 homepage * Hard code photos * fix imports * More copy and minor mobile improvements --------- Co-authored-by: Devon Govett <[email protected]> Co-authored-by: Robert Snow <[email protected]>
1 parent c80e3d1 commit 07c8177

File tree

15 files changed

+146
-106
lines changed

15 files changed

+146
-106
lines changed

packages/dev/s2-docs/pages/react-aria/index.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {Button} from 'tailwind-starter/Button';
2121
import ogImage from 'url:../../assets/ReactAriaOpenGraph.webp';
2222
import reactAriaFavicon from 'url:../../assets/react-aria.ico';
2323
import SearchMenuWrapperServer from '../../src/SearchMenuWrapperServer';
24+
import {SearchMenuButton} from '../../src/SearchMenuWrapper';
2425
import {getCurrentPage, getPages} from '../../src/getPages';
2526
import {getBaseUrl} from '../../src/pageUtils';
2627

@@ -108,7 +109,7 @@ export const description = 'Accessible, high quality UI components and hooks for
108109
<div className="flex flex-col md:flex-row items-center gap-4 my-10 justify-center">
109110
<a href="getting-started" className="no-underline bg-linear-to-r from-blue-600 to-indigo-600 border border-blue-700 shadow-[inset_0_1px_0_rgba(255,255,255,0.1)] text-base md:text-lg font-bold text-white px-8 py-3 rounded-full transition focus-ring dark:outline-white outline-offset-2 active:scale-95 cursor-pointer">Get Started</a>
110111
<SearchMenuWrapperServer currentPage={props.currentPage}>
111-
<span className="block font-spectrum no-underline bg-white/60 border border-black/10 bg-clip-padding text-base md:text-lg font-bold text-slate-800 px-8 py-3 rounded-full backdrop-saturate-150 backdrop-brightness-125 transition hover:bg-white/60 focus-ring dark:outline-white outline-offset-2 group-pressed:scale-95 cursor-pointer focus-ring group-focus-visible:outline-2">Explore Components</span>
112+
<SearchMenuButton className="block font-spectrum no-underline bg-white/60 border border-black/10 bg-clip-padding text-base md:text-lg font-bold text-slate-800 px-8 py-3 rounded-full backdrop-saturate-150 backdrop-brightness-125 transition hover:bg-white/60 focus-ring dark:outline-white outline-offset-2 pressed:scale-95 focus-ring focus-visible:outline-2">Explore Components</SearchMenuButton>
112113
</SearchMenuWrapperServer>
113114
</div>
114115

@@ -632,10 +633,10 @@ export const description = 'Accessible, high quality UI components and hooks for
632633
</a>
633634

634635
<SearchMenuWrapperServer currentPage={props.currentPage}>
635-
<span className="block text-start no-underline card-shadow bg-white dark:bg-zinc-800 rounded-xl p-6 transition duration-300 card-shadow-hover hover:scale-[101%] cursor-pointer group-focus-visible:!outline-blue-600 group-focus-visible:dark:!outline-blue-500 group-focus-visible:!outline-2">
636+
<SearchMenuButton className="font-[inherit] block text-start no-underline card-shadow bg-white dark:bg-zinc-800 rounded-xl p-6 transition duration-300 card-shadow-hover hover:scale-[101%] cursor-pointer">
636637
<CardTitle>View Components <ArrowRight aria-hidden className="inline w-5 h-5 mb-1 align-middle" /></CardTitle>
637638
<CardDescription>See an overview of all of the components and hooks offered by React Aria.</CardDescription>
638-
</span>
639+
</SearchMenuButton>
639640
</SearchMenuWrapperServer>
640641

641642
<a href="examples/" className="no-underline card-shadow bg-white dark:bg-zinc-800 rounded-xl p-6 transition duration-300 card-shadow-hover hover:scale-[101%]">

packages/dev/s2-docs/pages/s2/home/ExampleApp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ export function AppFrame({children, inert, hidden, page, onPageChange}: any) {
293293
<Sidebar page={page} onPageChange={onPageChange} />
294294
<div
295295
data-content
296+
inert={!children}
296297
className={style({
297298
gridArea: 'content',
298299
backgroundColor: 'base',

packages/dev/s2-docs/pages/s2/home/Home.tsx

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { size, style } from "@react-spectrum/s2/style" with {type: 'macro'};
2-
// @ts-ignore
3-
import { getColorScale } from "../../../src/color.macro" with {type: 'macro'};
4-
// @ts-ignore
5-
import { Code } from "../../../src/Code";
6-
// @ts-ignore
7-
import { Pre } from "../../../src/CodePlatter";
2+
import { getColorScale } from "@react-spectrum/s2-docs/src//color.macro" with {type: 'macro'};
3+
import { Code } from "@react-spectrum/s2-docs/src//Code";
4+
import { Pre } from "@react-spectrum/s2-docs/src/CodePlatter";
85
import { ObjectStyles } from "./ObjectStyles";
96
import { DarkMode } from "./DarkMode";
107
import { AppFrame, ExampleApp } from "./ExampleApp";
11-
import { Divider, Link, LinkButton, Provider } from "@react-spectrum/s2";
8+
import { Button, Divider, Link, LinkButton, Provider } from "@react-spectrum/s2";
129
import { Mobile } from "./Mobile";
1310
import { Rems } from "./Rems";
1411
// import { PressAnimation } from "./Press";
@@ -40,14 +37,15 @@ import { Responsive } from "./Responsive";
4037
import { mergeStyles } from "../../../../../@react-spectrum/s2/style/runtime";
4138
import { ReduceMotion } from "./ReduceMotion";
4239
import { Colors } from "./Colors";
43-
import '../../../src/footer.css';
40+
import '@react-spectrum/s2-docs/src/footer.css';
4441
// @ts-ignore
4542
import bg from 'data-url:./bg.svg';
4643
// import { SubmenuAnimation } from "./SubmenuAnimation";
4744
// @ts-ignore
4845
import { keyframes } from "../../../../../@react-spectrum/s2/style/style-macro" with {type: 'macro'};
49-
// @ts-ignore
50-
import { getBaseUrl } from "../../../src/pageUtils";
46+
import { getBaseUrl } from "@react-spectrum/s2-docs/src/pageUtils";
47+
import SearchMenuWrapperServer from "@react-spectrum/s2-docs/src/SearchMenuWrapperServer";
48+
import type {Page} from "@parcel/rsc";
5149
// @ts-ignore
5250
import { fontSizeToken } from "../../../../../@react-spectrum/s2/style/tokens" with {type: 'macro'};
5351
// @ts-ignore
@@ -64,7 +62,8 @@ const container = style({
6462
position: 'relative',
6563
overflow: 'clip',
6664
display: 'flex',
67-
flexDirection: 'column'
65+
flexDirection: 'column',
66+
rowGap: 12
6867
});
6968

7069
// Animated heading sliding in from the top.
@@ -157,7 +156,7 @@ const swapRow = style({
157156
height: '[1.2em]'
158157
});
159158

160-
export function Home() {
159+
export function Home({currentPage}: {currentPage: Page}) {
161160
let headingId = useId();
162161
return (
163162
<body
@@ -228,10 +227,12 @@ export function Home() {
228227
<span className={swapSizer} aria-hidden>React Spectrum</span>
229228
</span>
230229
</HomeH1>
231-
<p className={style({font: 'body-3xl', marginY: 0, color: 'white'})}>React Spectrum gives you the power to build high quality, accessible UI with the cohesive look and feel of Adobe. </p>
232-
<div className={style({display: 'flex', gap: 16, flexDirection: {default: 'column', sm: 'row'}, marginTop: 32, marginBottom: 56})}>
230+
<p className={style({font: {default: 'body-2xl', md: 'body-3xl'}, marginY: 0, color: 'white', textWrap: 'balance'})}>React Spectrum empowers you to build high quality, accessible, cohesive apps with Adobe's signature design.</p>
231+
<div className={style({display: 'flex', gap: 16, flexDirection: {default: 'column', sm: 'row'}, marginTop: 32, marginBottom: 96})}>
233232
<LinkButton size="XL" staticColor="white" href="getting-started">Get started</LinkButton>
234-
<LinkButton size="XL" staticColor="white" variant="secondary" href="react-spectrum">Explore components</LinkButton>
233+
<SearchMenuWrapperServer currentPage={currentPage}>
234+
<Button size="XL" staticColor="white" variant="secondary">Explore components</Button>
235+
</SearchMenuWrapperServer>
235236
</div>
236237
<section aria-label="Example app" className={style({height: 'calc(100svh - 24px)', maxHeight: size(600)})}>
237238
<ExampleApp showArrows />
@@ -240,10 +241,10 @@ export function Home() {
240241
<main className={style({marginX: 'auto', paddingX: {default: 16, sm: 40}, maxWidth: 1600})}>
241242
<Section
242243
title="Build Once. Adapt Everywhere."
243-
description="React Spectrum makes interfaces more accessible, flexible, and easier to maintain, while giving users a seamless experience no matter where they are.">
244+
description="React Spectrum makes interfaces more accessible, flexible, and maintainable, giving users a seamless experience no matter where they are.">
244245
<Feature
245246
title="Dark mode"
246-
description="Deliver effortless dark and light mode support with no extra styling needed."
247+
description="Deliver effortless light and dark mode support with no extra styling needed."
247248
illustration={<Lightbulb />}
248249
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3', xl: 'span 4'}})}>
249250
<DarkMode />
@@ -257,7 +258,7 @@ export function Home() {
257258
</Feature>
258259
<Feature
259260
title="Global ready by default"
260-
description="Automatically mirrors component layouts, and formats text for different languages, currencies, dates, and locales."
261+
description="Components automatically mirror their layout and format text for different languages, currencies, dates, and locales."
261262
illustration={<Translate />}
262263
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3'}})}>
263264
<Provider
@@ -297,14 +298,14 @@ export function Home() {
297298
</Feature> */}
298299
<Feature
299300
title="High contrast mode"
300-
description="Support for high contrast mode included, ensuring a clear and readable experience based on preference."
301+
description="Support for high contrast mode is included, ensuring a clear and readable experience based on preference."
301302
illustration={<Accessibility />}
302303
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3', xl: 'span 2'}})}>
303304
<HCM />
304305
</Feature>
305306
<Feature
306307
title="Adaptive font sizes"
307-
description="Fonts scale automatically according to user preferences and screen size, fully compatible with rem-based typography, allowing your text to scale naturally."
308+
description="Fonts scale automatically according to user preferences and screen size using rem-based typography, allowing your text to scale naturally."
308309
illustration={<TextIcon />}
309310
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3', xl: 'span 4'}})}>
310311
<Rems />
@@ -328,28 +329,28 @@ export function Home() {
328329
<SubmenuAnimation />
329330
</Feature>
330331
</Section> */}
331-
<Section title="Everything you need to build beautiful apps" description="Bring your interface to life with expressive icons, Spectrum colors, and rich illustrations. Every detail works together to make your product look polished and on-brand.">
332+
<Section title="Everything you need to build beautiful apps." description="Bring your interface to life with expressive icons, Spectrum colors, and rich illustrations. Every detail works together to make your product look polished and on-brand.">
332333
<Feature
333334
title="Icons"
334-
description="Spectrum icon support for your product. Use the icon search to simplify finding the right icon the right experience."
335+
description={<>With hundreds of Spectrum icons to choose from, use our <Link href="icons" variant="secondary">icon search</Link> to find the right icon for the right experience.</>}
335336
illustration={<VectorDraw />}
336337
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3'}})}>
337338
<Icons />
338339
</Feature>
339340
<Feature
340341
title="Illustrations"
341-
description="Rich illustrations that help bring your interface to life. Use the illustration search to find the right illustration for your product."
342+
description={<>Rich illustrations help bring your interface to life. Use our <Link href="illustrations" variant="secondary">illustration search</Link> to find the right illustration for your product.</>}
342343
illustration={<IllustrationIcon />}
343344
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3'}})}>
344345
<Illustrations />
345346
</Feature>
346347
</Section>
347348
<Section
348-
title={<>Rapidly style custom components with Style Macros</>}
349+
title={<>Rapidly style custom components with Style Macros.</>}
349350
description={<>Easily use Spectrum tokens like colors, spacing, and typography in your own custom components with style macros. Styles are <strong>colocated</strong> with your component code, allowing you to <strong>develop more efficiently</strong> and <strong>refactor with confidence</strong> – no more CSS conflicts or specificity issues. Style macros generate atomic CSS at build time, so you get tiny bundle sizes and fast runtime performance.</>}>
350351
<Feature
351352
title="Colors"
352-
description="Access the full range of Spectrum color tokens when you need them."
353+
description="Convenient access to the full range of Spectrum color tokens."
353354
illustration={<Color />}
354355
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3', xl: 'span 2'}})}>
355356
<ColorScales />
@@ -363,21 +364,21 @@ export function Home() {
363364
</Feature>
364365
<Feature
365366
title="Object styles"
366-
description="Follow Spectrum's foundational design principles using object style tokens."
367+
description="Apply Spectrums foundational design principles using object-style tokens."
367368
illustration={<Shapes />}
368369
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3', xl: 'span 2'}})}>
369370
<ObjectStyles />
370371
</Feature>
371372
<Feature
372373
title="States and variants"
373-
description="Define the states needed for your custom components, all in one place using Spectrum tokens."
374+
description="Define the states for your custom components all in one place using Spectrum tokens."
374375
illustration={<Layers />}
375376
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 3'}})}>
376377
<States />
377378
</Feature>
378379
<Feature
379380
title="Reusable utilities"
380-
description="Macros are functions that can be used to create reusable style utilities for your own components."
381+
description="Use macros to create reusable style utilities for your own components."
381382
illustration={<CodeBrackets />}
382383
styles={style({gridColumnStart: {default: 'span 6', xl: 'span 3'}})}>
383384
<div className={style({display: 'flex', flexDirection: 'column', gap: 16, flexGrow: 1, justifyContent: 'space-between'})}>
@@ -441,14 +442,14 @@ const buttonStyle = style({
441442
</Feature>
442443
<Feature
443444
title="Responsive design"
444-
description="Adaptive UI built on Spectrum's responsive layout definitions.... *needs work"
445+
description="Adapt your application for any screen size using our built-in breakpoints, or define your own."
445446
illustration={<Phone />}
446447
style={{gridColumn: 'span 6'}}>
447448
<Responsive />
448449
</Feature>
449450
</Section>
450451
<Section
451-
title="Built for modern development and the modern web"
452+
title="Built for modern development and the modern web."
452453
description="With AI-ready documentation, server side and runtime performance optimizations, React Spectrum helps you build modern, scalable apps without compromise.">
453454
<Feature
454455
title="AI-ready"
@@ -459,19 +460,28 @@ const buttonStyle = style({
459460
</Feature>
460461
<Feature
461462
title="SSR"
462-
description="Server-side rendering and React Server Components support, maximizing Core Web Vitals with zero layout thrashing."
463+
description="Server-side rendering and React Server Components support maximize Core Web Vitals."
463464
illustration={<Server />}
464465
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 2'}})}>
465466

466467
</Feature>
467468
<Feature
468469
title="Small bundle"
469-
description="Aggressive tree-shaking and atomic CSS resulting in reduced bundle sizes and faster runtime performance."
470+
description="Aggressive tree-shaking and atomic CSS produce smaller bundles and faster runtime performance."
470471
illustration={<SpeedFast />}
471472
styles={style({gridColumnStart: {default: 'span 6', lg: 'span 2'}})}>
472473

473474
</Feature>
474475
</Section>
476+
<section className={style({paddingY: 64})}>
477+
<h2 className={style({font: 'heading-2xl', color: 'white'})}>Ready to get started?</h2>
478+
<div className={style({display: 'flex', gap: 16, flexDirection: {default: 'column', sm: 'row'}})}>
479+
<LinkButton size="XL" staticColor="white" href="getting-started">Install and setup</LinkButton>
480+
<SearchMenuWrapperServer currentPage={currentPage}>
481+
<Button size="XL" staticColor="white">Explore components</Button>
482+
</SearchMenuWrapperServer>
483+
</div>
484+
</section>
475485
</main>
476486
<footer
477487
className={style({
@@ -548,8 +558,8 @@ function Section({title, description, children}: any) {
548558
let headingId = useId();
549559
return (
550560
<section aria-labelledby={headingId} className={style({paddingY: 64})}>
551-
<h2 id={headingId} className={style({font: 'heading-2xl', color: 'white'})}>{title}</h2>
552-
<p className={style({font: 'body-2xl', color: 'white', maxWidth: '80%', marginBottom: 64})}>{description}</p>
561+
<h2 id={headingId} className={style({font: {default: 'heading-xl', sm: 'heading-2xl'}, color: 'white'})}>{title}</h2>
562+
<p className={style({font: {default: 'body-xl', sm: 'body-2xl'}, color: 'white', maxWidth: {default: 'full', lg: '75%'}, marginBottom: 64, textWrap: 'balance'})}>{description}</p>
553563
<div className={style({display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: 16})}>
554564
{children}
555565
</div>
@@ -561,11 +571,11 @@ function Feature({title, description, illustration, children, style: styleProp,
561571
let headingId = useId();
562572
return (
563573
<section aria-labelledby={headingId} className={mergeStyles(container, styles)} style={styleProp}>
564-
<div className={style({display: 'flex', flexDirection: {default: 'column', sm: 'row'}, gap: 12, alignItems: 'start', marginBottom: 12})}>
574+
<div className={style({display: 'flex', flexDirection: {default: 'column', sm: 'row'}, gap: 12, alignItems: 'start'})}>
565575
<div style={{marginTop: -12, marginInlineStart: -12}}>
566576
{illustration}
567577
</div>
568-
<div>
578+
<div className={style({display: 'flex', flexDirection: 'column', rowGap: 4})}>
569579
<h3 id={headingId} className={style({font: 'heading', marginY: 0})}>{title}</h3>
570580
<p className={style({font: 'body-lg', marginY: 0})}>{description}</p>
571581
</div>

packages/dev/s2-docs/pages/s2/home/States.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ export function States() {
5959
className={style({
6060
gridArea: 'props',
6161
display: 'flex',
62-
alignItems: 'center',
63-
columnGap: 16
62+
flexDirection: 'column',
63+
alignItems: {
64+
default: 'center',
65+
xl: 'start'
66+
},
67+
gap: 16
6468
})}>
6569
<Picker
6670
label="Variant"

packages/dev/s2-docs/pages/s2/home/app/Ideas.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ import { Arrow, Arrows } from './Arrows';
1414
export function Ideas() {
1515
let {locale} = useLocale();
1616
let list = useAsyncList<Topic, number | null>({
17-
async load({signal, cursor}) {
18-
let page = cursor || 1;
19-
let res = await fetch(
20-
`https://api.unsplash.com/topics?page=${page}&per_page=30&client_id=AJuU-FPh11hn7RuumUllp4ppT8kgiLS7LtOHp_sp4nc`,
21-
{signal}
22-
);
23-
let items = (await res.json()).filter((topic: Topic) => !!topic.preview_photos);
24-
return {items, cursor: items.length ? page + 1 : null};
17+
async load() {
18+
let res = await import('./topics.json');
19+
let items = res.filter((topic: Topic) => !!topic.preview_photos);
20+
return {items};
2521
}
2622
});
2723

0 commit comments

Comments
 (0)