diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bdab14b28026b3..e07c57865cfd6c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -233,6 +233,7 @@ packages/react-components/react-breadcrumb @microsoft/cxe-prg packages/react-components/react-drawer @microsoft/cxe-prg packages/react-components/react-storybook-addon-codesandbox @microsoft/fluentui-react-build packages/react-components/babel-preset-storybook-full-source @microsoft/fluentui-react-build +packages/react-components/react-jsx-runtime @microsoft/teams-prg # <%= NX-CODEOWNER-PLACEHOLDER %> ## Components diff --git a/packages/react-components/react-jsx-runtime/.babelrc.json b/packages/react-components/react-jsx-runtime/.babelrc.json new file mode 100644 index 00000000000000..45fb71ca16d2c3 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/.babelrc.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../.babelrc-v9.json", + "plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] +} diff --git a/packages/react-components/react-jsx-runtime/.eslintrc.json b/packages/react-components/react-jsx-runtime/.eslintrc.json new file mode 100644 index 00000000000000..ceea884c70dccc --- /dev/null +++ b/packages/react-components/react-jsx-runtime/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["plugin:@fluentui/eslint-plugin/react"], + "root": true +} diff --git a/packages/react-components/react-jsx-runtime/.npmignore b/packages/react-components/react-jsx-runtime/.npmignore new file mode 100644 index 00000000000000..f7ce568a6dbf7c --- /dev/null +++ b/packages/react-components/react-jsx-runtime/.npmignore @@ -0,0 +1,30 @@ +.storybook/ +.vscode/ +bundle-size/ +config/ +coverage/ +docs/ +etc/ +node_modules/ +src/ +stories/ +dist/types/ +temp/ +__fixtures__ +__mocks__ +__tests__ + +*.api.json +*.log +*.spec.* +*.cy.* +*.test.* +*.yml + +# config files +*config.* +*rc.* +.editorconfig +.eslint* +.git* +.prettierignore diff --git a/packages/react-components/react-jsx-runtime/.swcrc b/packages/react-components/react-jsx-runtime/.swcrc new file mode 100644 index 00000000000000..b4ffa86dee3067 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/.swcrc @@ -0,0 +1,30 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "exclude": [ + "/testing", + "/**/*.cy.ts", + "/**/*.cy.tsx", + "/**/*.spec.ts", + "/**/*.spec.tsx", + "/**/*.test.ts", + "/**/*.test.tsx" + ], + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": true, + "decorators": false, + "dynamicImport": false + }, + "externalHelpers": true, + "transform": { + "react": { + "runtime": "classic", + "useSpread": true + } + }, + "target": "es2019" + }, + "minify": false, + "sourceMaps": true +} diff --git a/packages/react-components/react-jsx-runtime/LICENSE b/packages/react-components/react-jsx-runtime/LICENSE new file mode 100644 index 00000000000000..3345fffa9bb172 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/LICENSE @@ -0,0 +1,15 @@ +@fluentui/react-jsx-runtime + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license diff --git a/packages/react-components/react-jsx-runtime/README.md b/packages/react-components/react-jsx-runtime/README.md new file mode 100644 index 00000000000000..5e40fe7bcc7bee --- /dev/null +++ b/packages/react-components/react-jsx-runtime/README.md @@ -0,0 +1,5 @@ +# @fluentui/react-jsx-runtime + +**React Jsx Runtime components for [Fluent UI React](https://react.fluentui.dev/)** + +These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release. diff --git a/packages/react-components/react-jsx-runtime/config/api-extractor.json b/packages/react-components/react-jsx-runtime/config/api-extractor.json new file mode 100644 index 00000000000000..e533bf30b48a2b --- /dev/null +++ b/packages/react-components/react-jsx-runtime/config/api-extractor.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json" +} diff --git a/packages/react-components/react-jsx-runtime/config/tests.js b/packages/react-components/react-jsx-runtime/config/tests.js new file mode 100644 index 00000000000000..2e211ae9e21420 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/config/tests.js @@ -0,0 +1 @@ +/** Jest test setup file. */ diff --git a/packages/react-components/react-jsx-runtime/etc/react-jsx-runtime.api.md b/packages/react-components/react-jsx-runtime/etc/react-jsx-runtime.api.md new file mode 100644 index 00000000000000..85ea2e96e04b47 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/etc/react-jsx-runtime.api.md @@ -0,0 +1,9 @@ +## API Report File for "@fluentui/react-jsx-runtime" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/react-components/react-jsx-runtime/jest.config.js b/packages/react-components/react-jsx-runtime/jest.config.js new file mode 100644 index 00000000000000..b3440c12005efe --- /dev/null +++ b/packages/react-components/react-jsx-runtime/jest.config.js @@ -0,0 +1,21 @@ +// @ts-check + +/** + * @type {import('@jest/types').Config.InitialOptions} + */ +module.exports = { + displayName: 'react-jsx-runtime', + preset: '../../../jest.preset.js', + globals: { + 'ts-jest': { + tsconfig: '/tsconfig.spec.json', + diagnostics: false, + }, + }, + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + coverageDirectory: './coverage', + setupFilesAfterEnv: ['./config/tests.js'], + snapshotSerializers: ['@griffel/jest-serializer'], +}; diff --git a/packages/react-components/react-jsx-runtime/just.config.ts b/packages/react-components/react-jsx-runtime/just.config.ts new file mode 100644 index 00000000000000..b7b2c9a33bf435 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/just.config.ts @@ -0,0 +1,5 @@ +import { preset, task } from '@fluentui/scripts-tasks'; + +preset(); + +task('build', 'build:react-components').cached?.(); diff --git a/packages/react-components/react-jsx-runtime/package.json b/packages/react-components/react-jsx-runtime/package.json new file mode 100644 index 00000000000000..8ad4f1b06971dc --- /dev/null +++ b/packages/react-components/react-jsx-runtime/package.json @@ -0,0 +1,55 @@ +{ + "name": "@fluentui/react-jsx-runtime", + "version": "9.0.0-alpha.0", + "private": true, + "description": "React components for building web experiences", + "main": "lib-commonjs/index.js", + "module": "lib/index.js", + "typings": "./dist/index.d.ts", + "sideEffects": false, + "repository": { + "type": "git", + "url": "https://github.com/microsoft/fluentui" + }, + "license": "MIT", + "scripts": { + "build": "just-scripts build", + "clean": "just-scripts clean", + "code-style": "just-scripts code-style", + "just": "just-scripts", + "lint": "just-scripts lint", + "test": "jest --passWithNoTests", + "type-check": "tsc -b tsconfig.json", + "generate-api": "just-scripts generate-api" + }, + "devDependencies": { + "@fluentui/eslint-plugin": "*", + "@fluentui/react-conformance": "*", + "@fluentui/react-conformance-griffel": "9.0.0-beta.20", + "@fluentui/scripts-api-extractor": "*", + "@fluentui/scripts-tasks": "*" + }, + "dependencies": { + "@swc/helpers": "^0.4.14" + }, + "peerDependencies": { + "@types/react": ">=16.8.0 <19.0.0", + "react": ">=16.8.0 <19.0.0" + }, + "beachball": { + "disallowedChangeTypes": [ + "major", + "minor", + "patch" + ] + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": "./lib-commonjs/index.js", + "import": "./lib/index.js", + "require": "./lib-commonjs/index.js" + }, + "./package.json": "./package.json" + } +} diff --git a/packages/react-components/react-jsx-runtime/src/index.ts b/packages/react-components/react-jsx-runtime/src/index.ts new file mode 100644 index 00000000000000..aacbad0068e241 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/src/index.ts @@ -0,0 +1,2 @@ +// TODO: replace with real exports +export {}; diff --git a/packages/react-components/react-jsx-runtime/tsconfig.json b/packages/react-components/react-jsx-runtime/tsconfig.json new file mode 100644 index 00000000000000..12ca516af1c5b2 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "target": "ES2019", + "noEmit": true, + "isolatedModules": true, + "importHelpers": true, + "jsx": "react", + "noUnusedLocals": true, + "preserveConstEnums": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/react-components/react-jsx-runtime/tsconfig.lib.json b/packages/react-components/react-jsx-runtime/tsconfig.lib.json new file mode 100644 index 00000000000000..b2da24eff1b32f --- /dev/null +++ b/packages/react-components/react-jsx-runtime/tsconfig.lib.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019", "dom"], + "declaration": true, + "declarationDir": "../../../dist/out-tsc/types", + "outDir": "../../../dist/out-tsc", + "inlineSources": true, + "types": ["static-assets", "environment"] + }, + "exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"], + "include": ["./src/**/*.ts", "./src/**/*.tsx"] +} diff --git a/packages/react-components/react-jsx-runtime/tsconfig.spec.json b/packages/react-components/react-jsx-runtime/tsconfig.spec.json new file mode 100644 index 00000000000000..469fcba4d7ba75 --- /dev/null +++ b/packages/react-components/react-jsx-runtime/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node"] + }, + "include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 0e79fcf4d48ce6..b994a894ae86fd 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -47,6 +47,7 @@ "@fluentui/react-image": ["packages/react-components/react-image/src/index.ts"], "@fluentui/react-infobutton": ["packages/react-components/react-infobutton/src/index.ts"], "@fluentui/react-input": ["packages/react-components/react-input/src/index.ts"], + "@fluentui/react-jsx-runtime": ["packages/react-components/react-jsx-runtime/src/index.ts"], "@fluentui/react-label": ["packages/react-components/react-label/src/index.ts"], "@fluentui/react-link": ["packages/react-components/react-link/src/index.ts"], "@fluentui/react-menu": ["packages/react-components/react-menu/src/index.ts"], diff --git a/workspace.json b/workspace.json index 5734b81403817b..426abf087bf6bb 100644 --- a/workspace.json +++ b/workspace.json @@ -553,6 +553,13 @@ "tags": ["vNext", "platform:web"], "implicitDependencies": [] }, + "@fluentui/react-jsx-runtime": { + "root": "packages/react-components/react-jsx-runtime", + "projectType": "library", + "implicitDependencies": [], + "sourceRoot": "packages/react-components/react-jsx-runtime/src", + "tags": ["vNext", "platform:web"] + }, "@fluentui/react-label": { "root": "packages/react-components/react-label", "projectType": "library",