diff --git a/.circleci/comment.js b/.circleci/comment.js index fc238675dfe..fb9906eb906 100644 --- a/.circleci/comment.js +++ b/.circleci/comment.js @@ -10,7 +10,7 @@ async function run() { let pr; // If we aren't running on a PR commit, double check if this is a branch created for a fork. If so, we'll need to // comment the build link on the fork. - if (!process.env.CIRCLE_PULL_REQUEST) { + if (true) { try { const commit = await octokit.git.getCommit({ owner: 'adobe', @@ -41,7 +41,7 @@ async function run() { break; } } - } else if (!process.env.CIRCLE_PULL_REQUEST) { + } else if (true) { // If it isn't a PR commit, then we are on main. Create a comment for the test app and docs build await octokit.repos.createCommitComment({ owner: 'adobe', diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e0309e3364..5eaa4e69338 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -390,7 +390,7 @@ jobs: - store_artifacts: path: ~/junit - test-esm: + test-build: executor: rsp-2xlarge steps: - restore_cache: @@ -401,6 +401,7 @@ jobs: command: | make build node --loader ./scripts/esm-support/loader.mjs ./scripts/esm-support/testESM.mjs + node scripts/testCJS.cjs lint: executor: rsp-xlarge @@ -921,7 +922,7 @@ workflows: - test-ssr-18: requires: - install-18 - - test-esm: + - test-build: requires: - install - lint: @@ -965,9 +966,9 @@ workflows: branches: only: main - verdaccio: - filters: - branches: - only: main + # filters: + # branches: + # only: main requires: - install - v-rsp-cra-18: @@ -1014,7 +1015,7 @@ workflows: - test-17 - test-ssr-18 - test-18 - - test-esm + - test-build - storybook - storybook-s2 - deploy-s3-stage: diff --git a/.parcelrc-storybook b/.parcelrc-storybook deleted file mode 100644 index 2ff3823ae26..00000000000 --- a/.parcelrc-storybook +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "@parcel/config-storybook", - "resolvers": ["@parcel/resolver-glob", "..."], - "transformers": { - "packages/*/*/intl/*.json": ["parcel-transformer-intl"] - } -} diff --git a/.storybook/.parcelrc b/.storybook/.parcelrc index c2544f2aec3..f725210d16d 100644 --- a/.storybook/.parcelrc +++ b/.storybook/.parcelrc @@ -2,7 +2,7 @@ "extends": "@parcel/config-storybook", "resolvers": ["@parcel/resolver-glob", "..."], "transformers": { - "packages/*/*/intl/*.json": ["parcel-transformer-intl"], + "packages/**/intl/**/*.json": ["parcel-transformer-intl"], "raw:*": ["@parcel/transformer-raw"] } } diff --git a/.storybook/main.js b/.storybook/main.js index e062445e402..6d2ed3805fe 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -3,6 +3,9 @@ module.exports = { stories: [ '../packages/@{react-aria,react-stately,spectrum-icons}/*/stories/*.stories.{js,jsx,ts,tsx}', '../packages/@react-spectrum/!(s2)/stories/*.stories.{js,jsx,ts,tsx}', + '../packages/@adobe/react-spectrum/stories/*/*.stories.{js,jsx,ts,tsx}', + '../packages/react-aria/stories/*/*.stories.{js,jsx,ts,tsx}', + '../packages/react-stately/stories/*/*.stories.{js,jsx,ts,tsx}', '../packages/react-aria-components/stories/*.stories.{js,jsx,ts,tsx}' ], diff --git a/Makefile b/Makefile index 6d39a12ee2d..6b7a9f96748 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ clean_dist: rm -rf packages/@adobe/react-spectrum/i18n rm -rf packages/@react-aria/i18n/server rm -rf packages/@react-spectrum/s2/style/dist packages/@react-spectrum/s2/page.css packages/@react-spectrum/s2/icons packages/@react-spectrum/s2/illustrations + rm -rf packages/{@adobe/react-spectrum,@react-spectrum/s2,react-aria,react-stately,react-aria-components}/*.js clean_parcel: rm -rf .parcel-cache @@ -98,14 +99,16 @@ publish-nightly: build yarn publish:nightly build: - parcel build packages/@react-{spectrum,aria,stately}/*/ packages/@internationalized/{message,string,date,number}/ packages/react-aria-components --no-optimize --config .parcelrc-build + mkdir -p dist + yarn tsgo --project tsconfig.build.json --declaration --emitDeclarationOnly --outDir dist/types --rootDir packages + parcel build packages/@react-{spectrum,aria,stately}/*/ packages/@internationalized/{message,string,date,number}/ packages/{react-aria,react-stately,react-aria-components,@adobe/react-spectrum} --no-optimize --config .parcelrc-build yarn workspaces foreach --all -pt run prepublishOnly - for pkg in packages/@react-{spectrum,aria,stately}/*/ packages/@internationalized/{message,string,date,number}/ packages/@adobe/react-spectrum/ packages/react-aria/ packages/react-stately/ packages/react-aria-components/; \ - do node scripts/buildEsm.js $$pkg; \ - done + node scripts/buildEsm.js node scripts/buildI18n.js node scripts/generateIconDts.js node scripts/fixUseClient.js + node scripts/moveTypes.mjs + rm -rf types website: yarn build:docs --public-url /reactspectrum/$$(git rev-parse HEAD)/docs --dist-dir dist/$$(git rev-parse HEAD)/docs diff --git a/bin/useLayoutEffectRule.js b/bin/useLayoutEffectRule.js index fe2b47b04fe..b725e563a95 100644 --- a/bin/useLayoutEffectRule.js +++ b/bin/useLayoutEffectRule.js @@ -15,7 +15,7 @@ module.exports = { return { ImportDeclaration(node) { const source = node.source.value; - if (source === '@react-aria/utils' || source === './useLayoutEffect' || source === './') { + if (source !== 'react') { return; } const importSpecifiers = node.specifiers.filter(specifier => specifier.type === 'ImportSpecifier'); diff --git a/eslint.config.mjs b/eslint.config.mjs index febc4cebfdd..f90200bfa2b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -189,7 +189,7 @@ export default [{ "no-nested-ternary": ERROR, "no-multiple-empty-lines": ERROR, "no-unneeded-ternary": ERROR, - "no-duplicate-imports": ERROR, + // "no-duplicate-imports": ERROR, "react/display-name": OFF, "react/jsx-curly-spacing": [ERROR, "never"], "react/jsx-indent-props": [ERROR, ERROR], @@ -337,16 +337,6 @@ export default [{ "jsx-a11y/scope": ERROR, "jsx-a11y/tabindex-no-positive": ERROR, - "monorepo/no-internal-import": [ERROR, { - ignore: [ - "@adobe/spectrum-css-temp", - "@spectrum-icons/ui", - "@spectrum-icons/workflow", - "@spectrum-icons/illustrations", - "@react-spectrum/s2/icons" - ], - }], - "monorepo/no-relative-import": ERROR, }, }, { diff --git a/examples/rac-spectrum-tailwind/tsconfig.json b/examples/rac-spectrum-tailwind/tsconfig.json index 0163835a93a..66c175a102c 100644 --- a/examples/rac-spectrum-tailwind/tsconfig.json +++ b/examples/rac-spectrum-tailwind/tsconfig.json @@ -13,7 +13,7 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, diff --git a/examples/rsp-cra-18/src/App.tsx b/examples/rsp-cra-18/src/App.tsx index 0abebf7ad5d..1ca5cd4f2f3 100644 --- a/examples/rsp-cra-18/src/App.tsx +++ b/examples/rsp-cra-18/src/App.tsx @@ -3,7 +3,7 @@ import {Provider, defaultTheme, Item, TagGroup, Cell, Column, Row, TableBody, Ta import Lighting from './Lighting'; import {useState} from 'react' import BodyContent from './BodyContent'; -import {enableTableNestedRows} from '@react-stately/flags'; +import {enableTableNestedRows} from 'react-stately/private/flags/flags'; import ButtonExamples from './sections/ButtonExamples'; import CollectionExamples from './sections/CollectionExamples'; import DateTimeExamples from './sections/DateTimeExamples'; diff --git a/examples/rsp-cra-18/src/AutocompleteExample.tsx b/examples/rsp-cra-18/src/AutocompleteExample.tsx index e92c4d8d763..66d82987f64 100644 --- a/examples/rsp-cra-18/src/AutocompleteExample.tsx +++ b/examples/rsp-cra-18/src/AutocompleteExample.tsx @@ -1,5 +1,5 @@ import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components' -import {classNames} from '@react-spectrum/utils'; +import {classNames} from '@adobe/react-spectrum/private/utils/classNames'; import styles from './autocomplete.css'; interface AutocompleteItem { diff --git a/examples/rsp-cra-18/src/sections/StatusExamples.tsx b/examples/rsp-cra-18/src/sections/StatusExamples.tsx index 03375a112cc..d2a478ffc93 100644 --- a/examples/rsp-cra-18/src/sections/StatusExamples.tsx +++ b/examples/rsp-cra-18/src/sections/StatusExamples.tsx @@ -1,5 +1,4 @@ -import {Flex, Divider, Badge, InlineAlert, Heading, Content, LabeledValue, Meter, ProgressBar, ProgressCircle, StatusLight, Button} from '@adobe/react-spectrum'; -import {ToastContainer, ToastQueue} from '@react-spectrum/toast' +import {Flex, Divider, Badge, InlineAlert, Heading, Content, LabeledValue, Meter, ProgressBar, ProgressCircle, StatusLight, Button, ToastContainer, ToastQueue} from '@adobe/react-spectrum'; export default function StatusExamples() { return ( diff --git a/examples/rsp-cra-18/tsconfig.json b/examples/rsp-cra-18/tsconfig.json index d2befe045b8..ff87c41a6b7 100644 --- a/examples/rsp-cra-18/tsconfig.json +++ b/examples/rsp-cra-18/tsconfig.json @@ -14,7 +14,7 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, diff --git a/examples/rsp-next-ts-17/components/ReorderableListView.tsx b/examples/rsp-next-ts-17/components/ReorderableListView.tsx index 5c7d9b58d93..43fd81cf40c 100644 --- a/examples/rsp-next-ts-17/components/ReorderableListView.tsx +++ b/examples/rsp-next-ts-17/components/ReorderableListView.tsx @@ -1,5 +1,4 @@ -import { Item, ListView, Text, useListData } from "@adobe/react-spectrum"; -import { useDragAndDrop } from "@react-spectrum/dnd"; +import { Item, ListView, Text, useListData, useDragAndDrop } from "@adobe/react-spectrum"; import Folder from "@spectrum-icons/illustrations/Folder"; export default function ReorderableListView() { diff --git a/examples/rsp-next-ts-17/pages/_app.tsx b/examples/rsp-next-ts-17/pages/_app.tsx index d5a7ef8d618..b73773d8de8 100644 --- a/examples/rsp-next-ts-17/pages/_app.tsx +++ b/examples/rsp-next-ts-17/pages/_app.tsx @@ -8,13 +8,13 @@ import { Flex, Grid, View, + ToastContainer, } from "@adobe/react-spectrum"; import { ColorScheme } from "@react-types/provider"; import { useState } from "react"; import Moon from "@spectrum-icons/workflow/Moon"; import Light from "@spectrum-icons/workflow/Light"; -import { ToastContainer } from "@react-spectrum/toast"; -import {enableTableNestedRows} from '@react-stately/flags'; +import {enableTableNestedRows} from 'react-stately/private/flags/flags'; function MyApp({ Component, pageProps }: AppProps) { const [theme, setTheme] = useState("light"); diff --git a/examples/rsp-next-ts-17/pages/index.tsx b/examples/rsp-next-ts-17/pages/index.tsx index 09f8d7da63f..55b5e295ed0 100644 --- a/examples/rsp-next-ts-17/pages/index.tsx +++ b/examples/rsp-next-ts-17/pages/index.tsx @@ -84,14 +84,14 @@ import { DisclosurePanel, TreeView, TreeViewItem, - TreeViewItemContent + TreeViewItemContent, + ToastQueue, + SubmenuTrigger } from "@adobe/react-spectrum"; import Edit from "@spectrum-icons/workflow/Edit"; import NotFound from "@spectrum-icons/illustrations/NotFound"; import Section from "../components/Section"; import ReorderableListView from "../components/ReorderableListView"; -import {ToastQueue} from '@react-spectrum/toast'; -import {SubmenuTrigger} from "@react-spectrum/menu"; import FileTxt from '@spectrum-icons/workflow/FileTxt'; import Folder from '@spectrum-icons/workflow/Folder'; diff --git a/examples/rsp-next-ts-17/tsconfig.json b/examples/rsp-next-ts-17/tsconfig.json index 73e4afb1513..caeef2192cc 100644 --- a/examples/rsp-next-ts-17/tsconfig.json +++ b/examples/rsp-next-ts-17/tsconfig.json @@ -9,7 +9,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/examples/rsp-next-ts/components/AutocompleteExample.tsx b/examples/rsp-next-ts/components/AutocompleteExample.tsx index 7228c5688f8..5c1c8d3dbe9 100644 --- a/examples/rsp-next-ts/components/AutocompleteExample.tsx +++ b/examples/rsp-next-ts/components/AutocompleteExample.tsx @@ -1,5 +1,5 @@ import {Autocomplete, Input, Label, Menu, MenuItem, SearchField, Text, useFilter} from 'react-aria-components' -import {classNames} from '@react-spectrum/utils'; +import {classNames} from '@adobe/react-spectrum/private/utils/classNames'; import React from 'react'; import styles from './autocomplete.module.css'; diff --git a/examples/rsp-next-ts/components/ReorderableListView.tsx b/examples/rsp-next-ts/components/ReorderableListView.tsx index 5c7d9b58d93..43fd81cf40c 100644 --- a/examples/rsp-next-ts/components/ReorderableListView.tsx +++ b/examples/rsp-next-ts/components/ReorderableListView.tsx @@ -1,5 +1,4 @@ -import { Item, ListView, Text, useListData } from "@adobe/react-spectrum"; -import { useDragAndDrop } from "@react-spectrum/dnd"; +import { Item, ListView, Text, useListData, useDragAndDrop } from "@adobe/react-spectrum"; import Folder from "@spectrum-icons/illustrations/Folder"; export default function ReorderableListView() { diff --git a/examples/rsp-next-ts/pages/_app.tsx b/examples/rsp-next-ts/pages/_app.tsx index d791494cdf9..e64d05ed668 100644 --- a/examples/rsp-next-ts/pages/_app.tsx +++ b/examples/rsp-next-ts/pages/_app.tsx @@ -7,13 +7,13 @@ import { Flex, Grid, View, + ToastContainer, } from "@adobe/react-spectrum"; import { ColorScheme } from "@react-types/provider"; import { useState } from "react"; import Moon from "@spectrum-icons/workflow/Moon"; import Light from "@spectrum-icons/workflow/Light"; -import { ToastContainer } from "@react-spectrum/toast"; -import {enableTableNestedRows} from '@react-stately/flags'; +import {enableTableNestedRows} from 'react-stately/private/flags/flags'; import {useRouter, type NextRouter} from 'next/router'; import Script from 'next/script'; diff --git a/examples/rsp-next-ts/pages/index.tsx b/examples/rsp-next-ts/pages/index.tsx index 4b94a2f0447..51edad1361a 100644 --- a/examples/rsp-next-ts/pages/index.tsx +++ b/examples/rsp-next-ts/pages/index.tsx @@ -84,15 +84,15 @@ import { DisclosurePanel, TreeView, TreeViewItem, - TreeViewItemContent + TreeViewItemContent, + ToastQueue, + SubmenuTrigger } from "@adobe/react-spectrum"; import {AutocompleteExample} from "../components/AutocompleteExample"; import Edit from "@spectrum-icons/workflow/Edit"; import NotFound from "@spectrum-icons/illustrations/NotFound"; import Section from "../components/Section"; import ReorderableListView from "../components/ReorderableListView"; -import {ToastQueue} from '@react-spectrum/toast'; -import {SubmenuTrigger} from "@react-spectrum/menu"; import FileTxt from '@spectrum-icons/workflow/FileTxt'; import Folder from '@spectrum-icons/workflow/Folder'; diff --git a/examples/rsp-next-ts/tsconfig.json b/examples/rsp-next-ts/tsconfig.json index dc358701300..e4dacbf0e0d 100644 --- a/examples/rsp-next-ts/tsconfig.json +++ b/examples/rsp-next-ts/tsconfig.json @@ -9,7 +9,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/examples/rsp-webpack-4/src/App.js b/examples/rsp-webpack-4/src/App.js index da8eca112de..ed65587e902 100644 --- a/examples/rsp-webpack-4/src/App.js +++ b/examples/rsp-webpack-4/src/App.js @@ -3,7 +3,7 @@ import {Provider, defaultTheme, Item, TagGroup, Cell, Column, InlineAlert, Row, import Lighting from './Lighting'; import {useState} from 'react' import BodyContent from './BodyContent'; -import {enableTableNestedRows} from '@react-stately/flags'; +import {enableTableNestedRows} from 'react-stately/private/flags/flags'; let columns = [ {name: 'Foo', key: 'foo'}, diff --git a/examples/s2-esbuild-starter-app/tsconfig.json b/examples/s2-esbuild-starter-app/tsconfig.json index 554e640ede2..b1cae0c6f72 100644 --- a/examples/s2-esbuild-starter-app/tsconfig.json +++ b/examples/s2-esbuild-starter-app/tsconfig.json @@ -12,7 +12,7 @@ "strict": true, "forceConsistentCasingInFileNames": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, diff --git a/examples/s2-webpack-5-typescript-example/tsconfig.json b/examples/s2-webpack-5-typescript-example/tsconfig.json index 115bb034d22..411a1e99288 100644 --- a/examples/s2-webpack-5-typescript-example/tsconfig.json +++ b/examples/s2-webpack-5-typescript-example/tsconfig.json @@ -10,7 +10,7 @@ "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", diff --git a/jest.config.js b/jest.config.js index a71bca685f9..0c77e5fa46c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -156,7 +156,9 @@ module.exports = { testEnvironment: 'jsdom', // Options that will be passed to the testEnvironment - // testEnvironmentOptions: {}, + testEnvironmentOptions: { + customExportConditions: ['source'] + }, // Adds a location field to test results // testLocationInResults: false, diff --git a/lib/jestResolver.js b/lib/jestResolver.js index 9f5f9a85170..87e23d12f96 100644 --- a/lib/jestResolver.js +++ b/lib/jestResolver.js @@ -29,6 +29,12 @@ try { module.exports = (request, options) => { // Handle glob imports. if (request.endsWith('*.json')) { + if (!request.startsWith('.')) { + let pkg = request.startsWith('@') ? request.split('/').slice(0, 2).join('/') : request.split('/')[0]; + let resolved = options.defaultResolver(pkg, options); + let relative = path.relative(options.basedir, path.dirname(path.dirname(resolved))); + request = path.join(relative, request.startsWith('@') ? request.split('/').slice(2).join('/') : request.split('/').slice(1).join('/')); + } let files = glob.sync(request, {cwd: options.basedir}); let source = ''; for (let file of files) { @@ -44,6 +50,21 @@ module.exports = (request, options) => { ...options, // https://github.com/microsoft/accessibility-insights-web/pull/5421#issuecomment-1109168149 packageFilter: pkg => { + if (/(react-aria|react-spectrum|react-stately)/.test(pkg.name) && pkg.exports) { + processExports(pkg.exports); + if (!pkg.exports['.']) { + pkg.exports = { + '.': pkg.exports + }; + } + Object.assign(pkg.exports, { + './src/*': ['./src/*.ts', './src/*.tsx'], + './test/*.tsx': './test/*.tsx', + './test/*': './test/*.js' + }); + return pkg; + } + if (!pkg.name?.startsWith('@tailwind') && pkg.name !== 'tailwindcss' && !pkg.name?.startsWith('storybook') && !pkg.name?.startsWith('@storybook')) { delete pkg['exports']; delete pkg['module']; @@ -51,7 +72,7 @@ module.exports = (request, options) => { return pkg; } }); - if (/packages[\/\\].*[\/\\].*[\/\\]intl[\/\\].*\.json$/.test(resolved)) { + if (/packages[\/\\].*[\/\\]intl[\/\\].*\.json$/.test(resolved)) { let sourceText = fs.readFileSync(resolved, 'utf8'); let json = JSON.parse(sourceText); let res = compileStrings(json); @@ -77,3 +98,15 @@ function writeCacheFile(cacheFile, res) { fs.renameSync(tmpFile, cacheFile); return cacheFile; } + +function processExports(exports) { + for (let key in exports) { + if (typeof exports[key] === 'object') { + processExports(exports[key]); + } else if (key === 'import' || key === 'types' || key === 'require') { + delete exports[key]; + } else if (key === 'source') { + exports.default = exports.source; + } + } +} diff --git a/lib/svg.d.ts b/lib/svg.d.ts index 9569e1964b5..bb0f28f7ce1 100644 --- a/lib/svg.d.ts +++ b/lib/svg.d.ts @@ -25,3 +25,8 @@ declare module '*.svg' { const content: FunctionComponent> ; export default content; } + +declare module '*.json' { + const content: any; + export default content; +} diff --git a/package.json b/package.json index a9e0a772283..b12df3f8a2c 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "start:s2": "NODE_ENV=storybook storybook dev -p 6006 --ci -c '.storybook-s2'", "build:storybook-s2": "NODE_ENV=storybook storybook build -c .storybook-s2 -o dist/$(git rev-parse HEAD)/storybook-s2", "build:s2-storybook-docs": "NODE_ENV=storybook storybook build -c .storybook-s2 --docs", - "start:docs": "DOCS_ENV=dev parcel 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'", - "build:docs": "DOCS_ENV=staging parcel build 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'", + "start:docs": "DOCS_ENV=dev parcel 'packages/{@adobe/react-spectrum,react-aria,react-stately}/docs/**/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'", + "build:docs": "DOCS_ENV=staging parcel build 'packages/{@adobe/react-spectrum,react-aria,react-stately}/docs/**/*.mdx' 'packages/dev/docs/pages/{react-spectrum,releases}/**/*.mdx'", "start:s2-docs": "yarn workspace @react-spectrum/s2-docs start", "build:s2-docs": "yarn workspace @react-spectrum/s2-docs build", "check:s2-docs-build": "node packages/dev/s2-docs/scripts/validateS2DocsBuild.mjs", @@ -113,8 +113,8 @@ "@parcel/transformer-react-static": "^2.16.3", "@parcel/transformer-svg-react": "^2.16.3", "@parcel/transformer-typescript-types": "^2.16.3", - "@react-spectrum/parcel-namer-s2": "^0.3.0", - "@react-spectrum/s2-icon-builder": "^0.3.0", + "@react-spectrum/parcel-namer-s2": "workspace:^", + "@react-spectrum/s2-icon-builder": "workspace:^", "@spectrum-css/component-builder": "workspace:^", "@spectrum-css/vars": "^2.3.0", "@storybook/addon-a11y": "^9.0.18", @@ -249,6 +249,8 @@ "packages/@react-spectrum/style-macro-s1/**", "packages/@react-spectrum/tree/**", "packages/@react-spectrum/color/src/*.tsx", + "packages/@adobe/react-spectrum/src/tree/**", + "packages/@adobe/react-spectrum/src/color/*.tsx", "packages/@react-spectrum/s2/**/*.{js,ts,tsx}", "packages/@react-spectrum/s2/stories/**", ".storybook-s2/**", diff --git a/packages/@adobe/react-spectrum/.gitignore b/packages/@adobe/react-spectrum/.gitignore index 5669308ee0f..2b7c9c109c4 100644 --- a/packages/@adobe/react-spectrum/.gitignore +++ b/packages/@adobe/react-spectrum/.gitignore @@ -1 +1,3 @@ -i18n +/i18n +/*.js +/private diff --git a/packages/@adobe/react-spectrum/chromatic-fc/accordion/Accordion.stories.tsx b/packages/@adobe/react-spectrum/chromatic-fc/accordion/Accordion.stories.tsx new file mode 100644 index 00000000000..df46120ac18 --- /dev/null +++ b/packages/@adobe/react-spectrum/chromatic-fc/accordion/Accordion.stories.tsx @@ -0,0 +1,29 @@ +/* + * Copyright 2020 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +import {Meta, StoryObj} from '@storybook/react'; +import React from 'react'; +import {SpectrumAccordionProps} from '../../src/accordion/Accordion'; +import {Template} from '../../chromatic/accordion/Accordion.stories'; + +const meta: Meta = { + title: 'Accordion' +}; + +export default meta; + +export type AccordionStory = StoryObj; + +export const Default: AccordionStory = { + render: (args) =>