diff --git a/.prettierignore b/.prettierignore index e794a80b7..b3cfa0949 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,3 +10,4 @@ CONTRIBUTING.md docs .next .cache +api-report/* \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index df4194c6d..69cbf5659 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@babel/preset-react": "^7.14.5", "@babel/preset-typescript": "7.23.3", "@formatjs/cli-lib": "6.3.3", + "@microsoft/api-extractor": "7.47.9", "@nrwl/eslint-plugin-nx": "19.5.4", "@nrwl/linter": "19.5.4", "@nx/eslint": "19.5.4", @@ -5180,19 +5181,19 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.47.4", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.4.tgz", - "integrity": "sha512-HKm+P4VNzWwvq1Ey+Jfhhj/3MjsD+ka2hbt8L5AcRM95lu1MFOYnz3XlU7Gr79Q/ZhOb7W/imAKeYrOI0bFydg==", + "version": "7.47.9", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.9.tgz", + "integrity": "sha512-TTq30M1rikVsO5wZVToQT/dGyJY7UXJmjiRtkHPLb74Prx3Etw8+bX7Bv7iLuby6ysb7fuu1NFWqma+csym8Jw==", "dev": true, "license": "MIT", "dependencies": { - "@microsoft/api-extractor-model": "7.29.4", + "@microsoft/api-extractor-model": "7.29.8", "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.5.1", + "@rushstack/node-core-library": "5.9.0", "@rushstack/rig-package": "0.5.3", - "@rushstack/terminal": "0.13.3", - "@rushstack/ts-command-line": "4.22.3", + "@rushstack/terminal": "0.14.2", + "@rushstack/ts-command-line": "4.22.8", "lodash": "~4.17.15", "minimatch": "~3.0.3", "resolve": "~1.22.1", @@ -5205,15 +5206,15 @@ } }, "node_modules/@microsoft/api-extractor-model": { - "version": "7.29.4", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.4.tgz", - "integrity": "sha512-LHOMxmT8/tU1IiiiHOdHFF83Qsi+V8d0kLfscG4EvQE9cafiR8blOYr8SfkQKWB1wgEilQgXJX3MIA4vetDLZw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.8.tgz", + "integrity": "sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==", "dev": true, "license": "MIT", "dependencies": { "@microsoft/tsdoc": "~0.15.0", "@microsoft/tsdoc-config": "~0.17.0", - "@rushstack/node-core-library": "5.5.1" + "@rushstack/node-core-library": "5.9.0" } }, "node_modules/@microsoft/api-extractor-model/node_modules/@microsoft/tsdoc": { @@ -7810,9 +7811,9 @@ "license": "MIT" }, "node_modules/@rushstack/node-core-library": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.1.tgz", - "integrity": "sha512-ZutW56qIzH8xIOlfyaLQJFx+8IBqdbVCZdnj+XT1MorQ1JqqxHse8vbCpEM+2MjsrqcbxcgDIbfggB1ZSQ2A3g==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.9.0.tgz", + "integrity": "sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==", "dev": true, "license": "MIT", "dependencies": { @@ -7934,13 +7935,13 @@ } }, "node_modules/@rushstack/terminal": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.3.tgz", - "integrity": "sha512-fc3zjXOw8E0pXS5t9vTiIPx9gHA0fIdTXsu9mT4WbH+P3mYvnrX0iAQ5a6NvyK1+CqYWBTw/wVNx7SDJkI+WYQ==", + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.2.tgz", + "integrity": "sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==", "dev": true, "license": "MIT", "dependencies": { - "@rushstack/node-core-library": "5.5.1", + "@rushstack/node-core-library": "5.9.0", "supports-color": "~8.1.1" }, "peerDependencies": { @@ -7979,13 +7980,13 @@ } }, "node_modules/@rushstack/ts-command-line": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.3.tgz", - "integrity": "sha512-edMpWB3QhFFZ4KtSzS8WNjBgR4PXPPOVrOHMbb7kNpmQ1UFS9HdVtjCXg1H5fG+xYAbeE+TMPcVPUyX2p84STA==", + "version": "4.22.8", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.8.tgz", + "integrity": "sha512-XbFjOoV7qZHJnSuFUHv0pKaFA4ixyCuki+xMjsMfDwfvQjs5MYG0IK5COal3tRnG7KCDe2l/G+9LrzYE/RJhgg==", "dev": true, "license": "MIT", "dependencies": { - "@rushstack/terminal": "0.13.3", + "@rushstack/terminal": "0.14.2", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" @@ -13098,6 +13099,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/lodash.merge": { + "version": "4.6.9", + "resolved": "https://registry.npmjs.org/@types/lodash.merge/-/lodash.merge-4.6.9.tgz", + "integrity": "sha512-23sHDPmzd59kUgWyKGiOMO2Qb9YtqRO/x4IhkgNUiPQ1+5MUVqi6bCZeq9nBJ17msjIMbEIO5u+XW4Kz6aGUhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/mdx": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", @@ -25821,7 +25832,6 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, "license": "MIT" }, "node_modules/lodash.sortby": { @@ -32586,6 +32596,63 @@ } } }, + "node_modules/vite-plugin-dts/node_modules/@microsoft/api-extractor": { + "version": "7.47.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.4.tgz", + "integrity": "sha512-HKm+P4VNzWwvq1Ey+Jfhhj/3MjsD+ka2hbt8L5AcRM95lu1MFOYnz3XlU7Gr79Q/ZhOb7W/imAKeYrOI0bFydg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/api-extractor-model": "7.29.4", + "@microsoft/tsdoc": "~0.15.0", + "@microsoft/tsdoc-config": "~0.17.0", + "@rushstack/node-core-library": "5.5.1", + "@rushstack/rig-package": "0.5.3", + "@rushstack/terminal": "0.13.3", + "@rushstack/ts-command-line": "4.22.3", + "lodash": "~4.17.15", + "minimatch": "~3.0.3", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "source-map": "~0.6.1", + "typescript": "5.4.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/vite-plugin-dts/node_modules/@microsoft/api-extractor-model": { + "version": "7.29.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.4.tgz", + "integrity": "sha512-LHOMxmT8/tU1IiiiHOdHFF83Qsi+V8d0kLfscG4EvQE9cafiR8blOYr8SfkQKWB1wgEilQgXJX3MIA4vetDLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "~0.15.0", + "@microsoft/tsdoc-config": "~0.17.0", + "@rushstack/node-core-library": "5.5.1" + } + }, + "node_modules/vite-plugin-dts/node_modules/@microsoft/tsdoc": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.0.tgz", + "integrity": "sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite-plugin-dts/node_modules/@microsoft/tsdoc-config": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.0.tgz", + "integrity": "sha512-v/EYRXnCAIHxOHW+Plb6OWuUoMotxTN0GLatnpOb1xq0KuTNw/WI3pamJx/UbsoJP5k9MCw1QxvvhPcF9pH3Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@microsoft/tsdoc": "0.15.0", + "ajv": "~8.12.0", + "jju": "~1.4.0", + "resolve": "~1.22.2" + } + }, "node_modules/vite-plugin-dts/node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -32609,6 +32676,145 @@ } } }, + "node_modules/vite-plugin-dts/node_modules/@rushstack/node-core-library": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.5.1.tgz", + "integrity": "sha512-ZutW56qIzH8xIOlfyaLQJFx+8IBqdbVCZdnj+XT1MorQ1JqqxHse8vbCpEM+2MjsrqcbxcgDIbfggB1ZSQ2A3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "~8.13.0", + "ajv-draft-04": "~1.0.0", + "ajv-formats": "~3.0.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/vite-plugin-dts/node_modules/@rushstack/node-core-library/node_modules/ajv": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz", + "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/vite-plugin-dts/node_modules/@rushstack/terminal": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.13.3.tgz", + "integrity": "sha512-fc3zjXOw8E0pXS5t9vTiIPx9gHA0fIdTXsu9mT4WbH+P3mYvnrX0iAQ5a6NvyK1+CqYWBTw/wVNx7SDJkI+WYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/node-core-library": "5.5.1", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/vite-plugin-dts/node_modules/@rushstack/ts-command-line": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.22.3.tgz", + "integrity": "sha512-edMpWB3QhFFZ4KtSzS8WNjBgR4PXPPOVrOHMbb7kNpmQ1UFS9HdVtjCXg1H5fG+xYAbeE+TMPcVPUyX2p84STA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rushstack/terminal": "0.13.3", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, + "node_modules/vite-plugin-dts/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/vite-plugin-dts/node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/vite-plugin-dts/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/vite-plugin-dts/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/vite-plugin-dts/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/vite-plugin-dts/node_modules/magic-string": { "version": "0.30.11", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", @@ -32619,6 +32825,82 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/vite-plugin-dts/node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/vite-plugin-dts/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vite-plugin-dts/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/vite-plugin-dts/node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/vite-plugin-dts/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/vite-plugin-dts/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, "node_modules/vite-plugin-require": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/vite-plugin-require/-/vite-plugin-require-1.2.14.tgz", @@ -33920,6 +34202,7 @@ "@ory/client-fetch": "^1.15.4", "clsx": "2.1.1", "input-otp": "1.2.4", + "lodash.merge": "4.6.2", "react-hook-form": "7.53.0", "react-intl": "6.7.0", "tailwind-merge": "2.5.2" @@ -33927,6 +34210,7 @@ "devDependencies": { "@hookform/devtools": "^4.3.1", "@svgr/plugin-svgo": "^8.1.0", + "@types/lodash.merge": "4.6.9", "esbuild-plugin-svgr": "^2.1.0", "eslint-plugin-react": "7.37.0", "postcss": "8.4.47", diff --git a/package.json b/package.json index 72f278fc4..bb938d48b 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,15 @@ "@babel/preset-react": "^7.14.5", "@babel/preset-typescript": "7.23.3", "@formatjs/cli-lib": "6.3.3", + "@microsoft/api-extractor": "7.47.9", "@nrwl/eslint-plugin-nx": "19.5.4", "@nrwl/linter": "19.5.4", "@nx/eslint": "19.5.4", "@nx/eslint-plugin": "19.5.4", "@nx/jest": "19.5.4", "@nx/js": "19.5.4", - "@nx/storybook": "19.5.4", "@nx/react": "19.5.4", + "@nx/storybook": "19.5.4", "@nx/vite": "19.5.4", "@nx/web": "19.5.4", "@ory/client": "1.6.2", diff --git a/packages/elements-react-stories/.storybook/preview.tsx b/packages/elements-react-stories/.storybook/preview.tsx index 9ae98f12c..a3e59cdbf 100644 --- a/packages/elements-react-stories/.storybook/preview.tsx +++ b/packages/elements-react-stories/.storybook/preview.tsx @@ -1,4 +1,3 @@ -import { IntlProvider } from "@ory/elements-react" import type { Decorator, Preview } from "@storybook/react" import { chromaticModes } from "./modes" import "@ory/elements-react/theme/styles.css" @@ -28,11 +27,8 @@ const preview: Preview = { const withI18next: Decorator = (Story, context) => { const { locale } = context.globals - return ( - - - - ) + // TODO: this needs a refactor, because it doesn't pass the locale to the Ory Provider at the moment. + return } // export decorators for storybook to wrap your stories in diff --git a/packages/elements-react-stories/src/elements-react/components/login/1fa/all.stories.ts b/packages/elements-react-stories/src/elements-react/components/login/1fa/all.stories.ts index b5d41da30..3197882dc 100644 --- a/packages/elements-react-stories/src/elements-react/components/login/1fa/all.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/login/1fa/all.stories.ts @@ -3,7 +3,7 @@ import { LoginFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" -import { Login } from "../../../pages/login" +import { Login } from "@ory/elements-react/theme" import { config } from "../../../utils" const meta = { diff --git a/packages/elements-react-stories/src/elements-react/components/login/1fa/code.stories.ts b/packages/elements-react-stories/src/elements-react/components/login/1fa/code.stories.ts index 4a95de5cd..93b9bd77b 100644 --- a/packages/elements-react-stories/src/elements-react/components/login/1fa/code.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/login/1fa/code.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Login } from "../../../pages/login" +import { Login } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/login/1fa/custom.stories.tsx b/packages/elements-react-stories/src/elements-react/components/login/1fa/custom.stories.tsx index 7b145d092..b94537756 100644 --- a/packages/elements-react-stories/src/elements-react/components/login/1fa/custom.stories.tsx +++ b/packages/elements-react-stories/src/elements-react/components/login/1fa/custom.stories.tsx @@ -1,18 +1,18 @@ +import { LoginFlowFromJSON } from "@ory/client-fetch" import { - HeadlessSocialButtonProps, OryCard, OryCardContent, OryForm, OryFormGroups, OryFormSocialButtons, + OryNodeOIDCButtonProps, } from "@ory/elements-react" -import { FlowContextProps, Login } from "../../../pages/login" +import { Login, LoginFlowContextProps } from "@ory/elements-react/theme" import { config } from "../../../utils" -import { LoginFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" -const CustomSocialButton = ({ node }: HeadlessSocialButtonProps) => ( +const CustomSocialButton = ({ node }: OryNodeOIDCButtonProps) => (
(
) -const CustomComponents = ({ flow, config }: FlowContextProps) => { +const CustomComponents = ({ flow, config }: LoginFlowContextProps) => { return ( diff --git a/packages/elements-react-stories/src/elements-react/components/login/1fa/passkey.stories.ts b/packages/elements-react-stories/src/elements-react/components/login/1fa/passkey.stories.ts index 7360cfbcc..b5c85958c 100644 --- a/packages/elements-react-stories/src/elements-react/components/login/1fa/passkey.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/login/1fa/passkey.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Login } from "../../../pages/login" +import { Login } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/login/1fa/password.stories.ts b/packages/elements-react-stories/src/elements-react/components/login/1fa/password.stories.ts index 5152ad7b0..8ce8957fc 100644 --- a/packages/elements-react-stories/src/elements-react/components/login/1fa/password.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/login/1fa/password.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Login } from "../../../pages/login" +import { Login } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/registration/one-step/all-methods.stories.ts b/packages/elements-react-stories/src/elements-react/components/registration/one-step/all-methods.stories.ts index 0c811680b..5edb629d6 100644 --- a/packages/elements-react-stories/src/elements-react/components/registration/one-step/all-methods.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/registration/one-step/all-methods.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Registration } from "../../../pages/registration" +import { Registration } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON, RegistrationFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/registration/one-step/password.stories.ts b/packages/elements-react-stories/src/elements-react/components/registration/one-step/password.stories.ts index e98aed4a5..1521783b9 100644 --- a/packages/elements-react-stories/src/elements-react/components/registration/one-step/password.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/registration/one-step/password.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Registration } from "../../../pages/registration" +import { Registration } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON, RegistrationFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/registration/one-step/webauthn.stories.ts b/packages/elements-react-stories/src/elements-react/components/registration/one-step/webauthn.stories.ts index 0015fcabb..82416bf45 100644 --- a/packages/elements-react-stories/src/elements-react/components/registration/one-step/webauthn.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/registration/one-step/webauthn.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Registration } from "../../../pages/registration" +import { Registration } from "@ory/elements-react/theme" import { config } from "../../../utils" import { RegistrationFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/registration/two-step/all-methods.stories.ts b/packages/elements-react-stories/src/elements-react/components/registration/two-step/all-methods.stories.ts index f6f959ffa..d7cba7350 100644 --- a/packages/elements-react-stories/src/elements-react/components/registration/two-step/all-methods.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/registration/two-step/all-methods.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Registration } from "../../../pages/registration" +import { Registration } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON, RegistrationFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/components/registration/two-step/password.stories.ts b/packages/elements-react-stories/src/elements-react/components/registration/two-step/password.stories.ts index fad32f600..ce50fac68 100644 --- a/packages/elements-react-stories/src/elements-react/components/registration/two-step/password.stories.ts +++ b/packages/elements-react-stories/src/elements-react/components/registration/two-step/password.stories.ts @@ -1,7 +1,7 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { Registration } from "../../../pages/registration" +import { Registration } from "@ory/elements-react/theme" import { config } from "../../../utils" import { LoginFlowFromJSON, RegistrationFlowFromJSON } from "@ory/client-fetch" import type { Meta, StoryObj } from "@storybook/react" diff --git a/packages/elements-react-stories/src/elements-react/pages/login.tsx b/packages/elements-react-stories/src/elements-react/pages/login.tsx deleted file mode 100644 index 7fdfc9fb8..000000000 --- a/packages/elements-react-stories/src/elements-react/pages/login.tsx +++ /dev/null @@ -1,34 +0,0 @@ -"use client" -import { FlowType, LoginFlow } from "@ory/client-fetch" -import { - OryCard, - OryClientConfiguration, - OryFlowComponents, - OryProvider, -} from "@ory/elements-react" -import { OryDefaultComponents } from "@ory/elements-react/theme" -import { PropsWithChildren } from "react" - -export type FlowContextProps = { - flow: LoginFlow - components?: Partial - config: OryClientConfiguration -} - -export function Login({ - flow, - config, - children, - components, -}: PropsWithChildren) { - return ( - - {children || } - - ) -} diff --git a/packages/elements-react-stories/src/elements-react/pages/registration.tsx b/packages/elements-react-stories/src/elements-react/pages/registration.tsx deleted file mode 100644 index c1076ee8d..000000000 --- a/packages/elements-react-stories/src/elements-react/pages/registration.tsx +++ /dev/null @@ -1,35 +0,0 @@ -"use client" - -import { Configuration, FlowType, RegistrationFlow } from "@ory/client-fetch" -import { - OryCard, - OryClientConfiguration, - OryFlowComponents, - OryProvider, -} from "@ory/elements-react" -import { OryDefaultComponents } from "@ory/elements-react/theme" -import { PropsWithChildren } from "react" - -export type FlowContextProps = { - flow: RegistrationFlow - components?: Partial - config: OryClientConfiguration -} - -export function Registration({ - flow, - config, - children, - components, -}: PropsWithChildren) { - return ( - - {children || } - - ) -} diff --git a/packages/elements-react/.gitignore b/packages/elements-react/.gitignore index 607fb1702..aa05f3938 100644 --- a/packages/elements-react/.gitignore +++ b/packages/elements-react/.gitignore @@ -1,3 +1,4 @@ playwright/.cache/ playwright-report/* -.last-run.json \ No newline at end of file +.last-run.json +api-report/temp \ No newline at end of file diff --git a/packages/elements-react/api-report/elements-react-theme.api.json b/packages/elements-react/api-report/elements-react-theme.api.json new file mode 100644 index 000000000..09698e725 --- /dev/null +++ b/packages/elements-react/api-report/elements-react-theme.api.json @@ -0,0 +1,1251 @@ +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.47.9", + "schemaVersion": 1011, + "oldestForwardsCompatibleVersion": 1001, + "tsdocConfig": { + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "noStandardTags": true, + "tagDefinitions": [ + { + "tagName": "@alpha", + "syntaxKind": "modifier" + }, + { + "tagName": "@beta", + "syntaxKind": "modifier" + }, + { + "tagName": "@defaultValue", + "syntaxKind": "block" + }, + { + "tagName": "@decorator", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@deprecated", + "syntaxKind": "block" + }, + { + "tagName": "@eventProperty", + "syntaxKind": "modifier" + }, + { + "tagName": "@example", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@experimental", + "syntaxKind": "modifier" + }, + { + "tagName": "@inheritDoc", + "syntaxKind": "inline" + }, + { + "tagName": "@internal", + "syntaxKind": "modifier" + }, + { + "tagName": "@label", + "syntaxKind": "inline" + }, + { + "tagName": "@link", + "syntaxKind": "inline", + "allowMultiple": true + }, + { + "tagName": "@override", + "syntaxKind": "modifier" + }, + { + "tagName": "@packageDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@param", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@privateRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@public", + "syntaxKind": "modifier" + }, + { + "tagName": "@readonly", + "syntaxKind": "modifier" + }, + { + "tagName": "@remarks", + "syntaxKind": "block" + }, + { + "tagName": "@returns", + "syntaxKind": "block" + }, + { + "tagName": "@sealed", + "syntaxKind": "modifier" + }, + { + "tagName": "@see", + "syntaxKind": "block" + }, + { + "tagName": "@throws", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@typeParam", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@virtual", + "syntaxKind": "modifier" + }, + { + "tagName": "@betaDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@internalRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@preapproved", + "syntaxKind": "modifier" + } + ], + "supportForTags": { + "@alpha": true, + "@beta": true, + "@defaultValue": true, + "@decorator": true, + "@deprecated": true, + "@eventProperty": true, + "@example": true, + "@experimental": true, + "@inheritDoc": true, + "@internal": true, + "@label": true, + "@link": true, + "@override": true, + "@packageDocumentation": true, + "@param": true, + "@privateRemarks": true, + "@public": true, + "@readonly": true, + "@remarks": true, + "@returns": true, + "@sealed": true, + "@see": true, + "@throws": true, + "@typeParam": true, + "@virtual": true, + "@betaDocumentation": true, + "@internalRemarks": true, + "@preapproved": true + }, + "reportUnsupportedHtmlElements": false + } + }, + "kind": "Package", + "canonicalReference": "@ory/elements-react!", + "docComment": "", + "name": "@ory/elements-react", + "preserveMemberOrder": false, + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "@ory/elements-react!", + "name": "", + "preserveMemberOrder": false, + "members": [ + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultCard:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultCard({ children }: " + }, + { + "kind": "Reference", + "text": "OryCardProps", + "canonicalReference": "@ory/elements-react!~OryCardRootProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "DefaultCard" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultCardContent:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultCardContent({ children }: " + }, + { + "kind": "Reference", + "text": "OryCardContentProps", + "canonicalReference": "@ory/elements-react!~OryCardContentProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react.ReactNode", + "canonicalReference": "@types/react!React.ReactNode:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "DefaultCardContent" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultCardFooter:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultCardFooter(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "DefaultCardFooter" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultCardHeader:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultCardHeader(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "DefaultCardHeader" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultCardLogo:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultCardLogo(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "DefaultCardLogo" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultFormContainer:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultFormContainer({ children, onSubmit, action, method, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFormRootProps", + "canonicalReference": "@ory/elements-react!~OryFormRootProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children, onSubmit, action, method, }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "isOptional": false + } + ], + "name": "DefaultFormContainer" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultMessage:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultMessage({ message }: " + }, + { + "kind": "Reference", + "text": "OryMessageContentProps", + "canonicalReference": "@ory/elements-react!~OryMessageContentProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ message }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "DefaultMessage" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!DefaultMessageContainer:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function DefaultMessageContainer({ children }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "DefaultMessageContainer" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Error_2:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Error({ error, children, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ErrorFlowContextProps", + "canonicalReference": "@ory/elements-react!ErrorFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ error, children, }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "isOptional": false + } + ], + "name": "Error_2" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!ErrorFlowContextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type ErrorFlowContextProps = " + }, + { + "kind": "Content", + "text": "{\n error: " + }, + { + "kind": "Reference", + "text": "FlowError", + "canonicalReference": "@ory/client-fetch!FlowError:interface" + }, + { + "kind": "Content", + "text": ";\n components?: " + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!~OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ">;\n config: " + }, + { + "kind": "Reference", + "text": "OryClientConfiguration", + "canonicalReference": "@ory/elements-react!~OryClientConfiguration:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "releaseTag": "Public", + "name": "ErrorFlowContextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Login:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Login({ flow, config, children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": flowOverrideComponents, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "LoginFlowContextProps", + "canonicalReference": "@ory/elements-react!LoginFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ flow, config, children, components: flowOverrideComponents, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "Login" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!LoginFlowContextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type LoginFlowContextProps = " + }, + { + "kind": "Content", + "text": "{\n flow: " + }, + { + "kind": "Reference", + "text": "LoginFlow", + "canonicalReference": "@ory/client-fetch!LoginFlow:interface" + }, + { + "kind": "Content", + "text": ";\n components?: " + }, + { + "kind": "Reference", + "text": "OryFlowComponentOverrides", + "canonicalReference": "@ory/elements-react!~OryFlowComponentOverrides:type" + }, + { + "kind": "Content", + "text": ";\n config: " + }, + { + "kind": "Reference", + "text": "OryClientConfiguration", + "canonicalReference": "@ory/elements-react!~OryClientConfiguration:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "releaseTag": "Public", + "name": "LoginFlowContextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 8 + } + }, + { + "kind": "Variable", + "canonicalReference": "@ory/elements-react!OryDefaultComponents:var", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "OryDefaultComponents: " + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!~OryFlowComponents:type" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "isReadonly": true, + "releaseTag": "Public", + "name": "OryDefaultComponents", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Recovery:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Recovery({ flow, config, children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": flowOverrideComponents, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "RecoveryFlowContextProps", + "canonicalReference": "@ory/elements-react!RecoveryFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ flow, config, children, components: flowOverrideComponents, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "Recovery" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!RecoveryFlowContextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type RecoveryFlowContextProps = " + }, + { + "kind": "Content", + "text": "{\n flow: " + }, + { + "kind": "Reference", + "text": "RecoveryFlow", + "canonicalReference": "@ory/client-fetch!RecoveryFlow:interface" + }, + { + "kind": "Content", + "text": ";\n components?: " + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!~OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ">;\n config: " + }, + { + "kind": "Reference", + "text": "OryClientConfiguration", + "canonicalReference": "@ory/elements-react!~OryClientConfiguration:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "releaseTag": "Public", + "name": "RecoveryFlowContextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Registration:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Registration({ flow, children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": flowOverrideComponents, config, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "RegistrationFlowContextProps", + "canonicalReference": "@ory/elements-react!~RegistrationFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ flow, children, components: flowOverrideComponents, config, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "Registration" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Settings:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Settings({ flow, config, children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": flowOverrideComponents, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "SettingsFlowContextProps", + "canonicalReference": "@ory/elements-react!SettingsFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ flow, config, children, components: flowOverrideComponents, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "Settings" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!SettingsFlowContextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type SettingsFlowContextProps = " + }, + { + "kind": "Content", + "text": "{\n flow: " + }, + { + "kind": "Reference", + "text": "SettingsFlow", + "canonicalReference": "@ory/client-fetch!SettingsFlow:interface" + }, + { + "kind": "Content", + "text": ";\n components?: " + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!~OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ">;\n config: " + }, + { + "kind": "Reference", + "text": "OryClientConfiguration", + "canonicalReference": "@ory/elements-react!~OryClientConfiguration:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "releaseTag": "Public", + "name": "SettingsFlowContextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!Verification:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function Verification({ flow, config, children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": flowOverrideComponents, }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "VerificationFlowContextProps", + "canonicalReference": "@ory/elements-react!VerificationFlowContextProps:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ flow, config, children, components: flowOverrideComponents, }", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "Verification" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!VerificationFlowContextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type VerificationFlowContextProps = " + }, + { + "kind": "Content", + "text": "{\n flow: " + }, + { + "kind": "Reference", + "text": "VerificationFlow", + "canonicalReference": "@ory/client-fetch!VerificationFlow:interface" + }, + { + "kind": "Content", + "text": ";\n components?: " + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!~OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ">;\n config: " + }, + { + "kind": "Reference", + "text": "OryClientConfiguration", + "canonicalReference": "@ory/elements-react!~OryClientConfiguration:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/theme/default/index.d.ts", + "releaseTag": "Public", + "name": "VerificationFlowContextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + } + ] + } + ] +} diff --git a/packages/elements-react/api-report/elements-react-theme.api.md b/packages/elements-react/api-report/elements-react-theme.api.md new file mode 100644 index 000000000..5a3b9d45f --- /dev/null +++ b/packages/elements-react/api-report/elements-react-theme.api.md @@ -0,0 +1,129 @@ +## API Report File for "@ory/elements-react" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ComponentPropsWithoutRef } from 'react'; +import { ComponentType } from 'react'; +import { ConfigurationParameters } from '@ory/client-fetch'; +import { DetailedHTMLProps } from 'react'; +import { FlowError } from '@ory/client-fetch'; +import { FormEventHandler } from 'react'; +import { HTMLAttributes } from 'react'; +import { LoginFlow } from '@ory/client-fetch'; +import { MouseEventHandler } from 'react'; +import { PropsWithChildren } from 'react'; +import * as react from 'react'; +import * as react_jsx_runtime from 'react/jsx-runtime'; +import { RecoveryFlow } from '@ory/client-fetch'; +import { RegistrationFlow } from '@ory/client-fetch'; +import { SettingsFlow } from '@ory/client-fetch'; +import { UiNode } from '@ory/client-fetch'; +import { UiNodeAnchorAttributes } from '@ory/client-fetch'; +import { UiNodeImageAttributes } from '@ory/client-fetch'; +import { UiNodeInputAttributes } from '@ory/client-fetch'; +import { UiNodeTextAttributes } from '@ory/client-fetch'; +import { UiText } from '@ory/client-fetch'; +import { VerificationFlow } from '@ory/client-fetch'; + +// Warning: (ae-forgotten-export) The symbol "OryCardRootProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultCard({ children }: OryCardRootProps): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryCardContentProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultCardContent({ children }: OryCardContentProps): react.ReactNode; + +// @public (undocumented) +export function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export function DefaultCardHeader(): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function DefaultCardLogo(): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryFormRootProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultFormContainer({ children, onSubmit, action, method, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryMessageContentProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultMessage({ message }: OryMessageContentProps): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function DefaultMessageContainer({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +function Error_2({ error, children, }: PropsWithChildren): react_jsx_runtime.JSX.Element; +export { Error_2 as Error } + +// @public (undocumented) +export type ErrorFlowContextProps = { + error: FlowError; + components?: Partial; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export function Login({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type LoginFlowContextProps = { + flow: LoginFlow; + components?: OryFlowComponentOverrides; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export const OryDefaultComponents: OryFlowComponents; + +// @public (undocumented) +export function Recovery({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type RecoveryFlowContextProps = { + flow: RecoveryFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// Warning: (ae-forgotten-export) The symbol "RegistrationFlowContextProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function Registration({ flow, children, components: flowOverrideComponents, config, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function Settings({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type SettingsFlowContextProps = { + flow: SettingsFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export function Verification({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type VerificationFlowContextProps = { + flow: VerificationFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// Warnings were encountered during analysis: +// +// dist/theme/default/index.d.ts:25:5 - (ae-forgotten-export) The symbol "OryFlowComponents" needs to be exported by the entry point index.d.ts +// dist/theme/default/index.d.ts:26:5 - (ae-forgotten-export) The symbol "OryClientConfiguration" needs to be exported by the entry point index.d.ts +// dist/theme/default/index.d.ts:32:5 - (ae-forgotten-export) The symbol "OryFlowComponentOverrides" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/elements-react/api-report/elements-react.api.json b/packages/elements-react/api-report/elements-react.api.json new file mode 100644 index 000000000..dcd0e78b1 --- /dev/null +++ b/packages/elements-react/api-report/elements-react.api.json @@ -0,0 +1,3214 @@ +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "7.47.4", + "schemaVersion": 1011, + "oldestForwardsCompatibleVersion": 1001, + "tsdocConfig": { + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "noStandardTags": true, + "tagDefinitions": [ + { + "tagName": "@alpha", + "syntaxKind": "modifier" + }, + { + "tagName": "@beta", + "syntaxKind": "modifier" + }, + { + "tagName": "@defaultValue", + "syntaxKind": "block" + }, + { + "tagName": "@decorator", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@deprecated", + "syntaxKind": "block" + }, + { + "tagName": "@eventProperty", + "syntaxKind": "modifier" + }, + { + "tagName": "@example", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@experimental", + "syntaxKind": "modifier" + }, + { + "tagName": "@inheritDoc", + "syntaxKind": "inline" + }, + { + "tagName": "@internal", + "syntaxKind": "modifier" + }, + { + "tagName": "@label", + "syntaxKind": "inline" + }, + { + "tagName": "@link", + "syntaxKind": "inline", + "allowMultiple": true + }, + { + "tagName": "@override", + "syntaxKind": "modifier" + }, + { + "tagName": "@packageDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@param", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@privateRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@public", + "syntaxKind": "modifier" + }, + { + "tagName": "@readonly", + "syntaxKind": "modifier" + }, + { + "tagName": "@remarks", + "syntaxKind": "block" + }, + { + "tagName": "@returns", + "syntaxKind": "block" + }, + { + "tagName": "@sealed", + "syntaxKind": "modifier" + }, + { + "tagName": "@see", + "syntaxKind": "block" + }, + { + "tagName": "@throws", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@typeParam", + "syntaxKind": "block", + "allowMultiple": true + }, + { + "tagName": "@virtual", + "syntaxKind": "modifier" + }, + { + "tagName": "@betaDocumentation", + "syntaxKind": "modifier" + }, + { + "tagName": "@internalRemarks", + "syntaxKind": "block" + }, + { + "tagName": "@preapproved", + "syntaxKind": "modifier" + } + ], + "supportForTags": { + "@alpha": true, + "@beta": true, + "@defaultValue": true, + "@decorator": true, + "@deprecated": true, + "@eventProperty": true, + "@example": true, + "@experimental": true, + "@inheritDoc": true, + "@internal": true, + "@label": true, + "@link": true, + "@override": true, + "@packageDocumentation": true, + "@param": true, + "@privateRemarks": true, + "@public": true, + "@readonly": true, + "@remarks": true, + "@returns": true, + "@sealed": true, + "@see": true, + "@throws": true, + "@typeParam": true, + "@virtual": true, + "@betaDocumentation": true, + "@internalRemarks": true, + "@preapproved": true + }, + "reportUnsupportedHtmlElements": false + } + }, + "kind": "Package", + "canonicalReference": "@ory/elements-react!", + "docComment": "", + "name": "@ory/elements-react", + "preserveMemberOrder": false, + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "@ory/elements-react!", + "name": "", + "preserveMemberOrder": false, + "members": [ + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!ErrorFlowContainer:type", + "docComment": "/**\n * A flow container for the error flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * FlowError (Error flow)\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type ErrorFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Error", + "canonicalReference": "@ory/client-fetch!FlowType.Error:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "FlowError", + "canonicalReference": "@ory/client-fetch!FlowError:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "ErrorFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!FlowContainerSetter:type", + "docComment": "/**\n * Function to set the flow container.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type FlowContainerSetter = " + }, + { + "kind": "Reference", + "text": "Dispatch", + "canonicalReference": "@types/react!React.Dispatch:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowContainer", + "canonicalReference": "@ory/elements-react!OryFlowContainer:type" + }, + { + "kind": "Content", + "text": ">>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "FlowContainerSetter", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!FlowContextValue:type", + "docComment": "/**\n * The return value of the OryFlowContext.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type FlowContextValue = " + }, + { + "kind": "Reference", + "text": "OryFlowContainer", + "canonicalReference": "@ory/elements-react!OryFlowContainer:type" + }, + { + "kind": "Content", + "text": " & {\n setFlowContainer: " + }, + { + "kind": "Reference", + "text": "FlowContainerSetter", + "canonicalReference": "@ory/elements-react!FlowContainerSetter:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "FlowContextValue", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!formElementId:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function formElementId(attributes: " + }, + { + "kind": "Content", + "text": "{\n name: string;\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "{\n id: string;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "attributes", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "formElementId" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!formLabelId:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function formLabelId(attributes: " + }, + { + "kind": "Content", + "text": "{\n name: string;\n}" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "{\n htmlFor: string;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "attributes", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "formLabelId" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!FormValues:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type FormValues = " + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "FormValues", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!IntlProviderProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryIntlProviderProps = " + }, + { + "kind": "Content", + "text": "Translation extends " + }, + { + "kind": "Reference", + "text": "CustomTranslations", + "canonicalReference": "@ory/elements-react!~CustomTranslations:type" + }, + { + "kind": "Content", + "text": " ? " + }, + { + "kind": "Reference", + "text": "CustomTranslations", + "canonicalReference": "@ory/elements-react!~CustomTranslations:type" + }, + { + "kind": "Content", + "text": " : " + }, + { + "kind": "Reference", + "text": "SupportedTranslations", + "canonicalReference": "@ory/elements-react!SupportedTranslations:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "IntlProviderProps", + "typeParameters": [ + { + "typeParameterName": "Translation", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!Locale:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type Locale = " + }, + { + "kind": "Content", + "text": "keyof typeof " + }, + { + "kind": "Reference", + "text": "locales", + "canonicalReference": "@ory/elements-react!OryLocales:namespace" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "Locale", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!LoginFlowContainer:type", + "docComment": "/**\n * A flow container for the login flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * LoginFlow\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type LoginFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Login", + "canonicalReference": "@ory/client-fetch!FlowType.Login:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "LoginFlow", + "canonicalReference": "@ory/client-fetch!LoginFlow:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "LoginFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!messageTestId:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function messageTestId(message: " + }, + { + "kind": "Reference", + "text": "UiText", + "canonicalReference": "@ory/client-fetch!UiText:interface" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "{\n \"data-testid\": string;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "message", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "messageTestId" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OnSubmitHandlerProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OnSubmitHandlerProps = " + }, + { + "kind": "Content", + "text": "{\n setFlowContainer: (flowContainer: " + }, + { + "kind": "Reference", + "text": "OryFlowContainer", + "canonicalReference": "@ory/elements-react!OryFlowContainer:type" + }, + { + "kind": "Content", + "text": ") => void;\n body: T;\n onRedirect: " + }, + { + "kind": "Reference", + "text": "OnRedirectHandler", + "canonicalReference": "@ory/client-fetch!OnRedirectHandler:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OnSubmitHandlerProps", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 10 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 11, + "endIndex": 16 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryCard:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryCard({ children }: " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryCard" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardAuthMethodListItemProps:type", + "docComment": "/**\n * Props for the AuthMethodListItem component. This component is used to render a single auth method in the AuthMethodList component.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardAuthMethodListItemProps = " + }, + { + "kind": "Content", + "text": "{\n onClick: () => void;\n group: string;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardAuthMethodListItemProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryCardContent:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryCardContent({ children }: " + }, + { + "kind": "Reference", + "text": "OryCardContentProps", + "canonicalReference": "@ory/elements-react!OryCardContentProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryCardContent" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardContentProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardContentProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardContentProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardDividerProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardDividerProps = " + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardDividerProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryCardFooter:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryCardFooter(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "OryCardFooter" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardFooterProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardFooterProps = " + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardFooterProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryCardHeader:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryCardHeader(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "OryCardHeader" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardHeaderProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardHeaderProps = " + }, + { + "kind": "Reference", + "text": "Record", + "canonicalReference": "!Record:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardHeaderProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCardProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCardRootProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCardProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryCardValidationMessages:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryCardValidationMessages({ ...props }: " + }, + { + "kind": "Reference", + "text": "OryMessageRootProps", + "canonicalReference": "@ory/elements-react!OryMessageRootProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ ...props }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryCardValidationMessages" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryClientConfiguration:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryClientConfiguration = " + }, + { + "kind": "Content", + "text": "{\n name: string;\n logoUrl?: string;\n stylesheet?: string;\n favicon?: string;\n sdk: {\n url: string;\n options?: " + }, + { + "kind": "Reference", + "text": "Partial", + "canonicalReference": "!Partial:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ConfigurationParameters", + "canonicalReference": "@ory/client-fetch!ConfigurationParameters:interface" + }, + { + "kind": "Content", + "text": ">;\n };\n project: {\n registration_enabled: boolean;\n verification_enabled: boolean;\n recovery_enabled: boolean;\n recovery_ui_url: string;\n registration_ui_url: string;\n verification_ui_url: string;\n login_ui_url: string;\n };\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryClientConfiguration", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 6 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryCurrentIdentifierProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryCurrentIdentifierProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeInputAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeInputAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n onClick?: () => void;\n href?: string;\n} & " + }, + { + "kind": "Reference", + "text": "Omit", + "canonicalReference": "!Omit:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ComponentPropsWithoutRef", + "canonicalReference": "@types/react!React.ComponentPropsWithoutRef:type" + }, + { + "kind": "Content", + "text": "<\"button\">, \"children\" | \"onClick\">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryCurrentIdentifierProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFlowComponentOverrides:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFlowComponentOverrides = " + }, + { + "kind": "Reference", + "text": "DeepPartialTwoLevels", + "canonicalReference": "@ory/elements-react!~DeepPartialTwoLevels:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFlowComponentOverrides", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFlowComponents:type", + "docComment": "/**\n * A record of all the components that are used in the OryForm component.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFlowComponents = " + }, + { + "kind": "Content", + "text": "{\n Node: {\n Button: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeButtonProps", + "canonicalReference": "@ory/elements-react!OryNodeButtonProps:type" + }, + { + "kind": "Content", + "text": ">;\n OIDCButton: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeOIDCButtonProps", + "canonicalReference": "@ory/elements-react!OryNodeOIDCButtonProps:type" + }, + { + "kind": "Content", + "text": ">;\n CurrentIdentifierButton: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCurrentIdentifierProps", + "canonicalReference": "@ory/elements-react!OryCurrentIdentifierProps:type" + }, + { + "kind": "Content", + "text": ">;\n Anchor: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeAnchorProps", + "canonicalReference": "@ory/elements-react!OryNodeAnchorProps:type" + }, + { + "kind": "Content", + "text": ">;\n Input: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeInputProps", + "canonicalReference": "@ory/elements-react!OryNodeInputProps:type" + }, + { + "kind": "Content", + "text": ">;\n CodeInput: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeInputProps", + "canonicalReference": "@ory/elements-react!OryNodeInputProps:type" + }, + { + "kind": "Content", + "text": ">;\n Image: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeImageProps", + "canonicalReference": "@ory/elements-react!OryNodeImageProps:type" + }, + { + "kind": "Content", + "text": ">;\n Label: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeLabelProps", + "canonicalReference": "@ory/elements-react!OryNodeLabelProps:type" + }, + { + "kind": "Content", + "text": ">;\n Checkbox: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeInputProps", + "canonicalReference": "@ory/elements-react!OryNodeInputProps:type" + }, + { + "kind": "Content", + "text": ">;\n Text: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryNodeTextProps", + "canonicalReference": "@ory/elements-react!OryNodeTextProps:type" + }, + { + "kind": "Content", + "text": ">;\n };\n Card: {\n Root: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardRootProps", + "canonicalReference": "@ory/elements-react!OryCardProps:type" + }, + { + "kind": "Content", + "text": ">;\n Footer: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardFooterProps", + "canonicalReference": "@ory/elements-react!OryCardFooterProps:type" + }, + { + "kind": "Content", + "text": ">;\n Header: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardRootProps", + "canonicalReference": "@ory/elements-react!OryCardProps:type" + }, + { + "kind": "Content", + "text": ">;\n Content: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardContentProps", + "canonicalReference": "@ory/elements-react!OryCardContentProps:type" + }, + { + "kind": "Content", + "text": ">;\n Logo: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": ";\n Divider: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardDividerProps", + "canonicalReference": "@ory/elements-react!OryCardDividerProps:type" + }, + { + "kind": "Content", + "text": ">;\n AuthMethodListItem: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryCardAuthMethodListItemProps", + "canonicalReference": "@ory/elements-react!OryCardAuthMethodListItemProps:type" + }, + { + "kind": "Content", + "text": ">;\n };\n Form: {\n Root: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFormRootProps", + "canonicalReference": "@ory/elements-react!OryFormRootProps:type" + }, + { + "kind": "Content", + "text": ">;\n OIDCRoot: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFormOIDCRootProps", + "canonicalReference": "@ory/elements-react!OryFormOIDCRootProps:type" + }, + { + "kind": "Content", + "text": ">;\n Group: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryFormGroupProps", + "canonicalReference": "@ory/elements-react!OryFormGroupProps:type" + }, + { + "kind": "Content", + "text": ">;\n };\n Message: {\n Root: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryMessageRootProps", + "canonicalReference": "@ory/elements-react!OryMessageRootProps:type" + }, + { + "kind": "Content", + "text": ">;\n Content: " + }, + { + "kind": "Reference", + "text": "ComponentType", + "canonicalReference": "@types/react!React.ComponentType:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "OryMessageContentProps", + "canonicalReference": "@ory/elements-react!OryMessageContentProps:type" + }, + { + "kind": "Content", + "text": ">;\n };\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFlowComponents", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 88 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFlowContainer:type", + "docComment": "/**\n * A union type of all flow containers\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFlowContainer = " + }, + { + "kind": "Reference", + "text": "LoginFlowContainer", + "canonicalReference": "@ory/elements-react!LoginFlowContainer:type" + }, + { + "kind": "Content", + "text": " | " + }, + { + "kind": "Reference", + "text": "RegistrationFlowContainer", + "canonicalReference": "@ory/elements-react!RegistrationFlowContainer:type" + }, + { + "kind": "Content", + "text": " | " + }, + { + "kind": "Reference", + "text": "RecoveryFlowContainer", + "canonicalReference": "@ory/elements-react!RecoveryFlowContainer:type" + }, + { + "kind": "Content", + "text": " | " + }, + { + "kind": "Reference", + "text": "VerificationFlowContainer", + "canonicalReference": "@ory/elements-react!VerificationFlowContainer:type" + }, + { + "kind": "Content", + "text": " | " + }, + { + "kind": "Reference", + "text": "SettingsFlowContainer", + "canonicalReference": "@ory/elements-react!SettingsFlowContainer:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryForm:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryForm({ children }: " + }, + { + "kind": "Reference", + "text": "OryFormProps", + "canonicalReference": "@ory/elements-react!OryFormProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "string | " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryForm" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryFormGroupDivider:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryFormGroupDivider(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "OryFormGroupDivider" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormGroupProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormGroupProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormGroupProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryFormGroups:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryFormGroups({ children, groups }: " + }, + { + "kind": "Reference", + "text": "OryFormGroupsProps", + "canonicalReference": "@ory/elements-react!OryFormGroupsProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children, groups }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryFormGroups" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormGroupsProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormGroupsProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<{\n groups: " + }, + { + "kind": "Reference", + "text": "UiNodeGroupEnum", + "canonicalReference": "@ory/client-fetch!UiNodeGroupEnum:type" + }, + { + "kind": "Content", + "text": "[];\n}>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormGroupsProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormOIDCButtonsProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormOIDCButtonsProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<{\n hideDivider?: boolean;\n}>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormOIDCButtonsProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 3 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormOIDCRootProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormOIDCRootProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": "<{\n nodes: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": "[];\n}>" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormOIDCRootProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 5 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormProps = " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryFormRootProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryFormRootProps = " + }, + { + "kind": "Reference", + "text": "ComponentPropsWithoutRef", + "canonicalReference": "@types/react!React.ComponentPropsWithoutRef:type" + }, + { + "kind": "Content", + "text": "<\"form\"> & {\n onSubmit: " + }, + { + "kind": "Reference", + "text": "FormEventHandler", + "canonicalReference": "@types/react!React.FormEventHandler:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "HTMLFormElement", + "canonicalReference": "!HTMLFormElement:interface" + }, + { + "kind": "Content", + "text": ">;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryFormRootProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryFormSocialButtons:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryFormSocialButtons({ children, hideDivider, }: " + }, + { + "kind": "Reference", + "text": "OryFormOIDCButtonsProps", + "canonicalReference": "@ory/elements-react!OryFormOIDCButtonsProps:type" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 3, + "endIndex": 5 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children, hideDivider, }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "isOptional": false + } + ], + "name": "OryFormSocialButtons" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryFormSocialButtonsForm:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryFormSocialButtonsForm(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": " | null" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "OryFormSocialButtonsForm" + }, + { + "kind": "Namespace", + "canonicalReference": "@ory/elements-react!OryLocales:namespace", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare namespace locales " + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryLocales", + "preserveMemberOrder": false, + "members": [] + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryMessageContentProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryMessageContentProps = " + }, + { + "kind": "Content", + "text": "{\n message: " + }, + { + "kind": "Reference", + "text": "UiText", + "canonicalReference": "@ory/client-fetch!UiText:interface" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryMessageContentProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 4 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryMessageRootProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryMessageRootProps = " + }, + { + "kind": "Reference", + "text": "DetailedHTMLProps", + "canonicalReference": "@types/react!React.DetailedHTMLProps:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "HTMLAttributes", + "canonicalReference": "@types/react!React.HTMLAttributes:interface" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "HTMLDivElement", + "canonicalReference": "!HTMLDivElement:interface" + }, + { + "kind": "Content", + "text": ">, " + }, + { + "kind": "Reference", + "text": "HTMLDivElement", + "canonicalReference": "!HTMLDivElement:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryMessageRootProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 9 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeAnchorProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeAnchorProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeAnchorAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeAnchorAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n} & " + }, + { + "kind": "Reference", + "text": "Omit", + "canonicalReference": "!Omit:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ComponentPropsWithoutRef", + "canonicalReference": "@types/react!React.ComponentPropsWithoutRef:type" + }, + { + "kind": "Content", + "text": "<\"a\">, \"children\">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeAnchorProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeButtonProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeButtonProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeInputAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeInputAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n} & " + }, + { + "kind": "Reference", + "text": "Omit", + "canonicalReference": "!Omit:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "ComponentPropsWithoutRef", + "canonicalReference": "@types/react!React.ComponentPropsWithoutRef:type" + }, + { + "kind": "Content", + "text": "<\"button\">, \"children\">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeButtonProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 10 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeImageProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeImageProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeImageAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeImageAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeImageProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 6 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeInputProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeInputProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeInputAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeInputAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n onClick?: " + }, + { + "kind": "Reference", + "text": "MouseEventHandler", + "canonicalReference": "@types/react!React.MouseEventHandler:type" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeInputProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 8 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeLabelProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeLabelProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeInputAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeInputAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n} & " + }, + { + "kind": "Reference", + "text": "ComponentPropsWithoutRef", + "canonicalReference": "@types/react!React.ComponentPropsWithoutRef:type" + }, + { + "kind": "Content", + "text": "<\"label\">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeLabelProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 8 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeOIDCButtonProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeOIDCButtonProps = " + }, + { + "kind": "Content", + "text": "{\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeInputAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeInputAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n onClick?: () => void;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeOIDCButtonProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 6 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryNodeTextProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryNodeTextProps = " + }, + { + "kind": "Content", + "text": "{\n attributes: " + }, + { + "kind": "Reference", + "text": "UiNodeTextAttributes", + "canonicalReference": "@ory/client-fetch!UiNodeTextAttributes:interface" + }, + { + "kind": "Content", + "text": ";\n node: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ";\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryNodeTextProps", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 6 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryProvider:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryProvider({ children, " + }, + { + "kind": "Reference", + "text": "components", + "canonicalReference": "@ory/elements-react!~__type#components" + }, + { + "kind": "Content", + "text": ": Components, ...props }: " + }, + { + "kind": "Reference", + "text": "OryProviderProps", + "canonicalReference": "@ory/elements-react!OryProviderProps:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ children, components: Components, ...props }", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 7 + }, + "isOptional": false + } + ], + "typeParameters": [ + { + "typeParameterName": "Translation", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "OryProvider" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!OryProviderProps:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type OryProviderProps = " + }, + { + "kind": "Content", + "text": "{\n components: " + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ";\n} & " + }, + { + "kind": "Reference", + "text": "OryIntlProviderProps", + "canonicalReference": "@ory/elements-react!IntlProviderProps:type" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "OryFlowContainer", + "canonicalReference": "@ory/elements-react!OryFlowContainer:type" + }, + { + "kind": "Content", + "text": " & " + }, + { + "kind": "Reference", + "text": "PropsWithChildren", + "canonicalReference": "@types/react!React.PropsWithChildren:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "OryProviderProps", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 0, + "endIndex": 0 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "typeTokenRange": { + "startIndex": 1, + "endIndex": 9 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!OryTwoStepCard:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function OryTwoStepCard(): " + }, + { + "kind": "Reference", + "text": "react_jsx_runtime.JSX.Element", + "canonicalReference": "@types/react!JSX.Element:interface" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "OryTwoStepCard" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!RecoveryFlowContainer:type", + "docComment": "/**\n * A flow container for the recovery flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * RecoveryFlow\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type RecoveryFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Recovery", + "canonicalReference": "@ory/client-fetch!FlowType.Recovery:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "RecoveryFlow", + "canonicalReference": "@ory/client-fetch!RecoveryFlow:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "RecoveryFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!RegistrationFlowContainer:type", + "docComment": "/**\n * A flow container for the registration flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * RegistrationFlow\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type RegistrationFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Registration", + "canonicalReference": "@ory/client-fetch!FlowType.Registration:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "RegistrationFlow", + "canonicalReference": "@ory/client-fetch!RegistrationFlow:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "RegistrationFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!SettingsFlowContainer:type", + "docComment": "/**\n * A flow container for the settings flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * SettingsFlow\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type SettingsFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Settings", + "canonicalReference": "@ory/client-fetch!FlowType.Settings:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "SettingsFlow", + "canonicalReference": "@ory/client-fetch!SettingsFlow:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "SettingsFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!SupportedTranslations:type", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "type SupportedTranslations = " + }, + { + "kind": "Content", + "text": "{\n locale?: " + }, + { + "kind": "Reference", + "text": "Locale", + "canonicalReference": "@ory/elements-react!Locale:type" + }, + { + "kind": "Content", + "text": ";\n defaultLocale?: string;\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "SupportedTranslations", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 4 + } + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!uiTextToFormattedMessage:function(1)", + "docComment": "/**\n * Converts a UiText to a FormattedMessage. The UiText contains the id of the message and the context. The context is used to inject values into the message from Ory, e.g. a timestamp. For example a UI Node from Ory might look like this:\n *\n * \\{ \"type\":\"input\", \"group\":\"default\", \"attributes\": \\{ \"name\":\"traits.email\", \"type\":\"email\", \"required\":true, \"autocomplete\":\"email\", \"disabled\":false, \"node_type\":\"input\" \\}, \"messages\":[], \"meta\": \\{ \"label\": \\{ \"id\":1070002, \"text\":\"E-Mail\", \"type\":\"info\", \"context\":\\{ \"title\":\"E-Mail\" \\}, \\} \\} \\}\n *\n * The context has the key \"title\" which matches the formatter template name \"\\{title\\}\" An example translation file would look like this: \\{ \"identities.messages.1070002\": \"\\{title\\}\" \\}\n *\n * The formatter would then take the meta.label.id and look for the translation with the key matching the id. It would then replace the template \"\\{title\\}\" with the value from the context with the key \"title\".\n *\n * @param uiText - The UiText is part of the UiNode object sent by Kratos when performing a flow.\n *\n * @param intl - The intl object from react-intl\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "uiTextToFormattedMessage: ({ id, context, text }: " + }, + { + "kind": "Reference", + "text": "Omit", + "canonicalReference": "!Omit:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "UiText", + "canonicalReference": "@ory/client-fetch!UiText:interface" + }, + { + "kind": "Content", + "text": ", \"type\">" + }, + { + "kind": "Content", + "text": ", intl: " + }, + { + "kind": "Reference", + "text": "IntlShape", + "canonicalReference": "react-intl!IntlShape:interface" + }, + { + "kind": "Content", + "text": ") => " + }, + { + "kind": "Content", + "text": "string" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 8, + "endIndex": 9 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "{ id, context, text }", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "isOptional": false + }, + { + "parameterName": "intl", + "parameterTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + }, + "isOptional": false + } + ], + "name": "uiTextToFormattedMessage" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!useComponents:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function useComponents(): " + }, + { + "kind": "Reference", + "text": "OryFlowComponents", + "canonicalReference": "@ory/elements-react!OryFlowComponents:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "useComponents" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!useNodeSorter:function(1)", + "docComment": "", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function useNodeSorter(): " + }, + { + "kind": "Content", + "text": "(a: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Reference", + "text": "UiNode", + "canonicalReference": "@ory/client-fetch!UiNode:interface" + }, + { + "kind": "Content", + "text": ", ctx: {\n flowType: string;\n}) => number" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "useNodeSorter" + }, + { + "kind": "Function", + "canonicalReference": "@ory/elements-react!useOryFlow:function(1)", + "docComment": "/**\n * Returns an object that contains the current flow and the flow type, as well as the configuration.\n *\n * @returns The current flow container\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "declare function useOryFlow(): " + }, + { + "kind": "Reference", + "text": "FlowContextValue", + "canonicalReference": "@ory/elements-react!FlowContextValue:type" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "useOryFlow" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@ory/elements-react!VerificationFlowContainer:type", + "docComment": "/**\n * A flow container for the verification flow\n *\n * @see\n *\n * OryFlow\n *\n * @see\n *\n * VerificationFlow\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "type VerificationFlowContainer = " + }, + { + "kind": "Reference", + "text": "OryFlow", + "canonicalReference": "@ory/elements-react!~OryFlow:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "FlowType.Verification", + "canonicalReference": "@ory/client-fetch!FlowType.Verification:member" + }, + { + "kind": "Content", + "text": ", " + }, + { + "kind": "Reference", + "text": "VerificationFlow", + "canonicalReference": "@ory/client-fetch!VerificationFlow:interface" + }, + { + "kind": "Content", + "text": ">" + }, + { + "kind": "Content", + "text": ";" + } + ], + "fileUrlPath": "dist/index.d.ts", + "releaseTag": "Public", + "name": "VerificationFlowContainer", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 7 + } + } + ] + } + ] +} diff --git a/packages/elements-react/api-report/elements-react.api.md b/packages/elements-react/api-report/elements-react.api.md new file mode 100644 index 000000000..06816ad3e --- /dev/null +++ b/packages/elements-react/api-report/elements-react.api.md @@ -0,0 +1,342 @@ +## API Report File for "@ory/elements-react" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ComponentPropsWithoutRef } from 'react'; +import { ComponentType } from 'react'; +import { ConfigurationParameters } from '@ory/client-fetch'; +import { DetailedHTMLProps } from 'react'; +import { Dispatch } from 'react'; +import { FlowError } from '@ory/client-fetch'; +import { FlowType } from '@ory/client-fetch'; +import { FormEventHandler } from 'react'; +import { HTMLAttributes } from 'react'; +import { IntlShape } from 'react-intl'; +import { LoginFlow } from '@ory/client-fetch'; +import { MouseEventHandler } from 'react'; +import { OnRedirectHandler } from '@ory/client-fetch'; +import { PropsWithChildren } from 'react'; +import * as react_jsx_runtime from 'react/jsx-runtime'; +import { RecoveryFlow } from '@ory/client-fetch'; +import { RegistrationFlow } from '@ory/client-fetch'; +import { SettingsFlow } from '@ory/client-fetch'; +import { UiNode } from '@ory/client-fetch'; +import { UiNodeAnchorAttributes } from '@ory/client-fetch'; +import { UiNodeGroupEnum } from '@ory/client-fetch'; +import { UiNodeImageAttributes } from '@ory/client-fetch'; +import { UiNodeInputAttributes } from '@ory/client-fetch'; +import { UiNodeTextAttributes } from '@ory/client-fetch'; +import { UiText } from '@ory/client-fetch'; +import { UpdateLoginFlowBody } from '@ory/client-fetch'; +import { UpdateRecoveryFlowBody } from '@ory/client-fetch'; +import { UpdateRegistrationFlowBody } from '@ory/client-fetch'; +import { UpdateSettingsFlowBody } from '@ory/client-fetch'; +import { UpdateVerificationFlowBody } from '@ory/client-fetch'; +import { VerificationFlow } from '@ory/client-fetch'; + +// Warning: (ae-forgotten-export) The symbol "OryFlow" needs to be exported by the entry point index.d.ts +// +// @public +export type ErrorFlowContainer = OryFlow; + +// @public +export type FlowContainerSetter = Dispatch>; + +// @public +export type FlowContextValue = OryFlowContainer & { + setFlowContainer: FlowContainerSetter; +}; + +// @public (undocumented) +export function formElementId(attributes: { + name: string; +}): { + id: string; +}; + +// @public (undocumented) +export function formLabelId(attributes: { + name: string; +}): { + htmlFor: string; +}; + +// @public (undocumented) +export type FormValues = Record; + +// Warning: (ae-forgotten-export) The symbol "CustomTranslations" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type IntlProviderProps = Translation extends CustomTranslations ? CustomTranslations : SupportedTranslations; + +// @public (undocumented) +export type Locale = keyof typeof OryLocales; + +// @public +export type LoginFlowContainer = OryFlow; + +// @public (undocumented) +export function messageTestId(message: UiText): { + "data-testid": string; +}; + +// @public (undocumented) +export type OnSubmitHandlerProps = { + setFlowContainer: (flowContainer: OryFlowContainer) => void; + body: T; + onRedirect: OnRedirectHandler; +}; + +// @public (undocumented) +export function OryCard({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public +export type OryCardAuthMethodListItemProps = { + onClick: () => void; + group: string; +}; + +// @public (undocumented) +export function OryCardContent({ children }: OryCardContentProps): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type OryCardContentProps = PropsWithChildren; + +// @public (undocumented) +export type OryCardDividerProps = Record; + +// @public (undocumented) +export function OryCardFooter(): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type OryCardFooterProps = Record; + +// @public (undocumented) +export function OryCardHeader(): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type OryCardHeaderProps = Record; + +// @public (undocumented) +export type OryCardProps = PropsWithChildren; + +// @public (undocumented) +export function OryCardValidationMessages({ ...props }: OryMessageRootProps): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export type OryClientConfiguration = { + name: string; + logoUrl?: string; + stylesheet?: string; + favicon?: string; + sdk: { + url: string; + options?: Partial; + }; + project: { + registration_enabled: boolean; + verification_enabled: boolean; + recovery_enabled: boolean; + recovery_ui_url: string; + registration_ui_url: string; + verification_ui_url: string; + login_ui_url: string; + }; +}; + +// @public (undocumented) +export type OryCurrentIdentifierProps = { + attributes: UiNodeInputAttributes; + node: UiNode; + onClick?: () => void; + href?: string; +} & Omit, "children" | "onClick">; + +// Warning: (ae-forgotten-export) The symbol "DeepPartialTwoLevels" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export type OryFlowComponentOverrides = DeepPartialTwoLevels; + +// @public +export type OryFlowComponents = { + Node: { + Button: ComponentType; + OIDCButton: ComponentType; + CurrentIdentifierButton: ComponentType; + Anchor: ComponentType; + Input: ComponentType; + CodeInput: ComponentType; + Image: ComponentType; + Label: ComponentType; + Checkbox: ComponentType; + Text: ComponentType; + }; + Card: { + Root: ComponentType; + Footer: ComponentType; + Header: ComponentType; + Content: ComponentType; + Logo: ComponentType; + Divider: ComponentType; + AuthMethodListItem: ComponentType; + }; + Form: { + Root: ComponentType; + OIDCRoot: ComponentType; + Group: ComponentType; + }; + Message: { + Root: ComponentType; + Content: ComponentType; + }; +}; + +// @public +export type OryFlowContainer = LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer | VerificationFlowContainer | SettingsFlowContainer; + +// @public (undocumented) +export function OryForm({ children }: OryFormProps): string | react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function OryFormGroupDivider(): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export type OryFormGroupProps = PropsWithChildren; + +// @public (undocumented) +export function OryFormGroups({ children, groups }: OryFormGroupsProps): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type OryFormGroupsProps = PropsWithChildren<{ + groups: UiNodeGroupEnum[]; +}>; + +// @public (undocumented) +export type OryFormOIDCButtonsProps = PropsWithChildren<{ + hideDivider?: boolean; +}>; + +// @public (undocumented) +export type OryFormOIDCRootProps = PropsWithChildren<{ + nodes: UiNode[]; +}>; + +// @public (undocumented) +export type OryFormProps = PropsWithChildren; + +// @public (undocumented) +export type OryFormRootProps = ComponentPropsWithoutRef<"form"> & { + onSubmit: FormEventHandler; +}; + +// @public (undocumented) +export function OryFormSocialButtons({ children, hideDivider, }: OryFormOIDCButtonsProps): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export function OryFormSocialButtonsForm(): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export namespace OryLocales { + { locales_de as de, locales_en as en, locales_es as es, locales_fr as fr, locales_nl as nl, locales_pl as pl, locales_pt as pt, locales_sv as sv }; +} + +// @public (undocumented) +export type OryMessageContentProps = { + message: UiText; +}; + +// @public (undocumented) +export type OryMessageRootProps = DetailedHTMLProps, HTMLDivElement>; + +// @public (undocumented) +export type OryNodeAnchorProps = { + attributes: UiNodeAnchorAttributes; + node: UiNode; +} & Omit, "children">; + +// @public (undocumented) +export type OryNodeButtonProps = { + attributes: UiNodeInputAttributes; + node: UiNode; +} & Omit, "children">; + +// @public (undocumented) +export type OryNodeImageProps = { + attributes: UiNodeImageAttributes; + node: UiNode; +}; + +// @public (undocumented) +export type OryNodeInputProps = { + attributes: UiNodeInputAttributes; + node: UiNode; + onClick?: MouseEventHandler; +}; + +// @public (undocumented) +export type OryNodeLabelProps = { + attributes: UiNodeInputAttributes; + node: UiNode; +} & ComponentPropsWithoutRef<"label">; + +// @public (undocumented) +export type OryNodeOIDCButtonProps = { + node: UiNode; + attributes: UiNodeInputAttributes; + onClick?: () => void; +}; + +// @public (undocumented) +export type OryNodeTextProps = { + attributes: UiNodeTextAttributes; + node: UiNode; +}; + +// @public (undocumented) +export function OryProvider({ children, components: Components, ...props }: OryProviderProps): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type OryProviderProps = { + components: OryFlowComponents; +} & IntlProviderProps & OryFlowContainer & PropsWithChildren; + +// @public (undocumented) +export function OryTwoStepCard(): react_jsx_runtime.JSX.Element; + +// @public +export type RecoveryFlowContainer = OryFlow; + +// @public +export type RegistrationFlowContainer = OryFlow; + +// @public +export type SettingsFlowContainer = OryFlow; + +// @public (undocumented) +export type SupportedTranslations = { + locale?: Locale; + defaultLocale?: string; +}; + +// @public +export const uiTextToFormattedMessage: ({ id, context, text }: Omit, intl: IntlShape) => string; + +// @public (undocumented) +export function useComponents(): OryFlowComponents; + +// @public (undocumented) +export function useNodeSorter(): (a: UiNode, b: UiNode, ctx: { + flowType: string; +}) => number; + +// @public +export function useOryFlow(): FlowContextValue; + +// @public +export type VerificationFlowContainer = OryFlow; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/elements-react/config/api-extractor-core.json b/packages/elements-react/config/api-extractor-core.json new file mode 100644 index 000000000..61627f875 --- /dev/null +++ b/packages/elements-react/config/api-extractor-core.json @@ -0,0 +1,457 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/dist/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we might specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + * + * The "bundledPackages" elements may specify glob patterns using minimatch syntax. To ensure deterministic + * output, globs are expanded by matching explicitly declared top-level dependencies only. For example, + * the pattern below will NOT match "@my-company/example" unless it appears in a field such as "dependencies" + * or "devDependencies" of the project's package.json file: + * + * "bundledPackages": [ "@my-company/*" ], + */ + "bundledPackages": [], + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Specifies how API Extractor sorts members of an enum when generating the .api.json file. By default, the output + * files will be sorted alphabetically, which is "by-name". To keep the ordering in the source code, specify + * "preserve". + * + * DEFAULT VALUE: "by-name" + */ + // "enumMemberOrder": "by-name", + + /** + * Set to true when invoking API Extractor's test harness. When `testMode` is true, the `toolVersion` field in the + * .api.json file is assigned an empty string to prevent spurious diffs in output files tracked for tests. + * + * DEFAULT VALUE: "false" + */ + // "testMode": false, + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The base filename for the API report files, to be combined with "reportFolder" or "reportTempFolder" + * to produce the full file path. The "reportFileName" should not include any path separators such as + * "\" or "/". The "reportFileName" should not include a file extension, since API Extractor will automatically + * append an appropriate file extension such as ".api.md". If the "reportVariants" setting is used, then the + * file extension includes the variant name, for example "my-report.public.api.md" or "my-report.beta.api.md". + * The "complete" variant always uses the simple extension "my-report.api.md". + * + * Previous versions of API Extractor required "reportFileName" to include the ".api.md" extension explicitly; + * for backwards compatibility, that is still accepted but will be discarded before applying the above rules. + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: "" + */ + // "reportFileName": "", + + /** + * To support different approval requirements for different API levels, multiple "variants" of the API report can + * be generated. The "reportVariants" setting specifies a list of variants to be generated. If omitted, + * by default only the "complete" variant will be generated, which includes all @internal, @alpha, @beta, + * and @public items. Other possible variants are "alpha" (@alpha + @beta + @public), "beta" (@beta + @public), + * and "public" (@public only). + * + * DEFAULT VALUE: [ "complete" ] + */ + // "reportVariants": ["public", "beta"], + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + "reportFolder": "/api-report", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + "reportTempFolder": "/api-report/temp/" + + /** + * Whether "forgotten exports" should be included in the API report file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + "apiJsonFilePath": "/api-report/.api.json" + + /** + * Whether "forgotten exports" should be included in the doc model file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false, + + /** + * The base URL where the project's source code can be viewed on a website such as GitHub or + * Azure DevOps. This URL path corresponds to the `` path on disk. + * + * This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items. + * For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API + * item's file path is "api/ExtractorConfig.ts", the full URL file path would be + * "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js". + * + * This setting can be omitted if you don't need source code links in your API documentation reference. + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "projectFolderUrl": "http://github.com/path/to/your/projectFolder" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release. + * This file will include only declarations that are marked as "@public", "@beta", or "@alpha". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "alphaTrimmedFilePath": "/dist/-alpha.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + }, + "ae-missing-release-tag": { + "logLevel": "none" + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/packages/elements-react/config/api-extractor-theme.json b/packages/elements-react/config/api-extractor-theme.json new file mode 100644 index 000000000..1392e82c5 --- /dev/null +++ b/packages/elements-react/config/api-extractor-theme.json @@ -0,0 +1,463 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/dist/theme/default/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we might specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + * + * The "bundledPackages" elements may specify glob patterns using minimatch syntax. To ensure deterministic + * output, globs are expanded by matching explicitly declared top-level dependencies only. For example, + * the pattern below will NOT match "@my-company/example" unless it appears in a field such as "dependencies" + * or "devDependencies" of the project's package.json file: + * + * "bundledPackages": [ "@my-company/*" ], + */ + "bundledPackages": [], + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Specifies how API Extractor sorts members of an enum when generating the .api.json file. By default, the output + * files will be sorted alphabetically, which is "by-name". To keep the ordering in the source code, specify + * "preserve". + * + * DEFAULT VALUE: "by-name" + */ + // "enumMemberOrder": "by-name", + + /** + * Set to true when invoking API Extractor's test harness. When `testMode` is true, the `toolVersion` field in the + * .api.json file is assigned an empty string to prevent spurious diffs in output files tracked for tests. + * + * DEFAULT VALUE: "false" + */ + // "testMode": false, + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The base filename for the API report files, to be combined with "reportFolder" or "reportTempFolder" + * to produce the full file path. The "reportFileName" should not include any path separators such as + * "\" or "/". The "reportFileName" should not include a file extension, since API Extractor will automatically + * append an appropriate file extension such as ".api.md". If the "reportVariants" setting is used, then the + * file extension includes the variant name, for example "my-report.public.api.md" or "my-report.beta.api.md". + * The "complete" variant always uses the simple extension "my-report.api.md". + * + * Previous versions of API Extractor required "reportFileName" to include the ".api.md" extension explicitly; + * for backwards compatibility, that is still accepted but will be discarded before applying the above rules. + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: "" + */ + "reportFileName": "-theme", + + /** + * To support different approval requirements for different API levels, multiple "variants" of the API report can + * be generated. The "reportVariants" setting specifies a list of variants to be generated. If omitted, + * by default only the "complete" variant will be generated, which includes all @internal, @alpha, @beta, + * and @public items. Other possible variants are "alpha" (@alpha + @beta + @public), "beta" (@beta + @public), + * and "public" (@public only). + * + * DEFAULT VALUE: [ "complete" ] + */ + // "reportVariants": ["public", "beta"], + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + "reportFolder": "/api-report", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + "reportTempFolder": "/api-report/temp/" + + /** + * Whether "forgotten exports" should be included in the API report file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + "apiJsonFilePath": "/api-report/-theme.api.json" + + /** + * Whether "forgotten exports" should be included in the doc model file. Forgotten exports are declarations + * flagged with `ae-forgotten-export` warnings. See https://api-extractor.com/pages/messages/ae-forgotten-export/ to + * learn more. + * + * DEFAULT VALUE: "false" + */ + // "includeForgottenExports": false, + + /** + * The base URL where the project's source code can be viewed on a website such as GitHub or + * Azure DevOps. This URL path corresponds to the `` path on disk. + * + * This URL is concatenated with the file paths serialized to the doc model to produce URL file paths to individual API items. + * For example, if the `projectFolderUrl` is "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor" and an API + * item's file path is "api/ExtractorConfig.ts", the full URL file path would be + * "https://github.com/microsoft/rushstack/tree/main/apps/api-extractor/api/ExtractorConfig.js". + * + * This setting can be omitted if you don't need source code links in your API documentation reference. + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "projectFolderUrl": "http://github.com/path/to/your/projectFolder" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release. + * This file will include only declarations that are marked as "@public", "@beta", or "@alpha". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "alphaTrimmedFilePath": "/dist/-alpha.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + }, + "ae-missing-release-tag": { + "logLevel": "none" + }, + // This is okay for the theme, because of the "weird" setup we have, where the theme itself is really a package, + // but we include it as a subfolder with a TS alias. Api Extractor does not know how to deal with that, so we + // have to tell it to ignore it. + "ae-wrong-input-file-type": { + "logLevel": "none" + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/packages/elements-react/package.json b/packages/elements-react/package.json index 1c33addd7..fc235cca7 100644 --- a/packages/elements-react/package.json +++ b/packages/elements-react/package.json @@ -25,12 +25,14 @@ } }, "main": "./dist/index.js", + "typings": "./distindex.d.ts", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "dependencies": { "@ory/client-fetch": "^1.15.4", "clsx": "2.1.1", "input-otp": "1.2.4", + "lodash.merge": "4.6.2", "react-hook-form": "7.53.0", "react-intl": "6.7.0", "tailwind-merge": "2.5.2" @@ -42,6 +44,7 @@ "devDependencies": { "@hookform/devtools": "^4.3.1", "@svgr/plugin-svgo": "^8.1.0", + "@types/lodash.merge": "4.6.9", "esbuild-plugin-svgr": "^2.1.0", "eslint-plugin-react": "7.37.0", "postcss": "8.4.47", diff --git a/packages/elements-react/project.json b/packages/elements-react/project.json index c6f166e4d..31d2d6b22 100644 --- a/packages/elements-react/project.json +++ b/packages/elements-react/project.json @@ -10,7 +10,7 @@ } }, "dev": { - "command": "tsup --watch --dts", + "command": "tsup --watch --onSuccess 'tsup --dts-only'", "options": { "cwd": "packages/elements-react" } @@ -29,6 +29,28 @@ "coverage": true, "coverageReporters": ["text", "cobertura"] } + }, + "api-extractor": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/elements-react", + "commands": [ + "api-extractor run --verbose -c config/api-extractor-core.json", + "api-extractor run --verbose -c config/api-extractor-theme.json" + ] + }, + "dependsOn": ["build"] + }, + "api-extractor-refresh": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/elements-react", + "commands": [ + "api-extractor run --local --verbose -c config/api-extractor-core.json", + "api-extractor run --local --verbose -c config/api-extractor-theme.json" + ] + }, + "dependsOn": ["build"] } } } diff --git a/packages/elements-react/src/components/card/card-two-step.tsx b/packages/elements-react/src/components/card/card-two-step.tsx index 396ce4e24..1cf82c977 100644 --- a/packages/elements-react/src/components/card/card-two-step.tsx +++ b/packages/elements-react/src/components/card/card-two-step.tsx @@ -36,8 +36,7 @@ export function OryTwoStepCard() { const [selectedGroup, setSelectedGroup] = useState< UiNodeGroupEnum | undefined >() - const Components = useComponents() - const { FormGroup } = useComponents() + const { Form, Card } = useComponents() const { flowType } = useOryFlow() const nodeSorter = useNodeSorter() @@ -79,7 +78,7 @@ export function OryTwoStepCard() { )} - + {step === ProcessStep.ProvideIdentifier && zeroStepGroups .sort(sortNodes) @@ -90,7 +89,7 @@ export function OryTwoStepCard() { )} {options.map((option) => ( - setSelectedGroup(option)} @@ -106,7 +105,7 @@ export function OryTwoStepCard() { ))} )} - + @@ -123,7 +122,7 @@ const BackButton = ({ onClick, href }: BackButtonProps) => { const { flow: { ui }, } = useOryFlow() - const Components = useComponents() + const { Node } = useComponents() const nodeBackButton = ui.nodes.find( (node) => @@ -139,7 +138,7 @@ const BackButton = ({ onClick, href }: BackButtonProps) => { } return ( - {children} + } + + return ( + + + + + + ) +} diff --git a/packages/elements-react/src/components/card/content.tsx b/packages/elements-react/src/components/card/content.tsx new file mode 100644 index 000000000..aeacb2900 --- /dev/null +++ b/packages/elements-react/src/components/card/content.tsx @@ -0,0 +1,39 @@ +import { PropsWithChildren } from "react" +import { useComponents } from "../../context" +import { + OryCardValidationMessages, + OryForm, + OryFormGroups, + OryFormSocialButtons, +} from "../form" + +export type OryCardContentProps = PropsWithChildren + +export function OryCardContent({ children }: OryCardContentProps) { + const { Card } = useComponents() + + if (children) { + return {children} + } + + return ( + + + + + + + + ) +} diff --git a/packages/elements-react/src/components/card/footer.tsx b/packages/elements-react/src/components/card/footer.tsx new file mode 100644 index 000000000..cf24efaf9 --- /dev/null +++ b/packages/elements-react/src/components/card/footer.tsx @@ -0,0 +1,8 @@ +import { useComponents } from "../../context" + +export type OryCardFooterProps = Record + +export function OryCardFooter() { + const { Card } = useComponents() + return +} diff --git a/packages/elements-react/src/components/card/header.tsx b/packages/elements-react/src/components/card/header.tsx index e63ff266e..27c1ae950 100644 --- a/packages/elements-react/src/components/card/header.tsx +++ b/packages/elements-react/src/components/card/header.tsx @@ -3,6 +3,6 @@ import { useComponents } from "../../context" export type OryCardHeaderProps = Record export function OryCardHeader() { - const { CardHeader } = useComponents() - return + const { Card } = useComponents() + return } diff --git a/packages/elements-react/src/components/card/index.tsx b/packages/elements-react/src/components/card/index.tsx index c49140c08..44e49fd32 100644 --- a/packages/elements-react/src/components/card/index.tsx +++ b/packages/elements-react/src/components/card/index.tsx @@ -1,96 +1,14 @@ -import { ComponentType, PropsWithChildren } from "react" -import { useComponents } from "../../context" -import { OryForm } from "../form/form" -import { OryFormGroups } from "../form/groups" -import { OryCardValidationMessages } from "../form/messages" -import { OryTwoStepCard } from "./card-two-step" import { OryCardHeader, OryCardHeaderProps } from "./header" +import { OryCard, OryCardRootProps } from "./card" +import { OryCardFooter, OryCardFooterProps } from "./footer" +import { OryCardContent, OryCardContentProps } from "./content" +import { OryTwoStepCard } from "./card-two-step" -export type OryCardContentProps = PropsWithChildren - -export function OryCardContent({ children }: OryCardContentProps) { - const { CardContent } = useComponents() - - if (children) { - return {children} - } - - return ( - - - - - - - ) -} - -export type OryCardFooterProps = Record - -export function OryCardFooter() { - const { CardFooter } = useComponents() - return -} - -export type OryCardProps = PropsWithChildren - -export function OryCard({ children }: OryCardProps) { - const { Card } = useComponents() - - if (children) { - return {children} - } - - return ( - - - - - - ) -} - -/** - * Card components are used to show login, registration, recovery, and verification flows. - */ -export type OryCardComponents = { - /** - * The card container is the main container of the card. - */ - Card: ComponentType - - /** - * The card footer is the footer of the card container. - */ - CardFooter: ComponentType - - /** - * The card header is the header of the card container. - */ - CardHeader: ComponentType - - /** - * The card content is the main content of the card container. - */ - CardContent: ComponentType +export { OryCardHeader, OryCard, OryCardFooter, OryCardContent, OryTwoStepCard } - /** - * The card logo is the logo of the card container. - */ - CardLogo: ComponentType +export type { + OryCardHeaderProps, + OryCardRootProps as OryCardProps, + OryCardFooterProps, + OryCardContentProps, } - -export { OryCardHeader, OryTwoStepCard } - -export type { OryCardHeaderProps } diff --git a/packages/elements-react/src/components/form/form-helpers.ts b/packages/elements-react/src/components/form/form-helpers.ts index 4f2ce0b53..388c0e960 100644 --- a/packages/elements-react/src/components/form/form-helpers.ts +++ b/packages/elements-react/src/components/form/form-helpers.ts @@ -3,9 +3,11 @@ import { isUiNodeInputAttributes } from "@ory/client-fetch" import { FormValues } from "../../types" -import { FlowContainer } from "../../util" +import { OryFlowContainer } from "../../util" -export function computeDefaultValues(flowContainer: FlowContainer): FormValues { +export function computeDefaultValues( + flowContainer: OryFlowContainer, +): FormValues { return flowContainer.flow.ui.nodes.reduce((acc, node) => { if (isUiNodeInputAttributes(node.attributes)) { if (node.attributes.name === "method") { diff --git a/packages/elements-react/src/components/form/form.tsx b/packages/elements-react/src/components/form/form.tsx index b5507d4a8..fb8e4eac9 100644 --- a/packages/elements-react/src/components/form/form.tsx +++ b/packages/elements-react/src/components/form/form.tsx @@ -11,22 +11,22 @@ import { useIntl } from "react-intl" import { useOryFlow, useComponents } from "../../context" import { FormValues, - HeadlessAuthMethodListItemProps, - HeadlessButtonProps, - HeadlessCurrentIdentifierProps, - HeadlessFormProps, - HeadlessImageProps, - HeadlessInputProps, - HeadlessLabelProps, - HeadlessLinkButtonProps, - HeadlessTextProps, + OryCardAuthMethodListItemProps, + OryNodeButtonProps, + OryFormRootProps, + OryNodeImageProps, + OryNodeInputProps, + OryNodeLabelProps, + OryNodeAnchorProps, + OryNodeTextProps, + OryCurrentIdentifierProps, } from "../../types" -import { HorizontalDividerProps } from "../generic/divider" -import { HeadlessGroupContainerProps, OryFormGroups } from "./groups" -import { HeadlessMessageProps, HeadlessMessagesProps } from "./messages" +import { OryCardDividerProps } from "../generic/divider" +import { OryFormGroupProps, OryFormGroups } from "./groups" +import { OryMessageContentProps, OryMessageRootProps } from "./messages" import { - HeadlessSocialButtonContainerProps, - HeadlessSocialButtonProps, + OryFormOIDCRootProps, + OryNodeOIDCButtonProps, OryFormSocialButtons, } from "./social" import { @@ -37,46 +37,147 @@ import { isUiNodeInputAttributes, isUiNodeScriptAttributes, } from "@ory/client-fetch" -import { - FlowContainer, - onSubmitLogin, - onSubmitRecovery, - onSubmitRegistration, - onSubmitSettings, - onSubmitVerification, -} from "../../util" +import { OryFlowContainer } from "../../util" import { computeDefaultValues } from "./form-helpers" +import { OryCardRootProps } from "../card/card" +import { OryCardFooterProps } from "../card" +import { OryCardContentProps } from "../card/content" +import { onSubmitLogin } from "../../util/onSubmitLogin" +import { onSubmitRegistration } from "../../util/onSubmitRegistration" +import { onSubmitVerification } from "../../util/onSubmitVerification" +import { onSubmitRecovery } from "../../util/onSubmitRecovery" +import { onSubmitSettings } from "../../util/onSubmitSettings" -export type OryFormComponents = { - Button: ComponentType - LinkButton: ComponentType - Input: ComponentType - PinCodeInput: ComponentType - Image: ComponentType - Label: ComponentType - Checkbox: ComponentType - Text: ComponentType - - FormContainer: ComponentType - - SocialButton: ComponentType - SocialButtonContainer: ComponentType - - AuthMethodListItem: ComponentType +/** + * A record of all the components that are used in the OryForm component. + */ +export type OryFlowComponents = { + Node: { + /** + * Button component, rendered whenever a button is encountered in the Ory UI Nodes. + */ + Button: ComponentType + /** + * The SocialButton component is rendered whenever a button of group "oidc" node is encountered. + * + * It renders the "Login with Google", "Login with Facebook" etc. buttons. + */ + OIDCButton: ComponentType + /** + * The CurrentIdentifierButton component is rendered whenever a button of group "identifier_first" node is encountered. + * + * It is used to show the current identifier and can allow the user to start a new flow, if they want to. + */ + CurrentIdentifierButton: ComponentType + /** + * Anchor component, rendered whenever an "anchor" node is encountered + */ + Anchor: ComponentType + /** + * The Input component is rendered whenever a "input" node is encountered. + */ + Input: ComponentType + /** + * Special version of the Input component for OTP codes. + */ + CodeInput: ComponentType + /** + * The Image component is rendered whenever an "image" node is encountered. + * + * For example used in the "Logo" node. + */ + Image: ComponentType + /** + * The Label component is rendered around Input components and is used to render form labels. + */ + Label: ComponentType + /** + * The Checkbox component is rendered whenever an input node with of boolean type is encountered. + */ + Checkbox: ComponentType + /** + * The Text component is rendered whenever a "text" node is encountered. + */ + Text: ComponentType + } + Card: { + /** + * The card container is the main container of the card. + */ + Root: ComponentType + /** + * The card footer is the footer of the card container. + */ + Footer: ComponentType + /** + * The card header is the header of the card container. + */ + Header: ComponentType + /** + * The card content is the main content of the card container. + */ + Content: ComponentType + /** + * The card logo is the logo of the card container. + */ + Logo: ComponentType + /** + * The HorizontalDivider component is rendered between groups. + */ + Divider: ComponentType + /** + * The AuthMethodListItem component is rendered on the "method" chooser step in the identifier_first login flow. + * + * This is only used, if login is configured to use identifier_first authentication. + */ + AuthMethodListItem: ComponentType + } + Form: { + /** + * The FormContainer component is the main container of the form. + * + * It should render its children. + * + * You most likely don't want to override this component directly. + */ + Root: ComponentType + /** + * A special form group container for the social buttons. + * + * This is required, because the social buttons need to be in it's form, to not influence the other form groups. + * + * You most likely don't want to override this component directly. + */ + OIDCRoot: ComponentType - HorizontalDivider: ComponentType + /** + * The FormGroup is rendered around each group of nodes in the UI nodes. + */ + Group: ComponentType + } + Message: { + /** + * The MessageContainer is rendered around the messages. + */ + Root: ComponentType - FormGroup: ComponentType + /** + * The Message component is rendered whenever a message is encountered. + */ + Content: ComponentType + } +} - MessageContainer: ComponentType - Message: ComponentType - CurrentIdentifierButton: ComponentType +type DeepPartialTwoLevels = { + [P in keyof T]?: T[P] extends object ? { [K in keyof T[P]]?: T[P][K] } : T[P] } +export type OryFlowComponentOverrides = DeepPartialTwoLevels + export type OryFormProps = PropsWithChildren export function OryForm({ children }: OryFormProps) { - const { FormContainer } = useComponents() + const { Form } = useComponents() const flowContainer = useOryFlow() const methods = useForm({ // TODO: Generify this, so we have typesafety in the submit handler. @@ -95,7 +196,7 @@ export function OryForm({ children }: OryFormProps) { window.location.href = url } - const handleSuccess = (flow: FlowContainer) => { + const handleSuccess = (flow: OryFlowContainer) => { flowContainer.setFlowContainer(flow) methods.reset(computeDefaultValues(flow)) } @@ -191,7 +292,7 @@ export function OryForm({ children }: OryFormProps) { return ( - void methods.handleSubmit(onSubmit)(e)} @@ -211,7 +312,7 @@ export function OryForm({ children }: OryFormProps) { /> )} - + ) } diff --git a/packages/elements-react/src/components/form/groups.tsx b/packages/elements-react/src/components/form/groups.tsx index 7183bd18e..bf967e910 100644 --- a/packages/elements-react/src/components/form/groups.tsx +++ b/packages/elements-react/src/components/form/groups.tsx @@ -4,29 +4,29 @@ import { UiNodeGroupEnum } from "@ory/client-fetch" import { PropsWithChildren } from "react" import { Node } from "./nodes/node" -export type HeadlessGroupProps = PropsWithChildren<{ +export type OryFormGroupsProps = PropsWithChildren<{ groups: UiNodeGroupEnum[] }> -export type HeadlessGroupContainerProps = PropsWithChildren +export type OryFormGroupProps = PropsWithChildren -export function OryFormGroups({ children, groups }: HeadlessGroupProps) { +export function OryFormGroups({ children, groups }: OryFormGroupsProps) { const { flow: { ui }, } = useOryFlow() const nodeSorter = useNodeSorter() const { flowType } = useOryFlow() - const { FormGroup } = useComponents() + const { Form } = useComponents() const nodes = ui.nodes .filter((node) => groups.indexOf(node.group) > -1) .sort((a, b) => nodeSorter(a, b, { flowType })) return ( - + {children ?? nodes.map((node, k) => { return })} - + ) } diff --git a/packages/elements-react/src/components/form/messages.tsx b/packages/elements-react/src/components/form/messages.tsx index 9b592ab07..6b977ca61 100644 --- a/packages/elements-react/src/components/form/messages.tsx +++ b/packages/elements-react/src/components/form/messages.tsx @@ -2,34 +2,29 @@ import { useOryFlow, useComponents } from "../../context" import { UiText } from "@ory/client-fetch" import { DetailedHTMLProps, HTMLAttributes } from "react" -export type HeadlessMessagesProps = DetailedHTMLProps< +export type OryMessageContentProps = { + message: UiText +} + +export type OryMessageRootProps = DetailedHTMLProps< HTMLAttributes, HTMLDivElement > -export function OryCardValidationMessages({ ...props }: HeadlessMessagesProps) { +export function OryCardValidationMessages({ ...props }: OryMessageRootProps) { const { flow } = useOryFlow() const messages = flow.ui.messages - const { MessageContainer } = useComponents() + const { Message } = useComponents() if (!messages) { return null } return ( - + {messages?.map((message) => ( - + ))} - + ) } - -export type HeadlessMessageProps = { - message: UiText -} - -export function HeadlessMessage({ message }: HeadlessMessageProps) { - const { Message } = useComponents() - return -} diff --git a/packages/elements-react/src/components/form/nodes/input.tsx b/packages/elements-react/src/components/form/nodes/input.tsx index b7c56df3e..33e0acb9d 100644 --- a/packages/elements-react/src/components/form/nodes/input.tsx +++ b/packages/elements-react/src/components/form/nodes/input.tsx @@ -14,7 +14,7 @@ export const NodeInput = ({ attributes: UiNodeInputAttributes onClick?: MouseEventHandler }): ReactNode => { - const Components = useComponents() + const { Node } = useComponents() const nodeType = attributes.type const { onloadTrigger: onloadTrigger, @@ -57,58 +57,40 @@ export const NodeInput = ({ case UiNodeInputAttributesTypeEnum.Submit: case UiNodeInputAttributesTypeEnum.Button: if (isSocial) { - return + return } if (isResend) { return null } return ( - + ) case UiNodeInputAttributesTypeEnum.DatetimeLocal: throw new Error("Not implemented") case UiNodeInputAttributesTypeEnum.Checkbox: return ( - + ) case UiNodeInputAttributesTypeEnum.Hidden: - return ( - - ) + return default: if (isPinCodeInput) { return ( - - + - + ) } return ( - - - + + + ) } } diff --git a/packages/elements-react/src/components/form/nodes/node.tsx b/packages/elements-react/src/components/form/nodes/node.tsx index cfb77de09..b8dbaebd1 100644 --- a/packages/elements-react/src/components/form/nodes/node.tsx +++ b/packages/elements-react/src/components/form/nodes/node.tsx @@ -17,19 +17,19 @@ export type NodeProps = { } export const Node = ({ node, onClick }: NodeProps): ReactNode => { - const Components = useComponents() + const { Node } = useComponents() if (isUiNodeImageAttributes(node.attributes)) { - return + return } else if (isUiNodeTextAttributes(node.attributes)) { const attrs = node.attributes - return + return } else if (isUiNodeInputAttributes(node.attributes)) { return ( ) } else if (isUiNodeAnchorAttributes(node.attributes)) { - return + return } else if (isUiNodeScriptAttributes(node.attributes)) { const { crossorigin, diff --git a/packages/elements-react/src/components/form/social.tsx b/packages/elements-react/src/components/form/social.tsx index 60e106e6a..979038a4c 100644 --- a/packages/elements-react/src/components/form/social.tsx +++ b/packages/elements-react/src/components/form/social.tsx @@ -5,24 +5,24 @@ import { PropsWithChildren } from "react" import { OryForm } from "./form" import { useFormContext } from "react-hook-form" -export type HeadlessSocialButtonsProps = PropsWithChildren<{ +export type OryFormOIDCButtonsProps = PropsWithChildren<{ hideDivider?: boolean }> -export type HeadlessSocialButtonContainerProps = PropsWithChildren<{ +export type OryFormOIDCRootProps = PropsWithChildren<{ nodes: UiNode[] }> -export type HeadlessSocialButtonProps = PropsWithChildren<{ +export type OryNodeOIDCButtonProps = { node: UiNode attributes: UiNodeInputAttributes onClick?: () => void -}> +} export function OryFormSocialButtons({ children, hideDivider, -}: HeadlessSocialButtonsProps) { +}: OryFormOIDCButtonsProps) { const { flow: { ui }, } = useOryFlow() @@ -31,8 +31,7 @@ export function OryFormSocialButtons({ // Only get the oidc nodes. const filteredNodes = ui.nodes.filter((node) => node.group === "oidc") - const { SocialButtonContainer, HorizontalDivider, SocialButton } = - useComponents() + const { Form, Card, Node } = useComponents() if (filteredNodes.length === 0) { return null @@ -45,11 +44,11 @@ export function OryFormSocialButtons({ return ( <> - + {children ?? filteredNodes.map((node, k) => { return ( - ) })} - + {!hideDivider && filteredNodes.length > 0 && otherNodes.length > 0 && ( - + )} ) diff --git a/packages/elements-react/src/components/generic/divider.tsx b/packages/elements-react/src/components/generic/divider.tsx index 4feae2729..66c17616b 100644 --- a/packages/elements-react/src/components/generic/divider.tsx +++ b/packages/elements-react/src/components/generic/divider.tsx @@ -1,10 +1,10 @@ import { useComponents } from "../../context" import { useOryFlow } from "../../context" -export type HorizontalDividerProps = Record +export type OryCardDividerProps = Record export function OryFormGroupDivider() { - const { HorizontalDivider } = useComponents() + const { Card } = useComponents() const { flow: { ui }, } = useOryFlow() @@ -18,7 +18,7 @@ export function OryFormGroupDivider() { ) if (filteredNodes.length > 0 && otherNodes.length > 0) { - return + return } return null } diff --git a/packages/elements-react/src/context/component.tsx b/packages/elements-react/src/context/component.tsx index 70b49167f..ac7895f44 100644 --- a/packages/elements-react/src/context/component.tsx +++ b/packages/elements-react/src/context/component.tsx @@ -1,6 +1,6 @@ import { UiNode } from "@ory/client-fetch" import { PropsWithChildren, createContext, useContext } from "react" -import { OryFlowComponents } from "../types" +import { OryFlowComponents } from "../components" type ComponentContextValue = { components: OryFlowComponents diff --git a/packages/elements-react/src/context/flow-context.tsx b/packages/elements-react/src/context/flow-context.tsx index fb0c2cc3a..233988f70 100644 --- a/packages/elements-react/src/context/flow-context.tsx +++ b/packages/elements-react/src/context/flow-context.tsx @@ -5,7 +5,7 @@ import { useContext, useState, } from "react" -import { FlowContainer } from "../util/flowContainer" +import { OryFlowContainer } from "../util/flowContainer" /** * Returns an object that contains the current flow and the flow type, as well as the configuration. @@ -21,16 +21,25 @@ export function useOryFlow() { return ctx } -export type FlowContainerSetter = Dispatch> +/** + * Function to set the flow container. + */ +export type FlowContainerSetter = Dispatch> -export type FlowContextValue = FlowContainer & { +/** + * The return value of the OryFlowContext. + */ +export type FlowContextValue = OryFlowContainer & { + /** + * Function to set the flow container. + */ setFlowContainer: FlowContainerSetter } // This is fine, because we don't export the context itself and guard from it being null in useOryFlow const OryFlowContext = createContext(null!) -export type OryFlowProviderProps = PropsWithChildren +export type OryFlowProviderProps = PropsWithChildren export function OryFlowProvider({ children, @@ -49,7 +58,7 @@ export function OryFlowProvider({ ({ ...container, ...updatedContainer, - }) as FlowContainer, + }) as OryFlowContainer, ) }, } as FlowContextValue diff --git a/packages/elements-react/src/context/index.tsx b/packages/elements-react/src/context/index.tsx index 14939b390..a73d99c89 100644 --- a/packages/elements-react/src/context/index.tsx +++ b/packages/elements-react/src/context/index.tsx @@ -1,4 +1,12 @@ -export * from "./component" -export * from "./flow-context" -export * from "./intl-context" +export { useComponents, useNodeSorter } from "./component" +export { + useOryFlow, + type FlowContextValue, + type FlowContainerSetter, +} from "./flow-context" +export type { + SupportedTranslations, + OryIntlProviderProps as IntlProviderProps, + Locale, +} from "./intl-context" export * from "./provider" diff --git a/packages/elements-react/src/context/intl-context.tsx b/packages/elements-react/src/context/intl-context.tsx index bb3278a0c..09bec9a06 100644 --- a/packages/elements-react/src/context/intl-context.tsx +++ b/packages/elements-react/src/context/intl-context.tsx @@ -147,6 +147,9 @@ export const LanguageCodes = [ "zu", ] as const +/** + * A record of custom translations for a specific locale. + */ export type CustomLanguageFormats = { [k in (typeof LanguageCodes)[number]]?: Partial } @@ -173,16 +176,19 @@ export type SupportedTranslations = { defaultLocale?: string } -export type IntlProviderProps = Type extends CustomTranslations - ? CustomTranslations - : SupportedTranslations +export type OryIntlProviderProps = + Translation extends CustomTranslations + ? CustomTranslations + : SupportedTranslations export const IntlProvider = < - T extends SupportedTranslations | CustomTranslations = SupportedTranslations, + Translation extends + | SupportedTranslations + | CustomTranslations = SupportedTranslations, >({ children, ...props -}: PropsWithChildren>) => { +}: PropsWithChildren>) => { const intlCtx = useContext(IntlContext) if (intlCtx) { diff --git a/packages/elements-react/src/context/provider.tsx b/packages/elements-react/src/context/provider.tsx index 9d65bea33..08f91fc31 100644 --- a/packages/elements-react/src/context/provider.tsx +++ b/packages/elements-react/src/context/provider.tsx @@ -1,27 +1,27 @@ "use client" -import { ComponentPropsWithoutRef, PropsWithChildren } from "react" -import { OryFlowComponents } from "../types" +import { PropsWithChildren } from "react" + +import { OryFlowComponents } from "../components" +import { OryFlowContainer } from "../util/flowContainer" import { OryComponentProvider } from "./component" import { OryFlowProvider } from "./flow-context" import { IntlProvider, - IntlProviderProps, + OryIntlProviderProps, SupportedTranslations, } from "./intl-context" -import { FlowContainer } from "../util/flowContainer" -export type ProviderProps = { +export type OryProviderProps = { components: OryFlowComponents -} & IntlProviderProps & - FlowContainer & - ComponentPropsWithoutRef<"div"> & +} & OryIntlProviderProps & + OryFlowContainer & PropsWithChildren -export function OryProvider({ +export function OryProvider({ children, components: Components, ...props -}: ProviderProps) { +}: OryProviderProps) { const { locale, defaultLocale, ...oryFlowProps } = props return ( diff --git a/packages/elements-react/src/tests/jest/test-utils.tsx b/packages/elements-react/src/tests/jest/test-utils.tsx index 0b8d1314e..c5e5ec31b 100644 --- a/packages/elements-react/src/tests/jest/test-utils.tsx +++ b/packages/elements-react/src/tests/jest/test-utils.tsx @@ -1,13 +1,13 @@ import { PropsWithChildren, ReactElement, ReactNode } from "react" +import { OryComponentProvider } from "../../context/component" +import { OryDefaultComponents } from "../../theme/default" +import { render, RenderOptions } from "@testing-library/react" +import { OryClientConfiguration } from "../../util" import { - OryComponentProvider, OryProvider, - ProviderProps, + OryProviderProps, SupportedTranslations, } from "../../context" -import { OryDefaultComponents } from "../../theme/default" -import { render, RenderOptions } from "@testing-library/react" -import { OryClientConfiguration } from "../../util" const AllProviders = ({ children }: PropsWithChildren) => ( @@ -41,7 +41,7 @@ export function renderWithOryProvider( { providerProps, ...renderOptions - }: RenderOptions & { providerProps: ProviderProps }, + }: RenderOptions & { providerProps: OryProviderProps }, ) { return render(ui, { wrapper: ({ children }) => ( diff --git a/packages/elements-react/src/theme/default/components/card/auth-methods.tsx b/packages/elements-react/src/theme/default/components/card/auth-methods.tsx index 7b6fd6219..ec99b5f83 100644 --- a/packages/elements-react/src/theme/default/components/card/auth-methods.tsx +++ b/packages/elements-react/src/theme/default/components/card/auth-methods.tsx @@ -1,10 +1,10 @@ -import { HeadlessAuthMethodListItemProps } from "@ory/elements-react" +import { useIntl } from "react-intl" +import { OryCardAuthMethodListItemProps } from "@ory/elements-react" import code from "../../assets/icons/code.svg" import passkey from "../../assets/icons/passkey.svg" import password from "../../assets/icons/password.svg" import webauthn from "../../assets/icons/webauthn.svg" -import { useIntl } from "react-intl" const iconsMap: Record = { code, @@ -17,7 +17,7 @@ const iconsMap: Record = { export function DefaultAuthMethodListItem({ onClick, group, -}: HeadlessAuthMethodListItemProps) { +}: OryCardAuthMethodListItemProps) { const intl = useIntl() const Icon = iconsMap[group] || null diff --git a/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx b/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx index bb360a08b..fd202306c 100644 --- a/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx +++ b/packages/elements-react/src/theme/default/components/card/current-identifier-button.tsx @@ -1,4 +1,4 @@ -import { HeadlessCurrentIdentifierProps } from "@ory/elements-react" +import { OryCurrentIdentifierProps } from "@ory/elements-react" import IconArrowLeft from "../../assets/icons/arrow-left.svg" export function DefaultCurrentIdentifierButton({ @@ -6,7 +6,7 @@ export function DefaultCurrentIdentifierButton({ onClick, type, href, -}: HeadlessCurrentIdentifierProps) { +}: OryCurrentIdentifierProps) { const Element = onClick ? "button" : "a" return ( diff --git a/packages/elements-react/src/theme/default/components/card/header.tsx b/packages/elements-react/src/theme/default/components/card/header.tsx index f360ea731..d72a0db49 100644 --- a/packages/elements-react/src/theme/default/components/card/header.tsx +++ b/packages/elements-react/src/theme/default/components/card/header.tsx @@ -2,10 +2,10 @@ import { useComponents, useOryFlow } from "@ory/elements-react" import { constructCardHeaderText } from "../../utils/constructCardHeader" function InnerCardHeader({ title, text }: { title: string; text?: string }) { - const { CardLogo } = useComponents() + const { Card } = useComponents() return (
- +

{title} diff --git a/packages/elements-react/src/theme/default/components/default-components.tsx b/packages/elements-react/src/theme/default/components/default-components.tsx index f791f16f0..2898b20c2 100644 --- a/packages/elements-react/src/theme/default/components/default-components.tsx +++ b/packages/elements-react/src/theme/default/components/default-components.tsx @@ -29,32 +29,34 @@ import { DefaultCurrentIdentifierButton } from "./card/current-identifier-button import { OryFlowComponents } from "@ory/elements-react" export const OryDefaultComponents: OryFlowComponents = { - Card: DefaultCard, - CardHeader: DefaultCardHeader, - CardContent: DefaultCardContent, - CardFooter: DefaultCardFooter, - CardLogo: DefaultCardLogo, - - // Generic - HorizontalDivider: DefaultHorizontalDivider, - - // Form - FormGroup: DefaultGroupContainer, - - SocialButtonContainer: DefaultSocialButtonContainer, - MessageContainer: DefaultMessageContainer, - Message: DefaultMessage, - Input: DefaultInput, - Image: DefaultImage, - Label: DefaultLabel, - Checkbox: DefaultCheckbox, - Text: DefaultText, - PinCodeInput: DefaultPinCodeInput, - Button: DefaultButton, - LinkButton: DefaultLinkButton, - SocialButton: DefaultButtonSocial, - FormContainer: DefaultFormContainer, - - AuthMethodListItem: DefaultAuthMethodListItem, - CurrentIdentifierButton: DefaultCurrentIdentifierButton, + Card: { + Root: DefaultCard, + Footer: DefaultCardFooter, + Header: DefaultCardHeader, + Content: DefaultCardContent, + Logo: DefaultCardLogo, + Divider: DefaultHorizontalDivider, + AuthMethodListItem: DefaultAuthMethodListItem, + }, + Node: { + Button: DefaultButton, + OIDCButton: DefaultButtonSocial, + CurrentIdentifierButton: DefaultCurrentIdentifierButton, + Input: DefaultInput, + CodeInput: DefaultPinCodeInput, + Image: DefaultImage, + Label: DefaultLabel, + Checkbox: DefaultCheckbox, + Text: DefaultText, + Anchor: DefaultLinkButton, + }, + Form: { + Root: DefaultFormContainer, + Group: DefaultGroupContainer, + OIDCRoot: DefaultSocialButtonContainer, + }, + Message: { + Root: DefaultMessageContainer, + Content: DefaultMessage, + }, } diff --git a/packages/elements-react/src/theme/default/components/form/button.tsx b/packages/elements-react/src/theme/default/components/form/button.tsx index c8af0e273..2241dc985 100644 --- a/packages/elements-react/src/theme/default/components/form/button.tsx +++ b/packages/elements-react/src/theme/default/components/form/button.tsx @@ -1,15 +1,18 @@ +import { getNodeLabel } from "@ory/client-fetch" +import { + OryNodeButtonProps, + uiTextToFormattedMessage, +} from "@ory/elements-react" import { useFormContext } from "react-hook-form" import { useIntl } from "react-intl" -import { Spinner } from "./spinner" import { cn } from "../../utils/cn" -import { formatMessage, HeadlessButtonProps } from "@ory/elements-react" -import { getNodeLabel } from "@ory/client-fetch" +import { Spinner } from "./spinner" export const DefaultButton = ({ attributes, node, onClick, -}: HeadlessButtonProps) => { +}: OryNodeButtonProps) => { const { type, name, @@ -75,7 +78,7 @@ export const DefaultButton = ({ }, )} > - {formatMessage(label, intl)} + {label ? uiTextToFormattedMessage(label, intl) : ""} ) diff --git a/packages/elements-react/src/theme/default/components/form/checkbox.tsx b/packages/elements-react/src/theme/default/components/form/checkbox.tsx index 653e2e4a9..db68cc052 100644 --- a/packages/elements-react/src/theme/default/components/form/checkbox.tsx +++ b/packages/elements-react/src/theme/default/components/form/checkbox.tsx @@ -1,11 +1,14 @@ "use client" +import { getNodeLabel } from "@ory/client-fetch" +import { + OryNodeInputProps, + messageTestId, + uiTextToFormattedMessage, +} from "@ory/elements-react" import { useState } from "react" import { useForm } from "react-hook-form" import { useIntl } from "react-intl" import { cn } from "../../utils/cn" -import { HeadlessInputProps } from "@ory/elements-react" -import { formatMessage, messageTestId } from "@ory/elements-react" -import { getNodeLabel } from "@ory/client-fetch" function CheckboxSVG() { return ( @@ -34,7 +37,7 @@ function CheckboxSVG() { export const DefaultCheckbox = ({ attributes: initialAttributes, node, -}: HeadlessInputProps) => { +}: OryNodeInputProps) => { const { value, name, @@ -76,7 +79,7 @@ export const DefaultCheckbox = ({

{node.messages.map((message) => ( - {formatMessage(message, intl)} + {uiTextToFormattedMessage(message, intl)} ))}
diff --git a/packages/elements-react/src/theme/default/components/form/group-container.tsx b/packages/elements-react/src/theme/default/components/form/group-container.tsx index cd80950a6..98aa3c565 100644 --- a/packages/elements-react/src/theme/default/components/form/group-container.tsx +++ b/packages/elements-react/src/theme/default/components/form/group-container.tsx @@ -1,7 +1,5 @@ -import { HeadlessGroupContainerProps } from "@ory/elements-react" +import { OryFormGroupProps } from "@ory/elements-react" -export function DefaultGroupContainer({ - children, -}: HeadlessGroupContainerProps) { +export function DefaultGroupContainer({ children }: OryFormGroupProps) { return
{children}
} diff --git a/packages/elements-react/src/theme/default/components/form/image.tsx b/packages/elements-react/src/theme/default/components/form/image.tsx index 2812217f9..3c7b79151 100644 --- a/packages/elements-react/src/theme/default/components/form/image.tsx +++ b/packages/elements-react/src/theme/default/components/form/image.tsx @@ -1,6 +1,6 @@ -import { HeadlessImageProps } from "@ory/elements-react" +import { OryNodeImageProps } from "@ory/elements-react" -export function DefaultImage({ attributes }: HeadlessImageProps) { +export function DefaultImage({ attributes }: OryNodeImageProps) { // const intl = useIntl() return (
diff --git a/packages/elements-react/src/theme/default/components/form/index.tsx b/packages/elements-react/src/theme/default/components/form/index.tsx index f2ec56377..34a5963d3 100644 --- a/packages/elements-react/src/theme/default/components/form/index.tsx +++ b/packages/elements-react/src/theme/default/components/form/index.tsx @@ -1,14 +1,14 @@ import { PropsWithChildren } from "react" import { cn } from "../../utils/cn" -import { HeadlessFormProps } from "@ory/elements-react" -import { HeadlessMessageProps } from "@ory/elements-react" +import { OryFormRootProps } from "@ory/elements-react" +import { OryMessageContentProps } from "@ory/elements-react" export function DefaultFormContainer({ children, onSubmit, action, method, -}: PropsWithChildren) { +}: PropsWithChildren) { return (
{children} } -export function DefaultMessage({ message }: HeadlessMessageProps) { +export function DefaultMessage({ message }: OryMessageContentProps) { return ( { +}: OryNodeInputProps) => { const label = getNodeLabel(node) const { register } = useFormContext() const { value, autocomplete, name, maxlength, ...rest } = attributes diff --git a/packages/elements-react/src/theme/default/components/form/label.tsx b/packages/elements-react/src/theme/default/components/form/label.tsx index f383cd1aa..8ef3f4b81 100644 --- a/packages/elements-react/src/theme/default/components/form/label.tsx +++ b/packages/elements-react/src/theme/default/components/form/label.tsx @@ -1,8 +1,11 @@ import { FlowType, getNodeLabel } from "@ory/client-fetch" +import { + OryNodeLabelProps, + messageTestId, + uiTextToFormattedMessage, + useOryFlow, +} from "@ory/elements-react" import { useIntl } from "react-intl" -import { useOryFlow } from "@ory/elements-react" -import { HeadlessLabelProps } from "@ory/elements-react" -import { formatMessage, messageTestId } from "@ory/elements-react" import { cn } from "../../utils/cn" export function DefaultLabel({ @@ -10,7 +13,7 @@ export function DefaultLabel({ children, attributes, ...rest -}: HeadlessLabelProps) { +}: OryNodeLabelProps) { const intl = useIntl() const label = getNodeLabel(node) const { config, flowType } = useOryFlow() @@ -29,7 +32,7 @@ export function DefaultLabel({ htmlFor={attributes.name} {...rest} > - {formatMessage(label, intl)} + {uiTextToFormattedMessage(label, intl)} {isPassword && config.project.recovery_enabled && @@ -65,7 +68,7 @@ export function DefaultLabel({ })} {...messageTestId(message)} > - {formatMessage(message, intl)} + {uiTextToFormattedMessage(message, intl)} ))} diff --git a/packages/elements-react/src/theme/default/components/form/link-button.tsx b/packages/elements-react/src/theme/default/components/form/link-button.tsx index 2a680ac33..b40af8796 100644 --- a/packages/elements-react/src/theme/default/components/form/link-button.tsx +++ b/packages/elements-react/src/theme/default/components/form/link-button.tsx @@ -1,13 +1,15 @@ +import { getNodeLabel } from "@ory/client-fetch" +import { + OryNodeAnchorProps, + uiTextToFormattedMessage, +} from "@ory/elements-react" import { forwardRef } from "react" import { useIntl } from "react-intl" import { cn } from "../../utils/cn" -import { HeadlessLinkButtonProps } from "@ory/elements-react" -import { formatMessage } from "@ory/elements-react" -import { getNodeLabel } from "@ory/client-fetch" export const DefaultLinkButton = forwardRef< HTMLAnchorElement, - HeadlessLinkButtonProps + OryNodeAnchorProps >(({ attributes, node }, ref) => { const intl = useIntl() const label = getNodeLabel(node) @@ -15,12 +17,12 @@ export const DefaultLinkButton = forwardRef< - {formatMessage(label, intl)} + {label ? uiTextToFormattedMessage(label, intl) : ""} ) }) diff --git a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx index dfbcef108..027a6d833 100644 --- a/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx +++ b/packages/elements-react/src/theme/default/components/form/pin-code-input.tsx @@ -1,9 +1,9 @@ "use client" import { useFormContext } from "react-hook-form" import { InputOTP, InputOTPGroup, InputOTPSlot } from "./shadcn/otp-input" -import { HeadlessInputProps } from "@ory/elements-react" +import { OryNodeInputProps } from "@ory/elements-react" -export const DefaultPinCodeInput = ({ attributes }: HeadlessInputProps) => { +export const DefaultPinCodeInput = ({ attributes }: OryNodeInputProps) => { const { setValue, watch } = useFormContext() const { maxlength, name } = attributes const elements = maxlength ?? 6 diff --git a/packages/elements-react/src/theme/default/components/form/social.tsx b/packages/elements-react/src/theme/default/components/form/social.tsx index 16e1a998e..83358d12d 100644 --- a/packages/elements-react/src/theme/default/components/form/social.tsx +++ b/packages/elements-react/src/theme/default/components/form/social.tsx @@ -1,6 +1,6 @@ import { - HeadlessSocialButtonContainerProps, - HeadlessSocialButtonProps, + OryFormOIDCRootProps, + OryNodeOIDCButtonProps, useOryFlow, } from "@ory/elements-react" import logos from "../../provider-logos" @@ -22,7 +22,7 @@ export function DefaultButtonSocial({ attributes, node, onClick, -}: HeadlessSocialButtonProps) { +}: OryNodeOIDCButtonProps) { const { node_type: _ignoredNodeType, type: _ignoredType, @@ -79,7 +79,7 @@ export function DefaultButtonSocial({ export function DefaultSocialButtonContainer({ children, nodes, -}: HeadlessSocialButtonContainerProps) { +}: OryFormOIDCRootProps) { return (

- {formatMessage(node.meta.label, intl)} + {node.meta.label ? uiTextToFormattedMessage(node.meta.label, intl) : ""}

{( attributes.text.context as { @@ -16,7 +15,7 @@ export function DefaultText({ node, attributes }: HeadlessTextProps) { } ).secrets?.map((text: UiText, index) => (
-          {formatMessage(text, intl)}
+          {text ? uiTextToFormattedMessage(text, intl) : ""}
         
))} diff --git a/packages/elements-react/src/theme/default/flows/login.tsx b/packages/elements-react/src/theme/default/flows/login.tsx index aea7b03f0..1cbf3b838 100644 --- a/packages/elements-react/src/theme/default/flows/login.tsx +++ b/packages/elements-react/src/theme/default/flows/login.tsx @@ -2,16 +2,17 @@ import { FlowType, LoginFlow } from "@ory/client-fetch" import { OryClientConfiguration, - OryFlowComponents, + OryFlowComponentOverrides, OryProvider, OryTwoStepCard, } from "@ory/elements-react" +import merge from "lodash.merge" import { PropsWithChildren } from "react" import { OryDefaultComponents } from "../components" export type LoginFlowContextProps = { flow: LoginFlow - components?: Partial + components?: OryFlowComponentOverrides config: OryClientConfiguration } @@ -21,10 +22,9 @@ export function Login({ children, components: flowOverrideComponents, }: PropsWithChildren) { - const components = { - ...OryDefaultComponents, - ...flowOverrideComponents, - } + const components = flowOverrideComponents + ? merge({}, OryDefaultComponents, flowOverrideComponents) + : OryDefaultComponents return ( ) { - const components = { - ...OryDefaultComponents, - ...flowOverrideComponents, - } + const components = flowOverrideComponents + ? merge({}, OryDefaultComponents, flowOverrideComponents) + : OryDefaultComponents return ( ) { - const components = { - ...OryDefaultComponents, - ...flowOverrideComponents, - } + const components = flowOverrideComponents + ? merge({}, OryDefaultComponents, flowOverrideComponents) + : OryDefaultComponents return ( ) { - const components = { - ...OryDefaultComponents, - ...flowOverrideComponents, - } + const components = flowOverrideComponents + ? merge({}, OryDefaultComponents, flowOverrideComponents) + : OryDefaultComponents return ( ) { - const components = { - ...OryDefaultComponents, - ...flowOverrideComponents, - } + const components = flowOverrideComponents + ? merge({}, OryDefaultComponents, flowOverrideComponents) + : OryDefaultComponents return ( , "children"> -export type HeadlessCurrentIdentifierProps = { +export type OryCurrentIdentifierProps = { attributes: UiNodeInputAttributes node: UiNode onClick?: () => void href?: string } & Omit, "children" | "onClick"> -export type HeadlessLinkButtonProps = { +export type OryNodeAnchorProps = { attributes: UiNodeAnchorAttributes node: UiNode } & Omit, "children"> -export type HeadlessLabelProps = { +export type OryNodeLabelProps = { attributes: UiNodeInputAttributes node: UiNode } & ComponentPropsWithoutRef<"label"> -export type HeadlessTextProps = { +export type OryNodeTextProps = { attributes: UiNodeTextAttributes node: UiNode } -export type HeadlessAuthMethodListItemProps = { +/** + * Props for the AuthMethodListItem component. This component is used + * to render a single auth method in the AuthMethodList component. + */ +export type OryCardAuthMethodListItemProps = { onClick: () => void group: string } -export type HeadlessImageProps = { +export type OryNodeImageProps = { attributes: UiNodeImageAttributes node: UiNode } export type FormValues = Record -export type HeadlessFormProps = ComponentPropsWithoutRef<"form"> & { +export type OryFormRootProps = ComponentPropsWithoutRef<"form"> & { onSubmit: FormEventHandler } -export type HeadlessInputProps = { +export type OryNodeInputProps = { attributes: UiNodeInputAttributes node: UiNode onClick?: MouseEventHandler } - -export type OryFlowComponents = OryFormComponents & OryCardComponents diff --git a/packages/elements-react/src/util/flowContainer.ts b/packages/elements-react/src/util/flowContainer.ts index 228107a23..72a64de52 100644 --- a/packages/elements-react/src/util/flowContainer.ts +++ b/packages/elements-react/src/util/flowContainer.ts @@ -12,26 +12,76 @@ import { } from "@ory/client-fetch" import { OryClientConfiguration } from "./clientConfiguration" -type BaseFlow = { +/** + * A generic flow container, containing a flowType, the flow itself and the config object + * + * @see OryClientConfiguration + */ +type OryFlow = { flowType: TFlowType flow: TFlow config: OryClientConfiguration } -export type LoginFlowContainer = BaseFlow -export type RegistrationFlowContainer = BaseFlow< +/** + * A flow container for the login flow + * + * @see OryFlow + * @see LoginFlow + */ +export type LoginFlowContainer = OryFlow + +/** + * A flow container for the registration flow + * + * @see OryFlow + * @see RegistrationFlow + */ +export type RegistrationFlowContainer = OryFlow< FlowType.Registration, RegistrationFlow > -export type RecoveryFlowContainer = BaseFlow -export type VerificationFlowContainer = BaseFlow< + +/** + * A flow container for the recovery flow + * + * @see OryFlow + * @see RecoveryFlow + */ +export type RecoveryFlowContainer = OryFlow + +/** + * A flow container for the verification flow + * + * @see OryFlow + * @see VerificationFlow + * + */ +export type VerificationFlowContainer = OryFlow< FlowType.Verification, VerificationFlow > -export type SettingsFlowContainer = BaseFlow -export type ErrorFlowContainer = BaseFlow +/** + * A flow container for the settings flow + * + * @see OryFlow + * @see SettingsFlow + */ +export type SettingsFlowContainer = OryFlow + +/** + * A flow container for the error flow + * + * @see OryFlow + * @see FlowError (Error flow) + * + */ +export type ErrorFlowContainer = OryFlow -export type FlowContainer = +/** + * A union type of all flow containers + */ +export type OryFlowContainer = | LoginFlowContainer | RegistrationFlowContainer | RecoveryFlowContainer diff --git a/packages/elements-react/src/util/i18n/__tests__/test-components.tsx b/packages/elements-react/src/util/i18n/__tests__/test-components.tsx index 74f3828dd..88d91e042 100644 --- a/packages/elements-react/src/util/i18n/__tests__/test-components.tsx +++ b/packages/elements-react/src/util/i18n/__tests__/test-components.tsx @@ -1,9 +1,9 @@ -import { formatMessage } from "../index" import { UiText } from "@ory/client-fetch" import { useIntl } from "react-intl" +import { uiTextToFormattedMessage } from "../index" export const Inner = ({ uiText }: { uiText: UiText }) => { const intl = useIntl() - return
{formatMessage(uiText, intl)}
+ return
{uiTextToFormattedMessage(uiText, intl)}
} diff --git a/packages/elements-react/src/util/i18n/index.ts b/packages/elements-react/src/util/i18n/index.ts index 094697897..fa0da8877 100644 --- a/packages/elements-react/src/util/i18n/index.ts +++ b/packages/elements-react/src/util/i18n/index.ts @@ -4,13 +4,6 @@ import { UiText } from "@ory/client-fetch" import { IntlShape } from "react-intl" -export function formatMessage(uiText: UiText | undefined, intl: IntlShape) { - if (!uiText) { - return "" - } - return uiTextToFormattedMessage(uiText, intl) -} - /** * Converts a UiText to a FormattedMessage. * The UiText contains the id of the message and the context. diff --git a/packages/elements-react/src/util/index.ts b/packages/elements-react/src/util/index.ts index b9cb65cc8..d73561cb7 100644 --- a/packages/elements-react/src/util/index.ts +++ b/packages/elements-react/src/util/index.ts @@ -1,13 +1,8 @@ // Copyright © 2024 Ory Corp // SPDX-License-Identifier: Apache-2.0 -export * from "./test-id" -export * from "./i18n" -export * from "./onSubmitLogin" -export * from "./onSubmitSettings" -export * from "./onSubmitRecovery" -export * from "./onSubmitVerification" -export * from "./onSubmitRegistration" export * from "./clientConfiguration" export * from "./flowContainer" +export * from "./i18n" export * from "./submitHandler" +export * from "./test-id" diff --git a/packages/elements-react/src/util/onSubmitLogin.ts b/packages/elements-react/src/util/onSubmitLogin.ts index 46df83502..b1677ce78 100644 --- a/packages/elements-react/src/util/onSubmitLogin.ts +++ b/packages/elements-react/src/util/onSubmitLogin.ts @@ -9,7 +9,7 @@ import { UpdateLoginFlowBody, } from "@ory/client-fetch" import { OnSubmitHandlerProps } from "./submitHandler" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" import { frontendClient } from "./client" /** @@ -22,7 +22,7 @@ import { frontendClient } from "./client" * @param onRedirect - This method is used to redirect the user to a different page. */ export async function onSubmitLogin( - { config, flow }: FlowContainer, + { config, flow }: OryFlowContainer, { setFlowContainer, body, diff --git a/packages/elements-react/src/util/onSubmitRecovery.ts b/packages/elements-react/src/util/onSubmitRecovery.ts index 02a91dfa6..abbba7596 100644 --- a/packages/elements-react/src/util/onSubmitRecovery.ts +++ b/packages/elements-react/src/util/onSubmitRecovery.ts @@ -9,7 +9,7 @@ import { recoveryUrl, UpdateRecoveryFlowBody, } from "@ory/client-fetch" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" import { OnSubmitHandlerProps } from "./submitHandler" import { frontendClient } from "./client" @@ -23,7 +23,7 @@ import { frontendClient } from "./client" * @param onRedirect - This method is used to redirect the user to a different page. */ export async function onSubmitRecovery( - { config, flow }: FlowContainer, + { config, flow }: OryFlowContainer, { setFlowContainer, body, diff --git a/packages/elements-react/src/util/onSubmitRegistration.ts b/packages/elements-react/src/util/onSubmitRegistration.ts index 5788c9b88..dc858b0dd 100644 --- a/packages/elements-react/src/util/onSubmitRegistration.ts +++ b/packages/elements-react/src/util/onSubmitRegistration.ts @@ -9,7 +9,7 @@ import { registrationUrl, UpdateRegistrationFlowBody, } from "@ory/client-fetch" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" import { OnSubmitHandlerProps } from "./submitHandler" import { frontendClient } from "./client" @@ -23,7 +23,7 @@ import { frontendClient } from "./client" * @param onRedirect - This method is used to redirect the user to a different page. */ export async function onSubmitRegistration( - { config, flow }: FlowContainer, + { config, flow }: OryFlowContainer, { setFlowContainer, body, diff --git a/packages/elements-react/src/util/onSubmitSettings.ts b/packages/elements-react/src/util/onSubmitSettings.ts index 7ce49d1e7..36e4f8c7d 100644 --- a/packages/elements-react/src/util/onSubmitSettings.ts +++ b/packages/elements-react/src/util/onSubmitSettings.ts @@ -9,7 +9,7 @@ import { settingsUrl, UpdateSettingsFlowBody, } from "@ory/client-fetch" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" import { OnSubmitHandlerProps } from "./submitHandler" import { frontendClient } from "./client" @@ -23,7 +23,7 @@ import { frontendClient } from "./client" * @param onRedirect - This method is used to redirect the user to a different page. */ export async function onSubmitSettings( - { config, flow }: FlowContainer, + { config, flow }: OryFlowContainer, { setFlowContainer, body, diff --git a/packages/elements-react/src/util/onSubmitVerification.ts b/packages/elements-react/src/util/onSubmitVerification.ts index d05ece4a6..5ebee3013 100644 --- a/packages/elements-react/src/util/onSubmitVerification.ts +++ b/packages/elements-react/src/util/onSubmitVerification.ts @@ -8,7 +8,7 @@ import { VerificationFlow, verificationUrl, } from "@ory/client-fetch" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" import { OnSubmitHandlerProps } from "./submitHandler" import { frontendClient } from "./client" @@ -22,7 +22,7 @@ import { frontendClient } from "./client" * @param onRedirect - This method is used to redirect the user to a different page. */ export async function onSubmitVerification( - { config, flow }: FlowContainer, + { config, flow }: OryFlowContainer, { setFlowContainer, body, diff --git a/packages/elements-react/src/util/submitHandler.ts b/packages/elements-react/src/util/submitHandler.ts index d555f34ad..5472754c1 100644 --- a/packages/elements-react/src/util/submitHandler.ts +++ b/packages/elements-react/src/util/submitHandler.ts @@ -9,7 +9,7 @@ import { UpdateSettingsFlowBody, UpdateVerificationFlowBody, } from "@ory/client-fetch" -import { FlowContainer } from "./flowContainer" +import { OryFlowContainer } from "./flowContainer" export type OnSubmitHandlerProps< T extends @@ -22,7 +22,7 @@ export type OnSubmitHandlerProps< /** * This method is used to update the flow container when a validation error occurs, for example. */ - setFlowContainer: (flowContainer: FlowContainer) => void + setFlowContainer: (flowContainer: OryFlowContainer) => void /** * The form values to submit. diff --git a/packages/elements-react/temp/elements-react-theme.api.md b/packages/elements-react/temp/elements-react-theme.api.md new file mode 100644 index 000000000..5a3b9d45f --- /dev/null +++ b/packages/elements-react/temp/elements-react-theme.api.md @@ -0,0 +1,129 @@ +## API Report File for "@ory/elements-react" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ComponentPropsWithoutRef } from 'react'; +import { ComponentType } from 'react'; +import { ConfigurationParameters } from '@ory/client-fetch'; +import { DetailedHTMLProps } from 'react'; +import { FlowError } from '@ory/client-fetch'; +import { FormEventHandler } from 'react'; +import { HTMLAttributes } from 'react'; +import { LoginFlow } from '@ory/client-fetch'; +import { MouseEventHandler } from 'react'; +import { PropsWithChildren } from 'react'; +import * as react from 'react'; +import * as react_jsx_runtime from 'react/jsx-runtime'; +import { RecoveryFlow } from '@ory/client-fetch'; +import { RegistrationFlow } from '@ory/client-fetch'; +import { SettingsFlow } from '@ory/client-fetch'; +import { UiNode } from '@ory/client-fetch'; +import { UiNodeAnchorAttributes } from '@ory/client-fetch'; +import { UiNodeImageAttributes } from '@ory/client-fetch'; +import { UiNodeInputAttributes } from '@ory/client-fetch'; +import { UiNodeTextAttributes } from '@ory/client-fetch'; +import { UiText } from '@ory/client-fetch'; +import { VerificationFlow } from '@ory/client-fetch'; + +// Warning: (ae-forgotten-export) The symbol "OryCardRootProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultCard({ children }: OryCardRootProps): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryCardContentProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultCardContent({ children }: OryCardContentProps): react.ReactNode; + +// @public (undocumented) +export function DefaultCardFooter(): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +export function DefaultCardHeader(): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function DefaultCardLogo(): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryFormRootProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultFormContainer({ children, onSubmit, action, method, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// Warning: (ae-forgotten-export) The symbol "OryMessageContentProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function DefaultMessage({ message }: OryMessageContentProps): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function DefaultMessageContainer({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element | null; + +// @public (undocumented) +function Error_2({ error, children, }: PropsWithChildren): react_jsx_runtime.JSX.Element; +export { Error_2 as Error } + +// @public (undocumented) +export type ErrorFlowContextProps = { + error: FlowError; + components?: Partial; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export function Login({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type LoginFlowContextProps = { + flow: LoginFlow; + components?: OryFlowComponentOverrides; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export const OryDefaultComponents: OryFlowComponents; + +// @public (undocumented) +export function Recovery({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type RecoveryFlowContextProps = { + flow: RecoveryFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// Warning: (ae-forgotten-export) The symbol "RegistrationFlowContextProps" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export function Registration({ flow, children, components: flowOverrideComponents, config, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export function Settings({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type SettingsFlowContextProps = { + flow: SettingsFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// @public (undocumented) +export function Verification({ flow, config, children, components: flowOverrideComponents, }: PropsWithChildren): react_jsx_runtime.JSX.Element; + +// @public (undocumented) +export type VerificationFlowContextProps = { + flow: VerificationFlow; + components?: Partial; + config: OryClientConfiguration; +}; + +// Warnings were encountered during analysis: +// +// dist/theme/default/index.d.ts:25:5 - (ae-forgotten-export) The symbol "OryFlowComponents" needs to be exported by the entry point index.d.ts +// dist/theme/default/index.d.ts:26:5 - (ae-forgotten-export) The symbol "OryClientConfiguration" needs to be exported by the entry point index.d.ts +// dist/theme/default/index.d.ts:32:5 - (ae-forgotten-export) The symbol "OryFlowComponentOverrides" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +```