From 1af59d1a5b3cb40843350350f9570ff3e7158a37 Mon Sep 17 00:00:00 2001 From: Kyle Taborski Date: Wed, 7 Aug 2024 11:59:51 -0700 Subject: [PATCH] Nextjs example app - Adding fonts and improving mobile scale (#6745) * Adding fonts, color components, and improving mobile scale * remving no longer needed dev code * removing unused import * removing ColorPicker due to nextjs bug #68476 * adding adobe clean font --- examples/rsp-next-ts/package.json | 10 ++-- examples/rsp-next-ts/pages/_app.tsx | 75 +++++++++++++++++----------- examples/rsp-next-ts/pages/index.tsx | 19 ++++--- 3 files changed, 61 insertions(+), 43 deletions(-) diff --git a/examples/rsp-next-ts/package.json b/examples/rsp-next-ts/package.json index aef8fc2e314..7db2e777734 100644 --- a/examples/rsp-next-ts/package.json +++ b/examples/rsp-next-ts/package.json @@ -13,12 +13,12 @@ "test": "jest" }, "dependencies": { - "@adobe/react-spectrum": "^3.26.0", - "@react-aria/optimize-locales-plugin": "^1.0.0", - "@react-spectrum/color": "^3.0.0-beta.16", + "@adobe/react-spectrum": "^3.35.0", + "@react-aria/optimize-locales-plugin": "^1.1.0", + "@react-spectrum/color": "^3.0.0-beta.33", "@react-spectrum/provider": "^3.9.7", - "@react-spectrum/toast": "^3.0.0-alpha.0", - "@spectrum-icons/illustrations": "^3.5.0", + "@react-spectrum/toast": "^3.0.0-beta.11", + "@spectrum-icons/illustrations": "^3.6.12", "@spectrum-icons/workflow": "^4.2.12", "glob": "^10.3.12", "next": "^13.4.1", diff --git a/examples/rsp-next-ts/pages/_app.tsx b/examples/rsp-next-ts/pages/_app.tsx index 1fda71502e6..d791494cdf9 100644 --- a/examples/rsp-next-ts/pages/_app.tsx +++ b/examples/rsp-next-ts/pages/_app.tsx @@ -15,6 +15,7 @@ import Light from "@spectrum-icons/workflow/Light"; import { ToastContainer } from "@react-spectrum/toast"; import {enableTableNestedRows} from '@react-stately/flags'; import {useRouter, type NextRouter} from 'next/router'; +import Script from 'next/script'; declare module '@adobe/react-spectrum' { interface RouterConfig { @@ -31,39 +32,53 @@ function MyApp({ Component, pageProps }: AppProps) { enableTableNestedRows(); return ( - router.push(href, undefined, opts), - useHref: (href: string) => router.basePath + href - }} - locale="en"> - - + + router.push(href, undefined, opts), + useHref: (href: string) => router.basePath + href + }} + locale="en"> + - setTheme(otherTheme)} + - {themeIcons[otherTheme]} - - - - - - - - + setTheme(otherTheme)} + > + {themeIcons[otherTheme]} + + + + + + + + + ); } export default MyApp; diff --git a/examples/rsp-next-ts/pages/index.tsx b/examples/rsp-next-ts/pages/index.tsx index b1276b07ddd..84888af327a 100644 --- a/examples/rsp-next-ts/pages/index.tsx +++ b/examples/rsp-next-ts/pages/index.tsx @@ -82,7 +82,7 @@ import { ColorSlider, ColorSwatch, ColorSwatchPicker, - ColorWheel, + ColorWheel } from "@react-spectrum/color"; import ReorderableListView from "../components/ReorderableListView"; import {ToastQueue} from '@react-spectrum/toast'; @@ -110,6 +110,7 @@ export default function Home() { React Spectrum + NextJS + @@ -240,16 +241,18 @@ export default function Home() {
- + + + + + + + + + - - - - - -